You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/11/21 16:26:52 UTC
[05/54] [abbrv] [partial] Reformatted all of the code.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index b3cf81e..187c701 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -282,7 +282,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
Map<VirtualMachine.Type, VirtualMachineGuru> _vmGurus = new HashMap<VirtualMachine.Type, VirtualMachineGuru>();
protected StateMachine2<State, VirtualMachine.Event, VirtualMachine> _stateMachine;
- static final ConfigKey<Integer> StartRetry = new ConfigKey<Integer>("Advanced", Integer.class, "start.retry", "10", "Number of times to retry create and start commands", true);
+ static final ConfigKey<Integer> StartRetry = new ConfigKey<Integer>("Advanced", Integer.class, "start.retry", "10",
+ "Number of times to retry create and start commands", true);
static final ConfigKey<Integer> VmOpWaitInterval = new ConfigKey<Integer>("Advanced", Integer.class, "vm.op.wait.interval", "120",
"Time (in seconds) to wait before checking if a previous operation has succeeded", true);
@@ -296,8 +297,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
"Time (in seconds) to wait before cancelling a operation", false);
static final ConfigKey<Boolean> VmDestroyForcestop = new ConfigKey<Boolean>("Advanced", Boolean.class, "vm.destroy.forcestop", "false",
"On destroy, force-stop takes this value ", true);
- static final ConfigKey<Integer> ClusterDeltaSyncInterval = new ConfigKey<Integer>("Advanced", Integer.class, "sync.interval", "60", "Cluster Delta sync interval in seconds",
- false);
+ static final ConfigKey<Integer> ClusterDeltaSyncInterval = new ConfigKey<Integer>("Advanced", Integer.class, "sync.interval", "60",
+ "Cluster Delta sync interval in seconds", false);
ScheduledExecutorService _executor = null;
@@ -312,9 +313,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
@Override
@DB
- public void allocate(String vmInstanceName, final VirtualMachineTemplate template, ServiceOffering serviceOffering, final Pair<? extends DiskOffering, Long> rootDiskOffering,
- LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferings, final LinkedHashMap<? extends Network, ? extends NicProfile> auxiliaryNetworks, DeploymentPlan plan,
- HypervisorType hyperType) throws InsufficientCapacityException {
+ public void allocate(String vmInstanceName, final VirtualMachineTemplate template, ServiceOffering serviceOffering,
+ final Pair<? extends DiskOffering, Long> rootDiskOffering, LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferings,
+ final LinkedHashMap<? extends Network, ? extends NicProfile> auxiliaryNetworks, DeploymentPlan plan, HypervisorType hyperType)
+ throws InsufficientCapacityException {
VMInstanceVO vm = _vmDao.findVMByInstanceName(vmInstanceName);
final Account owner = _entityMgr.findById(Account.class, vm.getAccountId());
@@ -329,7 +331,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet";
final VMInstanceVO vmFinal = _vmDao.persist(vm);
- final LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferingsFinal = dataDiskOfferings == null ? new LinkedHashMap<DiskOffering, Long>() : dataDiskOfferings;
+ final LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferingsFinal =
+ dataDiskOfferings == null ? new LinkedHashMap<DiskOffering, Long>() : dataDiskOfferings;
final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmFinal, template, serviceOffering, null, null);
@@ -370,8 +373,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
@Override
- public void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, LinkedHashMap<? extends Network, ? extends NicProfile> networks,
- DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException {
+ public void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering,
+ LinkedHashMap<? extends Network, ? extends NicProfile> networks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException {
allocate(vmInstanceName, template, serviceOffering, new Pair<DiskOffering, Long>(serviceOffering, null), null, networks, plan, hyperType);
}
@@ -550,8 +553,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
@DB
- protected Ternary<VMInstanceVO, ReservationContext, ItWorkVO> changeToStartState(VirtualMachineGuru vmGuru, final VMInstanceVO vm, final User caller, final Account account)
- throws ConcurrentOperationException {
+ protected Ternary<VMInstanceVO, ReservationContext, ItWorkVO> changeToStartState(VirtualMachineGuru vmGuru, final VMInstanceVO vm, final User caller,
+ final Account account) throws ConcurrentOperationException {
long vmId = vm.getId();
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Starting, vm.getType(), vm.getId());
@@ -559,23 +562,24 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
while (retry-- != 0) {
try {
final ItWorkVO workFinal = work;
- Ternary<VMInstanceVO, ReservationContext, ItWorkVO> result = Transaction.execute(new TransactionCallbackWithException<Ternary<VMInstanceVO, ReservationContext, ItWorkVO>, NoTransitionException>() {
- @Override
- public Ternary<VMInstanceVO, ReservationContext, ItWorkVO> doInTransaction(TransactionStatus status) throws NoTransitionException {
- Journal journal = new Journal.LogJournal("Creating " + vm, s_logger);
- ItWorkVO work = _workDao.persist(workFinal);
- ReservationContextImpl context = new ReservationContextImpl(work.getId(), journal, caller, account);
-
- if (stateTransitTo(vm, Event.StartRequested, null, work.getId())) {
- if (s_logger.isDebugEnabled()) {
- s_logger.debug("Successfully transitioned to start state for " + vm + " reservation id = " + work.getId());
+ Ternary<VMInstanceVO, ReservationContext, ItWorkVO> result =
+ Transaction.execute(new TransactionCallbackWithException<Ternary<VMInstanceVO, ReservationContext, ItWorkVO>, NoTransitionException>() {
+ @Override
+ public Ternary<VMInstanceVO, ReservationContext, ItWorkVO> doInTransaction(TransactionStatus status) throws NoTransitionException {
+ Journal journal = new Journal.LogJournal("Creating " + vm, s_logger);
+ ItWorkVO work = _workDao.persist(workFinal);
+ ReservationContextImpl context = new ReservationContextImpl(work.getId(), journal, caller, account);
+
+ if (stateTransitTo(vm, Event.StartRequested, null, work.getId())) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Successfully transitioned to start state for " + vm + " reservation id = " + work.getId());
+ }
+ return new Ternary<VMInstanceVO, ReservationContext, ItWorkVO>(vm, context, work);
}
- return new Ternary<VMInstanceVO, ReservationContext, ItWorkVO>(vm, context, work);
- }
- return new Ternary<VMInstanceVO, ReservationContext, ItWorkVO>(null, null, work);
- }
- });
+ return new Ternary<VMInstanceVO, ReservationContext, ItWorkVO>(null, null, work);
+ }
+ });
work = result.third();
if (result.first() != null)
@@ -681,11 +685,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vm.getPodIdToDeployIn(), null, null, null, null, ctx);
if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) {
if (s_logger.isDebugEnabled()) {
- s_logger.debug("advanceStart: DeploymentPlan is provided, using dcId:" + planToDeploy.getDataCenterId() + ", podId: " + planToDeploy.getPodId() + ", clusterId: " +
- planToDeploy.getClusterId() + ", hostId: " + planToDeploy.getHostId() + ", poolId: " + planToDeploy.getPoolId());
+ s_logger.debug("advanceStart: DeploymentPlan is provided, using dcId:" + planToDeploy.getDataCenterId() + ", podId: " + planToDeploy.getPodId() +
+ ", clusterId: " + planToDeploy.getClusterId() + ", hostId: " + planToDeploy.getHostId() + ", poolId: " + planToDeploy.getPoolId());
}
- plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
- planToDeploy.getPoolId(), planToDeploy.getPhysicalNetworkId(), ctx);
+ plan =
+ new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
+ planToDeploy.getPoolId(), planToDeploy.getPhysicalNetworkId(), ctx);
}
HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
@@ -743,20 +748,21 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// planner
if (s_logger.isDebugEnabled()) {
s_logger.debug("Cannot satisfy the deployment plan passed in since the ready Root volume is in different cluster. volume's cluster: " +
- rootVolClusterId + ", cluster specified: " + clusterIdSpecified);
+ rootVolClusterId + ", cluster specified: " + clusterIdSpecified);
}
throw new ResourceUnavailableException(
- "Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " + vm,
- Cluster.class, clusterIdSpecified);
+ "Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " +
+ vm, Cluster.class, clusterIdSpecified);
}
}
- plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
- vol.getPoolId(), null, ctx);
+ plan =
+ new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(),
+ planToDeploy.getHostId(), vol.getPoolId(), null, ctx);
} else {
plan = new DataCenterDeployment(rootVolDcId, rootVolPodId, rootVolClusterId, null, vol.getPoolId(), null, ctx);
if (s_logger.isDebugEnabled()) {
s_logger.debug(vol + " is READY, changing deployment plan to use this pool's dcId: " + rootVolDcId + " , podId: " + rootVolPodId +
- " , and clusterId: " + rootVolClusterId);
+ " , and clusterId: " + rootVolClusterId);
}
planChangedByVolume = true;
}
@@ -1146,7 +1152,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
advanceStop(vm, cleanUpEvenIfUnableToStop);
}
- private void advanceStop(VMInstanceVO vm, boolean cleanUpEvenIfUnableToStop) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException {
+ private void advanceStop(VMInstanceVO vm, boolean cleanUpEvenIfUnableToStop) throws AgentUnavailableException, OperationTimedoutException,
+ ConcurrentOperationException {
State state = vm.getState();
if (state == State.Stopped) {
if (s_logger.isDebugEnabled()) {
@@ -1606,9 +1613,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
s_logger.info("Migration was unsuccessful. Cleaning up: " + vm);
_networkMgr.rollbackNicForMigration(vmSrc, profile);
- _alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(), "Unable to migrate vm " + vm.getInstanceName() + " from host " +
- fromHost.getName() + " in zone " + dest.getDataCenter().getName() + " and pod " +
- dest.getPod().getName(), "Migrate Command failed. Please check logs.");
+ _alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(),
+ "Unable to migrate vm " + vm.getInstanceName() + " from host " + fromHost.getName() + " in zone " + dest.getDataCenter().getName() + " and pod " +
+ dest.getPod().getName(), "Migrate Command failed. Please check logs.");
try {
_agentMgr.send(dstHostId, new Commands(cleanup(vm)), null);
} catch (AgentUnavailableException ae) {
@@ -1641,8 +1648,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (_poolHostDao.findByPoolHost(pool.getId(), host.getId()) == null || pool.isLocal() != diskOffering.getUseLocalStorage()) {
// Cannot find a pool for the volume. Throw an exception.
throw new CloudRuntimeException("Cannot migrate volume " + volume + " to storage pool " + pool + " while migrating vm to host " + host +
- ". Either the pool is not accessible from the " +
- "host or because of the offering with which the volume is created it cannot be placed on " + "the given pool.");
+ ". Either the pool is not accessible from the " + "host or because of the offering with which the volume is created it cannot be placed on " +
+ "the given pool.");
} else if (pool.getId() == currentPool.getId()) {
// If the pool to migrate too is the same as current pool, remove the volume from the list of
// volumes to be migrated.
@@ -1674,7 +1681,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (!currentPoolAvailable && !volumeToPool.containsKey(volume)) {
// Cannot find a pool for the volume. Throw an exception.
throw new CloudRuntimeException("Cannot find a storage pool which is available for volume " + volume + " while migrating virtual machine " +
- profile.getVirtualMachine() + " to host " + host);
+ profile.getVirtualMachine() + " to host " + host);
}
}
}
@@ -1730,7 +1737,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// a vm and not migrating a vm with storage.
if (volumeToPool.isEmpty()) {
throw new InvalidParameterValueException("Migration of the vm " + vm + "from host " + srcHost + " to destination host " + destHost +
- " doesn't involve migrating the volumes.");
+ " doesn't involve migrating the volumes.");
}
short alertType = AlertManager.ALERT_TYPE_USERVM_MIGRATE;
@@ -1782,8 +1789,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} finally {
if (!migrated) {
s_logger.info("Migration was unsuccessful. Cleaning up: " + vm);
- _alertMgr.sendAlert(alertType, srcHost.getDataCenterId(), srcHost.getPodId(), "Unable to migrate vm " + vm.getInstanceName() + " from host " + srcHost.getName() +
- " in zone " + dc.getName() + " and pod " + dc.getName(),
+ _alertMgr.sendAlert(alertType, srcHost.getDataCenterId(), srcHost.getPodId(),
+ "Unable to migrate vm " + vm.getInstanceName() + " from host " + srcHost.getName() + " in zone " + dc.getName() + " and pod " + dc.getName(),
"Migrate Command failed. Please check logs.");
try {
_agentMgr.send(destHostId, new Commands(cleanup(vm.getInstanceName())), null);
@@ -2000,8 +2007,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
AgentVmInfo info = infos.remove(vm.getId());
// sync VM Snapshots related transient states
- List<VMSnapshotVO> vmSnapshotsInTrasientStates = _vmSnapshotDao.listByInstanceId(vm.getId(), VMSnapshot.State.Expunging, VMSnapshot.State.Reverting,
- VMSnapshot.State.Creating);
+ List<VMSnapshotVO> vmSnapshotsInTrasientStates =
+ _vmSnapshotDao.listByInstanceId(vm.getId(), VMSnapshot.State.Expunging, VMSnapshot.State.Reverting, VMSnapshot.State.Creating);
if (vmSnapshotsInTrasientStates.size() > 1) {
s_logger.info("Found vm " + vm.getInstanceName() + " with VM snapshots in transient states, needs to sync VM snapshot state");
if (!_vmSnapshotMgr.syncVMSnapshot(vm, hostId)) {
@@ -2123,8 +2130,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
AgentVmInfo info = infos.remove(vm.getId());
// sync VM Snapshots related transient states
- List<VMSnapshotVO> vmSnapshotsInExpungingStates = _vmSnapshotDao.listByInstanceId(vm.getId(), VMSnapshot.State.Expunging, VMSnapshot.State.Creating,
- VMSnapshot.State.Reverting);
+ List<VMSnapshotVO> vmSnapshotsInExpungingStates =
+ _vmSnapshotDao.listByInstanceId(vm.getId(), VMSnapshot.State.Expunging, VMSnapshot.State.Creating, VMSnapshot.State.Reverting);
if (vmSnapshotsInExpungingStates.size() > 0) {
s_logger.info("Found vm " + vm.getInstanceName() + " in state. " + vm.getState() + ", needs to sync VM snapshot state");
Long hostId = null;
@@ -2144,7 +2151,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if ((info == null && (vm.getState() == State.Running || vm.getState() == State.Starting)) ||
(info != null && (info.state == State.Running && vm.getState() == State.Starting))) {
s_logger.info("Found vm " + vm.getInstanceName() + " in inconsistent state. " + vm.getState() + " on CS while " + (info == null ? "Stopped" : "Running") +
- " on agent");
+ " on agent");
info = new AgentVmInfo(vm.getInstanceName(), vm, State.Stopped);
// Bug 13850- grab outstanding work item if any for this VM state so that we mark it as DONE after we change VM state, else it will remain pending
@@ -2181,7 +2188,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
e.printStackTrace();
}
} else if (info != null &&
- (vm.getState() == State.Stopped || vm.getState() == State.Stopping || vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging)) {
+ (vm.getState() == State.Stopped || vm.getState() == State.Stopping || vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging)) {
Host host = _hostDao.findByGuid(info.getHostUuid());
if (host != null) {
s_logger.warn("Stopping a VM which is stopped/stopping/destroyed/expunging " + info.name);
@@ -2335,9 +2342,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
HostVO hostVO = _hostDao.findById(vm.getHostId());
String hostDesc = "name: " + hostVO.getName() + " (id:" + hostVO.getId() + "), availability zone: " + dcVO.getName() + ", pod: " + podVO.getName();
- _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "VM (name: " + vm.getInstanceName() + ", id: " + vm.getId() + ") stopped on host " +
- hostDesc + " due to storage failure",
- "Virtual Machine " + vm.getInstanceName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped due to storage failure.");
+ _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "VM (name: " + vm.getInstanceName() + ", id: " + vm.getId() +
+ ") stopped on host " + hostDesc + " due to storage failure", "Virtual Machine " + vm.getInstanceName() + " (id: " + vm.getId() + ") running on host [" +
+ vm.getHostId() + "] stopped due to storage failure.");
}
// track hypervsion tools version
if (info.hvtoolsversion != null && !info.hvtoolsversion.isEmpty()) {
@@ -2362,7 +2369,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (serverState == State.Starting) {
if (vm.getHostId() != null && vm.getHostId() != hostId) {
s_logger.info("CloudStack is starting VM on host " + vm.getHostId() + ", but status report comes from a different host " + hostId +
- ", skip status sync for vm: " + vm.getInstanceName());
+ ", skip status sync for vm: " + vm.getInstanceName());
return null;
}
}
@@ -2387,7 +2394,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (serverState == State.Starting) {
if (vm.getHostId() != null && vm.getHostId() != hostId) {
s_logger.info("CloudStack is starting VM on host " + vm.getHostId() + ", but status report comes from a different host " + hostId +
- ", skip status sync for vm: " + vm.getInstanceName());
+ ", skip status sync for vm: " + vm.getInstanceName());
return null;
}
}
@@ -2402,8 +2409,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
//
if (vm.getHostId() == null || hostId != vm.getHostId()) {
if (s_logger.isDebugEnabled()) {
- s_logger.debug("detected host change when VM " + vm + " is at running state, VM could be live-migrated externally from host " + vm.getHostId() +
- " to host " + hostId);
+ s_logger.debug("detected host change when VM " + vm + " is at running state, VM could be live-migrated externally from host " +
+ vm.getHostId() + " to host " + hostId);
}
stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
@@ -2500,8 +2507,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
return command;
}
- private void ensureVmRunningContext(long hostId, VMInstanceVO vm, Event cause) throws OperationTimedoutException, ResourceUnavailableException, NoTransitionException,
- InsufficientAddressCapacityException {
+ private void ensureVmRunningContext(long hostId, VMInstanceVO vm, Event cause) throws OperationTimedoutException, ResourceUnavailableException,
+ NoTransitionException, InsufficientAddressCapacityException {
VirtualMachineGuru vmGuru = getVmGuru(vm);
s_logger.debug("VM state is starting on full sync so updating it to running");
@@ -2529,8 +2536,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
List<NicVO> nics = _nicsDao.listByVmId(profile.getId());
for (NicVO nic : nics) {
Network network = _networkModel.getNetwork(nic.getNetworkId());
- NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), null, _networkModel.isSecurityGroupSupportedInNetwork(network),
- _networkModel.getNetworkTag(profile.getHypervisorType(), network));
+ NicProfile nicProfile =
+ new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), null, _networkModel.isSecurityGroupSupportedInNetwork(network),
+ _networkModel.getNetworkTag(profile.getHypervisorType(), network));
profile.addNic(nicProfile);
}
@@ -2701,7 +2709,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
try {
lock.addRef();
- List<VMInstanceVO> instances = _vmDao.findVMInTransition(new Date(new Date().getTime() - (AgentManager.Wait.value() * 1000)), State.Starting, State.Stopping);
+ List<VMInstanceVO> instances =
+ _vmDao.findVMInTransition(new Date(new Date().getTime() - (AgentManager.Wait.value() * 1000)), State.Starting, State.Stopping);
for (VMInstanceVO instance : instances) {
State state = instance.getState();
if (state == State.Stopping) {
@@ -2768,17 +2777,18 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (!(vmInstance.getState().equals(State.Stopped) || vmInstance.getState().equals(State.Running))) {
s_logger.warn("Unable to upgrade virtual machine " + vmInstance.toString() + " in state " + vmInstance.getState());
throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() + " " + " in state " + vmInstance.getState() +
- "; make sure the virtual machine is stopped/running");
+ "; make sure the virtual machine is stopped/running");
}
// Check if the service offering being upgraded to is what the VM is already running with
if (vmInstance.getServiceOfferingId() == newServiceOffering.getId()) {
if (s_logger.isInfoEnabled()) {
- s_logger.info("Not upgrading vm " + vmInstance.toString() + " since it already has the requested " + "service offering (" + newServiceOffering.getName() + ")");
+ s_logger.info("Not upgrading vm " + vmInstance.toString() + " since it already has the requested " + "service offering (" + newServiceOffering.getName() +
+ ")");
}
throw new InvalidParameterValueException("Not upgrading vm " + vmInstance.toString() + " since it already " + "has the requested service offering (" +
- newServiceOffering.getName() + ")");
+ newServiceOffering.getName() + ")");
}
ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId());
@@ -2796,8 +2806,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// offering
if (currentServiceOffering.getUseLocalStorage() != newServiceOffering.getUseLocalStorage()) {
throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() +
- ", cannot switch between local storage and shared storage service offerings. Current offering " + "useLocalStorage=" +
- currentServiceOffering.getUseLocalStorage() + ", target offering useLocalStorage=" + newServiceOffering.getUseLocalStorage());
+ ", cannot switch between local storage and shared storage service offerings. Current offering " + "useLocalStorage=" +
+ currentServiceOffering.getUseLocalStorage() + ", target offering useLocalStorage=" + newServiceOffering.getUseLocalStorage());
}
// if vm is a system vm, check if it is a system service offering, if yes return with error as it cannot be used for user vms
@@ -2807,8 +2817,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// Check that there are enough resources to upgrade the service offering
if (!isVirtualMachineUpgradable(vmInstance, newServiceOffering)) {
- throw new InvalidParameterValueException("Unable to upgrade virtual machine, not enough resources available " + "for an offering of " + newServiceOffering.getCpu() +
- " cpu(s) at " + newServiceOffering.getSpeed() + " Mhz, and " + newServiceOffering.getRamSize() + " MB of memory");
+ throw new InvalidParameterValueException("Unable to upgrade virtual machine, not enough resources available " + "for an offering of " +
+ newServiceOffering.getCpu() + " cpu(s) at " + newServiceOffering.getSpeed() + " Mhz, and " + newServiceOffering.getRamSize() + " MB of memory");
}
// Check that the service offering being upgraded to has all the tags of the current service offering
@@ -2816,8 +2826,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
List<String> newTags = StringUtils.csvTagsToList(newServiceOffering.getTags());
if (!newTags.containsAll(currentTags)) {
throw new InvalidParameterValueException("Unable to upgrade virtual machine; the new service offering " + "does not have all the tags of the " +
- "current service offering. Current service offering tags: " + currentTags + "; " + "new service " + "offering tags: " +
- newTags);
+ "current service offering. Current service offering tags: " + currentTags + "; " + "new service " + "offering tags: " + newTags);
}
}
@@ -2922,11 +2931,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// if specified nic is associated with PF/LB/Static NAT
if (rulesMgr.listAssociatedRulesForGuestNic(nic).size() > 0) {
- throw new CloudRuntimeException("Failed to remove nic from " + vm + " in " + network + ", nic has associated Port forwarding or Load balancer or Static NAT rules.");
+ throw new CloudRuntimeException("Failed to remove nic from " + vm + " in " + network +
+ ", nic has associated Port forwarding or Load balancer or Static NAT rules.");
}
- NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), _networkModel.getNetworkRate(network.getId(), vm.getId()),
- _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getVirtualMachine().getHypervisorType(), network));
+ NicProfile nicProfile =
+ new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), _networkModel.getNetworkRate(network.getId(), vm.getId()),
+ _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getVirtualMachine().getHypervisorType(), network));
//1) Unplug the nic
if (vm.getState() == State.Running) {
@@ -2936,8 +2947,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (result) {
s_logger.debug("Nic is unplugged successfully for vm " + vm + " in network " + network);
long isDefault = (nic.isDefaultNic()) ? 1 : 0;
- UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), Long.toString(nic.getId()),
- network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid());
+ UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(),
+ Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid());
} else {
s_logger.warn("Failed to unplug nic for the vm " + vm + " from network " + network);
return false;
@@ -3008,8 +3019,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
try {
- NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), _networkModel.getNetworkRate(network.getId(), vm.getId()),
- _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getVirtualMachine().getHypervisorType(), network));
+ NicProfile nicProfile =
+ new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), _networkModel.getNetworkRate(network.getId(), vm.getId()),
+ _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getVirtualMachine().getHypervisorType(), network));
//1) Unplug the nic
if (vm.getState() == State.Running) {
@@ -3097,7 +3109,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
@Override
- public void migrateForScale(String vmUuid, long srcHostId, DeployDestination dest, Long oldSvcOfferingId) throws ResourceUnavailableException, ConcurrentOperationException {
+ public void migrateForScale(String vmUuid, long srcHostId, DeployDestination dest, Long oldSvcOfferingId) throws ResourceUnavailableException,
+ ConcurrentOperationException {
VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
s_logger.info("Migrating " + vm + " to " + dest);
@@ -3230,9 +3243,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (!migrated) {
s_logger.info("Migration was unsuccessful. Cleaning up: " + vm);
- _alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(), "Unable to migrate vm " + vm.getInstanceName() + " from host " +
- fromHost.getName() + " in zone " + dest.getDataCenter().getName() + " and pod " +
- dest.getPod().getName(), "Migrate Command failed. Please check logs.");
+ _alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(),
+ "Unable to migrate vm " + vm.getInstanceName() + " from host " + fromHost.getName() + " in zone " + dest.getDataCenter().getName() + " and pod " +
+ dest.getPod().getName(), "Migrate Command failed. Please check logs.");
try {
_agentMgr.send(dstHostId, new Commands(cleanup(vm.getInstanceName())), null);
} catch (AgentUnavailableException ae) {
@@ -3326,8 +3339,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
Float memoryOvercommitRatio = CapacityManager.MemOverprovisioningFactor.valueIn(hostVo.getClusterId());
Float cpuOvercommitRatio = CapacityManager.CpuOverprovisioningFactor.valueIn(hostVo.getClusterId());
long minMemory = (long)(newServiceOffering.getRamSize() / memoryOvercommitRatio);
- ScaleVmCommand reconfigureCmd = new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(), (int)(newServiceOffering.getSpeed() / cpuOvercommitRatio),
- newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse());
+ ScaleVmCommand reconfigureCmd =
+ new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(), (int)(newServiceOffering.getSpeed() / cpuOvercommitRatio),
+ newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse());
Long dstHostId = vm.getHostId();
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
@@ -3376,8 +3390,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
@Override
public ConfigKey<?>[] getConfigKeys() {
- return new ConfigKey<?>[] {ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait, VmOpLockStateRetry,
- VmOpWaitInterval, ExecuteInSequence};
+ return new ConfigKey<?>[] {ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait,
+ VmOpLockStateRetry, VmOpWaitInterval, ExecuteInSequence};
}
public List<StoragePoolAllocator> getStoragePoolAllocators() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
index 4c47b6c..7c53302 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.engine.cloud.entity.api;
+import java.util.Map;
+
import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
import com.cloud.deploy.DeploymentPlan;
@@ -27,8 +29,6 @@ import com.cloud.exception.OperationTimedoutException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.vm.VirtualMachineProfile;
-import java.util.Map;
-
public interface VMEntityManager {
VMEntityVO loadVirtualMachine(String vmId);
@@ -38,8 +38,8 @@ public interface VMEntityManager {
String reserveVirtualMachine(VMEntityVO vmEntityVO, String plannerToUse, DeploymentPlan plan, ExcludeList exclude) throws InsufficientCapacityException,
ResourceUnavailableException;
- void deployVirtualMachine(String reservationId, VMEntityVO vmEntityVO, String caller, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException,
- ResourceUnavailableException;
+ void deployVirtualMachine(String reservationId, VMEntityVO vmEntityVO, String caller, Map<VirtualMachineProfile.Param, Object> params)
+ throws InsufficientCapacityException, ResourceUnavailableException;
boolean stopvirtualmachine(VMEntityVO vmEntityVO, String caller) throws ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index d9c0d2d..c02e0ad 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -138,8 +138,8 @@ public class VMEntityManagerImpl implements VMEntityManager {
}
@Override
- public String reserveVirtualMachine(VMEntityVO vmEntityVO, String plannerToUse, DeploymentPlan planToDeploy, ExcludeList exclude) throws InsufficientCapacityException,
- ResourceUnavailableException {
+ public String reserveVirtualMachine(VMEntityVO vmEntityVO, String plannerToUse, DeploymentPlan planToDeploy, ExcludeList exclude)
+ throws InsufficientCapacityException, ResourceUnavailableException {
//call planner and get the deployDestination.
//load vm instance and offerings and call virtualMachineManagerImpl
@@ -148,8 +148,9 @@ public class VMEntityManagerImpl implements VMEntityManager {
VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm);
DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vm.getPodIdToDeployIn(), null, null, null, null);
if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) {
- plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
- planToDeploy.getPoolId(), planToDeploy.getPhysicalNetworkId());
+ plan =
+ new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
+ planToDeploy.getPoolId(), planToDeploy.getPhysicalNetworkId());
}
boolean planChangedByReadyVolume = false;
@@ -169,12 +170,13 @@ public class VMEntityManagerImpl implements VMEntityManager {
// cannot satisfy the plan passed in to the
// planner
throw new ResourceUnavailableException(
- "Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " + vm, Cluster.class,
- clusterIdSpecified);
+ "Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " + vm,
+ Cluster.class, clusterIdSpecified);
}
}
- plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
- vol.getPoolId(), null, null);
+ plan =
+ new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(),
+ vol.getPoolId(), null, null);
} else {
plan = new DataCenterDeployment(rootVolDcId, rootVolPodId, rootVolClusterId, null, vol.getPoolId(), null, null);
planChangedByReadyVolume = true;
@@ -223,8 +225,8 @@ public class VMEntityManagerImpl implements VMEntityManager {
VMReservationVO vmReservation = _reservationDao.findByReservationId(reservationId);
if (vmReservation != null) {
- DataCenterDeployment reservedPlan = new DataCenterDeployment(vm.getDataCenterId(), vmReservation.getPodId(), vmReservation.getClusterId(), vmReservation.getHostId(),
- null, null);
+ DataCenterDeployment reservedPlan =
+ new DataCenterDeployment(vm.getDataCenterId(), vmReservation.getPodId(), vmReservation.getClusterId(), vmReservation.getHostId(), null, null);
try {
_itMgr.start(vm.getUuid(), params, reservedPlan);
} catch (Exception ex) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
index 3d596d2..ed8909c 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
@@ -23,9 +23,10 @@ import java.util.Map;
import javax.inject.Inject;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
import org.springframework.stereotype.Component;
+import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
+
import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
import com.cloud.exception.AgentUnavailableException;
@@ -50,8 +51,8 @@ public class VirtualMachineEntityImpl implements VirtualMachineEntity {
this.vmEntityVO = this.manager.loadVirtualMachine(vmId);
}
- public void init(String vmId, String owner, String hostName, String displayName, int cpu, int speed, long memory, List<String> computeTags, List<String> rootDiskTags,
- List<String> networks) {
+ public void init(String vmId, String owner, String hostName, String displayName, int cpu, int speed, long memory, List<String> computeTags,
+ List<String> rootDiskTags, List<String> networks) {
init(vmId);
this.vmEntityVO.setOwner(owner);
this.vmEntityVO.setHostname(hostName);
@@ -196,7 +197,8 @@ public class VirtualMachineEntityImpl implements VirtualMachineEntity {
}
@Override
- public String reserve(String plannerToUse, DeploymentPlan plan, ExcludeList exclude, String caller) throws InsufficientCapacityException, ResourceUnavailableException {
+ public String reserve(String plannerToUse, DeploymentPlan plan, ExcludeList exclude, String caller) throws InsufficientCapacityException,
+ ResourceUnavailableException {
return manager.reserveVirtualMachine(this.vmEntityVO, plannerToUse, plan, exclude);
}
@@ -207,7 +209,8 @@ public class VirtualMachineEntityImpl implements VirtualMachineEntity {
}
@Override
- public void deploy(String reservationId, String caller, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException {
+ public void deploy(String reservationId, String caller, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException,
+ ResourceUnavailableException {
manager.deployVirtualMachine(reservationId, this.vmEntityVO, caller, params);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
index 006a366..a5416c0 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Cluster.ClusterType;
import com.cloud.org.Grouping.AllocationState;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
index 5bd2193..41366f7 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.engine.datacenter.entity.api;
import javax.inject.Inject;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDa
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDao;
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDao;
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDao;
-import org.springframework.stereotype.Component;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.utils.fsm.NoTransitionException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
index bccadcb..ee434bb 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
@@ -23,10 +23,13 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
+
import javax.ws.rs.GET;
import javax.ws.rs.Path;
+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
+
import com.cloud.utils.fsm.FiniteStateObject;
import com.cloud.utils.fsm.NoTransitionException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
index 723ce3a..82b6150 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
@@ -208,8 +208,8 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity {
this.firewallProvider = firewallProvider;
}
- public EngineDataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId,
- NetworkType zoneType, String zoneToken, String domainSuffix) {
+ public EngineDataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain,
+ Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) {
this(name, description, dns1, dns2, dns3, dns4, guestCidr, domain, domainId, zoneType, zoneToken, domainSuffix, false, false, null, null);
this.id = id;
this.allocationState = Grouping.AllocationState.Enabled;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java
index 910dea4..b064a35 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java
@@ -403,10 +403,10 @@ public class EngineHostVO implements EngineHost, Identity {
this.orchestrationState = State.Disabled;
}
- public EngineHostVO(long id, String name, Type type, String privateIpAddress, String privateNetmask, String privateMacAddress, String publicIpAddress, String publicNetmask,
- String publicMacAddress, String storageIpAddress, String storageNetmask, String storageMacAddress, String deuxStorageIpAddress, String duxStorageNetmask,
- String deuxStorageMacAddress, String guid, Status status, String version, String iqn, Date disconnectedOn, long dcId, Long podId, long serverId, long ping,
- String parent, long totalSize, StoragePoolType fsType) {
+ public EngineHostVO(long id, String name, Type type, String privateIpAddress, String privateNetmask, String privateMacAddress, String publicIpAddress,
+ String publicNetmask, String publicMacAddress, String storageIpAddress, String storageNetmask, String storageMacAddress, String deuxStorageIpAddress,
+ String duxStorageNetmask, String deuxStorageMacAddress, String guid, Status status, String version, String iqn, Date disconnectedOn, long dcId, Long podId,
+ long serverId, long ping, String parent, long totalSize, StoragePoolType fsType) {
this(id,
name,
type,
@@ -440,9 +440,10 @@ public class EngineHostVO implements EngineHost, Identity {
this.orchestrationState = State.Disabled;
}
- public EngineHostVO(long id, String name, Type type, String privateIpAddress, String privateNetmask, String privateMacAddress, String publicIpAddress, String publicNetmask,
- String publicMacAddress, String storageIpAddress, String storageNetmask, String storageMacAddress, String guid, Status status, String version, String url,
- Date disconnectedOn, long dcId, Long podId, long serverId, long ping, Integer cpus, Long speed, Long totalMemory, long dom0MinMemory, String caps) {
+ public EngineHostVO(long id, String name, Type type, String privateIpAddress, String privateNetmask, String privateMacAddress, String publicIpAddress,
+ String publicNetmask, String publicMacAddress, String storageIpAddress, String storageNetmask, String storageMacAddress, String guid, Status status,
+ String version, String url, Date disconnectedOn, long dcId, Long podId, long serverId, long ping, Integer cpus, Long speed, Long totalMemory,
+ long dom0MinMemory, String caps) {
this.id = id;
this.name = name;
this.status = status;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java
index f821049..b93d8f5 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java
@@ -22,9 +22,10 @@ import java.util.Map;
import javax.ejb.Local;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.DcDetailVO;
import org.springframework.stereotype.Component;
+import org.apache.cloudstack.engine.datacenter.entity.api.db.DcDetailVO;
+
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
index ee2c576..b21b230 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
@@ -28,13 +28,14 @@ import java.util.Map;
import javax.ejb.Local;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Grouping;
@@ -230,7 +231,8 @@ public class EngineClusterDaoImpl extends GenericDaoBase<EngineClusterVO, Long>
GenericSearchBuilder<EngineClusterVO, Long> clusterIdSearch = createSearchBuilder(Long.class);
clusterIdSearch.selectFields(clusterIdSearch.entity().getId());
- clusterIdSearch.join("disabledPodIdSearch", disabledPodIdSearch, clusterIdSearch.entity().getPodId(), disabledPodIdSearch.entity().getId(), JoinBuilder.JoinType.INNER);
+ clusterIdSearch.join("disabledPodIdSearch", disabledPodIdSearch, clusterIdSearch.entity().getPodId(), disabledPodIdSearch.entity().getId(),
+ JoinBuilder.JoinType.INNER);
clusterIdSearch.done();
SearchCriteria<Long> sc = clusterIdSearch.create();
@@ -276,7 +278,12 @@ public class EngineClusterDaoImpl extends GenericDaoBase<EngineClusterVO, Long>
EngineClusterVO dbCluster = findByIdIncludingRemoved(vo.getId());
if (dbCluster != null) {
StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString());
- str.append(": DB Data={id=").append(dbCluster.getId()).append("; state=").append(dbCluster.getState()).append(";updatedTime=").append(dbCluster.getLastUpdated());
+ str.append(": DB Data={id=")
+ .append(dbCluster.getId())
+ .append("; state=")
+ .append(dbCluster.getState())
+ .append(";updatedTime=")
+ .append(dbCluster.getLastUpdated());
str.append(": New Data={id=")
.append(vo.getId())
.append("; state=")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
index f7be7d2..4b6818e 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
@@ -26,12 +26,13 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import javax.persistence.TableGenerator;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
import com.cloud.org.Grouping;
import com.cloud.utils.NumbersUtil;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDao.java
index b6e9015..a332a4c 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDao.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDao.java
@@ -24,7 +24,6 @@ import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
-import com.cloud.host.Status;
import com.cloud.info.RunningHostCountInfo;
import com.cloud.resource.ResourceState;
import com.cloud.utils.db.GenericDao;
@@ -34,7 +33,8 @@ import com.cloud.utils.fsm.StateDao;
* Data Access Object for server
*
*/
-public interface EngineHostDao extends GenericDao<EngineHostVO, Long>, StateDao<DataCenterResourceEntity.State, DataCenterResourceEntity.State.Event, DataCenterResourceEntity> {
+public interface EngineHostDao extends GenericDao<EngineHostVO, Long>,
+ StateDao<DataCenterResourceEntity.State, DataCenterResourceEntity.State.Event, DataCenterResourceEntity> {
long countBy(long clusterId, ResourceState... states);
/**
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
index 7e01374..97ac589 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
@@ -502,7 +502,8 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
List<EngineHostVO> result = new ArrayList<EngineHostVO>();
ResultSet rs = null;
try {
- String sql = "select h.id from host h left join cluster c on h.cluster_id=c.id where h.mgmt_server_id is not null and h.last_ping < ? and h.status in ('Up', 'Updating', 'Disconnected', 'Connecting') and h.type not in ('ExternalFirewall', 'ExternalLoadBalancer', 'TrafficMonitor', 'SecondaryStorage', 'LocalSecondaryStorage', 'L2Networking') and (h.cluster_id is null or c.managed_state = 'Managed') ;";
+ String sql =
+ "select h.id from host h left join cluster c on h.cluster_id=c.id where h.mgmt_server_id is not null and h.last_ping < ? and h.status in ('Up', 'Updating', 'Disconnected', 'Connecting') and h.type not in ('ExternalFirewall', 'ExternalLoadBalancer', 'TrafficMonitor', 'SecondaryStorage', 'LocalSecondaryStorage', 'L2Networking') and (h.cluster_id is null or c.managed_state = 'Managed') ;";
pstmt = txn.prepareStatement(sql);
pstmt.setLong(1, timeout);
rs = pstmt.executeQuery();
@@ -593,10 +594,11 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
@Override
@DB
public List<RunningHostCountInfo> getRunningHostCounts(Date cutTime) {
- String sql = "select * from (" + "select h.data_center_id, h.type, count(*) as count from host as h INNER JOIN mshost as m ON h.mgmt_server_id=m.msid "
- + "where h.status='Up' and h.type='SecondaryStorage' and m.last_update > ? " + "group by h.data_center_id, h.type " + "UNION ALL "
- + "select h.data_center_id, h.type, count(*) as count from host as h INNER JOIN mshost as m ON h.mgmt_server_id=m.msid "
- + "where h.status='Up' and h.type='Routing' and m.last_update > ? " + "group by h.data_center_id, h.type) as t " + "ORDER by t.data_center_id, t.type";
+ String sql =
+ "select * from (" + "select h.data_center_id, h.type, count(*) as count from host as h INNER JOIN mshost as m ON h.mgmt_server_id=m.msid "
+ + "where h.status='Up' and h.type='SecondaryStorage' and m.last_update > ? " + "group by h.data_center_id, h.type " + "UNION ALL "
+ + "select h.data_center_id, h.type, count(*) as count from host as h INNER JOIN mshost as m ON h.mgmt_server_id=m.msid "
+ + "where h.status='Up' and h.type='Routing' and m.last_update > ? " + "group by h.data_center_id, h.type) as t " + "ORDER by t.data_center_id, t.type";
ArrayList<RunningHostCountInfo> l = new ArrayList<RunningHostCountInfo>();
@@ -752,8 +754,8 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
}
@Override
- public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> lockRows(SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc,
- Filter filter, boolean exclusive) {
+ public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> lockRows(
+ SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc, Filter filter, boolean exclusive) {
// TODO Auto-generated method stub
return null;
}
@@ -766,15 +768,15 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
}
@Override
- public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> search(SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc,
- Filter filter) {
+ public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> search(
+ SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc, Filter filter) {
// TODO Auto-generated method stub
return null;
}
@Override
- public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> search(SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc,
- Filter filter, boolean enable_query_cache) {
+ public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> search(
+ SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc, Filter filter, boolean enable_query_cache) {
// TODO Auto-generated method stub
return null;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
index 72d7dba..46480ef 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
@@ -26,21 +26,22 @@ import java.util.List;
import javax.ejb.Local;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
import com.cloud.org.Grouping;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.GenericSearchBuilder;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.UpdateBuilder;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.db.TransactionLegacy;
+import com.cloud.utils.db.UpdateBuilder;
@Component(value = "EngineHostPodDao")
@Local(value = {EngineHostPodDao.class})
@@ -162,7 +163,7 @@ public class EngineHostPodDaoImpl extends GenericDaoBase<EngineHostPodVO, Long>
builder.set(vo, "state", nextState);
builder.set(vo, "lastUpdated", new Date());
- int rows = update((EngineHostPodVO)vo, sc);
+ int rows = update(vo, sc);
if (rows == 0 && s_logger.isDebugEnabled()) {
EngineHostPodVO dbDC = findByIdIncludingRemoved(vo.getId());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/HostTagsDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/HostTagsDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/HostTagsDao.java
index fb142f4..12b8a59 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/HostTagsDao.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/HostTagsDao.java
@@ -17,6 +17,7 @@
package org.apache.cloudstack.engine.datacenter.entity.api.db.dao;
import java.util.List;
+
import com.cloud.host.HostTagVO;
import com.cloud.utils.db.GenericDao;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d620df2b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
index aaa44dd..303f1e0 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
@@ -96,8 +96,8 @@ public class CloudOrchestrator implements OrchestrationService {
public CloudOrchestrator() {
}
- public VirtualMachineEntity createFromScratch(String uuid, String iso, String os, String hypervisor, String hostName, int cpu, int speed, long memory, List<String> networks,
- List<String> computeTags, Map<String, String> details, String owner) {
+ public VirtualMachineEntity createFromScratch(String uuid, String iso, String os, String hypervisor, String hostName, int cpu, int speed, long memory,
+ List<String> networks, List<String> computeTags, Map<String, String> details, String owner) {
return null;
}
@@ -150,9 +150,9 @@ public class CloudOrchestrator implements OrchestrationService {
}
@Override
- public VirtualMachineEntity createVirtualMachine(String id, String owner, String templateId, String hostName, String displayName, String hypervisor, int cpu, int speed,
- long memory, Long diskSize, List<String> computeTags, List<String> rootDiskTags, Map<String, NicProfile> networkNicMap, DeploymentPlan plan, Long rootDiskSize)
- throws InsufficientCapacityException {
+ public VirtualMachineEntity createVirtualMachine(String id, String owner, String templateId, String hostName, String displayName, String hypervisor, int cpu,
+ int speed, long memory, Long diskSize, List<String> computeTags, List<String> rootDiskTags, Map<String, NicProfile> networkNicMap, DeploymentPlan plan,
+ Long rootDiskSize) throws InsufficientCapacityException {
// VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks, vmEntityManager);
@@ -198,14 +198,15 @@ public class CloudOrchestrator implements OrchestrationService {
dataDiskOfferings.put(diskOffering, size);
}
- _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), offering, rootDiskOffering, dataDiskOfferings, networkIpMap, plan, hypervisorType);
+ _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), offering, rootDiskOffering, dataDiskOfferings, networkIpMap, plan,
+ hypervisorType);
return vmEntity;
}
@Override
- public VirtualMachineEntity createVirtualMachineFromScratch(String id, String owner, String isoId, String hostName, String displayName, String hypervisor, String os, int cpu,
- int speed, long memory, Long diskSize, List<String> computeTags, List<String> rootDiskTags, Map<String, NicProfile> networkNicMap, DeploymentPlan plan)
+ public VirtualMachineEntity createVirtualMachineFromScratch(String id, String owner, String isoId, String hostName, String displayName, String hypervisor, String os,
+ int cpu, int speed, long memory, Long diskSize, List<String> computeTags, List<String> rootDiskTags, Map<String, NicProfile> networkNicMap, DeploymentPlan plan)
throws InsufficientCapacityException {
// VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks, vmEntityManager);