Search in sources :

Example 1 with HTTPMethod

use of org.apache.cloudstack.api.BaseCmd.HTTPMethod in project cloudstack by apache.

the class UserVmManagerImpl method updateVirtualMachine.

@Override
public UserVm updateVirtualMachine(long id, String displayName, String group, Boolean ha, Boolean isDisplayVmEnabled, Long osTypeId, String userData, Boolean isDynamicallyScalable, HTTPMethod httpMethod, String customId, String hostName, String instanceName, List<Long> securityGroupIdList, Map<String, Map<Integer, String>> extraDhcpOptionsMap) throws ResourceUnavailableException, InsufficientCapacityException {
    UserVmVO vm = _vmDao.findById(id);
    if (vm == null) {
        throw new CloudRuntimeException("Unable to find virtual machine with id " + id);
    }
    if (instanceName != null) {
        VMInstanceVO vmInstance = _vmInstanceDao.findVMByInstanceName(instanceName);
        if (vmInstance != null && vmInstance.getId() != id) {
            throw new CloudRuntimeException("Instance name : " + instanceName + " is not unique");
        }
    }
    if (vm.getState() == State.Error || vm.getState() == State.Expunging) {
        s_logger.error("vm is not in the right state: " + id);
        throw new InvalidParameterValueException("Vm with id " + id + " is not in the right state");
    }
    if (displayName == null) {
        displayName = vm.getDisplayName();
    }
    if (ha == null) {
        ha = vm.isHaEnabled();
    }
    ServiceOffering offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
    if (!offering.isOfferHA() && ha) {
        throw new InvalidParameterValueException("Can't enable ha for the vm as it's created from the Service offering having HA disabled");
    }
    if (isDisplayVmEnabled == null) {
        isDisplayVmEnabled = vm.isDisplayVm();
    }
    boolean updateUserdata = false;
    if (userData != null) {
        // check and replace newlines
        userData = userData.replace("\\n", "");
        userData = validateUserData(userData, httpMethod);
        // update userData on domain router.
        updateUserdata = true;
    } else {
        userData = vm.getUserData();
    }
    if (osTypeId == null) {
        osTypeId = vm.getGuestOSId();
    }
    if (group != null) {
        addInstanceToGroup(id, group);
    }
    if (isDynamicallyScalable == null) {
        isDynamicallyScalable = vm.isDynamicallyScalable();
    } else {
        if (isDynamicallyScalable == true) {
            VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId());
            if (!template.isDynamicallyScalable()) {
                throw new InvalidParameterValueException("Dynamic Scaling cannot be enabled for the VM since its template does not have dynamic scaling enabled");
            }
            if (!offering.isDynamicScalingEnabled()) {
                throw new InvalidParameterValueException("Dynamic Scaling cannot be enabled for the VM since its service offering does not have dynamic scaling enabled");
            }
            if (!UserVmManager.EnableDynamicallyScaleVm.valueIn(vm.getDataCenterId())) {
                s_logger.debug(String.format("Dynamic Scaling cannot be enabled for the VM %s since the global setting enable.dynamic.scale.vm is set to false", vm.getUuid()));
                throw new InvalidParameterValueException("Dynamic Scaling cannot be enabled for the VM since corresponding global setting is set to false");
            }
        }
    }
    boolean isVMware = (vm.getHypervisorType() == HypervisorType.VMware);
    if (securityGroupIdList != null && isVMware) {
        throw new InvalidParameterValueException("Security group feature is not supported for vmWare hypervisor");
    } else {
        // Get default guest network in Basic zone
        Network defaultNetwork = null;
        try {
            DataCenterVO zone = _dcDao.findById(vm.getDataCenterId());
            if (zone.getNetworkType() == NetworkType.Basic) {
                // Get default guest network in Basic zone
                defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId());
            } else if (zone.isSecurityGroupEnabled()) {
                NicVO defaultNic = _nicDao.findDefaultNicForVM(vm.getId());
                if (defaultNic != null) {
                    defaultNetwork = _networkDao.findById(defaultNic.getNetworkId());
                }
            }
        } catch (InvalidParameterValueException e) {
            if (s_logger.isDebugEnabled()) {
                s_logger.debug(e.getMessage(), e);
            }
            defaultNetwork = _networkModel.getDefaultNetworkForVm(id);
        }
        if (securityGroupIdList != null && _networkModel.isSecurityGroupSupportedInNetwork(defaultNetwork) && _networkModel.canAddDefaultSecurityGroup()) {
            if (vm.getState() == State.Stopped) {
                // Remove instance from security groups
                _securityGroupMgr.removeInstanceFromGroups(id);
                // Add instance in provided groups
                _securityGroupMgr.addInstanceToGroups(id, securityGroupIdList);
            } else {
                throw new InvalidParameterValueException("Virtual machine must be stopped prior to update security groups ");
            }
        }
    }
    List<? extends Nic> nics = _nicDao.listByVmId(vm.getId());
    if (hostName != null) {
        // Check is hostName is RFC compliant
        checkNameForRFCCompliance(hostName);
        if (vm.getHostName().equalsIgnoreCase(hostName)) {
            s_logger.debug("Vm " + vm + " is already set with the hostName specified: " + hostName);
            hostName = null;
        }
        // Verify that vm's hostName is unique
        List<NetworkVO> vmNtwks = new ArrayList<NetworkVO>(nics.size());
        for (Nic nic : nics) {
            vmNtwks.add(_networkDao.findById(nic.getNetworkId()));
        }
        checkIfHostNameUniqueInNtwkDomain(hostName, vmNtwks);
    }
    List<NetworkVO> networks = nics.stream().map(nic -> _networkDao.findById(nic.getNetworkId())).collect(Collectors.toList());
    verifyExtraDhcpOptionsNetwork(extraDhcpOptionsMap, networks);
    for (Nic nic : nics) {
        _networkMgr.saveExtraDhcpOptions(networks.stream().filter(network -> network.getId() == nic.getNetworkId()).findFirst().get().getUuid(), nic.getId(), extraDhcpOptionsMap);
    }
    _vmDao.updateVM(id, displayName, ha, osTypeId, userData, isDisplayVmEnabled, isDynamicallyScalable, customId, hostName, instanceName);
    if (updateUserdata) {
        updateUserData(vm);
    }
    if (State.Running == vm.getState()) {
        updateDns(vm, hostName);
    }
    return _vmDao.findById(id);
}
Also used : DataCenterVO(com.cloud.dc.DataCenterVO) ServiceOfferingJoinVO(com.cloud.api.query.vo.ServiceOfferingJoinVO) SecurityGroupManager(com.cloud.network.security.SecurityGroupManager) AccountService(com.cloud.user.AccountService) DeleteVMGroupCmd(org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd) NetworkModel(com.cloud.network.NetworkModel) UsageEventUtils(com.cloud.event.UsageEventUtils) HostDao(com.cloud.host.dao.HostDao) ExecutionException(com.cloud.utils.exception.ExecutionException) ResourceState(com.cloud.resource.ResourceState) ResetVMPasswordCmd(org.apache.cloudstack.api.command.user.vm.ResetVMPasswordCmd) Autowired(org.springframework.beans.factory.annotation.Autowired) Pod(com.cloud.dc.Pod) TemplateDataStoreDao(org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao) StringUtils(org.apache.commons.lang3.StringUtils) Base64(org.apache.commons.codec.binary.Base64) AgentUnavailableException(com.cloud.exception.AgentUnavailableException) PvlanSetupCommand(com.cloud.agent.api.PvlanSetupCommand) SnapshotDao(com.cloud.storage.dao.SnapshotDao) DiskOffering(com.cloud.offering.DiskOffering) TransactionCallbackWithException(com.cloud.utils.db.TransactionCallbackWithException) Document(org.w3c.dom.Document) Map(java.util.Map) ResizeVolumeCmd(org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd) VlanDao(com.cloud.dc.dao.VlanDao) TrafficType(com.cloud.network.Networks.TrafficType) GuestOSCategoryVO(com.cloud.storage.GuestOSCategoryVO) NetworkOrchestrationService(org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService) Service(com.cloud.network.Network.Service) PhysicalNetworkDao(com.cloud.network.dao.PhysicalNetworkDao) VolumeOrchestrationService(org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService) VmDiskStatisticsDao(com.cloud.user.dao.VmDiskStatisticsDao) ModifyTargetsCommand(com.cloud.agent.api.ModifyTargetsCommand) Network(com.cloud.network.Network) TransactionStatus(com.cloud.utils.db.TransactionStatus) DeploymentPlanner(com.cloud.deploy.DeploymentPlanner) ApiDBUtils(com.cloud.api.ApiDBUtils) QueryService(org.apache.cloudstack.query.QueryService) NetworkOfferingVO(com.cloud.offerings.NetworkOfferingVO) AffinityGroupVO(org.apache.cloudstack.affinity.AffinityGroupVO) ResourceTagVO(com.cloud.tags.ResourceTagVO) Stream(java.util.stream.Stream) ServiceOfferingVO(com.cloud.service.ServiceOfferingVO) ServiceOffering(com.cloud.offering.ServiceOffering) InsufficientServerCapacityException(com.cloud.exception.InsufficientServerCapacityException) UpdateVMCmd(org.apache.cloudstack.api.command.user.vm.UpdateVMCmd) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) VMSnapshotVO(com.cloud.vm.snapshot.VMSnapshotVO) AsyncCallFuture(org.apache.cloudstack.framework.async.AsyncCallFuture) ManagerBase(com.cloud.utils.component.ManagerBase) UserDataServiceProvider(com.cloud.network.element.UserDataServiceProvider) AssignVMCmd(org.apache.cloudstack.api.command.admin.vm.AssignVMCmd) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) Availability(com.cloud.offering.NetworkOffering.Availability) VMTemplateDao(com.cloud.storage.dao.VMTemplateDao) DataCenterVO(com.cloud.dc.DataCenterVO) GetVolumeStatsAnswer(com.cloud.agent.api.GetVolumeStatsAnswer) LinkedHashMap(java.util.LinkedHashMap) SnapshotVO(com.cloud.storage.SnapshotVO) NetworkType(com.cloud.dc.DataCenter.NetworkType) ClusterDao(com.cloud.dc.dao.ClusterDao) UserDao(com.cloud.user.dao.UserDao) SearchCriteria(com.cloud.utils.db.SearchCriteria) VlanVO(com.cloud.dc.VlanVO) User(com.cloud.user.User) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) GetVolumeStatsCommand(com.cloud.agent.api.GetVolumeStatsCommand) AffinityGroupVMMapDao(org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao) ResourceTag(com.cloud.server.ResourceTag) GetVmNetworkStatsCommand(com.cloud.agent.api.GetVmNetworkStatsCommand) InstanceGroupDao(com.cloud.vm.dao.InstanceGroupDao) VirtualMachineMigrationException(com.cloud.exception.VirtualMachineMigrationException) CommandSetupHelper(com.cloud.network.router.CommandSetupHelper) VMTemplateStorageResourceAssoc(com.cloud.storage.VMTemplateStorageResourceAssoc) UserVm(com.cloud.uservm.UserVm) NicTO(com.cloud.agent.api.to.NicTO) Vlan(com.cloud.dc.Vlan) HighAvailabilityManager(com.cloud.ha.HighAvailabilityManager) UserVmDao(com.cloud.vm.dao.UserVmDao) DestroyVMCmd(org.apache.cloudstack.api.command.user.vm.DestroyVMCmd) NicDao(com.cloud.vm.dao.NicDao) IOException(java.io.IOException) PhysicalNetwork(com.cloud.network.PhysicalNetwork) DB(com.cloud.utils.db.DB) GetVmStatsAnswer(com.cloud.agent.api.GetVmStatsAnswer) PrimaryDataStoreDriver(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver) Command(com.cloud.agent.api.Command) ControlledEntity(org.apache.cloudstack.acl.ControlledEntity) StringReader(java.io.StringReader) GlobalLock(com.cloud.utils.db.GlobalLock) ConfigurationDao(org.apache.cloudstack.framework.config.dao.ConfigurationDao) StorageManager(com.cloud.storage.StorageManager) AnnotationDao(org.apache.cloudstack.annotation.dao.AnnotationDao) URLDecoder(java.net.URLDecoder) Date(java.util.Date) SecurityGroupAction(org.apache.cloudstack.api.command.user.vm.SecurityGroupAction) StoragePool(com.cloud.storage.StoragePool) AlertManager(com.cloud.alert.AlertManager) UserStatisticsDao(com.cloud.user.dao.UserStatisticsDao) ResourceType(com.cloud.configuration.Resource.ResourceType) Cluster(com.cloud.org.Cluster) GuestOSCategoryDao(com.cloud.storage.dao.GuestOSCategoryDao) GetVmNetworkStatsAnswer(com.cloud.agent.api.GetVmNetworkStatsAnswer) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) OrchestrationService(org.apache.cloudstack.engine.service.api.OrchestrationService) CreateVMGroupCmd(org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd) Answer(com.cloud.agent.api.Answer) RSAHelper(com.cloud.utils.crypt.RSAHelper) Config(com.cloud.configuration.Config) DeploymentPlanningManager(com.cloud.deploy.DeploymentPlanningManager) UserVO(com.cloud.user.UserVO) Capacity(com.cloud.capacity.Capacity) State(com.cloud.vm.VirtualMachine.State) DeployDestination(com.cloud.deploy.DeployDestination) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Commands(com.cloud.agent.manager.Commands) UUID(java.util.UUID) Pair(com.cloud.utils.Pair) Collectors(java.util.stream.Collectors) VpcManager(com.cloud.network.vpc.VpcManager) Objects(java.util.Objects) DiskOfferingVO(com.cloud.storage.DiskOfferingVO) Entry(java.util.Map.Entry) StoragePoolType(com.cloud.storage.Storage.StoragePoolType) DedicatedResourceVO(com.cloud.dc.DedicatedResourceVO) NetUtils(com.cloud.utils.net.NetUtils) DataStoreManager(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager) DataCenterDeployment(com.cloud.deploy.DataCenterDeployment) UnsupportedServiceException(com.cloud.exception.UnsupportedServiceException) DiskOfferingDao(com.cloud.storage.dao.DiskOfferingDao) Domain(com.cloud.domain.Domain) DBEncryptionUtil(com.cloud.utils.crypt.DBEncryptionUtil) PortForwardingRuleVO(com.cloud.network.rules.PortForwardingRuleVO) HashSet(java.util.HashSet) Inject(javax.inject.Inject) ConfigKey(org.apache.cloudstack.framework.config.ConfigKey) IPAddressVO(com.cloud.network.dao.IPAddressVO) Qualifier(org.springframework.beans.factory.annotation.Qualifier) VolumeDao(com.cloud.storage.dao.VolumeDao) IPAddressDao(com.cloud.network.dao.IPAddressDao) FirewallRulesDao(com.cloud.network.dao.FirewallRulesDao) Snapshot(com.cloud.storage.Snapshot) NamedThreadFactory(com.cloud.utils.concurrency.NamedThreadFactory) ExecutorService(java.util.concurrent.ExecutorService) DataCenter(com.cloud.dc.DataCenter) PermissionDeniedException(com.cloud.exception.PermissionDeniedException) UpdateDefaultNicForVMCmd(org.apache.cloudstack.api.command.user.vm.UpdateDefaultNicForVMCmd) HostVO(com.cloud.host.HostVO) InputSource(org.xml.sax.InputSource) VMTemplateVO(com.cloud.storage.VMTemplateVO) NodeList(org.w3c.dom.NodeList) ConfigurationManager(com.cloud.configuration.ConfigurationManager) MapUtils(org.apache.commons.collections.MapUtils) VirtualMachineTO(com.cloud.agent.api.to.VirtualMachineTO) UserVmDeployAsIsDetailsDao(com.cloud.deployasis.dao.UserVmDeployAsIsDetailsDao) AddNicToVMCmd(org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd) UserVmDeployAsIsDetailVO(com.cloud.deployasis.UserVmDeployAsIsDetailVO) VolumeStatsEntry(com.cloud.agent.api.VolumeStatsEntry) SSHKeyPairDao(com.cloud.user.dao.SSHKeyPairDao) DiskTO(com.cloud.agent.api.to.DiskTO) NumbersUtil.toHumanReadableSize(com.cloud.utils.NumbersUtil.toHumanReadableSize) ApiConstants(org.apache.cloudstack.api.ApiConstants) UUIDManager(com.cloud.utils.db.UUIDManager) Element(org.w3c.dom.Element) DataStoreRole(com.cloud.storage.DataStoreRole) VolumeApiResult(org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult) TemplateDeployAsIsDetailsDao(com.cloud.deployasis.dao.TemplateDeployAsIsDetailsDao) StoragePoolVO(org.apache.cloudstack.storage.datastore.db.StoragePoolVO) FirewallManager(com.cloud.network.rules.FirewallManager) DpdkHelper(com.cloud.hypervisor.kvm.dpdk.DpdkHelper) OVFPropertyTO(com.cloud.agent.api.to.deployasis.OVFPropertyTO) Arrays(java.util.Arrays) ByteScaleUtils(org.apache.cloudstack.utils.bytescale.ByteScaleUtils) UpdateVmNicIpCmd(org.apache.cloudstack.api.command.user.vm.UpdateVmNicIpCmd) VolumeService(org.apache.cloudstack.engine.subsystem.api.storage.VolumeService) Transaction(com.cloud.utils.db.Transaction) TransactionCallbackWithExceptionNoReturn(com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn) NoTransitionException(com.cloud.utils.fsm.NoTransitionException) AgentManager(com.cloud.agent.AgentManager) ServiceOfferingDetailsDao(com.cloud.service.dao.ServiceOfferingDetailsDao) VirtualMachineTemplate(com.cloud.template.VirtualMachineTemplate) TemplateType(com.cloud.storage.Storage.TemplateType) Matcher(java.util.regex.Matcher) VmNetworkStatsEntry(com.cloud.agent.api.VmNetworkStatsEntry) ServiceOfferingDao(com.cloud.service.dao.ServiceOfferingDao) NetworkServiceMapDao(com.cloud.network.dao.NetworkServiceMapDao) CloudException(com.cloud.exception.CloudException) PlannerHostReservationDao(com.cloud.deploy.dao.PlannerHostReservationDao) Storage(com.cloud.storage.Storage) NicExtraDhcpOptionDao(com.cloud.vm.dao.NicExtraDhcpOptionDao) CapacityManager(com.cloud.capacity.CapacityManager) CallContext(org.apache.cloudstack.context.CallContext) GetVmStatsCommand(com.cloud.agent.api.GetVmStatsCommand) LoadBalancerVMMapDao(com.cloud.network.dao.LoadBalancerVMMapDao) NetworkGuru(com.cloud.network.guru.NetworkGuru) ResourceManager(com.cloud.resource.ResourceManager) TemplateApiService(com.cloud.template.TemplateApiService) Set(java.util.Set) ScopeType(com.cloud.storage.ScopeType) UpgradeVMCmd(org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd) DettachCommand(org.apache.cloudstack.storage.command.DettachCommand) OperationTimedoutException(com.cloud.exception.OperationTimedoutException) Executors(java.util.concurrent.Executors) VMTemplateZoneVO(com.cloud.storage.VMTemplateZoneVO) InsufficientCapacityException(com.cloud.exception.InsufficientCapacityException) VMSnapshotManager(com.cloud.vm.snapshot.VMSnapshotManager) VpcVirtualNetworkApplianceManager(com.cloud.network.router.VpcVirtualNetworkApplianceManager) PortForwardingRulesDao(com.cloud.network.rules.dao.PortForwardingRulesDao) GuestOSDao(com.cloud.storage.dao.GuestOSDao) InsufficientAddressCapacityException(com.cloud.exception.InsufficientAddressCapacityException) HypervisorCapabilitiesDao(com.cloud.hypervisor.dao.HypervisorCapabilitiesDao) ServiceOfferingJoinDao(com.cloud.api.query.dao.ServiceOfferingJoinDao) AccountDao(com.cloud.user.dao.AccountDao) AffinityGroupDao(org.apache.cloudstack.affinity.dao.AffinityGroupDao) IpAddressManager(com.cloud.network.IpAddressManager) NumbersUtil(com.cloud.utils.NumbersUtil) PrimaryDataStore(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore) UsageEventVO(com.cloud.event.UsageEventVO) StorageUnavailableException(com.cloud.exception.StorageUnavailableException) HTTPMethod(org.apache.cloudstack.api.BaseCmd.HTTPMethod) ArrayList(java.util.ArrayList) VmStatsEntry(com.cloud.agent.api.VmStatsEntry) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) TemplateDataStoreVO(org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO) StartAnswer(com.cloud.agent.api.StartAnswer) PlannerHostReservationVO(com.cloud.deploy.PlannerHostReservationVO) VmDiskStatsEntry(com.cloud.agent.api.VmDiskStatsEntry) ConfigurationManagerImpl(com.cloud.configuration.ConfigurationManagerImpl) VMInstanceDao(com.cloud.vm.dao.VMInstanceDao) DomainRouterDao(com.cloud.vm.dao.DomainRouterDao) LinkedHashSet(java.util.LinkedHashSet) HypervisorType(com.cloud.hypervisor.Hypervisor.HypervisorType) Journal(com.cloud.utils.Journal) UsageEventDao(com.cloud.event.dao.UsageEventDao) ScaleVMCmd(org.apache.cloudstack.api.command.user.vm.ScaleVMCmd) LoadBalancerVMMapVO(com.cloud.network.dao.LoadBalancerVMMapVO) DeployVMCmdByAdmin(org.apache.cloudstack.api.command.admin.vm.DeployVMCmdByAdmin) ResetVMSSHKeyCmd(org.apache.cloudstack.api.command.user.vm.ResetVMSSHKeyCmd) ResourceTagDao(com.cloud.tags.dao.ResourceTagDao) RestoreVMSnapshotAnswer(com.cloud.agent.api.RestoreVMSnapshotAnswer) VolumeDataFactory(org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory) HostPodDao(com.cloud.dc.dao.HostPodDao) Host(com.cloud.host.Host) ActionEvent(com.cloud.event.ActionEvent) AccountManager(com.cloud.user.AccountManager) DocumentBuilder(javax.xml.parsers.DocumentBuilder) ImageFormat(com.cloud.storage.Storage.ImageFormat) ExcludeList(com.cloud.deploy.DeploymentPlanner.ExcludeList) RulesManager(com.cloud.network.rules.RulesManager) StatsCollector(com.cloud.server.StatsCollector) ManagementService(com.cloud.server.ManagementService) DataStoreDriver(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver) ActionEventUtils(com.cloud.event.ActionEventUtils) TemplateManager(com.cloud.template.TemplateManager) DeleteCommand(org.apache.cloudstack.storage.command.DeleteCommand) RemoveNicFromVMCmd(org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd) VMNetworkMapDao(org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDao) StoragePoolStatus(com.cloud.storage.StoragePoolStatus) Grouping(com.cloud.org.Grouping) BackupDao(org.apache.cloudstack.backup.dao.BackupDao) NumberUtils(org.apache.commons.lang.math.NumberUtils) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) SecurityGroupDao(com.cloud.network.security.dao.SecurityGroupDao) DataStoreProviderManager(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager) Logger(org.apache.log4j.Logger) ResourceAllocationException(com.cloud.exception.ResourceAllocationException) ResourceLimitService(com.cloud.user.ResourceLimitService) SecurityGroup(com.cloud.network.security.SecurityGroup) DomainDao(com.cloud.domain.dao.DomainDao) Ip(com.cloud.utils.net.Ip) TransactionCallbackNoReturn(com.cloud.utils.db.TransactionCallbackNoReturn) ManagedContextRunnable(org.apache.cloudstack.managed.context.ManagedContextRunnable) PrimaryDataStoreDao(org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao) IpAddresses(com.cloud.network.Network.IpAddresses) SSHKeyPair(com.cloud.user.SSHKeyPair) AffinityConflictException(com.cloud.exception.AffinityConflictException) Account(com.cloud.user.Account) DedicatedResourceDao(com.cloud.dc.dao.DedicatedResourceDao) Status(com.cloud.host.Status) VMSnapshotDao(com.cloud.vm.snapshot.dao.VMSnapshotDao) List(java.util.List) DataCenterDao(com.cloud.dc.dao.DataCenterDao) ACLType(org.apache.cloudstack.acl.ControlledEntity.ACLType) ConcurrentOperationException(com.cloud.exception.ConcurrentOperationException) SAXException(org.xml.sax.SAXException) Pattern(java.util.regex.Pattern) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Backup(org.apache.cloudstack.backup.Backup) GetVmIpAddressCommand(com.cloud.agent.api.GetVmIpAddressCommand) OVFNetworkTO(com.cloud.agent.api.to.deployasis.OVFNetworkTO) InstanceGroupVMMapDao(com.cloud.vm.dao.InstanceGroupVMMapDao) VmDiskStatisticsVO(com.cloud.user.VmDiskStatisticsVO) EntityManager(com.cloud.utils.db.EntityManager) VolumeApiService(com.cloud.storage.VolumeApiService) StartVMCmd(org.apache.cloudstack.api.command.user.vm.StartVMCmd) AccessType(org.apache.cloudstack.acl.SecurityChecker.AccessType) HashMap(java.util.HashMap) ConfigurationException(javax.naming.ConfigurationException) AffinityGroupService(org.apache.cloudstack.affinity.AffinityGroupService) NetworkDao(com.cloud.network.dao.NetworkDao) VM_USERDATA_MAX_LENGTH(com.cloud.configuration.ConfigurationManagerImpl.VM_USERDATA_MAX_LENGTH) EventTypes(com.cloud.event.EventTypes) RebootVMCmd(org.apache.cloudstack.api.command.user.vm.RebootVMCmd) GuestOSVO(com.cloud.storage.GuestOSVO) RestoreVMCmd(org.apache.cloudstack.api.command.user.vm.RestoreVMCmd) DataStoreProvider(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider) CollectionUtils(org.apache.commons.collections.CollectionUtils) UserVmDetailsDao(com.cloud.vm.dao.UserVmDetailsDao) NetworkVO(com.cloud.network.dao.NetworkVO) Configurable(org.apache.cloudstack.framework.config.Configurable) VlanType(com.cloud.dc.Vlan.VlanType) GPU(com.cloud.gpu.GPU) AnnotationService(org.apache.cloudstack.annotation.AnnotationService) LoadBalancingRulesManager(com.cloud.network.lb.LoadBalancingRulesManager) SSHKeyPairVO(com.cloud.user.SSHKeyPairVO) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) AffinityGroupVMMapVO(org.apache.cloudstack.affinity.AffinityGroupVMMapVO) Hypervisor(com.cloud.hypervisor.Hypervisor) ChangeOfferingForVolumeCmd(org.apache.cloudstack.api.command.user.volume.ChangeOfferingForVolumeCmd) VirtualMachineEntity(org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntity) GetVmDiskStatsCommand(com.cloud.agent.api.GetVmDiskStatsCommand) DateUtil(com.cloud.utils.DateUtil) TimeUnit(java.util.concurrent.TimeUnit) BackupManager(org.apache.cloudstack.backup.BackupManager) GetVmDiskStatsAnswer(com.cloud.agent.api.GetVmDiskStatsAnswer) NetworkOffering(com.cloud.offering.NetworkOffering) HostPodVO(com.cloud.dc.HostPodVO) VMTemplateZoneDao(com.cloud.storage.dao.VMTemplateZoneDao) DeployVMCmd(org.apache.cloudstack.api.command.user.vm.DeployVMCmd) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) NetworkOfferingDao(com.cloud.offerings.dao.NetworkOfferingDao) RecoverVMCmd(org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd) Volume(com.cloud.storage.Volume) RestoreVMSnapshotCommand(com.cloud.agent.api.RestoreVMSnapshotCommand) DomainVO(com.cloud.domain.DomainVO) ManagementServerException(com.cloud.exception.ManagementServerException) FirewallRuleVO(com.cloud.network.rules.FirewallRuleVO) Provider(com.cloud.network.Network.Provider) UserStatisticsVO(com.cloud.user.UserStatisticsVO) VolumeVO(com.cloud.storage.VolumeVO) NetworkHelper(com.cloud.network.router.NetworkHelper) NetworkVO(com.cloud.network.dao.NetworkVO) ServiceOffering(com.cloud.offering.ServiceOffering) VMTemplateVO(com.cloud.storage.VMTemplateVO) ArrayList(java.util.ArrayList) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) Network(com.cloud.network.Network) PhysicalNetwork(com.cloud.network.PhysicalNetwork)

Aggregations

AgentManager (com.cloud.agent.AgentManager)1 Answer (com.cloud.agent.api.Answer)1 Command (com.cloud.agent.api.Command)1 GetVmDiskStatsAnswer (com.cloud.agent.api.GetVmDiskStatsAnswer)1 GetVmDiskStatsCommand (com.cloud.agent.api.GetVmDiskStatsCommand)1 GetVmIpAddressCommand (com.cloud.agent.api.GetVmIpAddressCommand)1 GetVmNetworkStatsAnswer (com.cloud.agent.api.GetVmNetworkStatsAnswer)1 GetVmNetworkStatsCommand (com.cloud.agent.api.GetVmNetworkStatsCommand)1 GetVmStatsAnswer (com.cloud.agent.api.GetVmStatsAnswer)1 GetVmStatsCommand (com.cloud.agent.api.GetVmStatsCommand)1 GetVolumeStatsAnswer (com.cloud.agent.api.GetVolumeStatsAnswer)1 GetVolumeStatsCommand (com.cloud.agent.api.GetVolumeStatsCommand)1 ModifyTargetsCommand (com.cloud.agent.api.ModifyTargetsCommand)1 PvlanSetupCommand (com.cloud.agent.api.PvlanSetupCommand)1 RestoreVMSnapshotAnswer (com.cloud.agent.api.RestoreVMSnapshotAnswer)1 RestoreVMSnapshotCommand (com.cloud.agent.api.RestoreVMSnapshotCommand)1 StartAnswer (com.cloud.agent.api.StartAnswer)1 VmDiskStatsEntry (com.cloud.agent.api.VmDiskStatsEntry)1 VmNetworkStatsEntry (com.cloud.agent.api.VmNetworkStatsEntry)1 VmStatsEntry (com.cloud.agent.api.VmStatsEntry)1