You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2013/09/02 22:05:26 UTC
[40/50] [abbrv] git commit: updated refs/heads/disk-cache to 99d67cb
Revert "Starting the work of moving orchestration pieces to engine"
This reverts commit 7a2aaf96fd12842f24730c4c515400b5cc7a780e.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d8a5f03c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d8a5f03c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d8a5f03c
Branch: refs/heads/disk-cache
Commit: d8a5f03c7f4ecd77b25d3b39a983a8a81dc5c810
Parents: ab91def
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Aug 2 15:04:09 2013 -0700
Committer: Chiradeep Vittal <ch...@apache.org>
Committed: Fri Aug 2 15:09:29 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/vm/VirtualMachineManager.java | 183 -------------------
pom.xml | 15 +-
.../src/com/cloud/vm/VirtualMachineManager.java | 183 +++++++++++++++++++
3 files changed, 190 insertions(+), 191 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d8a5f03c/engine/orchestration/src/com/cloud/vm/VirtualMachineManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManager.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManager.java
deleted file mode 100644
index a0a8464..0000000
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManager.java
+++ /dev/null
@@ -1,183 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.agent.api.to.NicTO;
-import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.deploy.DeployDestination;
-import com.cloud.deploy.DeploymentPlan;
-import com.cloud.deploy.DeploymentPlanner;
-import com.cloud.exception.AgentUnavailableException;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InsufficientServerCapacityException;
-import com.cloud.exception.OperationTimedoutException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.network.Network;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.service.ServiceOfferingVO;
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.storage.Volume;
-import com.cloud.utils.Pair;
-import com.cloud.utils.component.Manager;
-import com.cloud.utils.fsm.NoTransitionException;
-
-/**
- * Manages allocating resources to vms.
- */
-public interface VirtualMachineManager extends Manager {
-
- void allocate(String vmInstanceName,
- VMTemplateVO template,
- ServiceOfferingVO serviceOffering,
- Pair<? extends DiskOfferingVO, Long> rootDiskOffering,
- List<Pair<DiskOfferingVO, Long>> dataDiskOfferings,
- List<Pair<NetworkVO, NicProfile>> networks,
- Map<VirtualMachineProfile.Param, Object> params,
- DeploymentPlan plan,
- HypervisorType hyperType) throws InsufficientCapacityException;
-
- void allocate(String vmInstanceName,
- VMTemplateVO template,
- ServiceOfferingVO serviceOffering,
- List<Pair<NetworkVO, NicProfile>> networkProfiles,
- DeploymentPlan plan,
- HypervisorType hyperType) throws InsufficientCapacityException;
-
- void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params);
-
- void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy);
-
- void stop(String vmUuid) throws ResourceUnavailableException;
-
- void expunge(String vmUuid) throws ResourceUnavailableException;
-
- void registerGuru(VirtualMachine.Type type, VirtualMachineGuru guru);
-
- boolean stateTransitTo(VMInstanceVO vm, VirtualMachine.Event e, Long hostId) throws NoTransitionException;
-
- void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
- ConcurrentOperationException, OperationTimedoutException;
-
- void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
- ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
-
- void advanceStop(String vmUuid, boolean cleanupEvenIfUnableToStop) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
-
- void advanceExpunge(String vmUuid) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
-
- void destroy(String vmUuid) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException;
-
- void migrateAway(String vmUuid, long hostId) throws InsufficientServerCapacityException;
-
- void migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException;
-
- void migrateWithStorage(String vmUuid, long srcId, long destId, Map<Volume, StoragePool> volumeToPool) throws ResourceUnavailableException, ConcurrentOperationException;
-
- void reboot(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException;
-
- void advanceReboot(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
- ConcurrentOperationException, OperationTimedoutException;
-
- /**
- * Check to see if a virtual machine can be upgraded to the given service offering
- *
- * @param vm
- * @param offering
- * @return true if the host can handle the upgrade, false otherwise
- */
- boolean isVirtualMachineUpgradable(final VirtualMachine vm, final ServiceOffering offering);
-
- VirtualMachine findById(long vmId);
-
- void storageMigration(String vmUuid, StoragePool storagePoolId);
-
- /**
- * @param vmInstance
- * @param newServiceOfferingId
- */
- void checkIfCanUpgrade(VirtualMachine vmInstance, long newServiceOfferingId);
-
- /**
- * @param vmId
- * @param serviceOfferingId
- * @return
- */
- boolean upgradeVmDb(long vmId, long serviceOfferingId);
-
- /**
- * @param vm
- * @param network
- * @param requested TODO
- * @return
- * @throws ConcurrentOperationException
- * @throws ResourceUnavailableException
- * @throws InsufficientCapacityException
- */
- NicProfile addVmToNetwork(VirtualMachine vm, Network network, NicProfile requested) throws ConcurrentOperationException,
- ResourceUnavailableException, InsufficientCapacityException;
-
- /**
- * @param vm
- * @param nic
- * @return
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
- */
- boolean removeNicFromVm(VirtualMachine vm, NicVO nic) throws ConcurrentOperationException, ResourceUnavailableException;
-
- /**
- * @param vm
- * @param network
- * @param broadcastUri TODO
- * @return
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
- */
- boolean removeVmFromNetwork(VirtualMachine vm, Network network, URI broadcastUri) throws ConcurrentOperationException, ResourceUnavailableException;
-
- /**
- * @param nic
- * @param hypervisorType
- * @return
- */
- NicTO toNicTO(NicProfile nic, HypervisorType hypervisorType);
-
- /**
- * @param profile
- * @param hvGuru
- * @return
- */
- VirtualMachineTO toVmTO(VirtualMachineProfile profile);
-
-
- VMInstanceVO reConfigureVm(VMInstanceVO vm, ServiceOffering newServiceOffering, boolean sameHost) throws ResourceUnavailableException, ConcurrentOperationException;
-
- void findHostAndMigrate(String vmUuid, Long newSvcOfferingId, DeploymentPlanner.ExcludeList excludeHostList) throws InsufficientCapacityException,
- ConcurrentOperationException, ResourceUnavailableException;
-
- void migrateForScale(String vmUuid, long srcHostId, DeployDestination dest, Long newSvcOfferingId) throws ResourceUnavailableException, ConcurrentOperationException;
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d8a5f03c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0f8d8c6..0c9e4f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -458,9 +458,9 @@
</execution>
</executions>
</plugin>
- <plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself. -->
+ <plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
@@ -469,8 +469,12 @@
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-antrun-plugin
+ </artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>run</goal>
@@ -485,11 +489,6 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- </plugin>
- <plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d8a5f03c/server/src/com/cloud/vm/VirtualMachineManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManager.java b/server/src/com/cloud/vm/VirtualMachineManager.java
new file mode 100644
index 0000000..a0a8464
--- /dev/null
+++ b/server/src/com/cloud/vm/VirtualMachineManager.java
@@ -0,0 +1,183 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.vm;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import com.cloud.agent.api.to.NicTO;
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.deploy.DeployDestination;
+import com.cloud.deploy.DeploymentPlan;
+import com.cloud.deploy.DeploymentPlanner;
+import com.cloud.exception.AgentUnavailableException;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InsufficientServerCapacityException;
+import com.cloud.exception.OperationTimedoutException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.Network;
+import com.cloud.network.dao.NetworkVO;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.service.ServiceOfferingVO;
+import com.cloud.storage.DiskOfferingVO;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.Volume;
+import com.cloud.utils.Pair;
+import com.cloud.utils.component.Manager;
+import com.cloud.utils.fsm.NoTransitionException;
+
+/**
+ * Manages allocating resources to vms.
+ */
+public interface VirtualMachineManager extends Manager {
+
+ void allocate(String vmInstanceName,
+ VMTemplateVO template,
+ ServiceOfferingVO serviceOffering,
+ Pair<? extends DiskOfferingVO, Long> rootDiskOffering,
+ List<Pair<DiskOfferingVO, Long>> dataDiskOfferings,
+ List<Pair<NetworkVO, NicProfile>> networks,
+ Map<VirtualMachineProfile.Param, Object> params,
+ DeploymentPlan plan,
+ HypervisorType hyperType) throws InsufficientCapacityException;
+
+ void allocate(String vmInstanceName,
+ VMTemplateVO template,
+ ServiceOfferingVO serviceOffering,
+ List<Pair<NetworkVO, NicProfile>> networkProfiles,
+ DeploymentPlan plan,
+ HypervisorType hyperType) throws InsufficientCapacityException;
+
+ void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params);
+
+ void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy);
+
+ void stop(String vmUuid) throws ResourceUnavailableException;
+
+ void expunge(String vmUuid) throws ResourceUnavailableException;
+
+ void registerGuru(VirtualMachine.Type type, VirtualMachineGuru guru);
+
+ boolean stateTransitTo(VMInstanceVO vm, VirtualMachine.Event e, Long hostId) throws NoTransitionException;
+
+ void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
+ ConcurrentOperationException, OperationTimedoutException;
+
+ void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
+ ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
+
+ void advanceStop(String vmUuid, boolean cleanupEvenIfUnableToStop) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
+
+ void advanceExpunge(String vmUuid) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
+
+ void destroy(String vmUuid) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException;
+
+ void migrateAway(String vmUuid, long hostId) throws InsufficientServerCapacityException;
+
+ void migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException;
+
+ void migrateWithStorage(String vmUuid, long srcId, long destId, Map<Volume, StoragePool> volumeToPool) throws ResourceUnavailableException, ConcurrentOperationException;
+
+ void reboot(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException;
+
+ void advanceReboot(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
+ ConcurrentOperationException, OperationTimedoutException;
+
+ /**
+ * Check to see if a virtual machine can be upgraded to the given service offering
+ *
+ * @param vm
+ * @param offering
+ * @return true if the host can handle the upgrade, false otherwise
+ */
+ boolean isVirtualMachineUpgradable(final VirtualMachine vm, final ServiceOffering offering);
+
+ VirtualMachine findById(long vmId);
+
+ void storageMigration(String vmUuid, StoragePool storagePoolId);
+
+ /**
+ * @param vmInstance
+ * @param newServiceOfferingId
+ */
+ void checkIfCanUpgrade(VirtualMachine vmInstance, long newServiceOfferingId);
+
+ /**
+ * @param vmId
+ * @param serviceOfferingId
+ * @return
+ */
+ boolean upgradeVmDb(long vmId, long serviceOfferingId);
+
+ /**
+ * @param vm
+ * @param network
+ * @param requested TODO
+ * @return
+ * @throws ConcurrentOperationException
+ * @throws ResourceUnavailableException
+ * @throws InsufficientCapacityException
+ */
+ NicProfile addVmToNetwork(VirtualMachine vm, Network network, NicProfile requested) throws ConcurrentOperationException,
+ ResourceUnavailableException, InsufficientCapacityException;
+
+ /**
+ * @param vm
+ * @param nic
+ * @return
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
+ */
+ boolean removeNicFromVm(VirtualMachine vm, NicVO nic) throws ConcurrentOperationException, ResourceUnavailableException;
+
+ /**
+ * @param vm
+ * @param network
+ * @param broadcastUri TODO
+ * @return
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
+ */
+ boolean removeVmFromNetwork(VirtualMachine vm, Network network, URI broadcastUri) throws ConcurrentOperationException, ResourceUnavailableException;
+
+ /**
+ * @param nic
+ * @param hypervisorType
+ * @return
+ */
+ NicTO toNicTO(NicProfile nic, HypervisorType hypervisorType);
+
+ /**
+ * @param profile
+ * @param hvGuru
+ * @return
+ */
+ VirtualMachineTO toVmTO(VirtualMachineProfile profile);
+
+
+ VMInstanceVO reConfigureVm(VMInstanceVO vm, ServiceOffering newServiceOffering, boolean sameHost) throws ResourceUnavailableException, ConcurrentOperationException;
+
+ void findHostAndMigrate(String vmUuid, Long newSvcOfferingId, DeploymentPlanner.ExcludeList excludeHostList) throws InsufficientCapacityException,
+ ConcurrentOperationException, ResourceUnavailableException;
+
+ void migrateForScale(String vmUuid, long srcHostId, DeployDestination dest, Long newSvcOfferingId) throws ResourceUnavailableException, ConcurrentOperationException;
+
+}