diff --git a/api/src/com/cloud/agent/manager/allocator/HostAllocator.java b/api/src/com/cloud/agent/manager/allocator/HostAllocator.java index fcd1fc10072..14525aa52de 100755 --- a/api/src/com/cloud/agent/manager/allocator/HostAllocator.java +++ b/api/src/com/cloud/agent/manager/allocator/HostAllocator.java @@ -47,7 +47,7 @@ public interface HostAllocator extends Adapter { * @return List List of hosts that are suitable for VM allocation **/ - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo); + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo); /** * Determines which physical hosts are suitable to @@ -62,7 +62,7 @@ public interface HostAllocator extends Adapter { * @return List List of hosts that are suitable for VM allocation **/ - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity); + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity); /** * Determines which physical hosts are suitable to @@ -77,7 +77,7 @@ public interface HostAllocator extends Adapter { * @param boolean considerReservedCapacity (default should be true, set to false if host capacity calculation should not look at reserved capacity) * @return List List of hosts that are suitable for VM allocation **/ - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, int returnUpTo, boolean considerReservedCapacity); public static int RETURN_UPTO_ALL = -1; diff --git a/api/src/com/cloud/deploy/DeploymentClusterPlanner.java b/api/src/com/cloud/deploy/DeploymentClusterPlanner.java index 8b15ea56e8f..ca73267e732 100644 --- a/api/src/com/cloud/deploy/DeploymentClusterPlanner.java +++ b/api/src/com/cloud/deploy/DeploymentClusterPlanner.java @@ -18,9 +18,7 @@ package com.cloud.deploy; import java.util.List; -import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.exception.InsufficientServerCapacityException; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; /** @@ -38,10 +36,10 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner { * avoid these data centers, pods, clusters, or hosts. * @return DeployDestination for that virtual machine. */ - List orderClusters(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) + List orderClusters(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException; - PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, + PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException; } diff --git a/api/src/com/cloud/deploy/DeploymentPlanner.java b/api/src/com/cloud/deploy/DeploymentPlanner.java index 769da39f3ff..741a8048a0a 100644 --- a/api/src/com/cloud/deploy/DeploymentPlanner.java +++ b/api/src/com/cloud/deploy/DeploymentPlanner.java @@ -29,7 +29,6 @@ import com.cloud.host.Host; import com.cloud.org.Cluster; import com.cloud.storage.StoragePool; import com.cloud.utils.component.Adapter; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; /** @@ -48,7 +47,7 @@ public interface DeploymentPlanner extends Adapter { * @return DeployDestination for that virtual machine. */ @Deprecated - DeployDestination plan(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException; + DeployDestination plan(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException; /** * check() is called right before the virtual machine starts to make sure @@ -65,7 +64,7 @@ public interface DeploymentPlanner extends Adapter { * @return true if it's okay to start; false if not. If false, the exclude list will include what should be * excluded. */ - boolean check(VirtualMachineProfile vm, DeploymentPlan plan, DeployDestination dest, ExcludeList exclude); + boolean check(VirtualMachineProfile vm, DeploymentPlan plan, DeployDestination dest, ExcludeList exclude); /** * canHandle is called before plan to determine if the plan can do the allocation. Planers should be exclusive so @@ -80,7 +79,7 @@ public interface DeploymentPlanner extends Adapter { * avoid these data centers, pods, clusters, or hosts. * @return true if it's okay to allocate; false or not */ - boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid); + boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid); public enum AllocationAlgorithm { random, diff --git a/api/src/com/cloud/hypervisor/HypervisorGuru.java b/api/src/com/cloud/hypervisor/HypervisorGuru.java index 47ca17a84a3..182f06ae968 100644 --- a/api/src/com/cloud/hypervisor/HypervisorGuru.java +++ b/api/src/com/cloud/hypervisor/HypervisorGuru.java @@ -36,7 +36,7 @@ public interface HypervisorGuru extends Adapter { * @param vm * @return */ - VirtualMachineTO implement(VirtualMachineProfile vm); + VirtualMachineTO implement(VirtualMachineProfile vm); /** * Give hypervisor guru opportunity to decide if certain command needs to be delegated to other host, mainly to secondary storage VM host diff --git a/api/src/com/cloud/network/NetworkMigrationResponder.java b/api/src/com/cloud/network/NetworkMigrationResponder.java index 6283cc54128..951e1c2b4d2 100644 --- a/api/src/com/cloud/network/NetworkMigrationResponder.java +++ b/api/src/com/cloud/network/NetworkMigrationResponder.java @@ -38,7 +38,7 @@ public interface NetworkMigrationResponder { * @param context * @return true when operation was successful. */ - public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context); + public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context); /** * Cancel for migration preparation. @@ -52,7 +52,7 @@ public interface NetworkMigrationResponder { * @param src The context nic migrates from. * @param dst The context nic migrates to. */ - public void rollbackMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst); + public void rollbackMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst); /** * Commit the migration resource. @@ -66,5 +66,5 @@ public interface NetworkMigrationResponder { * @param src the context nic migrates from. * @param dst the context nic migrates to. */ - public void commitMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst); + public void commitMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst); } diff --git a/api/src/com/cloud/network/element/DhcpServiceProvider.java b/api/src/com/cloud/network/element/DhcpServiceProvider.java index 6363d7cd22e..62c650be313 100644 --- a/api/src/com/cloud/network/element/DhcpServiceProvider.java +++ b/api/src/com/cloud/network/element/DhcpServiceProvider.java @@ -27,7 +27,7 @@ import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public interface DhcpServiceProvider extends NetworkElement { - boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; - boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; + boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; + boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; boolean removeDhcpSupportForSubnet(Network network) throws ResourceUnavailableException; } diff --git a/api/src/com/cloud/network/element/NetworkElement.java b/api/src/com/cloud/network/element/NetworkElement.java index d89c2a3c403..5f603ce6fbd 100644 --- a/api/src/com/cloud/network/element/NetworkElement.java +++ b/api/src/com/cloud/network/element/NetworkElement.java @@ -71,7 +71,7 @@ public interface NetworkElement extends Adapter { * @throws ResourceUnavailableException * @throws InsufficientNetworkCapacityException */ - boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, + boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException; @@ -85,7 +85,7 @@ public interface NetworkElement extends Adapter { * @throws ConcurrentOperationException * @throws ResourceUnavailableException */ - boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, + boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException; /** diff --git a/api/src/com/cloud/network/element/UserDataServiceProvider.java b/api/src/com/cloud/network/element/UserDataServiceProvider.java index d9ddf9329ff..29cd5ae9377 100644 --- a/api/src/com/cloud/network/element/UserDataServiceProvider.java +++ b/api/src/com/cloud/network/element/UserDataServiceProvider.java @@ -27,8 +27,8 @@ import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public interface UserDataServiceProvider extends NetworkElement { - public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; - boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException; - boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException; - boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException; + public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; + boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException; + boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException; + boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException; } diff --git a/api/src/com/cloud/network/guru/NetworkGuru.java b/api/src/com/cloud/network/guru/NetworkGuru.java index 4a9b871e240..4127233d3aa 100755 --- a/api/src/com/cloud/network/guru/NetworkGuru.java +++ b/api/src/com/cloud/network/guru/NetworkGuru.java @@ -127,7 +127,7 @@ public interface NetworkGuru extends Adapter { * @throws InsufficientAddressCapacityException if there are not addresses * to be assigned. */ - NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException; + NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException; /** * Once a guest network is implemented, then the virtual machine must @@ -147,7 +147,7 @@ public interface NetworkGuru extends Adapter { * @throws ConcurrentOperationException if there are multiple operations * happening on this guest network or vm. */ - void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException; + void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException; /** * When a virtual machine is stopped, the NetworkGuru is informed via the @@ -158,7 +158,7 @@ public interface NetworkGuru extends Adapter { * @param reservationId reservation id passed to it in the ReservationContext * @return true if release is successful or false if unsuccessful. */ - boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId); + boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId); /** * When a virtual machine is destroyed, the NetworkGuru is informed via @@ -169,7 +169,7 @@ public interface NetworkGuru extends Adapter { * @param nic nic that the vm was using to access the guest network. * @param vm virtual machine being destroyed. */ - void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm); + void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm); /** * @deprecated This method should not be here in the first place. What does this really mean? Is it always persisted diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java index 6861372d08d..3da8397fd0e 100644 --- a/api/src/com/cloud/vm/VirtualMachineProfile.java +++ b/api/src/com/cloud/vm/VirtualMachineProfile.java @@ -19,9 +19,7 @@ package com.cloud.vm; import java.util.List; import java.util.Map; -import com.cloud.agent.api.to.DataTO; import com.cloud.agent.api.to.DiskTO; -import com.cloud.agent.api.to.VolumeTO; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.offering.ServiceOffering; import com.cloud.template.VirtualMachineTemplate; @@ -33,10 +31,8 @@ import com.cloud.user.Account; * on what the virtual machine profile should look like before it is * actually started on the hypervisor. * - * @param - * a VirtualMachine */ -public interface VirtualMachineProfile { +public interface VirtualMachineProfile { public static class Param { @@ -69,7 +65,7 @@ public interface VirtualMachineProfile { /** * @return the virtual machine that backs up this profile. */ - T getVirtualMachine(); + VirtualMachine getVirtualMachine(); /** * @return service offering for this virtual machine. diff --git a/api/src/org/apache/cloudstack/affinity/AffinityGroupProcessor.java b/api/src/org/apache/cloudstack/affinity/AffinityGroupProcessor.java index e3a9b62c6ce..8e9fabd3f60 100644 --- a/api/src/org/apache/cloudstack/affinity/AffinityGroupProcessor.java +++ b/api/src/org/apache/cloudstack/affinity/AffinityGroupProcessor.java @@ -21,7 +21,6 @@ import com.cloud.deploy.DeploymentPlan; import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.exception.AffinityConflictException; import com.cloud.utils.component.Adapter; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public interface AffinityGroupProcessor extends Adapter { @@ -37,7 +36,7 @@ public interface AffinityGroupProcessor extends Adapter { * @param avoid * avoid these data centers, pods, clusters, or hosts. */ - void process(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) + void process(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException; /** @@ -57,6 +56,6 @@ public interface AffinityGroupProcessor extends Adapter { * @param plannedDestination * deployment destination where VM is planned to be deployed */ - boolean check(VirtualMachineProfile vm, DeployDestination plannedDestination) + boolean check(VirtualMachineProfile vm, DeployDestination plannedDestination) throws AffinityConflictException; } \ No newline at end of file diff --git a/api/src/org/apache/cloudstack/affinity/AffinityProcessorBase.java b/api/src/org/apache/cloudstack/affinity/AffinityProcessorBase.java index 325ab80e047..779ca326b3a 100644 --- a/api/src/org/apache/cloudstack/affinity/AffinityProcessorBase.java +++ b/api/src/org/apache/cloudstack/affinity/AffinityProcessorBase.java @@ -21,7 +21,6 @@ import com.cloud.deploy.DeploymentPlan; import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.exception.AffinityConflictException; import com.cloud.utils.component.AdapterBase; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public class AffinityProcessorBase extends AdapterBase implements AffinityGroupProcessor { @@ -29,7 +28,7 @@ public class AffinityProcessorBase extends AdapterBase implements AffinityGroupP protected String _type; @Override - public void process(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) + public void process(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException { } @@ -44,7 +43,7 @@ public class AffinityProcessorBase extends AdapterBase implements AffinityGroupP } @Override - public boolean check(VirtualMachineProfile vm, DeployDestination plannedDestination) + public boolean check(VirtualMachineProfile vm, DeployDestination plannedDestination) throws AffinityConflictException { return true; } diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java index eccf0f4f6e1..54808c195c5 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java @@ -23,7 +23,6 @@ import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.storage.StoragePool; import com.cloud.utils.component.Adapter; import com.cloud.vm.DiskProfile; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; /** @@ -44,7 +43,7 @@ public interface StoragePoolAllocator extends Adapter { * @return List List of storage pools that are suitable for the * VM **/ - List allocateToPool(DiskProfile dskCh, VirtualMachineProfile vmProfile, + List allocateToPool(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo); static int RETURN_UPTO_ALL = -1; 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 ee5ae2df804..aae0962ee3a 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 @@ -129,7 +129,7 @@ public class VMEntityManagerImpl implements VMEntityManager { } - protected boolean areAffinityGroupsAssociated(VirtualMachineProfile vmProfile) { + protected boolean areAffinityGroupsAssociated(VirtualMachineProfile vmProfile) { VirtualMachine vm = vmProfile.getVirtualMachine(); long vmGroupCount = _affinityGroupVMMapDao.countAffinityGroupsForVm(vm.getId()); @@ -147,7 +147,7 @@ public class VMEntityManagerImpl implements VMEntityManager { //load vm instance and offerings and call virtualMachineManagerImpl //FIXME: profile should work on VirtualMachineEntity VMInstanceVO vm = _vmDao.findByUuid(vmEntityVO.getUuid()); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm); + 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()); @@ -256,8 +256,6 @@ public class VMEntityManagerImpl implements VMEntityManager { VMInstanceVO vm = _vmDao.findByUuid(vmEntityVO.getUuid()); return _itMgr.destroy(vm, _userDao.findById(new Long(caller)), _accountDao.findById(vm.getAccountId())); - - } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java index 89e09748ea3..851377e8d74 100755 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java @@ -27,10 +27,11 @@ import java.util.Random; import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.log4j.Logger; + import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; -import org.apache.log4j.Logger; import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.ClusterVO; @@ -49,7 +50,6 @@ import com.cloud.user.Account; import com.cloud.utils.NumbersUtil; import com.cloud.utils.component.AdapterBase; import com.cloud.vm.DiskProfile; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public abstract class AbstractStoragePoolAllocator extends AdapterBase implements StoragePoolAllocator { @@ -99,12 +99,12 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement } protected abstract List select(DiskProfile dskCh, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo); @Override public List allocateToPool(DiskProfile dskCh, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { List pools = select(dskCh, vmProfile, plan, avoid, returnUpTo); return reOrder(pools, vmProfile, plan); @@ -144,7 +144,7 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement } protected List reOrder(List pools, - VirtualMachineProfile vmProfile, DeploymentPlan plan) { + VirtualMachineProfile vmProfile, DeploymentPlan plan) { if (pools == null) { return null; } diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java index 41afa837b52..b1105ba31a7 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java @@ -25,18 +25,18 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; -import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; +import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; + import com.cloud.deploy.DeploymentPlan; import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.offering.ServiceOffering; import com.cloud.storage.StoragePool; import com.cloud.storage.dao.DiskOfferingDao; import com.cloud.vm.DiskProfile; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; @Component @@ -49,7 +49,7 @@ public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocat DiskOfferingDao _diskOfferingDao; @Override - protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, + protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { s_logger.debug("ClusterScopeStoragePoolAllocator looking for storage pool"); @@ -91,7 +91,7 @@ public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocat if (suitablePools.size() == returnUpTo) { break; } - StoragePool pol = (StoragePool) this.dataStoreMgr.getPrimaryDataStore(pool.getId()); + StoragePool pol = (StoragePool) dataStoreMgr.getPrimaryDataStore(pool.getId()); if (filter(avoid, pol, dskCh, plan)) { suitablePools.add(pol); } else { diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java index 979ea73cd23..15b44071f81 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java @@ -49,7 +49,7 @@ public class GarbageCollectingStoragePoolAllocator extends AbstractStoragePoolAl boolean _storagePoolCleanupEnabled; @Override - public List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, + public List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { s_logger.debug("GarbageCollectingStoragePoolAllocator looking for storage pool"); if (!_storagePoolCleanupEnabled) { diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java index 4056fe756a1..310f4a1ff64 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java @@ -65,7 +65,7 @@ public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator { ConfigurationDao _configDao; @Override - protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, + protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { List suitablePools = new ArrayList(); diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/UseLocalForRootAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/UseLocalForRootAllocator.java index d0571382191..6d7ac9300a1 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/UseLocalForRootAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/UseLocalForRootAllocator.java @@ -42,7 +42,7 @@ public class UseLocalForRootAllocator extends LocalStoragePoolAllocator implemen @Override public List allocateToPool(DiskProfile dskCh, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { DataCenterVO dc = _dcDao.findById(plan.getDataCenterId()); if (!dc.isLocalStorageEnabled()) { diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java index 300d932a31c..0288b172ca2 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java @@ -56,7 +56,7 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { @Override protected List select(DiskProfile dskCh, - VirtualMachineProfile vmProfile, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { s_logger.debug("ZoneWideStoragePoolAllocator to find storage pool"); List suitablePools = new ArrayList(); diff --git a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java index a0eb56cbb8a..21693592e69 100644 --- a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java +++ b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java @@ -23,9 +23,10 @@ import java.util.Set; import javax.ejb.Local; import javax.inject.Inject; +import org.apache.log4j.Logger; + import org.apache.cloudstack.affinity.dao.AffinityGroupDao; import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; -import org.apache.log4j.Logger; import com.cloud.dc.ClusterVO; import com.cloud.dc.DataCenter; @@ -82,7 +83,7 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase implement * This IncludeList is then used to update the avoid list for a given data center. */ @Override - public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, + public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException { VirtualMachine vm = vmProfile.getVirtualMachine(); List vmGroupMappings = _affinityGroupVMMapDao.findByVmIdType(vm.getId(), getType()); diff --git a/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java b/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java index 1569c7ecd69..c4a847d5e0b 100644 --- a/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java +++ b/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java @@ -66,7 +66,7 @@ public class HostAntiAffinityProcessor extends AffinityProcessorBase implements protected VMReservationDao _reservationDao; @Override - public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, + public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException { VirtualMachine vm = vmProfile.getVirtualMachine(); @@ -118,7 +118,7 @@ public class HostAntiAffinityProcessor extends AffinityProcessorBase implements } @Override - public boolean check(VirtualMachineProfile vmProfile, DeployDestination plannedDestination) + public boolean check(VirtualMachineProfile vmProfile, DeployDestination plannedDestination) throws AffinityConflictException { if (plannedDestination.getHost() == null) { diff --git a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java index be016cb2507..6eee28d7a94 100644 --- a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java +++ b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java @@ -67,7 +67,7 @@ public class ImplicitDedicationPlanner extends FirstFitPlanner implements Deploy } @Override - public List orderClusters(VirtualMachineProfile vmProfile, + public List orderClusters(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { List clusterList = super.orderClusters(vmProfile, plan, avoid); Set hostsToAvoid = avoid.getHostsToAvoid(); @@ -251,7 +251,7 @@ public class ImplicitDedicationPlanner extends FirstFitPlanner implements Deploy } @Override - public PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, + public PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { // Check if strict or preferred mode should be used. boolean preferred = isServiceOfferingUsingPlannerInPreferredMode(vmProfile.getServiceOfferingId()); diff --git a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java index 02124a2ff20..73fd2490c29 100644 --- a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java +++ b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java @@ -176,8 +176,7 @@ public class ImplicitPlannerTest { public void checkWhenDcInAvoidList() throws InsufficientServerCapacityException { DataCenterVO mockDc = mock(DataCenterVO.class); ExcludeList avoids = mock(ExcludeList.class); - @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); VMInstanceVO vm = mock(VMInstanceVO.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); @@ -193,8 +192,7 @@ public class ImplicitPlannerTest { @Test public void checkStrictModeWithCurrentAccountVmsPresent() throws InsufficientServerCapacityException { - @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); ExcludeList avoids = new ExcludeList(); @@ -230,7 +228,7 @@ public class ImplicitPlannerTest { @Test public void checkStrictModeHostWithCurrentAccountVmsFull() throws InsufficientServerCapacityException { @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); ExcludeList avoids = new ExcludeList(); @@ -268,7 +266,7 @@ public class ImplicitPlannerTest { @Test public void checkStrictModeNoHostsAvailable() throws InsufficientServerCapacityException { @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); ExcludeList avoids = new ExcludeList(); @@ -289,7 +287,7 @@ public class ImplicitPlannerTest { @Test public void checkPreferredModePreferredHostAvailable() throws InsufficientServerCapacityException { @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); ExcludeList avoids = new ExcludeList(); @@ -328,7 +326,7 @@ public class ImplicitPlannerTest { @Test public void checkPreferredModeNoHostsAvailable() throws InsufficientServerCapacityException { @SuppressWarnings("unchecked") - VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); + VirtualMachineProfileImpl vmProfile = mock(VirtualMachineProfileImpl.class); DataCenterDeployment plan = mock(DataCenterDeployment.class); ExcludeList avoids = new ExcludeList(); @@ -347,7 +345,7 @@ public class ImplicitPlannerTest { assertTrue("Cluster list should not be null/empty", (clusterList == null || clusterList.isEmpty())); } - private void initializeForTest(VirtualMachineProfileImpl vmProfile, DataCenterDeployment plan) { + private void initializeForTest(VirtualMachineProfileImpl vmProfile, DataCenterDeployment plan) { DataCenterVO mockDc = mock(DataCenterVO.class); VMInstanceVO vm = mock(VMInstanceVO.class); UserVmVO userVm = mock(UserVmVO.class); diff --git a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java index d917893719e..2d734259ef5 100644 --- a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java +++ b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java @@ -41,7 +41,7 @@ public class UserConcentratedPodPlanner extends FirstFitPlanner implements Deplo * @return List ordered list of Cluster Ids */ @Override - protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List clusterIdsByCapacity = clusterCapacityInfo.first(); if(vmProfile.getOwner() == null || !isZone){ return clusterIdsByCapacity; @@ -118,7 +118,7 @@ public class UserConcentratedPodPlanner extends FirstFitPlanner implements Deplo * @return List ordered list of Pod Ids */ @Override - protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List podIdsByCapacity = podCapacityInfo.first(); if(vmProfile.getOwner() == null){ return podIdsByCapacity; diff --git a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java index 2b0b1588802..d70eb319e42 100755 --- a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java +++ b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java @@ -46,7 +46,7 @@ public class UserDispersingPlanner extends FirstFitPlanner implements Deployment * @return List ordered list of Cluster Ids */ @Override - protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List clusterIdsByCapacity = clusterCapacityInfo.first(); if(vmProfile.getOwner() == null){ return clusterIdsByCapacity; @@ -76,7 +76,7 @@ public class UserDispersingPlanner extends FirstFitPlanner implements Deployment * @return List ordered list of Pod Ids */ @Override - protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List podIdsByCapacity = podCapacityInfo.first(); if(vmProfile.getOwner() == null){ return podIdsByCapacity; diff --git a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java index 303e438419a..d4a62779df1 100755 --- a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java +++ b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java @@ -47,13 +47,13 @@ public class RandomAllocator extends AdapterBase implements HostAllocator { @Inject private ResourceManager _resourceMgr; @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo) { return allocateTo(vmProfile, plan, type, avoid, returnUpTo, true); } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, int returnUpTo, boolean considerReservedCapacity) { long dcId = plan.getDataCenterId(); Long podId = plan.getPodId(); @@ -109,7 +109,7 @@ public class RandomAllocator extends AdapterBase implements HostAllocator { } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity) { long dcId = plan.getDataCenterId(); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java index 03ba3fae61b..b2f12879bd0 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java @@ -5,20 +5,20 @@ // 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. -// +// // Automatically generated by addcopyright.py at 01/29/2013 // Apache License, Version 2.0 (the "License"); you may not use this // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// +// // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.baremetal.manager; @@ -38,7 +38,6 @@ import com.cloud.hypervisor.HypervisorGuruBase; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; import com.cloud.vm.VMInstanceVO; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.dao.VMInstanceDao; @@ -59,7 +58,7 @@ public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru } @Override - public VirtualMachineTO implement(VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); VMInstanceVO vo = _vmDao.findById(vm.getId()); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java index e6ddcbeae41..cf3ceedfe81 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java @@ -23,20 +23,21 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.dc.*; -import com.cloud.dc.ClusterDetailsDao; import org.apache.log4j.Logger; import com.cloud.capacity.CapacityManager; -import com.cloud.configuration.Config; import com.cloud.configuration.dao.ConfigurationDao; +import com.cloud.dc.ClusterDetailsDao; +import com.cloud.dc.ClusterDetailsVO; +import com.cloud.dc.ClusterVO; +import com.cloud.dc.DataCenter; +import com.cloud.dc.Pod; import com.cloud.dc.dao.ClusterDao; import com.cloud.dc.dao.DataCenterDao; import com.cloud.dc.dao.HostPodDao; import com.cloud.deploy.DeployDestination; import com.cloud.deploy.DeploymentPlan; import com.cloud.deploy.DeploymentPlanner; -import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.exception.InsufficientServerCapacityException; import com.cloud.host.Host; import com.cloud.host.HostVO; @@ -45,7 +46,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.offering.ServiceOffering; import com.cloud.org.Cluster; import com.cloud.resource.ResourceManager; -import com.cloud.utils.NumbersUtil; import com.cloud.utils.component.AdapterBase; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; @@ -63,7 +63,7 @@ public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner { @Inject protected ClusterDetailsDao _clusterDetailsDao; @Override - public DeployDestination plan(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { + public DeployDestination plan(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { VirtualMachine vm = vmProfile.getVirtualMachine(); ServiceOffering offering = vmProfile.getServiceOffering(); String hostTag = null; @@ -143,7 +143,7 @@ public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner { } @Override - public boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) { + public boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) { return vm.getHypervisorType() == HypervisorType.BareMetal; } @@ -163,7 +163,7 @@ public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner { } @Override - public boolean check(VirtualMachineProfile vm, DeploymentPlan plan, DeployDestination dest, ExcludeList exclude) { + public boolean check(VirtualMachineProfile vm, DeploymentPlan plan, DeployDestination dest, ExcludeList exclude) { // TODO Auto-generated method stub return false; } diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java index 77958ae6a1c..772898dca2b 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java @@ -5,20 +5,20 @@ // 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. -// +// // Automatically generated by addcopyright.py at 01/29/2013 // Apache License, Version 2.0 (the "License"); you may not use this // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// +// // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.baremetal.networkservice; @@ -31,10 +31,11 @@ import java.util.Map; import javax.ejb.Local; import javax.inject.Inject; +import org.apache.log4j.Logger; + import org.apache.cloudstack.api.AddBaremetalPxeCmd; import org.apache.cloudstack.api.AddBaremetalPxePingServerCmd; import org.apache.cloudstack.api.ListBaremetalPxePingServersCmd; -import org.apache.log4j.Logger; import com.cloud.agent.api.Answer; import com.cloud.agent.api.baremetal.IpmISetBootDevCommand; @@ -68,7 +69,6 @@ import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.NicProfile; import com.cloud.vm.NicVO; import com.cloud.vm.ReservationContext; -import com.cloud.vm.UserVmVO; import com.cloud.vm.VirtualMachineProfile; @Local(value=BaremetalPxeService.class) @@ -82,7 +82,7 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements @Override - public boolean prepare(VirtualMachineProfile profile, NicProfile pxeNic, DeployDestination dest, ReservationContext context) { + public boolean prepare(VirtualMachineProfile profile, NicProfile pxeNic, DeployDestination dest, ReservationContext context) { SearchCriteriaService sc = SearchCriteria2.create(BaremetalPxeVO.class); sc.addAnd(sc.getEntity().getDeviceType(), Op.EQ, BaremetalPxeType.PING.toString()); sc.addAnd(sc.getEntity().getPodId(), Op.EQ, dest.getPod().getId()); @@ -127,7 +127,7 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements @Override - public boolean prepareCreateTemplate(Long pxeServerId, UserVm vm, String templateUrl) { + public boolean prepareCreateTemplate(Long pxeServerId, UserVm vm, String templateUrl) { List nics = _nicDao.listByVmId(vm.getId()); if (nics.size() != 1) { throw new CloudRuntimeException("Wrong nic number " + nics.size() + " of vm " + vm.getId()); @@ -168,7 +168,7 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements if (cmd.getPhysicalNetworkId() == null || cmd.getUrl() == null || cmd.getUsername() == null || cmd.getPassword() == null) { throw new IllegalArgumentException("At least one of the required parameters(physical network id, url, username, password) is null"); - } + } pNetwork = _physicalNetworkDao.findById(cmd.getPhysicalNetworkId()); if (pNetwork == null) { @@ -188,7 +188,7 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements HostPodVO pod = _podDao.findById(cmd.getPodId()); if (pod == null) { throw new IllegalArgumentException("Could not find pod with ID: " + cmd.getPodId()); - } + } List pxes = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.BaremetalPxe, null, cmd.getPodId(), zoneId); if (pxes.size() != 0) { diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java index 6d14e3f1a0c..7501882df28 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java @@ -76,7 +76,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru { PodVlanMapDao _podVlanDao; @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { if (dest.getHost().getHypervisorType() != HypervisorType.BareMetal) { super.reserve(nic, network, vm, dest, context); @@ -149,7 +149,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru { s_logger.debug("Allocated a nic " + nic + " for " + vm); } - private void getBaremetalIp(NicProfile nic, Pod pod, VirtualMachineProfile vm, Network network, String requiredIp) + private void getBaremetalIp(NicProfile nic, Pod pod, VirtualMachineProfile vm, Network network, String requiredIp) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { DataCenter dc = _dcDao.findById(pod.getDataCenterId()); if (nic.getIp4Address() == null) { diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java index 96d702d7501..1eb1c74d2b3 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java @@ -103,7 +103,7 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv @Override @DB - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { Host host = dest.getHost(); if (vm.getType() != Type.User || vm.getHypervisorType() != HypervisorType.BareMetal) { @@ -122,7 +122,7 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; } @@ -158,7 +158,7 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv return true; } - public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (vm.getHypervisorType() != HypervisorType.BareMetal || !canHandle(dest, network.getTrafficType(), network.getGuestType())) { return false; @@ -167,7 +167,7 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv } @Override - public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { + public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { //TODO Add support for baremetal return true; } diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManager.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManager.java index 9c007318368..8a83c329552 100644 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManager.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManager.java @@ -47,7 +47,7 @@ public interface BaremetalDhcpManager extends Manager, PluggableService { DHCPD, } - boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException; + boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException; BaremetalDhcpVO addDchpServer(AddBaremetalDhcpCmd cmd); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java index 17e4481c535..1e2ad54157c 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java @@ -133,7 +133,7 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh } @Override - public boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile profile, + public boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { Long zoneId = profile.getVirtualMachine().getDataCenterId(); Long podId = profile.getVirtualMachine().getPodIdToDeployIn(); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java index 5858e7ebd61..9a6c1c69a11 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java @@ -5,9 +5,9 @@ // 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 @@ -27,10 +27,11 @@ import java.util.Map; import javax.ejb.Local; import javax.inject.Inject; +import org.apache.log4j.Logger; + import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd; import org.apache.cloudstack.api.AddBaremetalPxeCmd; import org.apache.cloudstack.api.ListBaremetalPxePingServersCmd; -import org.apache.log4j.Logger; import com.cloud.agent.api.Answer; import com.cloud.agent.api.baremetal.IpmISetBootDevCommand; @@ -62,7 +63,6 @@ import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.NicProfile; import com.cloud.vm.ReservationContext; -import com.cloud.vm.UserVmVO; import com.cloud.vm.VirtualMachineProfile; @Local(value = BaremetalPxeService.class) @@ -84,7 +84,7 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase imple VMTemplateDao _tmpDao; @Override - public boolean prepare(VirtualMachineProfile profile, NicProfile nic, DeployDestination dest, ReservationContext context) { + public boolean prepare(VirtualMachineProfile profile, NicProfile nic, DeployDestination dest, ReservationContext context) { NetworkVO nwVO = _nwDao.findById(nic.getNetworkId()); SearchCriteriaService sc = SearchCriteria2.create(BaremetalPxeVO.class); sc.addAnd(sc.getEntity().getDeviceType(), Op.EQ, BaremetalPxeType.KICK_START.toString()); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java index 7b8d528b4b4..82094d8ff46 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java @@ -111,7 +111,7 @@ public class BaremetalPxeElement extends AdapterBase implements NetworkElement { @Override @DB - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { if (vm.getType() != Type.User || vm.getHypervisorType() != HypervisorType.BareMetal) { return false; @@ -138,7 +138,7 @@ public class BaremetalPxeElement extends AdapterBase implements NetworkElement { } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; } diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManager.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManager.java index 7984ddd9750..73243b5657b 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManager.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManager.java @@ -5,20 +5,20 @@ // 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. -// +// // Automatically generated by addcopyright.py at 01/29/2013 // Apache License, Version 2.0 (the "License"); you may not use this // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// +// // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.baremetal.networkservice; @@ -37,7 +37,6 @@ import com.cloud.utils.component.Manager; import com.cloud.utils.component.PluggableService; import com.cloud.vm.NicProfile; import com.cloud.vm.ReservationContext; -import com.cloud.vm.UserVmVO; import com.cloud.vm.VirtualMachineProfile; public interface BaremetalPxeManager extends Manager, PluggableService { @@ -58,7 +57,7 @@ public interface BaremetalPxeManager extends Manager, PluggableService { List listPxeServers(ListBaremetalPxePingServersCmd cmd); - boolean addUserData(NicProfile nic, VirtualMachineProfile vm); + boolean addUserData(NicProfile nic, VirtualMachineProfile vm); public static final Network.Service BAREMETAL_PXE_SERVICE = new Network.Service("BaremetalPxeService"); public static final String BAREMETAL_PXE_CAPABILITY = "BaremetalPxe"; diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java index 555adf792d0..4e9a11dcf96 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java @@ -5,20 +5,20 @@ // 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. -// +// // Automatically generated by addcopyright.py at 01/29/2013 // Apache License, Version 2.0 (the "License"); you may not use this // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// +// // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.baremetal.networkservice; @@ -31,11 +31,12 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.log4j.Logger; + import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd; import org.apache.cloudstack.api.AddBaremetalPxeCmd; import org.apache.cloudstack.api.AddBaremetalPxePingServerCmd; import org.apache.cloudstack.api.ListBaremetalPxePingServersCmd; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -183,7 +184,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe } @Override - public boolean addUserData(NicProfile nic, VirtualMachineProfile profile) { + public boolean addUserData(NicProfile nic, VirtualMachineProfile profile) { UserVmVO vm = (UserVmVO) profile.getVirtualMachine(); _vmDao.loadDetails(vm); diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeService.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeService.java index af6a6c8043c..d74e31d501b 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeService.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeService.java @@ -5,20 +5,20 @@ // 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. -// +// // Automatically generated by addcopyright.py at 01/29/2013 // Apache License, Version 2.0 (the "License"); you may not use this // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// +// // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.baremetal.networkservice; @@ -29,17 +29,15 @@ import org.apache.cloudstack.api.ListBaremetalPxePingServersCmd; import com.cloud.baremetal.database.BaremetalPxeVO; import com.cloud.deploy.DeployDestination; -import com.cloud.host.Host; import com.cloud.uservm.UserVm; import com.cloud.utils.component.Adapter; import com.cloud.vm.NicProfile; import com.cloud.vm.ReservationContext; -import com.cloud.vm.UserVmVO; import com.cloud.vm.VirtualMachineProfile; public interface BaremetalPxeService extends Adapter { - public boolean prepare(VirtualMachineProfile profile, NicProfile nic, DeployDestination dest, ReservationContext context); + public boolean prepare(VirtualMachineProfile profile, NicProfile nic, DeployDestination dest, ReservationContext context); public boolean prepareCreateTemplate(Long pxeServerId, UserVm vm, String templateUrl); @@ -62,5 +60,5 @@ public interface BaremetalPxeService extends Adapter { public static final String PXE_PARAM_PING_STORAGE_SERVER_IP = "pingStorageServerIp"; public static final String PXE_PARAM_PING_ROOT_DIR = "pingDir"; public static final String PXE_PARAM_PING_STORAGE_SERVER_USERNAME = "pingStorageServerUserName"; - public static final String PXE_PARAM_PING_STORAGE_SERVER_PASSWORD = "pingStorageServerPassword"; + public static final String PXE_PARAM_PING_STORAGE_SERVER_PASSWORD = "pingStorageServerPassword"; } diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalUserdataElement.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalUserdataElement.java index 49c6fd9b957..524db26d0ee 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalUserdataElement.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalUserdataElement.java @@ -72,7 +72,7 @@ public class BaremetalUserdataElement extends AdapterBase implements NetworkElem } @Override - public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (!canHandle(dest)) { return false; @@ -82,17 +82,17 @@ public class BaremetalUserdataElement extends AdapterBase implements NetworkElem return false; } - return pxeMgr.addUserData(nic, (VirtualMachineProfile) vm); + return pxeMgr.addUserData(nic, (VirtualMachineProfile) vm); } @Override - public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { + public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @Override - public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException { + public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @@ -115,14 +115,14 @@ public class BaremetalUserdataElement extends AdapterBase implements NetworkElem } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { // TODO Auto-generated method stub return false; } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { // TODO Auto-generated method stub return false; @@ -154,7 +154,7 @@ public class BaremetalUserdataElement extends AdapterBase implements NetworkElem @Override - public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) + public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java index cb2cb13f915..206454b1240 100755 --- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java @@ -20,12 +20,11 @@ import javax.ejb.Local; import javax.inject.Inject; import com.cloud.agent.api.to.VirtualMachineTO; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.HypervisorGuru; import com.cloud.hypervisor.HypervisorGuruBase; -import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; @Local(value=HypervisorGuru.class) @@ -41,8 +40,7 @@ public class OvmGuru extends HypervisorGuruBase implements HypervisorGuru { } @Override - public VirtualMachineTO implement( - VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); to.setBootloader(vm.getBootLoaderType()); diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java index 57a38f1d3d8..8f36e1663e6 100644 --- a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java @@ -16,18 +16,17 @@ // under the License. package com.cloud.simulator; +import javax.ejb.Local; +import javax.inject.Inject; + import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.HypervisorGuru; import com.cloud.hypervisor.HypervisorGuruBase; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; -import javax.ejb.Local; -import javax.inject.Inject; - @Local(value=HypervisorGuru.class) public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru { @@ -43,7 +42,7 @@ public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru } @Override - public VirtualMachineTO implement(VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); // Determine the VM's OS description diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index b86b6d97b6f..78a596e9266 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -122,7 +122,7 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru { } @Override - public VirtualMachineTO implement(VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); to.setBootloader(BootloaderType.HVM); diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java index 4629b6c2d3e..e1f4a274e29 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java @@ -100,7 +100,7 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -109,7 +109,7 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java index c52020e84e8..6dd6f3fb422 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java @@ -11,7 +11,7 @@ // 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 +// KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package com.cloud.hypervisor; @@ -24,9 +24,7 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; import com.cloud.template.VirtualMachineTemplate.BootloaderType; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; -import com.cloud.vm.VirtualMachineProfileImpl; @Local(value=HypervisorGuru.class) public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru { @@ -42,7 +40,7 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru } @Override - public VirtualMachineTO implement(VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { BootloaderType bt = BootloaderType.PyGrub; if (vm.getBootLoaderType() == BootloaderType.CD) { bt = vm.getBootLoaderType(); diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/element/BigSwitchVnsElement.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/element/BigSwitchVnsElement.java index 411feab7339..54623e9d080 100644 --- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/element/BigSwitchVnsElement.java +++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/element/BigSwitchVnsElement.java @@ -182,7 +182,7 @@ public class BigSwitchVnsElement extends AdapterBase implements @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -228,7 +228,7 @@ public class BigSwitchVnsElement extends AdapterBase implements @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/guru/BigSwitchVnsGuestNetworkGuru.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/guru/BigSwitchVnsGuestNetworkGuru.java index f660b7c7838..52303a43fa1 100644 --- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/guru/BigSwitchVnsGuestNetworkGuru.java +++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/guru/BigSwitchVnsGuestNetworkGuru.java @@ -211,7 +211,7 @@ public class BigSwitchVnsGuestNetworkGuru extends GuestNetworkGuru { @Override public void reserve(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -221,7 +221,7 @@ public class BigSwitchVnsGuestNetworkGuru extends GuestNetworkGuru { @Override public boolean release(NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, String reservationId) { // TODO Auto-generated method stub return super.release(nic, vm, reservationId); diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java index de52c21d405..5291ad18ab9 100644 --- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java +++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java @@ -422,7 +422,7 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -441,7 +441,7 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; diff --git a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java index c421344baba..4a403c4e658 100644 --- a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java +++ b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java @@ -71,7 +71,7 @@ public class DnsNotifier extends AdapterBase implements NetworkElement { } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { // signal to the dns server that this vm is up and running and set the ip address to hostname mapping. vm.getHostName(); @@ -81,7 +81,7 @@ public class DnsNotifier extends AdapterBase implements NetworkElement { } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { vm.getHostName(); nic.getIp4Address(); nic.getIp6Address(); diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java index 8b1b4140a8d..fd7274d8e2b 100644 --- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java @@ -123,14 +123,14 @@ public class ElasticLoadBalancerElement extends AdapterBase implements LoadBalan } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { return true; } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java index 24ec87a27b6..8d32f4369a2 100644 --- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java @@ -127,7 +127,6 @@ import com.cloud.utils.net.Ip; import com.cloud.vm.DomainRouterVO; import com.cloud.vm.NicProfile; import com.cloud.vm.ReservationContext; -import com.cloud.vm.VMInstanceVO; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; import com.cloud.vm.VirtualMachineGuru; @@ -783,8 +782,7 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { - DomainRouterVO elbVm = profile.getVirtualMachine(); + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { List elbNics = profile.getNics(); Long guestNtwkId = null; @@ -864,8 +862,8 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { - DomainRouterVO elbVm = profile.getVirtualMachine(); + public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { + DomainRouterVO elbVm = _routerDao.findById(profile.getVirtualMachine().getId()); List nics = profile.getNics(); for (NicProfile nic : nics) { @@ -885,7 +883,7 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh"); if (answer == null || !answer.getResult()) { s_logger.warn("Unable to ssh to the ELB VM: " + answer.getDetails()); @@ -896,8 +894,8 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { - DomainRouterVO elbVm = profile.getVirtualMachine(); + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + DomainRouterVO elbVm = _routerDao.findById(profile.getVirtualMachine().getId()); DataCenterVO dcVo = _dcDao.findById(elbVm.getDataCenterId()); NicProfile controlNic = null; @@ -950,10 +948,9 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { if (answer != null) { - VMInstanceVO vm = profile.getVirtualMachine(); - DomainRouterVO elbVm = _routerDao.findById(vm.getId()); + DomainRouterVO elbVm = _routerDao.findById(profile.getVirtualMachine().getId()); processStopOrRebootAnswer(elbVm, answer); } } @@ -969,7 +966,7 @@ ElasticLoadBalancerManager, VirtualMachineGuru { } @Override - public void prepareStop(VirtualMachineProfile profile) { + public void prepareStop(VirtualMachineProfile profile) { } } diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java index 80b42e030d8..8ea4d61d9d9 100644 --- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java +++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java @@ -159,13 +159,13 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan } @Override - public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientNetworkCapacityException, ResourceUnavailableException { return true; } @Override - public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { + public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { return true; } diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java index 18ac13baef4..2376038b135 100644 --- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java +++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java @@ -170,7 +170,7 @@ public class InternalLoadBalancerElement extends AdapterBase implements LoadBala @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { if (!canHandle(network, null)) { @@ -218,7 +218,7 @@ public class InternalLoadBalancerElement extends AdapterBase implements LoadBala } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; } diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java index 90ff9bc0b49..481bbca2458 100644 --- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java +++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java @@ -156,7 +156,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { //Internal LB vm starts up with 2 Nics @@ -231,8 +231,9 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { - DomainRouterVO internalLbVm = profile.getVirtualMachine(); + public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { + + DomainRouterVO internalLbVm = _internalLbVmDao.findById(profile.getId()); List nics = profile.getNics(); for (NicProfile nic : nics) { @@ -248,8 +249,8 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { - DomainRouterVO internalLbVm = profile.getVirtualMachine(); + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { + DomainRouterVO internalLbVm = _internalLbVmDao.findById(profile.getId()); boolean result = true; @@ -297,8 +298,8 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { - DomainRouterVO internalLbVm = profile.getVirtualMachine(); + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + DomainRouterVO internalLbVm = _internalLbVmDao.findById(profile.getId()); NicProfile controlNic = getNicProfileByTrafficType(profile, TrafficType.Control); if (controlNic == null) { @@ -334,7 +335,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { } @Override @@ -342,7 +343,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements } @Override - public void prepareStop(VirtualMachineProfile profile) { + public void prepareStop(VirtualMachineProfile profile) { } @Override @@ -391,7 +392,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements return _name; } - protected NicProfile getNicProfileByTrafficType(VirtualMachineProfile profile, TrafficType trafficType) { + protected NicProfile getNicProfileByTrafficType(VirtualMachineProfile profile, TrafficType trafficType) { for (NicProfile nic : profile.getNics()) { if (nic.getTrafficType() == trafficType && nic.getIp4Address() != null) { return nic; @@ -400,7 +401,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements return null; } - protected void finalizeSshAndVersionOnStart(Commands cmds, VirtualMachineProfile profile, DomainRouterVO router, NicProfile controlNic) { + protected void finalizeSshAndVersionOnStart(Commands cmds, VirtualMachineProfile profile, DomainRouterVO router, NicProfile controlNic) { cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIp4Address(), 3922)); // Update internal lb vm template/scripts version diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java index c00d99abf88..85d6de6817b 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java @@ -145,13 +145,13 @@ PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer, Junip } @Override - public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientNetworkCapacityException, ResourceUnavailableException { return true; } @Override - public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { + public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { return true; } diff --git a/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java b/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java index ab6a6def405..b02e51ddb2c 100644 --- a/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java +++ b/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java @@ -391,7 +391,7 @@ public class MidoNetElement extends AdapterBase implements * From interface DHCPServiceProvider */ @Override - public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { @@ -455,7 +455,7 @@ public class MidoNetElement extends AdapterBase implements } @Override - public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { + public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { return false; //To change body of implemented methods use File | Settings | File Templates. } @@ -768,7 +768,7 @@ public class MidoNetElement extends AdapterBase implements } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { s_logger.debug("prepare called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); @@ -832,7 +832,7 @@ public class MidoNetElement extends AdapterBase implements } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { s_logger.debug("release called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); diff --git a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetGuestNetworkGuru.java b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetGuestNetworkGuru.java index d57affc5827..ac77cf6e07e 100644 --- a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetGuestNetworkGuru.java +++ b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetGuestNetworkGuru.java @@ -145,7 +145,7 @@ public class MidoNetGuestNetworkGuru extends GuestNetworkGuru { @Override public void reserve(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -156,7 +156,7 @@ public class MidoNetGuestNetworkGuru extends GuestNetworkGuru { @Override public boolean release(NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, String reservationId) { s_logger.debug("release called with nic: " + nic.toString() + " vm: " + vm.toString()); return super.release(nic, vm, reservationId); diff --git a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java index 1daf0bad040..38da02bf6f9 100644 --- a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java +++ b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java @@ -78,7 +78,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { super(); } - protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, + protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { if (nic.getIp4Address() == null) { PublicIp ip = _networkMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false); @@ -117,7 +117,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { @@ -148,7 +148,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { s_logger.debug("reserve called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); if (nic.getIp4Address() == null) { @@ -157,7 +157,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { s_logger.debug("release called with nic: " + nic.toString() + " vm: " + vm.toString()); return true; } @@ -189,7 +189,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { } @Override @DB - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { s_logger.debug("deallocate called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); if (s_logger.isDebugEnabled()) { s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); diff --git a/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java b/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java index a7d96b0c310..9023c6eefce 100644 --- a/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java +++ b/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java @@ -97,8 +97,8 @@ public class MidoNetElementTest extends TestCase { //mockVm @SuppressWarnings("unchecked") - VirtualMachineProfile mockVm = - (VirtualMachineProfile)mock(VirtualMachineProfile.class); + VirtualMachineProfile mockVm = + (VirtualMachineProfile)mock(VirtualMachineProfile.class); when(mockVm.getType()).thenReturn(VirtualMachine.Type.User); MidoNetElement elem = new MidoNetElement(); diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java index e7f634772fc..fa51fdcbb8b 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java @@ -200,13 +200,13 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl } @Override - public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientNetworkCapacityException, ResourceUnavailableException { return true; } @Override - public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { + public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { return true; } diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java index c22f669796c..754e7b1c1db 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java @@ -296,7 +296,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer { @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -373,7 +373,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer { @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java index b78d165ddd6..ff238edc600 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java @@ -212,7 +212,7 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru { @Override public void reserve(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -222,7 +222,7 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru { @Override public boolean release(NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, String reservationId) { // TODO Auto-generated method stub return super.release(nic, vm, reservationId); diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java index 40be5ff7b45..0366143a7e7 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java @@ -72,7 +72,7 @@ public class OvsElement extends AdapterBase implements NetworkElement { @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -92,7 +92,7 @@ public class OvsElement extends AdapterBase implements NetworkElement { @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) { diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java index 2a2a935d65a..36fd25fbea3 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java @@ -26,7 +26,7 @@ public interface OvsTunnelManager extends Manager { boolean isOvsTunnelEnabled(); - public void VmCheckAndCreateTunnel(VirtualMachineProfile vm, + public void VmCheckAndCreateTunnel(VirtualMachineProfile vm, Network nw, DeployDestination dest); public void CheckAndDestroyTunnel(VirtualMachine vm, Network nw); diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java index b1ecaaccd76..d3db89fb1c5 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java @@ -383,7 +383,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage @Override public void VmCheckAndCreateTunnel( - VirtualMachineProfile vm, + VirtualMachineProfile vm, Network nw, DeployDestination dest) { CheckAndCreateTunnel(vm.getVirtualMachine(), nw, dest); } diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java index 823c16b15e8..6e1461a9778 100644 --- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java +++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java @@ -509,7 +509,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp */ @Override public boolean prepare(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { @@ -526,7 +526,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp */ @Override public boolean release(Network network, NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { s_logger.trace("release"); @@ -569,7 +569,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp @Override public boolean prepareMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) { try { prepare(network, nic, vm, dest, context); @@ -588,7 +588,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp @Override public void rollbackMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { try { release(network, nic, vm, dst); @@ -601,7 +601,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp @Override public void commitMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { try { release(network, nic, vm, src); diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java index 6d5d871eb99..3deded92632 100644 --- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java +++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java @@ -119,7 +119,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr @Override public void reserve(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -129,7 +129,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr @Override public boolean release(NicProfile nic, - VirtualMachineProfile vm, + VirtualMachineProfile vm, String reservationId) { Network network = _networkDao.findById(nic.getNetworkId()); _sspMgr.deleteNicEnv(network, nic, new ReservationContextImpl(reservationId, null, null)); @@ -143,7 +143,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr @Override public boolean prepareMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) { try { reserve(nic, network, vm, dest, context); @@ -159,14 +159,14 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr @Override public void rollbackMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { release(nic, vm, dst.getReservationId()); } @Override public void commitMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { release(nic, vm, src.getReservationId()); } diff --git a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java index fda787f479d..025a9693f98 100644 --- a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java +++ b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java @@ -38,7 +38,7 @@ public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator { private static final Logger s_logger = Logger.getLogger(RandomStoragePoolAllocator.class); @Override - public List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, + public List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { List suitablePools = new ArrayList(); diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java index 4329c7017e6..088591fee8d 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java @@ -105,13 +105,13 @@ public class FirstFitAllocator extends AdapterBase implements HostAllocator { CapacityManager _capacityMgr; @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo) { return allocateTo(vmProfile, plan, type, avoid, returnUpTo, true); } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity) { long dcId = plan.getDataCenterId(); @@ -195,7 +195,7 @@ public class FirstFitAllocator extends AdapterBase implements HostAllocator { } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, int returnUpTo, boolean considerReservedCapacity) { long dcId = plan.getDataCenterId(); Long podId = plan.getPodId(); diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java index 102c6a56358..912a3257046 100644 --- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java @@ -32,7 +32,7 @@ import com.cloud.vm.VirtualMachineProfile; @Local(value={HostAllocator.class}) public class FirstFitRoutingAllocator extends FirstFitAllocator { @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo) { try { NDC.push("FirstFitRoutingAllocator"); diff --git a/server/src/com/cloud/agent/manager/allocator/impl/RecreateHostAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/RecreateHostAllocator.java index 3b659c02741..bb4051f94c4 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/RecreateHostAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/RecreateHostAllocator.java @@ -69,7 +69,7 @@ public class RecreateHostAllocator extends FirstFitRoutingAllocator { @Inject ResourceManager _resourceMgr; @Override - public List allocateTo(VirtualMachineProfile vm,DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vm,DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo) { List hosts = super.allocateTo(vm, plan, type, avoid, returnUpTo); diff --git a/server/src/com/cloud/agent/manager/allocator/impl/TestingAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/TestingAllocator.java index 3c69694346c..6b586d11694 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/TestingAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/TestingAllocator.java @@ -42,19 +42,19 @@ public class TestingAllocator extends AdapterBase implements HostAllocator { Long _routingHost; @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo) { return allocateTo(vmProfile, plan, type, avoid, returnUpTo, true); } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, int returnUpTo, boolean considerReservedCapacity) { return allocateTo(vmProfile, plan, type, avoid, returnUpTo, considerReservedCapacity); } @Override - public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity) { List availableHosts = new ArrayList(); Host host = null; diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index 5d6719d720c..5aeb6dc0307 100755 --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -1310,9 +1310,9 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { - ConsoleProxyVO vm = profile.getVirtualMachine(); + ConsoleProxyVO vm = _consoleProxyDao.findById(profile.getId()); Map details = _vmDetailsDao.findDetails(vm.getId()); vm.setDetails(details); @@ -1388,11 +1388,11 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { finalizeCommandsOnStart(cmds, profile); - ConsoleProxyVO proxy = profile.getVirtualMachine(); + ConsoleProxyVO proxy = _consoleProxyDao.findById(profile.getId()); DataCenter dc = dest.getDataCenter(); List nics = profile.getNics(); for (NicProfile nic : nics) { @@ -1411,7 +1411,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { NicProfile managementNic = null; NicProfile controlNic = null; @@ -1438,7 +1438,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh"); if (answer == null || !answer.getResult()) { if (answer != null) { @@ -1454,7 +1454,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy _rulesMgr.getSystemIpAndEnableStaticNatForVm(profile.getVirtualMachine(), false); IPAddressVO ipaddr = _ipAddressDao.findByAssociatedVmId(profile.getVirtualMachine().getId()); if (ipaddr != null && ipaddr.getSystem()) { - ConsoleProxyVO consoleVm = profile.getVirtualMachine(); + ConsoleProxyVO consoleVm = _consoleProxyDao.findById(profile.getId()); // override CPVM guest IP with EIP, so that console url's will be prepared with EIP consoleVm.setPublicIpAddress(ipaddr.getAddress().addr()); _consoleProxyDao.update(consoleVm.getId(), consoleVm); @@ -1483,7 +1483,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { //release elastic IP here if assigned IPAddressVO ip = _ipAddressDao.findByAssociatedVmId(profile.getId()); if (ip != null && ip.getSystem()) { @@ -1685,7 +1685,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy } @Override - public void prepareStop(VirtualMachineProfile profile) { + public void prepareStop(VirtualMachineProfile profile) { } } diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManager.java b/server/src/com/cloud/deploy/DeploymentPlanningManager.java index 9458df2946f..7dde8158bb1 100644 --- a/server/src/com/cloud/deploy/DeploymentPlanningManager.java +++ b/server/src/com/cloud/deploy/DeploymentPlanningManager.java @@ -20,7 +20,6 @@ import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.exception.AffinityConflictException; import com.cloud.exception.InsufficientServerCapacityException; import com.cloud.utils.component.Manager; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public interface DeploymentPlanningManager extends Manager { @@ -40,11 +39,11 @@ public interface DeploymentPlanningManager extends Manager { * * */ - DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, + DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException, AffinityConflictException; String finalizeReservation(DeployDestination plannedDestination, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException, AffinityConflictException; void cleanupVMReservations(); diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java index 975f80b6355..5336d30fe07 100644 --- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -207,7 +207,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } @Override - public DeployDestination planDeployment(VirtualMachineProfile vmProfile, + public DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException, AffinityConflictException { @@ -449,7 +449,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy return dest; } - private void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataCenter dc, ExcludeList avoids) { + private void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataCenter dc, ExcludeList avoids) { boolean isExplicit = false; VirtualMachine vm = vmProfile.getVirtualMachine(); // check affinity group of type Explicit dedication exists @@ -534,7 +534,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } } - private PlannerResourceUsage getPlannerUsage(DeploymentPlanner planner, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException { + private PlannerResourceUsage getPlannerUsage(DeploymentPlanner planner, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException { if (planner != null && planner instanceof DeploymentClusterPlanner) { return ((DeploymentClusterPlanner) planner).getResourceUsage(vmProfile, plan, avoids); } else { @@ -843,7 +843,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy // /refactoring planner methods private DeployDestination checkClustersforDestination(List clusterList, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, DataCenter dc, DeploymentPlanner.PlannerResourceUsage resourceUsageRequired, ExcludeList PlannerAvoidOutput) { if (s_logger.isTraceEnabled()) { @@ -1035,7 +1035,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy return hostCanAccessSPool; } - protected List findSuitableHosts(VirtualMachineProfile vmProfile, + protected List findSuitableHosts(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { List suitableHosts = new ArrayList(); for (HostAllocator allocator : _hostAllocators) { @@ -1052,7 +1052,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } protected Pair>, List> findSuitablePoolsForVolumes( - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { List volumesTobeCreated = _volsDao.findUsableVolumesForInstance(vmProfile.getId()); Map> suitableVolumeStoragePools = new HashMap>(); @@ -1219,7 +1219,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy @DB @Override public String finalizeReservation(DeployDestination plannedDestination, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException, AffinityConflictException { VirtualMachine vm = vmProfile.getVirtualMachine(); diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index 7124de28d7b..d2e0c14cb52 100755 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -110,7 +110,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla @Override - public List orderClusters(VirtualMachineProfile vmProfile, + public List orderClusters(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { VirtualMachine vm = vmProfile.getVirtualMachine(); @@ -178,7 +178,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } - private List scanPodsForDestination(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid){ + private List scanPodsForDestination(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid){ ServiceOffering offering = vmProfile.getServiceOffering(); int requiredCpu = offering.getCpu() * offering.getSpeed(); @@ -264,7 +264,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } private void removeClustersCrossingThreshold(List clusterListForVmAllocation, ExcludeList avoid, - VirtualMachineProfile vmProfile, DeploymentPlan plan) { + VirtualMachineProfile vmProfile, DeploymentPlan plan) { List capacityList = getCapacitiesForCheckingThreshold(); List clustersCrossingThreshold = new ArrayList(); @@ -302,7 +302,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } private List scanClustersForDestinationInZoneOrPod(long id, boolean isZone, - VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) { + VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) { VirtualMachine vm = vmProfile.getVirtualMachine(); ServiceOffering offering = vmProfile.getServiceOffering(); @@ -362,7 +362,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla * other than the capacity based ordering which is done by default. * @return List ordered list of Cluster Ids */ - protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderClusters(long id, boolean isZone, Pair, Map> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List reordersClusterIds = clusterCapacityInfo.first(); return reordersClusterIds; } @@ -374,7 +374,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla * other than the capacity based ordering which is done by default. * @return List ordered list of Pod Ids */ - protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ + protected List reorderPods(Pair, Map> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan){ List podIdsByCapacity = podCapacityInfo.first(); return podIdsByCapacity; } @@ -476,14 +476,14 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } @Override - public boolean check(VirtualMachineProfile vm, DeploymentPlan plan, + public boolean check(VirtualMachineProfile vm, DeploymentPlan plan, DeployDestination dest, ExcludeList exclude) { // TODO Auto-generated method stub return false; } @Override - public boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) { + public boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) { // check what the ServiceOffering says. If null, check the global config ServiceOffering offering = vm.getServiceOffering(); if (vm.getHypervisorType() != HypervisorType.BareMetal) { @@ -510,14 +510,14 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla @Override - public DeployDestination plan(VirtualMachineProfile vm, DeploymentPlan plan, + public DeployDestination plan(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { // TODO Auto-generated method stub return null; } @Override - public PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, + public PlannerResourceUsage getResourceUsage(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException { return PlannerResourceUsage.Shared; } diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java index 2ffd6821d3e..34584ab7a81 100644 --- a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java +++ b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java @@ -85,7 +85,7 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis } - protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) { + protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) { ServiceOffering offering = vmProfile.getServiceOffering(); VirtualMachine vm = vmProfile.getVirtualMachine(); diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java index 662ee3e836b..58e46e12979 100644 --- a/server/src/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/com/cloud/hypervisor/KVMGuru.java @@ -23,7 +23,6 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; @Local(value=HypervisorGuru.class) @@ -40,8 +39,7 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru { } @Override - public VirtualMachineTO implement( - VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); // Determine the VM's OS description diff --git a/server/src/com/cloud/hypervisor/LXCGuru.java b/server/src/com/cloud/hypervisor/LXCGuru.java index 7a530b5a203..dd61b20a0a7 100644 --- a/server/src/com/cloud/hypervisor/LXCGuru.java +++ b/server/src/com/cloud/hypervisor/LXCGuru.java @@ -23,7 +23,6 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.GuestOSVO; import com.cloud.storage.dao.GuestOSDao; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; @Local(value=HypervisorGuru.class) @@ -40,8 +39,7 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru { } @Override - public VirtualMachineTO implement( - VirtualMachineProfile vm) { + public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); // Determine the VM's OS description diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java index 8dc7743e706..f6dbb198945 100755 --- a/server/src/com/cloud/network/NetworkManager.java +++ b/server/src/com/cloud/network/NetworkManager.java @@ -5,7 +5,7 @@ // 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, @@ -55,7 +55,6 @@ import com.cloud.vm.Nic; import com.cloud.vm.NicProfile; import com.cloud.vm.NicVO; import com.cloud.vm.ReservationContext; -import com.cloud.vm.VMInstanceVO; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.Type; import com.cloud.vm.VirtualMachineProfile; @@ -82,7 +81,7 @@ public interface NetworkManager { * @throws InsufficientAddressCapacityException */ - PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp, + PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException; @@ -103,17 +102,17 @@ public interface NetworkManager { List setupNetwork(Account owner, NetworkOffering offering, Network predefined, DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup, Long domainId, ACLType aclType, Boolean subdomainAccess, Long vpcId, Boolean isDisplayNetworkEnabled) throws ConcurrentOperationException; - void allocate(VirtualMachineProfile vm, List> networks) throws InsufficientCapacityException, ConcurrentOperationException; + void allocate(VirtualMachineProfile vm, List> networks) throws InsufficientCapacityException, ConcurrentOperationException; - void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, + void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException; - void release(VirtualMachineProfile vmProfile, boolean forced) throws + void release(VirtualMachineProfile vmProfile, boolean forced) throws ConcurrentOperationException, ResourceUnavailableException; - void cleanupNics(VirtualMachineProfile vm); + void cleanupNics(VirtualMachineProfile vm); - void expungeNics(VirtualMachineProfile vm); + void expungeNics(VirtualMachineProfile vm); List getNicProfiles(VirtualMachine vm); @@ -129,27 +128,27 @@ public interface NetworkManager { * @param vm * @param dest */ - void prepareNicForMigration(VirtualMachineProfile vm, DeployDestination dest); + void prepareNicForMigration(VirtualMachineProfile vm, DeployDestination dest); /** * commit vm nic change for migration * - * This method will be called in migration transaction after the successful + * This method will be called in migration transaction after the successful * vm migration. * @param src * @param dst */ - void commitNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst); + void commitNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst); /** * rollback vm nic change for migration * - * This method will be called in migaration transaction after vm migration + * This method will be called in migaration transaction after vm migration * failure. * @param src * @param dst */ - void rollbackNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst); + void rollbackNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst); boolean shutdownNetwork(long networkId, ReservationContext context, boolean cleanupElements); @@ -193,8 +192,7 @@ public interface NetworkManager { boolean applyStaticNats(List staticNats, boolean continueOnError, boolean forRevoke) throws ResourceUnavailableException; - boolean reallocate(VirtualMachineProfile vm, - DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException; + boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException; IpAddress assignSystemIp(long networkId, Account owner, boolean forElasticLb, boolean forElasticIp) @@ -203,7 +201,7 @@ public interface NetworkManager { boolean handleSystemIpRelease(IpAddress ip); void allocateDirectIp(NicProfile nic, DataCenter dc, - VirtualMachineProfile vm, + VirtualMachineProfile vm, Network network, String requestedIpv4, String requestedIpv6) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException; @@ -212,8 +210,8 @@ public interface NetworkManager { * @param owner * @param guestNetwork * @return - * @throws ConcurrentOperationException - * @throws InsufficientAddressCapacityException + * @throws ConcurrentOperationException + * @throws InsufficientAddressCapacityException */ PublicIp assignSourceNatIpAddressToGuestNetwork(Account owner, Network guestNetwork) throws InsufficientAddressCapacityException, ConcurrentOperationException; @@ -229,8 +227,8 @@ public interface NetworkManager { * @throws InsufficientAddressCapacityException * @throws ConcurrentOperationException */ - Pair allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, int deviceId, - VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + Pair allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, int deviceId, + VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException; @@ -247,7 +245,7 @@ public interface NetworkManager { * @throws InsufficientCapacityException * @throws ResourceUnavailableException */ - NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, + NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context, long nicId, NetworkVO network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; @@ -256,7 +254,7 @@ public interface NetworkManager { * @param vm * @param nic TODO */ - void removeNic(VirtualMachineProfile vm, Nic nic); + void removeNic(VirtualMachineProfile vm, Nic nic); /** @@ -264,7 +262,7 @@ public interface NetworkManager { * @param networkId * @param releaseOnFailure TODO */ - IPAddressVO associateIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException, + IPAddressVO associateIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException, InsufficientAddressCapacityException, ConcurrentOperationException; IpAddress allocatePortableIp(Account ipOwner, Account caller, long dcId, Long networkId, Long vpcID) @@ -297,7 +295,7 @@ public interface NetworkManager { * @throws ConcurrentOperationException * @throws ResourceUnavailableException */ - void releaseNic(VirtualMachineProfile vmProfile, Nic nic) + void releaseNic(VirtualMachineProfile vmProfile, Nic nic) throws ConcurrentOperationException, ResourceUnavailableException; @@ -314,7 +312,8 @@ public interface NetworkManager { * @throws InsufficientCapacityException * @throws ResourceUnavailableException */ - NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, VirtualMachineProfile vmProfile, boolean prepare) throws InsufficientVirtualNetworkCapcityException, + NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, VirtualMachineProfile vmProfile, boolean prepare) + throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 279ea848a8d..30c4242c8e9 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -1615,7 +1615,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override @DB - public void allocate(VirtualMachineProfile vm, List> networks) + public void allocate(VirtualMachineProfile vm, List> networks) throws InsufficientCapacityException, ConcurrentOperationException { Transaction txn = Transaction.currentTxn(); txn.start(); @@ -1690,7 +1690,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @DB @Override public Pair allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, - int deviceId, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + int deviceId, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException{ NetworkVO ntwkVO = _networksDao.findById(network.getId()); @@ -1997,7 +1997,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } protected boolean prepareElement(NetworkElement element, NetworkVO network, - NicProfile profile, VirtualMachineProfile vmProfile, + NicProfile profile, VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { element.prepare(network, profile, vmProfile, dest, context); @@ -2044,7 +2044,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public void prepare(VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, + public void prepare(VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { List nics = _nicDao.listByVmId(vmProfile.getId()); @@ -2072,7 +2072,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination + public NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context, long nicId, NetworkVO network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { @@ -2136,7 +2136,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public void prepareNicForMigration(VirtualMachineProfile vm, DeployDestination dest) { + public void prepareNicForMigration(VirtualMachineProfile vm, DeployDestination dest) { List nics = _nicDao.listByVmId(vm.getId()); ReservationContext context = new ReservationContextImpl(UUID.randomUUID().toString(), null, null); for (NicVO nic : nics) { @@ -2163,7 +2163,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } } - private NicProfile findNicProfileById(VirtualMachineProfile vm, long id){ + private NicProfile findNicProfileById(VirtualMachineProfile vm, long id){ for(NicProfile nic: vm.getNics()){ if(nic.getId() == id){ return nic; @@ -2174,8 +2174,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override public void commitNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { + VirtualMachineProfile src, + VirtualMachineProfile dst) { for(NicProfile nicSrc: src.getNics()){ NetworkVO network = _networksDao.findById(nicSrc.getNetworkId()); NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName()); @@ -2200,8 +2200,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override public void rollbackNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { + VirtualMachineProfile src, + VirtualMachineProfile dst) { for(NicProfile nicDst: dst.getNics()){ NetworkVO network = _networksDao.findById(nicDst.getNetworkId()); NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName()); @@ -2222,7 +2222,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override @DB - public void release(VirtualMachineProfile vmProfile, boolean forced) throws + public void release(VirtualMachineProfile vmProfile, boolean forced) throws ConcurrentOperationException, ResourceUnavailableException { List nics = _nicDao.listByVmId(vmProfile.getId()); for (NicVO nic : nics) { @@ -2233,14 +2233,14 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override @DB - public void releaseNic(VirtualMachineProfile vmProfile, Nic nic) + public void releaseNic(VirtualMachineProfile vmProfile, Nic nic) throws ConcurrentOperationException, ResourceUnavailableException { NicVO nicVO = _nicDao.findById(nic.getId()); releaseNic(vmProfile, nicVO); } @DB - protected void releaseNic(VirtualMachineProfile vmProfile, NicVO nicVO) + protected void releaseNic(VirtualMachineProfile vmProfile, NicVO nicVO) throws ConcurrentOperationException, ResourceUnavailableException { //lock the nic Transaction txn = Transaction.currentTxn(); @@ -2292,7 +2292,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public void cleanupNics(VirtualMachineProfile vm) { + public void cleanupNics(VirtualMachineProfile vm) { if (s_logger.isDebugEnabled()) { s_logger.debug("Cleaning network for vm: " + vm.getId()); } @@ -2305,12 +2305,12 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override - public void removeNic(VirtualMachineProfile vm, Nic nic) { + public void removeNic(VirtualMachineProfile vm, Nic nic) { removeNic(vm, _nicDao.findById(nic.getId())); } - protected void removeNic(VirtualMachineProfile vm, NicVO nic) { + protected void removeNic(VirtualMachineProfile vm, NicVO nic) { nic.setState(Nic.State.Deallocating); _nicDao.update(nic.getId(), nic); NetworkVO network = _networksDao.findById(nic.getNetworkId()); @@ -2347,7 +2347,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public void expungeNics(VirtualMachineProfile vm) { + public void expungeNics(VirtualMachineProfile vm) { List nics = _nicDao.listByVmIdIncludingRemoved(vm.getId()); for (NicVO nic : nics) { _nicDao.expunge(nic.getId()); @@ -3704,7 +3704,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @DB @Override - public boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException { + public boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException { VMInstanceVO vmInstance = _vmDao.findById(vm.getId()); DataCenterVO dc = _dcDao.findById(vmInstance.getDataCenterId()); if (dc.getNetworkType() == NetworkType.Basic) { @@ -4198,7 +4198,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Override @DB - public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network, + public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network, String requestedIpv4, String requestedIpv6) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { //This method allocates direct ip for the Shared network in Advance zones @@ -4300,7 +4300,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L } @Override - public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, VirtualMachineProfile vmProfile, boolean prepare) + public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, VirtualMachineProfile vmProfile, boolean prepare) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { diff --git a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java index bdd8e61bbc2..5c7f333a687 100644 --- a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java +++ b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java @@ -50,7 +50,6 @@ import com.cloud.network.PhysicalNetworkServiceProvider; import com.cloud.network.dao.NetworkDao; import com.cloud.offering.NetworkOffering; import com.cloud.service.dao.ServiceOfferingDao; -import com.cloud.uservm.UserVm; import com.cloud.utils.PasswordGenerator; import com.cloud.utils.component.AdapterBase; import com.cloud.vm.NicProfile; @@ -112,13 +111,13 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { return true; } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { return true; } @@ -200,7 +199,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem } @Override - public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (canHandle(dest, network.getTrafficType())) { @@ -208,16 +207,16 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem return false; } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; - _userVmDao.loadDetails((UserVmVO) uservm.getVirtualMachine()); - String password = (String) uservm.getParameter(VirtualMachineProfile.Param.VmPassword); - String userData = uservm.getVirtualMachine().getUserData(); - String sshPublicKey = uservm.getVirtualMachine().getDetail("SSH.PublicKey"); + UserVmVO uservm = _userVmDao.findById(vm.getId()); + _userVmDao.loadDetails(uservm); + String password = (String)vm.getParameter(VirtualMachineProfile.Param.VmPassword); + String userData = uservm.getUserData(); + String sshPublicKey = uservm.getDetail("SSH.PublicKey"); Commands cmds = new Commands(OnError.Continue); if (password != null && nic.isDefaultNic()) { final String encodedPassword = PasswordGenerator.rot13(password); - SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), uservm.getVirtualMachine().getHostName(), _networkMgr.getExecuteInSeqNtwkElmtCmd()); + SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), uservm.getHostName(), _networkMgr.getExecuteInSeqNtwkElmtCmd()); cmds.addCommand("password", cmd); } String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(uservm.getServiceOfferingId()).getDisplayText(); @@ -225,7 +224,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem cmds.addCommand( "vmdata", - generateVmDataCommand(nic.getIp4Address(), userData, serviceOffering, zoneName, nic.getIp4Address(), uservm.getVirtualMachine().getHostName(), + generateVmDataCommand(nic.getIp4Address(), userData, serviceOffering, zoneName, nic.getIp4Address(), uservm.getHostName(), uservm.getInstanceName(), uservm.getId(), uservm.getUuid(), sshPublicKey)); try { _agentManager.send(dest.getHost().getId(), cmds); @@ -235,29 +234,29 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem } Answer dataAnswer = cmds.getAnswer("vmdata"); if (dataAnswer != null && dataAnswer.getResult()) { - s_logger.info("Sent vm data successfully to vm " + uservm.getVirtualMachine().getInstanceName()); + s_logger.info("Sent vm data successfully to vm " + uservm.getInstanceName()); return true; } - s_logger.info("Failed to send vm data to vm " + uservm.getVirtualMachine().getInstanceName()); + s_logger.info("Failed to send vm data to vm " + uservm.getInstanceName()); return false; } return false; } @Override - public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { + public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @Override - public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException { + public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @Override - public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { + public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } diff --git a/server/src/com/cloud/network/element/SecurityGroupElement.java b/server/src/com/cloud/network/element/SecurityGroupElement.java index 0659db781e3..4a740c0c186 100644 --- a/server/src/com/cloud/network/element/SecurityGroupElement.java +++ b/server/src/com/cloud/network/element/SecurityGroupElement.java @@ -68,13 +68,13 @@ public class SecurityGroupElement extends AdapterBase implements NetworkElement } @Override @DB - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { return true; } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; } diff --git a/server/src/com/cloud/network/element/VirtualRouterElement.java b/server/src/com/cloud/network/element/VirtualRouterElement.java index d26c1e111cd..15b7f13ee62 100755 --- a/server/src/com/cloud/network/element/VirtualRouterElement.java +++ b/server/src/com/cloud/network/element/VirtualRouterElement.java @@ -212,7 +212,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (vm.getType() != VirtualMachine.Type.User || vm.getHypervisorType() == HypervisorType.BareMetal) { @@ -232,7 +232,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; List routers = _routerMgr.deployVirtualRouterInGuestNetwork(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), offering.getRedundantRouter()); @@ -685,7 +685,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @Override - public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) + public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { if (!canHandle(network, null)) { return false; @@ -697,13 +697,13 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; return _routerMgr.savePasswordToRouter(network, nic, uservm, routers); } @Override - public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) + public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException { if (!canHandle(network, null)) { return false; @@ -715,13 +715,13 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; return _routerMgr.saveSSHPublicKeyToRouter(network, nic, uservm, routers, SSHPublicKey); } @Override - public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) + public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException { if (!canHandle(network, null)) { return false; @@ -733,7 +733,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; return _routerMgr.saveUserDataToRouter(network, nic, uservm, routers); } @@ -848,21 +848,21 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @Override - public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException { return true; } @Override - public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (canHandle(network, Service.Dhcp)) { if (vm.getType() != VirtualMachine.Type.User) { return false; } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; List routers = getRouters(network, dest); @@ -893,7 +893,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @Override - public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (canHandle(network, Service.Dhcp)) { @@ -902,7 +902,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; List routers = getRouters(network, dest); @@ -916,7 +916,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @Override - public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { if (canHandle(network, Service.UserData)) { @@ -930,7 +930,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl } @SuppressWarnings("unchecked") - VirtualMachineProfile uservm = (VirtualMachineProfile) vm; + VirtualMachineProfile uservm = (VirtualMachineProfile) vm; List routers = getRouters(network, dest); @@ -1049,7 +1049,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl @Override public boolean prepareMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) { if (nic.getBroadcastType() != Networks.BroadcastDomainType.Pvlan) { return true; @@ -1068,7 +1068,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl @Override public void rollbackMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { if (nic.getBroadcastType() != Networks.BroadcastDomainType.Pvlan) { return; @@ -1086,7 +1086,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl @Override public void commitMigration(NicProfile nic, Network network, - VirtualMachineProfile vm, + VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) { if (nic.getBroadcastType() != Networks.BroadcastDomainType.Pvlan) { return; diff --git a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java index 966710c36c9..979d8fe2d3d 100644 --- a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java +++ b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java @@ -185,7 +185,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc } @Override - public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { diff --git a/server/src/com/cloud/network/guru/ControlNetworkGuru.java b/server/src/com/cloud/network/guru/ControlNetworkGuru.java index e7c5cba132d..6060dac4b8f 100755 --- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java +++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java @@ -106,7 +106,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { if(vm.getHypervisorType() == HypervisorType.VMware && vm.getType() != VirtualMachine.Type.DomainRouter) { @@ -124,11 +124,11 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { } @Override - public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, + public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { assert nic.getTrafficType() == TrafficType.Control; @@ -163,7 +163,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { assert nic.getTrafficType() == TrafficType.Control; if (vm.getHypervisorType() == HypervisorType.VMware && vm.getType() == VirtualMachine.Type.DomainRouter) { diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java index b4577ac096a..5d0e7b1d9cf 100755 --- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java +++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java @@ -188,7 +188,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { DataCenter dc = _dcDao.findById(network.getDataCenterId()); @@ -208,7 +208,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { if (nic.getIp4Address() == null && nic.getIp6Address() == null) { allocateDirectIp(nic, network, vm, dest.getDataCenter(), null, null); @@ -217,7 +217,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { } @DB - protected void allocateDirectIp(NicProfile nic, Network network, VirtualMachineProfile vm, DataCenter dc, String requestedIp4Addr, String requestedIp6Addr) + protected void allocateDirectIp(NicProfile nic, Network network, VirtualMachineProfile vm, DataCenter dc, String requestedIp4Addr, String requestedIp6Addr) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -236,7 +236,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { return true; } @@ -246,7 +246,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { } @Override @DB - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { if (s_logger.isDebugEnabled()) { s_logger.debug("Deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); } diff --git a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java index f21e352ff76..110096b7147 100755 --- a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java +++ b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java @@ -88,7 +88,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru { } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { DataCenterVO dc = _dcDao.findById(network.getDataCenterId()); @@ -119,7 +119,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru { } @Override @DB - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { String oldIp = nic.getIp4Address(); @@ -159,7 +159,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru { } @DB - protected void getIp(NicProfile nic, Pod pod, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, + protected void getIp(NicProfile nic, Pod pod, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { DataCenter dc = _dcDao.findById(pod.getDataCenterId()); if (nic.getIp4Address() == null) { diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java index 36ea6a5b359..9355d7795e6 100644 --- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java @@ -198,7 +198,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { } @Override - public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { if (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId()) && nic != null && nic.getRequestedIpv4() != null) { @@ -224,7 +224,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { } @Override @DB - public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { super.deallocate(config, nic, vm); if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { @@ -241,7 +241,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { } @Override - public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { assert (nic.getReservationStrategy() == ReservationStrategy.Start) : "What can I do for nics that are not allocated at start? "; boolean _isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())); @@ -278,7 +278,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { return true; diff --git a/server/src/com/cloud/network/guru/GuestNetworkGuru.java b/server/src/com/cloud/network/guru/GuestNetworkGuru.java index 9adffa222e0..f2eeb1252f7 100755 --- a/server/src/com/cloud/network/guru/GuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/GuestNetworkGuru.java @@ -216,7 +216,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur } @Override @DB - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { if (network.getSpecifyIpRanges()) { if (s_logger.isDebugEnabled()) { s_logger.debug("Deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); @@ -316,7 +316,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { @@ -393,7 +393,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { assert (nic.getReservationStrategy() == ReservationStrategy.Start) : "What can I do for nics that are not allocated at start? "; @@ -403,7 +403,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { nic.setBroadcastUri(null); nic.setIsolationUri(null); return true; diff --git a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java index 5a24fe56305..38624652c1b 100755 --- a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java +++ b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java @@ -90,11 +90,11 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { } @Override - public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, + public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { TrafficType trafficType = config.getTrafficType(); assert trafficType == TrafficType.Management || trafficType == TrafficType.Storage: "Well, I can't take care of this config now can I? " + config; @@ -112,7 +112,7 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, + public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { Pod pod = dest.getPod(); @@ -144,7 +144,7 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { _dcDao.releasePrivateIpAddress(nic.getId(), nic.getReservationId()); nic.deallocate(); diff --git a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java index 2e266e7b780..6521cf4e1dd 100644 --- a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java +++ b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java @@ -132,7 +132,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { if (s_logger.isDebugEnabled()) { s_logger.debug("Deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); } @@ -153,7 +153,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { DataCenter dc = _configMgr.getZone(network.getDataCenterId()); NetworkOffering offering = _configMgr.getNetworkOffering(network.getNetworkOfferingId()); @@ -212,7 +212,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { if (nic.getIp4Address() == null) { @@ -222,7 +222,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { return true; } diff --git a/server/src/com/cloud/network/guru/PublicNetworkGuru.java b/server/src/com/cloud/network/guru/PublicNetworkGuru.java index a83cdb37c69..8beb42e5831 100755 --- a/server/src/com/cloud/network/guru/PublicNetworkGuru.java +++ b/server/src/com/cloud/network/guru/PublicNetworkGuru.java @@ -107,7 +107,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru { super(); } - protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, + protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { if (nic.getIp4Address() == null) { PublicIp ip = _networkMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), VlanType.VirtualNetwork, null, null, false); @@ -136,7 +136,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { @@ -164,7 +164,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { if (nic.getIp4Address() == null) { getIp(nic, dest.getDataCenter(), vm, network); @@ -172,7 +172,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru { } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { return true; } @@ -183,7 +183,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru { } @Override @DB - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { if (s_logger.isDebugEnabled()) { s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); } diff --git a/server/src/com/cloud/network/guru/StorageNetworkGuru.java b/server/src/com/cloud/network/guru/StorageNetworkGuru.java index 1d01184e0c5..86dd5f6b996 100755 --- a/server/src/com/cloud/network/guru/StorageNetworkGuru.java +++ b/server/src/com/cloud/network/guru/StorageNetworkGuru.java @@ -103,7 +103,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) + public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { assert network.getTrafficType() == TrafficType.Storage : "Well, I can't take care of this config now can I? " + network; if (!_sNwMgr.isStorageIpRangeAvailable(network.getDataCenterId())) { @@ -114,7 +114,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) + public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { if (!_sNwMgr.isStorageIpRangeAvailable(dest.getDataCenter().getId())) { super.reserve(nic, network, vm, dest, context); @@ -146,7 +146,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { + public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { Network nw = _nwDao.findById(nic.getNetworkId()); if (!_sNwMgr.isStorageIpRangeAvailable(nw.getDataCenterId())) { return super.release(nic, vm, reservationId); @@ -159,7 +159,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu } @Override - public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { // TODO Auto-generated method stub } diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java index 72fddf4f87d..dbbc2d543ed 100644 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java @@ -61,13 +61,13 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA * @param routers TODO * */ - boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, + boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException; - boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, + boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers, String SSHPublicKey) throws ResourceUnavailableException; - boolean saveUserDataToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, + boolean saveUserDataToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException; List deployVirtualRouterInGuestNetwork(Network guestNetwork, DeployDestination dest, Account owner, @@ -99,16 +99,16 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA boolean applyStaticNats(Network network, final List rules, List routers) throws ResourceUnavailableException; - boolean applyDhcpEntry(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + boolean applyDhcpEntry(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, List routers) throws ResourceUnavailableException; - boolean applyUserData(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, + boolean applyUserData(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, List routers) throws ResourceUnavailableException; boolean applyLoadBalancingRules(Network network, List rules, List routers) throws ResourceUnavailableException; - boolean configDhcpForSubnet(Network network, NicProfile nic, VirtualMachineProfile uservm, DeployDestination dest, List routers) throws ResourceUnavailableException ; + boolean configDhcpForSubnet(Network network, NicProfile nic, VirtualMachineProfile uservm, DeployDestination dest, List routers) throws ResourceUnavailableException ; boolean removeDhcpSupportForSubnet(Network network, List routers) throws ResourceUnavailableException; diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index d05d8e88bea..ef7f50b85e1 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -485,10 +485,10 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean savePasswordToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { + public boolean savePasswordToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); - final VirtualMachineProfile updatedProfile = profile; + final VirtualMachineProfile updatedProfile = profile; return applyRules(network, routers, "save password entry", false, null, false, new RuleApplier() { @Override @@ -503,10 +503,11 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean saveSSHPublicKeyToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers, final String SSHPublicKey) throws ResourceUnavailableException { - _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); + public boolean saveSSHPublicKeyToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers, final String SSHPublicKey) throws ResourceUnavailableException { + final UserVmVO vm = _userVmDao.findById(profile.getVirtualMachine().getId()); + _userVmDao.loadDetails(vm); - final VirtualMachineProfile updatedProfile = profile; + final VirtualMachineProfile updatedProfile = profile; return applyRules(network, routers, "save SSHkey entry", false, null, false, new RuleApplier() { @Override @@ -518,17 +519,16 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V if(template != null && template.getEnablePassword()) { createPasswordCommand(router, updatedProfile, nicVo, cmds); } - createVmDataCommand(router, updatedProfile.getVirtualMachine(), nicVo, SSHPublicKey, cmds); + createVmDataCommand(router, vm, nicVo, SSHPublicKey, cmds); return sendCommandsToRouter(router, cmds); } }); } @Override - public boolean saveUserDataToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { - _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); - - final VirtualMachineProfile updatedProfile = profile; + public boolean saveUserDataToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { + final UserVmVO vm = _userVmDao.findById(profile.getVirtualMachine().getId()); + _userVmDao.loadDetails(vm); return applyRules(network, routers, "save userdata entry", false, null, false, new RuleApplier() { @Override @@ -536,7 +536,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V // for basic zone, send vm data/password information only to the router in the same pod Commands cmds = new Commands(OnError.Stop); NicVO nicVo = _nicDao.findById(nic.getId()); - createVmDataCommand(router, updatedProfile.getVirtualMachine(), nicVo, null, cmds); + createVmDataCommand(router, vm, nicVo, null, cmds); return sendCommandsToRouter(router, cmds); } }); @@ -1979,7 +1979,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { boolean dnsProvided = true; @@ -1989,7 +1989,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V _dcDao.loadDetails(dc); //1) Set router details - DomainRouterVO router = profile.getVirtualMachine(); + DomainRouterVO router = _routerDao.findById(profile.getVirtualMachine().getId()); Map details = _vmDetailsDao.findDetails(router.getId()); router.setDetails(details); @@ -2262,9 +2262,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, + public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException { - DomainRouterVO router = profile.getVirtualMachine(); + DomainRouterVO router = _routerDao.findById(profile.getId()); List nics = profile.getNics(); for (NicProfile nic : nics) { @@ -2284,8 +2284,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { - DomainRouterVO router = profile.getVirtualMachine(); + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + DomainRouterVO router = _routerDao.findById(profile.getId()); NicProfile controlNic = getControlNic(profile); if (controlNic == null) { @@ -2324,8 +2324,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V return true; } - protected NicProfile getControlNic(VirtualMachineProfile profile) { - DomainRouterVO router = profile.getVirtualMachine(); + protected NicProfile getControlNic(VirtualMachineProfile profile) { + DomainRouterVO router = _routerDao.findById(profile.getId()); DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId()); NicProfile controlNic = null; if (profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType() == NetworkType.Basic) { @@ -2346,7 +2346,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V return controlNic; } - protected void finalizeSshAndVersionAndNetworkUsageOnStart(Commands cmds, VirtualMachineProfile profile, DomainRouterVO router, NicProfile controlNic) { + protected void finalizeSshAndVersionAndNetworkUsageOnStart(Commands cmds, VirtualMachineProfile profile, DomainRouterVO router, NicProfile controlNic) { + DomainRouterVO vr = _routerDao.findById(profile.getId()); cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIp4Address(), 3922)); // Update router template/scripts version @@ -2356,7 +2357,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V cmds.addCommand("getDomRVersion", command); // Network usage command to create iptables rules - boolean forVpc = profile.getVirtualMachine().getVpcId() != null; + boolean forVpc = vr.getVpcId() != null; if (!forVpc) cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getHostName(), "create", forVpc)); } @@ -2561,9 +2562,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { - DomainRouterVO router = profile.getVirtualMachine(); + DomainRouterVO router = _routerDao.findById(profile.getId()); boolean result = true; @@ -2620,9 +2621,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { if (answer != null) { - VMInstanceVO vm = profile.getVirtualMachine(); + VirtualMachine vm = profile.getVirtualMachine(); DomainRouterVO domR = _routerDao.findById(vm.getId()); processStopOrRebootAnswer(domR, answer); List routerNics = _nicDao.listByVmId(profile.getId()); @@ -2765,10 +2766,10 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean configDhcpForSubnet(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) throws ResourceUnavailableException { - _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); + public boolean configDhcpForSubnet(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) throws ResourceUnavailableException { + UserVmVO vm = _userVmDao.findById(profile.getId()); + _userVmDao.loadDetails(vm); - final VirtualMachineProfile updatedProfile = profile; final boolean isZoneBasic = (dest.getDataCenter().getNetworkType() == NetworkType.Basic); final Long podId = isZoneBasic ? dest.getPod().getId() : null; @@ -2780,7 +2781,6 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V router.getState(), DataCenter.class, network.getDataCenterId()); } //check if this is not the primary subnet. - UserVm vm = updatedProfile.getVirtualMachine(); NicVO domr_guest_nic = _nicDao.findByInstanceIdAndIpAddressAndVmtype(router.getId(), _nicDao.getIpAddress(nic.getNetworkId(), router.getId()), VirtualMachine.Type.DomainRouter); //check if the router ip address and the vm ip address belong to same subnet. //if they do not belong to same netwoek check for the alias ips. if not create one. @@ -2895,12 +2895,16 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V @Override - public boolean applyDhcpEntry(Network network, final NicProfile nic, VirtualMachineProfile profile, + public boolean applyDhcpEntry(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) throws ResourceUnavailableException { - _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); + if(s_logger.isTraceEnabled()) { + s_logger.trace("applyDhcpEntry(" + network.getCidr() + ", " + nic.getMacAddress() + ", " + profile.getUuid() + ", " + dest.getHost() + ", " + routers + ")"); + } + final UserVmVO vm = _userVmDao.findById(profile.getId()); + _userVmDao.loadDetails(vm); - final VirtualMachineProfile updatedProfile = profile; + final VirtualMachineProfile updatedProfile = profile; final boolean isZoneBasic = (dest.getDataCenter().getNetworkType() == NetworkType.Basic); final Long podId = isZoneBasic ? dest.getPod().getId() : null; @@ -2918,7 +2922,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V Commands cmds = new Commands(OnError.Stop); if (!(isZoneBasic && router.getPodIdToDeployIn().longValue() != podId.longValue() && _dnsBasicZoneUpdates.equalsIgnoreCase("pod"))) { NicVO nicVo = _nicDao.findById(nic.getId()); - createDhcpEntryCommand(router, updatedProfile.getVirtualMachine(), nicVo, cmds); + createDhcpEntryCommand(router, vm, nicVo, cmds); return sendCommandsToRouter(router, cmds); } return true; @@ -2970,11 +2974,12 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } @Override - public boolean applyUserData(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) + public boolean applyUserData(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) throws ResourceUnavailableException { - _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); + final UserVmVO vm = _userVmDao.findById(profile.getId()); + _userVmDao.loadDetails(vm); - final VirtualMachineProfile updatedProfile = profile; + final VirtualMachineProfile updatedProfile = profile; final boolean isZoneBasic = (dest.getDataCenter().getNetworkType() == NetworkType.Basic); final Long podId = isZoneBasic ? dest.getPod().getId() : null; @@ -2993,7 +2998,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V if (!(isZoneBasic && router.getPodIdToDeployIn().longValue() != podId.longValue())) { NicVO nicVo = _nicDao.findById(nic.getId()); createPasswordCommand(router, updatedProfile, nicVo, cmds); - createVmDataCommand(router, updatedProfile.getVirtualMachine(), nicVo, updatedProfile.getVirtualMachine().getDetail("SSH.PublicKey"), cmds); + createVmDataCommand(router, vm, nicVo, vm.getDetail("SSH.PublicKey"), cmds); return sendCommandsToRouter(router, cmds); } return true; @@ -3352,7 +3357,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V cmds.addCommand("startVpn", startVpnCmd); } - private void createPasswordCommand(VirtualRouter router, VirtualMachineProfile profile, NicVO nic, Commands cmds) { + private void createPasswordCommand(VirtualRouter router, VirtualMachineProfile profile, NicVO nic, Commands cmds) { String password = (String) profile.getParameter(VirtualMachineProfile.Param.VmPassword); DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId()); @@ -3960,11 +3965,10 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V @Override - public void prepareStop(VirtualMachineProfile profile){ + public void prepareStop(VirtualMachineProfile profile){ //Collect network usage before stopping Vm - VMInstanceVO vm = profile.getVirtualMachine(); - DomainRouterVO router = _routerDao.findById(vm.getId()); + DomainRouterVO router = _routerDao.findById(profile.getVirtualMachine().getId()); if(router == null){ return; } diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java index 5dbecb77577..6fafa3e40fc 100644 --- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java @@ -27,7 +27,6 @@ import java.util.TreeSet; import javax.ejb.Local; import javax.inject.Inject; -import com.cloud.configuration.ZoneConfig; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -38,14 +37,12 @@ import com.cloud.agent.api.PlugNicCommand; import com.cloud.agent.api.SetupGuestNetworkAnswer; import com.cloud.agent.api.SetupGuestNetworkCommand; import com.cloud.agent.api.StopAnswer; -import com.cloud.agent.api.routing.DnsMasqConfigCommand; import com.cloud.agent.api.routing.IpAssocVpcCommand; import com.cloud.agent.api.routing.NetworkElementCommand; import com.cloud.agent.api.routing.SetNetworkACLCommand; import com.cloud.agent.api.routing.SetSourceNatCommand; import com.cloud.agent.api.routing.SetStaticRouteCommand; import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand; -import com.cloud.agent.api.to.DhcpTO; import com.cloud.agent.api.to.IpAddressTO; import com.cloud.agent.api.to.NetworkACLTO; import com.cloud.agent.api.to.NicTO; @@ -599,10 +596,11 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + DomainRouterVO vr = _routerDao.findById(profile.getId()); - if (profile.getVirtualMachine().getVpcId() != null) { + if (vr.getVpcId() != null) { String defaultDns1 = null; String defaultDns2 = null; //remove public and guest nics as we will plug them later @@ -623,7 +621,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian //add vpc cidr/dns/networkdomain to the boot load args StringBuilder buf = profile.getBootArgsBuilder(); - Vpc vpc = _vpcMgr.getVpc(profile.getVirtualMachine().getVpcId()); + Vpc vpc = _vpcMgr.getVpc(vr.getVpcId()); buf.append(" vpccidr=" + vpc.getCidr() + " domain=" + vpc.getNetworkDomain()); buf.append(" dns1=").append(defaultDns1); @@ -695,8 +693,8 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { - DomainRouterVO router = profile.getVirtualMachine(); + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + DomainRouterVO router = _routerDao.findById(profile.getId()); boolean isVpc = (router.getVpcId() != null); if (!isVpc) { @@ -1319,10 +1317,10 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { super.finalizeStop(profile, answer); //Mark VPN connections as Disconnected - DomainRouterVO router = profile.getVirtualMachine(); + DomainRouterVO router = _routerDao.findById(profile.getId()); Long vpcId = router.getVpcId(); if (vpcId != null) { _s2sVpnMgr.markDisconnectVpnConnByVpc(vpcId); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 8d979c7d1c2..23e2ca1f036 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -1060,7 +1060,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe } // Check if the vm is using any disks on local storage. - VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vm); List volumes = _volumeDao.findCreatedByInstance(vmProfile.getId()); boolean usesLocal = false; for (VolumeVO volume : volumes) { @@ -1156,7 +1156,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe suitableHosts, requiresStorageMotion); } - private Map> findSuitablePoolsForVolumes(VirtualMachineProfile vmProfile, + private Map> findSuitablePoolsForVolumes(VirtualMachineProfile vmProfile, Host host) { List volumes = _volumeDao.findCreatedByInstance(vmProfile.getId()); Map> suitableVolumeStoragePools = new HashMap>(); @@ -1284,7 +1284,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe // Volume stays in the same cluster after migration. DataCenterDeployment plan = new DataCenterDeployment(volume.getDataCenterId(), srcVolumePool.getPodId(), srcVolumePool.getClusterId(), null, null, null); - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId()); DiskProfile diskProfile = new DiskProfile(volume, diskOffering, profile.getHypervisorType()); diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 8a5085ef1f3..cd966cdd565 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -403,7 +403,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C public StoragePool findStoragePool(DiskProfile dskCh, final DataCenterVO dc, Pod pod, Long clusterId, Long hostId, VMInstanceVO vm, final Set avoid) { - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); for (StoragePoolAllocator allocator : _storagePoolAllocators) { ExcludeList avoidList = new ExcludeList(); diff --git a/server/src/com/cloud/storage/VolumeManager.java b/server/src/com/cloud/storage/VolumeManager.java index 2e44a3c35b3..d9bbd541713 100644 --- a/server/src/com/cloud/storage/VolumeManager.java +++ b/server/src/com/cloud/storage/VolumeManager.java @@ -41,7 +41,6 @@ import com.cloud.storage.Volume.Type; import com.cloud.user.Account; import com.cloud.vm.DiskProfile; import com.cloud.vm.VMInstanceVO; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; public interface VolumeManager extends VolumeApiService { @@ -85,7 +84,7 @@ public interface VolumeManager extends VolumeApiService { @Override Volume detachVolumeFromVM(DetachVolumeCmd cmmd); - void release(VirtualMachineProfile profile); + void release(VirtualMachineProfile profile); void cleanupVolumes(long vmId) throws ConcurrentOperationException; @@ -95,15 +94,11 @@ public interface VolumeManager extends VolumeApiService { void migrateVolumes(T vm, VirtualMachineTO vmTo, Host srcHost, Host destHost, Map volumeToPool); - boolean storageMigration( - VirtualMachineProfile vm, - StoragePool destPool); + boolean storageMigration(VirtualMachineProfile vm, StoragePool destPool); - void prepareForMigration( - VirtualMachineProfile vm, - DeployDestination dest); + void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest); - void prepare(VirtualMachineProfile vm, + void prepare(VirtualMachineProfile vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException; diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java index 7b44c5c29d8..fa7a33a51b9 100644 --- a/server/src/com/cloud/storage/VolumeManagerImpl.java +++ b/server/src/com/cloud/storage/VolumeManagerImpl.java @@ -2031,7 +2031,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { @DB protected VolumeVO switchVolume(VolumeVO existingVolume, - VirtualMachineProfile vm) + VirtualMachineProfile vm) throws StorageUnavailableException { Transaction txn = Transaction.currentTxn(); @@ -2070,7 +2070,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { @Override - public void release(VirtualMachineProfile profile) { + public void release(VirtualMachineProfile profile) { // add code here } @@ -2269,7 +2269,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { @Override public boolean storageMigration( - VirtualMachineProfile vm, + VirtualMachineProfile vm, StoragePool destPool) { List vols = _volsDao.findUsableVolumesForInstance(vm.getId()); List volumesNeedToMigrate = new ArrayList(); @@ -2307,7 +2307,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { @Override public void prepareForMigration( - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest) { List vols = _volsDao.findUsableVolumesForInstance(vm.getId()); if (s_logger.isDebugEnabled()) { @@ -2439,7 +2439,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { return tasks; } - private Pair recreateVolume(VolumeVO vol, VirtualMachineProfile vm, + private Pair recreateVolume(VolumeVO vol, VirtualMachineProfile vm, DeployDestination dest) throws StorageUnavailableException { VolumeVO newVol; boolean recreate = _recreateSystemVmEnabled; @@ -2506,7 +2506,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { } @Override - public void prepare(VirtualMachineProfile vm, + public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException { diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java index f7a72190097..037eb258323 100755 --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java @@ -107,7 +107,6 @@ import com.cloud.storage.template.TemplateConstants; import com.cloud.template.TemplateManager; import com.cloud.user.Account; import com.cloud.user.AccountService; -import com.cloud.user.User; import com.cloud.utils.DateUtil; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; @@ -257,8 +256,6 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar public SecondaryStorageVmVO startSecStorageVm(long secStorageVmId) { try { SecondaryStorageVmVO secStorageVm = _secStorageVmDao.findById(secStorageVmId); - Account systemAcct = _accountMgr.getSystemAccount(); - User systemUser = _accountMgr.getSystemUser(); _itMgr.advanceStart(secStorageVm.getUuid(), null); return _secStorageVmDao.findById(secStorageVm.getId()); } catch (StorageUnavailableException e) { @@ -1011,9 +1008,9 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { - SecondaryStorageVmVO vm = profile.getVirtualMachine(); + SecondaryStorageVmVO vm = _secStorageVmDao.findById(profile.getId()); Map details = _vmDetailsDao.findDetails(vm.getId()); vm.setDetails(details); @@ -1044,7 +1041,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } buf.append(" instance=SecStorage"); buf.append(" sslcopy=").append(Boolean.toString(_useSSlCopy)); - buf.append(" role=").append(profile.getVirtualMachine().getRole().toString()); + buf.append(" role=").append(vm.getRole().toString()); buf.append(" mtu=").append(_secStorageVmMtuSize); boolean externalDhcp = false; @@ -1110,11 +1107,11 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { finalizeCommandsOnStart(cmds, profile); - SecondaryStorageVmVO secVm = profile.getVirtualMachine(); + SecondaryStorageVmVO secVm = _secStorageVmDao.findById(profile.getId()); DataCenter dc = dest.getDataCenter(); List nics = profile.getNics(); for (NicProfile nic : nics) { @@ -1133,7 +1130,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { + public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile) { NicProfile managementNic = null; NicProfile controlNic = null; @@ -1160,7 +1157,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh"); if (!answer.getResult()) { s_logger.warn("Unable to ssh to the VM: " + answer.getDetails()); @@ -1172,7 +1169,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar _rulesMgr.getSystemIpAndEnableStaticNatForVm(profile.getVirtualMachine(), false); IPAddressVO ipaddr = _ipAddressDao.findByAssociatedVmId(profile.getVirtualMachine().getId()); if (ipaddr != null && ipaddr.getSystem()) { - SecondaryStorageVmVO secVm = profile.getVirtualMachine(); + SecondaryStorageVmVO secVm = _secStorageVmDao.findById(profile.getId()); // override SSVM guest IP with EIP, so that download url's with be prepared with EIP secVm.setPublicIpAddress(ipaddr.getAddress().addr()); _secStorageVmDao.update(secVm.getId(), secVm); @@ -1186,7 +1183,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { //release elastic IP here IPAddressVO ip = _ipAddressDao.findByAssociatedVmId(profile.getId()); if (ip != null && ip.getSystem()) { @@ -1381,7 +1378,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar } @Override - public void prepareStop(VirtualMachineProfile profile) { + public void prepareStop(VirtualMachineProfile profile) { } } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index f353bb74d74..14938717672 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -539,7 +539,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use Network defaultNetwork = _networkDao.findById(defaultNic.getNetworkId()); NicProfile defaultNicProfile = new NicProfile(defaultNic, defaultNetwork, null, null, null, _networkModel.isSecurityGroupSupportedInNetwork(defaultNetwork), _networkModel.getNetworkTag(template.getHypervisorType(), defaultNetwork)); - VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); + VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); vmProfile.setParameter(VirtualMachineProfile.Param.VmPassword, password); UserDataServiceProvider element = _networkMgr.getPasswordResetProvider(defaultNetwork); @@ -656,7 +656,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use _networkModel.isSecurityGroupSupportedInNetwork(defaultNetwork), _networkModel.getNetworkTag(template.getHypervisorType(), defaultNetwork)); - VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); + VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); if (template != null && template.getEnablePassword()) { vmProfile.setParameter(VirtualMachineProfile.Param.VmPassword, password); @@ -1831,7 +1831,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(template.getHypervisorType(), network)); - VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl((VMInstanceVO)vm); + VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vm); UserDataServiceProvider element = _networkModel.getUserDataUpdateProvider(network); if (element == null) { @@ -2888,10 +2888,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } @Override - public boolean finalizeVirtualMachineProfile( - VirtualMachineProfile profile, DeployDestination dest, - ReservationContext context) { - UserVmVO vm = profile.getVirtualMachine(); + public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { + UserVmVO vm = _vmDao.findById(profile.getId()); Map details = _vmDetailsDao.findDetails(vm.getId()); vm.setDetails(details); @@ -2959,9 +2957,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use @Override public boolean finalizeDeployment(Commands cmds, - VirtualMachineProfile profile, DeployDestination dest, + VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) { - UserVmVO userVm = profile.getVirtualMachine(); + UserVmVO userVm = _vmDao.findById(profile.getId()); List nics = _nicDao.listByVmId(userVm.getId()); for (NicVO nic : nics) { NetworkVO network = _networkDao.findById(nic.getNetworkId()); @@ -2987,14 +2985,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use @Override public boolean finalizeCommandsOnStart(Commands cmds, - VirtualMachineProfile profile) { + VirtualMachineProfile profile) { return true; } @Override - public boolean finalizeStart(VirtualMachineProfile profile, + public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context) { - UserVmVO vm = profile.getVirtualMachine(); + UserVmVO vm = _vmDao.findById(profile.getId()); Answer[] answersToCmds = cmds.getAnswers(); if (answersToCmds == null) { @@ -3055,7 +3053,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } if (ipChanged) { DataCenterVO dc = _dcDao.findById(vm.getDataCenterId()); - UserVmVO userVm = profile.getVirtualMachine(); + UserVmVO userVm = _vmDao.findById(profile.getId()); // dc.getDhcpProvider().equalsIgnoreCase(Provider.ExternalDhcpServer.getName()) if (_ntwkSrvcDao.canProviderSupportServiceInNetwork( guestNetwork.getId(), Service.Dhcp, @@ -3135,8 +3133,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } @Override - public void finalizeStop(VirtualMachineProfile profile, - StopAnswer answer) { + public void finalizeStop(VirtualMachineProfile profile, StopAnswer answer) { + VirtualMachine vm = profile.getVirtualMachine(); // release elastic IP here IPAddressVO ip = _ipAddressDao.findByAssociatedVmId(profile.getId()); if (ip != null && ip.getSystem()) { @@ -3156,7 +3154,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } } - VMInstanceVO vm = profile.getVirtualMachine(); List nics = _nicDao.listByVmId(vm.getId()); for (NicVO nic : nics) { NetworkVO network = _networkDao.findById(nic.getNetworkId()); @@ -4210,7 +4207,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use txn.commit(); VMInstanceVO vmoi = _itMgr.findByIdAndType(vm.getType(), vm.getId()); - VirtualMachineProfileImpl vmOldProfile = new VirtualMachineProfileImpl( + VirtualMachineProfileImpl vmOldProfile = new VirtualMachineProfileImpl( vmoi); // OS 3: update the network @@ -4288,7 +4285,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use profile)); VMInstanceVO vmi = _itMgr.findByIdAndType(vm.getType(), vm.getId()); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl( + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl( vmi); _networkMgr.allocate(vmProfile, networks); @@ -4423,7 +4420,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } VMInstanceVO vmi = _itMgr.findByIdAndType(vm.getType(), vm.getId()); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl( + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl( vmi); _networkMgr.allocate(vmProfile, networks); s_logger.debug("AssignVM: Advance virtual, adding networks no " @@ -4604,7 +4601,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use } @Override - public void prepareStop(VirtualMachineProfile profile) { + public void prepareStop(VirtualMachineProfile profile) { UserVmVO vm = _vmDao.findById(profile.getId()); if (vm.getState() == State.Running) collectVmDiskStatistics(vm); diff --git a/server/src/com/cloud/vm/VirtualMachineGuru.java b/server/src/com/cloud/vm/VirtualMachineGuru.java index df34e0eafa7..3318b461451 100644 --- a/server/src/com/cloud/vm/VirtualMachineGuru.java +++ b/server/src/com/cloud/vm/VirtualMachineGuru.java @@ -5,7 +5,7 @@ // 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, @@ -28,7 +28,7 @@ import com.cloud.exception.ResourceUnavailableException; public interface VirtualMachineGuru { T findById(long id); - boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context); + boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context); /** * finalize the virtual machine deployment. @@ -37,7 +37,7 @@ public interface VirtualMachineGuru { * @param dest destination to send the command. * @return true if everything checks out. false if not and we should try again. */ - boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException; + boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException; /** * Check the deployment results. @@ -46,11 +46,11 @@ public interface VirtualMachineGuru { * @param dest destination it was sent to. * @return true if deployment was fine; false if it didn't go well. */ - boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context); + boolean finalizeStart(VirtualMachineProfile profile, long hostId, Commands cmds, ReservationContext context); - boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile); + boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile profile); - void finalizeStop(VirtualMachineProfile profile, StopAnswer answer); + void finalizeStop(VirtualMachineProfile profile, StopAnswer answer); void finalizeExpunge(T vm); @@ -59,5 +59,5 @@ public interface VirtualMachineGuru { * @param profile * @return */ - void prepareStop(VirtualMachineProfile profile); + void prepareStop(VirtualMachineProfile profile); } diff --git a/server/src/com/cloud/vm/VirtualMachineManager.java b/server/src/com/cloud/vm/VirtualMachineManager.java index 49953b97331..0086bdb6dbc 100644 --- a/server/src/com/cloud/vm/VirtualMachineManager.java +++ b/server/src/com/cloud/vm/VirtualMachineManager.java @@ -179,7 +179,7 @@ public interface VirtualMachineManager extends Manager { * @param hvGuru * @return */ - VirtualMachineTO toVmTO(VirtualMachineProfile profile); + VirtualMachineTO toVmTO(VirtualMachineProfile profile); VMInstanceVO reConfigureVm(VMInstanceVO vm, ServiceOffering newServiceOffering, boolean sameHost) diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index 363bb454e61..88faea00782 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -470,7 +470,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac removeDhcpServiceInsubnet(vm); } - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType()); @@ -737,7 +737,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } - protected boolean areAffinityGroupsAssociated(VirtualMachineProfile vmProfile) { + protected boolean areAffinityGroupsAssociated(VirtualMachineProfile vmProfile) { VirtualMachine vm = vmProfile.getVirtualMachine(); long vmGroupCount = _affinityGroupVMMapDao.countAffinityGroupsForVm(vm.getId()); @@ -1060,8 +1060,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } - protected boolean sendStop(VirtualMachineGuru guru, VirtualMachineProfile profile, boolean force) { - VMInstanceVO vm = profile.getVirtualMachine(); + protected boolean sendStop(VirtualMachineGuru guru, VirtualMachineProfile profile, boolean force) { + VirtualMachine vm = profile.getVirtualMachine(); StopCommand stop = new StopCommand(vm, _mgmtServer.getExecuteInSequence()); try { Answer answer = _agentMgr.send(vm.getHostId(), stop); @@ -1195,7 +1195,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } VirtualMachineGuru vmGuru = getVmGuru(vm); - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); try { if (!stateTransitTo(vm, Event.StopRequested, vm.getHostId())) { @@ -1223,7 +1223,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } if (doCleanup) { - if (cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.StopRequested, forced, user, account)) { + if (cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.StopRequested, forced, user, account)) { try { if (s_logger.isDebugEnabled()) { s_logger.debug("Updating work item to Done, id:" + work.getId()); @@ -1440,7 +1440,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac throw new CloudRuntimeException("Unable to migrate vm: " + e.toString()); } - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); boolean migrationResult = false; try { migrationResult = volumeMgr.storageMigration(profile, destPool); @@ -1450,7 +1450,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac if (!vm.getPodIdToDeployIn().equals(destPool.getPodId())) { DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), destPool.getPodId(), null, null, null, null); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, null, null, null, null); + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, null, null, null, null); _networkMgr.reallocate(vmProfile, plan); } @@ -1526,12 +1526,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac alertType = AlertManager.ALERT_TYPE_CONSOLE_PROXY_MIGRATE; } - VirtualMachineProfile vmSrc = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile vmSrc = new VirtualMachineProfileImpl(vm); for(NicProfile nic: _networkMgr.getNicProfiles(vm)){ vmSrc.addNic(nic); } - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); _networkMgr.prepareNicForMigration(profile, dest); volumeMgr.prepareForMigration(profile, dest); @@ -1611,7 +1611,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } catch (AgentUnavailableException e) { s_logger.error("AgentUnavailableException while cleanup on source host: " + srcHostId); } - cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount()); + cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount()); return null; } } catch (OperationTimedoutException e) { @@ -1646,7 +1646,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } - private Map getPoolListForVolumesForMigration(VirtualMachineProfile profile, + private Map getPoolListForVolumesForMigration(VirtualMachineProfile profile, Host host, Map volumeToPool) { List allVolumes = _volsDao.findUsableVolumesForInstance(profile.getId()); for (VolumeVO volume : allVolumes) { @@ -1750,7 +1750,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac // Create a map of which volume should go in which storage pool. long vmId = vm.getId(); vm = vmGuru.findById(vmId); - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); volumeToPool = getPoolListForVolumesForMigration(profile, destHost, volumeToPool); // If none of the volumes have to be migrated, fail the call. Administrator needs to make a call for migrating @@ -1798,7 +1798,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } catch (AgentUnavailableException e) { s_logger.error("AgentUnavailableException while cleanup on source host: " + srcHostId); } - cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, + cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount()); return null; } @@ -1829,8 +1829,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } - @Override - public VirtualMachineTO toVmTO(VirtualMachineProfile profile) { + public VirtualMachineTO toVmTO(VirtualMachineProfile profile) { HypervisorGuru hvGuru = _hvGuruMgr.getGuru(profile.getVirtualMachine().getHypervisorType()); VirtualMachineTO to = hvGuru.implement(profile); return to; @@ -1884,7 +1883,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac return true; } - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); Long hostId = vm.getHostId(); if (hostId == null) { @@ -2563,7 +2562,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac vm = vmGuru.findById(vm.getId()); // this should ensure vm has the most // up to date info - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); List nics = _nicsDao.listByVmId(profile.getId()); for (NicVO nic : nics) { Network network = _networkModel.getNetwork(nic.getNetworkId()); @@ -2878,7 +2877,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac ReservationContext context = new ReservationContextImpl(null, null, _accountMgr.getActiveUser(User.UID_SYSTEM), _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, null, null, null); DataCenter dc = _configMgr.getZone(network.getDataCenterId()); @@ -2947,7 +2946,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac ReservationContext context = new ReservationContextImpl(null, null, _accountMgr.getActiveUser(User.UID_SYSTEM), _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, null, null, null); DataCenter dc = _configMgr.getZone(network.getDataCenterId()); @@ -3011,7 +3010,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac ReservationContext context = new ReservationContextImpl(null, null, _accountMgr.getActiveUser(User.UID_SYSTEM), _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)); - VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, + VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmVO, null, null, null, null); DataCenter dc = _configMgr.getZone(network.getDataCenterId()); @@ -3075,7 +3074,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac public VMInstanceVO findHostAndMigrate(VirtualMachine.Type vmType, VMInstanceVO vm, Long newSvcOfferingId, ExcludeList excludes) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, VirtualMachineMigrationException, ManagementServerException { - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); Long srcHostId = vm.getHostId(); Long oldSvcOfferingId = vm.getServiceOfferingId(); @@ -3179,7 +3178,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac alertType = AlertManager.ALERT_TYPE_CONSOLE_PROXY_MIGRATE; } - VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); _networkMgr.prepareNicForMigration(profile, dest); volumeMgr.prepareForMigration(profile, dest); @@ -3259,7 +3258,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } catch (AgentUnavailableException e) { s_logger.error("AgentUnavailableException while cleanup on source host: " + srcHostId); } - cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount()); + cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount()); return null; } } catch (OperationTimedoutException e) { diff --git a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java index 033daf33422..5e84c1f235d 100644 --- a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java @@ -21,9 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import com.cloud.agent.api.to.DiskTO; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.offering.ServiceOffering; import com.cloud.service.ServiceOfferingVO; @@ -39,9 +37,9 @@ import com.cloud.user.dao.AccountDao; * Implementation of VirtualMachineProfile. * */ -public class VirtualMachineProfileImpl implements VirtualMachineProfile { +public class VirtualMachineProfileImpl implements VirtualMachineProfile { - T _vm; + VirtualMachine _vm; ServiceOfferingVO _offering; VMTemplateVO _template; UserVmDetailVO _userVmDetails; @@ -56,7 +54,7 @@ public class VirtualMachineProfileImpl implements Virtua VirtualMachine.Type _type; - public VirtualMachineProfileImpl(T vm, VMTemplateVO template, ServiceOfferingVO offering, Account owner, Map params) { + public VirtualMachineProfileImpl(VirtualMachine vm, VMTemplateVO template, ServiceOfferingVO offering, Account owner, Map params) { _vm = vm; _template = template; _offering = offering; @@ -69,7 +67,7 @@ public class VirtualMachineProfileImpl implements Virtua _type = vm.getType(); } - public VirtualMachineProfileImpl(T vm) { + public VirtualMachineProfileImpl(VirtualMachine vm) { this(vm, null, null, null, null); } @@ -83,7 +81,7 @@ public class VirtualMachineProfileImpl implements Virtua } @Override - public T getVirtualMachine() { + public VirtualMachine getVirtualMachine() { return _vm; } @@ -102,7 +100,7 @@ public class VirtualMachineProfileImpl implements Virtua @Override public void setBootLoaderType(BootloaderType bootLoader) { - this._bootloader = bootLoader; + _bootloader = bootLoader; } @Override @@ -232,7 +230,7 @@ public class VirtualMachineProfileImpl implements Virtua @Override public BootloaderType getBootLoaderType() { - return this._bootloader; + return _bootloader; } @Override @@ -256,11 +254,11 @@ public class VirtualMachineProfileImpl implements Virtua @Override public Float getCpuOvercommitRatio() { - return this.cpuOvercommitRatio; + return cpuOvercommitRatio; } @Override public Float getMemoryOvercommitRatio() { - return this.memoryOvercommitRatio; + return memoryOvercommitRatio; } } diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java deleted file mode 100755 index 4577d0ae781..00000000000 --- a/server/test/com/cloud/network/MockNetworkManagerImpl.java +++ /dev/null @@ -1,962 +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.network; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ejb.Local; -import javax.naming.ConfigurationException; - -import org.apache.cloudstack.acl.ControlledEntity.ACLType; -import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; -import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd; -import org.apache.cloudstack.api.command.user.network.ListNetworksCmd; -import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd; -import org.apache.cloudstack.api.command.user.vm.ListNicsCmd; -import org.springframework.stereotype.Component; - -import com.cloud.dc.DataCenter; -import com.cloud.dc.Pod; -import com.cloud.dc.Vlan.VlanType; -import com.cloud.deploy.DataCenterDeployment; -import com.cloud.deploy.DeployDestination; -import com.cloud.deploy.DeploymentPlan; -import com.cloud.exception.ConcurrentOperationException; -import com.cloud.exception.InsufficientAddressCapacityException; -import com.cloud.exception.InsufficientCapacityException; -import com.cloud.exception.InsufficientVirtualNetworkCapcityException; -import com.cloud.exception.ResourceAllocationException; -import com.cloud.exception.ResourceUnavailableException; -import com.cloud.network.Network.Provider; -import com.cloud.network.Network.Service; -import com.cloud.network.Networks.TrafficType; -import com.cloud.network.addr.PublicIp; -import com.cloud.network.dao.IPAddressVO; -import com.cloud.network.dao.NetworkVO; -import com.cloud.network.GuestVlan; -import com.cloud.network.element.DhcpServiceProvider; -import com.cloud.network.element.LoadBalancingServiceProvider; -import com.cloud.network.element.StaticNatServiceProvider; -import com.cloud.network.element.UserDataServiceProvider; -import com.cloud.network.guru.NetworkGuru; -import com.cloud.network.rules.FirewallRule; -import com.cloud.network.rules.FirewallRule.Purpose; -import com.cloud.network.rules.FirewallRule.State; -import com.cloud.network.rules.LoadBalancerContainer.Scheme; -import com.cloud.network.rules.StaticNat; -import com.cloud.offering.NetworkOffering; -import com.cloud.offerings.NetworkOfferingVO; -import com.cloud.user.Account; -import com.cloud.user.User; -import com.cloud.utils.Pair; -import com.cloud.utils.component.ManagerBase; -import com.cloud.vm.*; -import com.cloud.vm.VirtualMachine.Type; -import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd; -import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd; -import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; -import org.apache.cloudstack.api.command.user.network.*; -import org.apache.cloudstack.api.command.user.vm.ListNicsCmd; -import org.springframework.stereotype.Component; - -import javax.ejb.Local; -import javax.naming.ConfigurationException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -@Component -@Local(value = { NetworkManager.class, NetworkService.class }) -public class MockNetworkManagerImpl extends ManagerBase implements NetworkManager, NetworkService { - - @Override - public List getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner) { - // TODO Auto-generated method stub - return null; - } - - @Override - public IPAddressVO associateIPToGuestNetwork(long ipId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException, ResourceUnavailableException { - // TODO Auto-generated method stub - return null; - } - - @Override - public IPAddressVO associatePortableIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException { - return null;// TODO Auto-generated method stub - } - - @Override - public IPAddressVO disassociatePortableIPToGuestNetwork(long ipAddrId, long networkId) throws ResourceAllocationException, ResourceUnavailableException, InsufficientAddressCapacityException, ConcurrentOperationException { - return null; // TODO Auto-generated method stub - } - - @Override - public boolean isPortableIpTransferableFromNetwork(long ipAddrId, long networkId) { - return false; - } - - @Override - public void transferPortableIP(long ipAddrId, long currentNetworkId, long newNetworkId) throws ResourceAllocationException, ResourceUnavailableException, - InsufficientAddressCapacityException, ConcurrentOperationException { - - } - - @Override - public boolean releaseIpAddress(long ipAddressId) { - // TODO Auto-generated method stub - return false; - } - - @Override - public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public List searchForNetworks(ListNetworksCmd cmd) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean deleteNetwork(long networkId) { - // TODO Auto-generated method stub - return false; - } - - @Override - public int getActiveNicsInNetwork(long networkId) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Network getNetwork(long networkId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Network getNetwork(String networkUuid) { - // TODO Auto-generated method stub - return null; - } - - @Override - public IpAddress getIp(long id) { - // TODO Auto-generated method stub - return null; - } - - @Override - public NetworkProfile convertNetworkToNetworkProfile(long networkId) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public boolean configure(String name, Map params) throws ConfigurationException { - return true; - } - - @Override - public boolean start() { - return true; - } - - @Override - public boolean stop() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - - @Override - public boolean disassociatePublicIpAddress(long id, long userId, Account caller) { - // TODO Auto-generated method stub - return false; - } - - - - @Override - public List setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault) - throws ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public List setupNetwork(Account owner, NetworkOffering offering, Network predefined, DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup, Long domainId, - ACLType aclType, Boolean subdomainAccess, Long vpcId, Boolean isDisplayNetworkEnabled) throws ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public void allocate(VirtualMachineProfile vm, List> networks) throws InsufficientCapacityException, ConcurrentOperationException { - // TODO Auto-generated method stub - - } - - @Override - public void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, - ResourceUnavailableException { - // TODO Auto-generated method stub - - } - - @Override - public void release(VirtualMachineProfile vmProfile, boolean forced) { - // TODO Auto-generated method stub - - } - - @Override - public void cleanupNics(VirtualMachineProfile vm) { - // TODO Auto-generated method stub - - } - - @Override - public void expungeNics(VirtualMachineProfile vm) { - // TODO Auto-generated method stub - - } - - - @Override - public List getNicProfiles(VirtualMachine vm) { - // TODO Auto-generated method stub - return null; - } - - - - - - @Override - public Pair implementNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, - InsufficientCapacityException { - // TODO Auto-generated method stub - return null; - } - - - @Override - public boolean destroyNetwork(long networkId, ReservationContext context) { - // TODO Auto-generated method stub - return false; - } - - @Override - public Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, String networkDomain, Account owner, Long domainId, - PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId, String gatewayv6, String cidrv6, Boolean displayNetworkEnabled, String isolatedPvlan) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId, Network networkToAssociateWith) throws InsufficientCapacityException, - ConcurrentOperationException, ResourceUnavailableException { - // TODO Auto-generated method stub - return false; - } - - - - - - @Override - public boolean applyIpAssociations(Network network, boolean continueOnError) throws ResourceUnavailableException { - // TODO Auto-generated method stub - return false; - } - - - - @Override - public boolean startNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { - // TODO Auto-generated method stub - return false; - } - - - @Override - public IPAddressVO markIpAsUnavailable(long addrId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String acquireGuestIpAddress(Network network, String requestedIp) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public boolean applyStaticNats(List staticNats, boolean continueOnError, boolean forRevoke) throws ResourceUnavailableException { - // TODO Auto-generated method stub - return false; - } - - - - public Map> getNetworkOfferingServiceProvidersMap(long networkOfferingId) { - return null; - } - - - - - - @Override - public PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed, List isolationMethods, String broadcastDomainRange, Long domainId, List tags, String name) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Pair, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword, Long startIndex, Long pageSize, String name) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state, String removeVlan) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean deletePhysicalNetwork(Long id) { - // TODO Auto-generated method stub - return false; - } - - @Override - public GuestVlan dedicateGuestVlanRange(DedicateGuestVlanRangeCmd cmd) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Pair, Integer> listDedicatedGuestVlanRanges(ListDedicatedGuestVlanRangesCmd cmd) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean releaseDedicatedGuestVlanRange(Long dedicatedGuestVlanRangeId) { - // TODO Auto-generated method stub - return true; - } - - @Override - public List listNetworkServices(String providerName) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName, Long destinationPhysicalNetworkId, List enabledServices) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Pair, Integer> listNetworkServiceProviders(Long physicalNetworkId, String name, String state, Long startIndex, Long pageSize) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean deleteNetworkServiceProvider(Long id) { - // TODO Auto-generated method stub - return false; - } - - @Override - public PhysicalNetwork getPhysicalNetwork(Long physicalNetworkId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetwork getCreatedPhysicalNetwork(Long physicalNetworkId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetworkServiceProvider getPhysicalNetworkServiceProvider(Long providerId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetworkServiceProvider getCreatedPhysicalNetworkServiceProvider(Long providerId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public PhysicalNetworkTrafficType getPhysicalNetworkTrafficType(Long id) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean deletePhysicalNetworkTrafficType(Long id) { - // TODO Auto-generated method stub - return false; - } - - @Override - public Pair, Integer> listTrafficTypes(Long physicalNetworkId) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public Network getExclusiveGuestNetwork(long zoneId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public UserDataServiceProvider getPasswordResetProvider(Network network) { - // TODO Auto-generated method stub - return null; - } - - @Override - public UserDataServiceProvider getSSHKeyResetProvider(Network network) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state, List enabledServices) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType, String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan) { - // TODO Auto-generated method stub - return null; - } - - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#applyRules(java.util.List, com.cloud.network.rules.FirewallRule.Purpose, com.cloud.network.NetworkRuleApplier, boolean) - */ - @Override - public boolean applyRules(List rules, Purpose purpose, NetworkRuleApplier applier, - boolean continueOnError) throws ResourceUnavailableException { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean, boolean, java.util.List) - */ - @Override - public boolean applyIpAssociations(Network network, boolean rulesRevoked, boolean continueOnError, - List publicIps) throws ResourceUnavailableException { - // TODO Auto-generated method stub - return false; - } - - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#restartNetwork(java.lang.Long, com.cloud.user.Account, com.cloud.user.User, boolean) - */ - @Override - public boolean restartNetwork(Long networkId, Account callerAccount, User callerUser, boolean cleanup) - throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#shutdownNetworkElementsAndResources(com.cloud.vm.ReservationContext, boolean, com.cloud.network.NetworkVO) - */ - @Override - public boolean shutdownNetworkElementsAndResources(ReservationContext context, boolean b, NetworkVO network) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#implementNetworkElementsAndResources(com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, com.cloud.network.NetworkVO, com.cloud.offerings.NetworkOfferingVO) - */ - @Override - public void implementNetworkElementsAndResources(DeployDestination dest, ReservationContext context, - NetworkVO network, NetworkOfferingVO findById) throws ConcurrentOperationException, - InsufficientAddressCapacityException, ResourceUnavailableException, InsufficientCapacityException { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#allocateIp(com.cloud.user.Account, boolean, com.cloud.user.Account, com.cloud.dc.DataCenter) - */ - @Override - public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerId, DataCenter zone) - throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#finalizeServicesAndProvidersForNetwork(com.cloud.offering.NetworkOffering, java.lang.Long) - */ - @Override - public Map finalizeServicesAndProvidersForNetwork(NetworkOffering offering, Long physicalNetworkId) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#getNicProfileForVm(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.VirtualMachine) - */ - protected NicProfile getNicProfileForVm(Network network, NicProfile requested, VirtualMachine vm) { - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#getOnePhysicalNetworkByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType) - */ - protected PhysicalNetwork getOnePhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType) { - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#getZoneNetworkDomain(long) - */ - protected String getZoneNetworkDomain(long zoneId) { - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#getNicInNetworkIncludingRemoved(long, long) - */ - protected Nic getNicInNetworkIncludingRemoved(long vmId, long networkId) { - return null; - } - - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#restartNetwork(com.cloud.api.commands.RestartNetworkCmd, boolean) - */ - @Override - public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup) throws ConcurrentOperationException, - ResourceUnavailableException, InsufficientCapacityException { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#updateGuestNetwork(long, java.lang.String, java.lang.String, com.cloud.user.Account, com.cloud.user.User, java.lang.String, java.lang.Long, java.lang.Boolean) - */ - @Override - public Network updateGuestNetwork(long networkId, String name, String displayText, Account callerAccount, - User callerUser, String domainSuffix, Long networkOfferingId, Boolean changeCidr, String guestVmCidr, Boolean displayNetwork) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#listTrafficTypeImplementor(com.cloud.api.commands.ListTrafficTypeImplementorsCmd) - */ - @Override - public List> listTrafficTypeImplementor(ListTrafficTypeImplementorsCmd cmd) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#getIsolatedNetworksWithSourceNATOwnedByAccountInZone(long, com.cloud.user.Account) - */ - @Override - public List getIsolatedNetworksWithSourceNATOwnedByAccountInZone(long zoneId, Account owner) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#associateIPToNetwork(long, long) - */ - @Override - public IpAddress associateIPToNetwork(long ipId, long networkId) throws InsufficientAddressCapacityException, - ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - @Override - - public Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan, - String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId, Boolean sourceNat) - throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#assignPublicIpAddress(long, java.lang.Long, com.cloud.user.Account, com.cloud.dc.Vlan.VlanType, java.lang.Long, java.lang.String, boolean) - */ - @Override - public PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, - String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#shutdownNetwork(long, com.cloud.vm.ReservationContext, boolean) - */ - @Override - public boolean shutdownNetwork(long networkId, ReservationContext context, boolean cleanupElements) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#reallocate(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DataCenterDeployment) - */ - @Override - public boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) - throws InsufficientCapacityException, ConcurrentOperationException { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#assignSystemIp(long, com.cloud.user.Account, boolean, boolean) - */ - @Override - public IpAddress assignSystemIp(long networkId, Account owner, boolean forElasticLb, boolean forElasticIp) - throws InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#handleSystemIpRelease(com.cloud.network.IpAddress) - */ - @Override - public boolean handleSystemIpRelease(IpAddress ip) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#allocateDirectIp(com.cloud.vm.NicProfile, com.cloud.dc.DataCenter, com.cloud.vm.VirtualMachineProfile, com.cloud.network.Network, java.lang.String) - */ - @Override - public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, - Network network, String requestedIpv4, String requestedIpv6) throws InsufficientVirtualNetworkCapcityException, - InsufficientAddressCapacityException { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#assignSourceNatIpAddressToGuestNetwork(com.cloud.user.Account, com.cloud.network.Network) - */ - @Override - public PublicIp assignSourceNatIpAddressToGuestNetwork(Account owner, Network guestNetwork) - throws InsufficientAddressCapacityException, ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#allocateNic(com.cloud.vm.NicProfile, com.cloud.network.Network, java.lang.Boolean, int, com.cloud.vm.VirtualMachineProfile) - */ - @Override - public Pair allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, - int deviceId, VirtualMachineProfile vm) - throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, - ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#prepareNic(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, long, com.cloud.network.NetworkVO) - */ - @Override - public NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, - ReservationContext context, long nicId, NetworkVO network) - throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, - ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic) - */ - @Override - public void removeNic(VirtualMachineProfile vm, Nic nic) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#setupDns(com.cloud.network.Network, com.cloud.network.Network.Provider) - */ - @Override - public boolean setupDns(Network network, Provider provider) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#releaseNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic) - */ - @Override - public void releaseNic(VirtualMachineProfile vmProfile, Nic nic) - throws ConcurrentOperationException, ResourceUnavailableException { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#createNicForVm(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.ReservationContext, com.cloud.vm.VirtualMachineProfileImpl, boolean) - */ - @Override - public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, - VirtualMachineProfile vmProfile, boolean prepare) - throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, - ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { - // TODO Auto-generated method stub - return null; - } - - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#markPublicIpAsAllocated(com.cloud.network.IPAddressVO) - */ - @Override - public void markPublicIpAsAllocated(IPAddressVO addr) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#assignDedicateIpAddress(com.cloud.user.Account, java.lang.Long, java.lang.Long, long, boolean) - */ - @Override - public PublicIp assignDedicateIpAddress(Account owner, Long guestNtwkId, Long vpcId, long dcId, boolean isSourceNat) - throws ConcurrentOperationException, InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#getNetworkLockTimeout() - */ - @Override - public int getNetworkLockTimeout() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean isNetworkInlineMode(Network network) { - // TODO Auto-generated method stub - return false; - } - - @Override - public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getProvidersForServiceInNetwork(Network network, - Service service) { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getRuleCountForIp(Long addressId, Purpose purpose, State state) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, boolean, long) - */ - @Override - public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException, - InsufficientAddressCapacityException, ConcurrentOperationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public IpAddress allocatePortableIp(Account ipOwner, Account caller, long dcId, Long networkId, Long vpcID) - throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException { - return null;// TODO Auto-generated method stub - } - - @Override - public IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, Long networkId, Long vpcId) throws ResourceAllocationException, - InsufficientAddressCapacityException, ConcurrentOperationException { - return null; - } - - @Override - public boolean releasePortableIpAddress(long ipAddressId) { - return false;// TODO Auto-generated method stub - } - - @Override - public boolean isSecondaryIpSetForNic(long nicId) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean releaseSecondaryIpFromNic(long ipAddressId) { - // TODO Auto-generated method stub - return false; - } - - @Override - public NicSecondaryIp allocateSecondaryGuestIP(Account account, long zoneId, - Long nicId, Long networkId, String ipaddress) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String allocateGuestIP(Account ipOwner, boolean isSystem, - long zoneId, Long networkId, String requestedIp) - throws InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - - @Override - public List listVmNics(Long vmId, Long nicId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List listNics(ListNicsCmd listNicsCmd) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Map getNetworkOfferingServiceCapabilities(NetworkOffering offering, Service service) { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public String allocatePublicIpForGuestNic(Long networkId, DataCenter dc, - Pod pod, Account caller, String requestedIp) - throws InsufficientAddressCapacityException { - // TODO Auto-generated method stub - return null; - } - - - @Override - public NicVO savePlaceholderNic(Network network, String ip4Address, String ip6Address, Type vmType) { - // TODO Auto-generated method stub - return null; - } - - @Override - public DhcpServiceProvider getDhcpServiceProvider(Network network) { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public PublicIp assignPublicIpAddressFromVlans(long dcId, Long podId, Account owner, VlanType type, List vlanDbIds, Long networkId, String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void prepareNicForMigration( - VirtualMachineProfile vm, - DeployDestination dest) { - // TODO Auto-generated method stub - - } - - @Override - public void commitNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { - // TODO Auto-generated method stub - - } - - @Override - public void rollbackNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { - // TODO Auto-generated method stub - } -} diff --git a/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java b/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java index 1e6d005ca60..a49b0e0fcd7 100644 --- a/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java +++ b/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java @@ -270,7 +270,7 @@ public class VirtualMachineManagerImplTest { @Test (expected=CloudRuntimeException.class) public void testScaleVM3() throws Exception { - /*VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); + /*VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); Long srcHostId = vm.getHostId(); Long oldSvcOfferingId = vm.getServiceOfferingId(); diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index fd61bc65c90..c10ec328d9c 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -24,7 +24,9 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.vm.*; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; + import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd; import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd; @@ -33,8 +35,6 @@ import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd; import org.apache.cloudstack.api.command.user.network.ListNetworksCmd; import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd; import org.apache.cloudstack.api.command.user.vm.ListNicsCmd; -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; import com.cloud.dc.DataCenter; import com.cloud.dc.Pod; @@ -66,7 +66,11 @@ import com.cloud.network.addr.PublicIp; import com.cloud.network.dao.IPAddressVO; import com.cloud.network.dao.NetworkServiceMapDao; import com.cloud.network.dao.NetworkVO; -import com.cloud.network.element.*; +import com.cloud.network.element.DhcpServiceProvider; +import com.cloud.network.element.LoadBalancingServiceProvider; +import com.cloud.network.element.NetworkElement; +import com.cloud.network.element.StaticNatServiceProvider; +import com.cloud.network.element.UserDataServiceProvider; import com.cloud.network.guru.NetworkGuru; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.FirewallRule.Purpose; @@ -80,19 +84,15 @@ import com.cloud.user.Account; import com.cloud.user.User; import com.cloud.utils.Pair; import com.cloud.utils.component.ManagerBase; +import com.cloud.vm.Nic; +import com.cloud.vm.NicProfile; +import com.cloud.vm.NicSecondaryIp; +import com.cloud.vm.NicVO; +import com.cloud.vm.ReservationContext; +import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.Type; - import com.cloud.vm.VirtualMachineProfile; -import org.apache.cloudstack.acl.ControlledEntity.ACLType; -import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd; -import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd; -import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; -import org.apache.cloudstack.api.command.user.network.*; -import org.apache.cloudstack.api.command.user.vm.ListNicsCmd; -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - @Component @Local(value = { NetworkManager.class, NetworkService.class }) @@ -738,7 +738,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#allocate(com.cloud.vm.VirtualMachineProfile, java.util.List) */ @Override - public void allocate(VirtualMachineProfile vm, List> networks) + public void allocate(VirtualMachineProfile vm, List> networks) throws InsufficientCapacityException, ConcurrentOperationException { // TODO Auto-generated method stub @@ -752,7 +752,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#prepare(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext) */ @Override - public void prepare(VirtualMachineProfile profile, DeployDestination dest, + public void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { // TODO Auto-generated method stub @@ -767,7 +767,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#release(com.cloud.vm.VirtualMachineProfile, boolean) */ @Override - public void release(VirtualMachineProfile vmProfile, boolean forced) + public void release(VirtualMachineProfile vmProfile, boolean forced) throws ConcurrentOperationException, ResourceUnavailableException { // TODO Auto-generated method stub @@ -781,7 +781,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#cleanupNics(com.cloud.vm.VirtualMachineProfile) */ @Override - public void cleanupNics(VirtualMachineProfile vm) { + public void cleanupNics(VirtualMachineProfile vm) { // TODO Auto-generated method stub } @@ -794,7 +794,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#expungeNics(com.cloud.vm.VirtualMachineProfile) */ @Override - public void expungeNics(VirtualMachineProfile vm) { + public void expungeNics(VirtualMachineProfile vm) { // TODO Auto-generated method stub } @@ -1001,7 +1001,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#reallocate(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DataCenterDeployment) */ @Override - public boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) + public boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException { // TODO Auto-generated method stub return false; @@ -1042,7 +1042,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#allocateDirectIp(com.cloud.vm.NicProfile, com.cloud.dc.DataCenter, com.cloud.vm.VirtualMachineProfile, com.cloud.network.Network, java.lang.String) */ @Override - public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, + public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network, String requestedIpv4, String requestedIpv6) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { // TODO Auto-generated method stub @@ -1071,7 +1071,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage */ @Override public Pair allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, - int deviceId, VirtualMachineProfile vm) + int deviceId, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { // TODO Auto-generated method stub @@ -1086,7 +1086,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#prepareNic(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, long, com.cloud.network.NetworkVO) */ @Override - public NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, + public NicProfile prepareNic(VirtualMachineProfile vmProfile, DeployDestination dest, ReservationContext context, long nicId, NetworkVO network) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { @@ -1102,7 +1102,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic) */ @Override - public void removeNic(VirtualMachineProfile vm, Nic nic) { + public void removeNic(VirtualMachineProfile vm, Nic nic) { // TODO Auto-generated method stub } @@ -1147,7 +1147,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage * @see com.cloud.network.NetworkManager#releaseNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic) */ @Override - public void releaseNic(VirtualMachineProfile vmProfile, Nic nic) + public void releaseNic(VirtualMachineProfile vmProfile, Nic nic) throws ConcurrentOperationException, ResourceUnavailableException { // TODO Auto-generated method stub @@ -1158,7 +1158,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage */ @Override public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, - VirtualMachineProfile vmProfile, boolean prepare) + VirtualMachineProfile vmProfile, boolean prepare) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { // TODO Auto-generated method stub @@ -1419,7 +1419,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage @Override public void prepareNicForMigration( - VirtualMachineProfile vm, + VirtualMachineProfile vm, DeployDestination dest) { // TODO Auto-generated method stub @@ -1431,8 +1431,8 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage @Override public void commitNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { + VirtualMachineProfile src, + VirtualMachineProfile dst) { // TODO Auto-generated method stub } @@ -1443,8 +1443,8 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage @Override public void rollbackNicForMigration( - VirtualMachineProfile src, - VirtualMachineProfile dst) { + VirtualMachineProfile src, + VirtualMachineProfile dst) { // TODO Auto-generated method stub } diff --git a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java index f325c4af077..7f1048fa616 100644 --- a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java +++ b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java @@ -72,14 +72,14 @@ VpcVirtualNetworkApplianceService { * @see com.cloud.network.router.VirtualNetworkApplianceManager#savePasswordToRouter(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.VirtualMachineProfile, java.util.List) */ @Override - public boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, + public boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @Override - public boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers, String SSHPublicKey) throws ResourceUnavailableException { + public boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers, String SSHPublicKey) throws ResourceUnavailableException { return false; //To change body of implemented methods use File | Settings | File Templates. } @@ -87,7 +87,7 @@ VpcVirtualNetworkApplianceService { * @see com.cloud.network.router.VirtualNetworkApplianceManager#saveUserDataToRouter(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.VirtualMachineProfile, java.util.List) */ @Override - public boolean saveUserDataToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, + public boolean saveUserDataToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; @@ -196,7 +196,7 @@ VpcVirtualNetworkApplianceService { * @see com.cloud.network.router.VirtualNetworkApplianceManager#applyDhcpEntry(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, java.util.List) */ @Override - public boolean applyDhcpEntry(Network config, NicProfile nic, VirtualMachineProfile vm, + public boolean applyDhcpEntry(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, List routers) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; @@ -206,14 +206,14 @@ VpcVirtualNetworkApplianceService { * @see com.cloud.network.router.VirtualNetworkApplianceManager#applyUserData(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, java.util.List) */ @Override - public boolean applyUserData(Network config, NicProfile nic, VirtualMachineProfile vm, + public boolean applyUserData(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, List routers) throws ResourceUnavailableException { // TODO Auto-generated method stub return false; } @Override - public boolean configDhcpForSubnet(Network network, NicProfile nic, VirtualMachineProfile uservm, DeployDestination dest, List routers) throws ResourceUnavailableException { + public boolean configDhcpForSubnet(Network network, NicProfile nic, VirtualMachineProfile uservm, DeployDestination dest, List routers) throws ResourceUnavailableException { return false; //To change body of implemented methods use File | Settings | File Templates. }