Search in sources :

Example 1 with GetUnmanagedInstancesCommand

use of com.cloud.agent.api.GetUnmanagedInstancesCommand in project cloudstack by apache.

the class UnmanagedVMsManagerImpl method listUnmanagedInstances.

@Override
public ListResponse<UnmanagedInstanceResponse> listUnmanagedInstances(ListUnmanagedInstancesCmd cmd) {
    final Account caller = CallContext.current().getCallingAccount();
    if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
        throw new PermissionDeniedException(String.format("Cannot perform this operation, Calling account is not root admin: %s", caller.getUuid()));
    }
    final Long clusterId = cmd.getClusterId();
    if (clusterId == null) {
        throw new InvalidParameterValueException(String.format("Cluster ID cannot be null"));
    }
    final Cluster cluster = clusterDao.findById(clusterId);
    if (cluster == null) {
        throw new InvalidParameterValueException(String.format("Cluster ID: %d cannot be found", clusterId));
    }
    if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) {
        throw new InvalidParameterValueException(String.format("VM ingestion is currently not supported for hypervisor: %s", cluster.getHypervisorType().toString()));
    }
    String keyword = cmd.getKeyword();
    if (StringUtils.isNotEmpty(keyword)) {
        keyword = keyword.toLowerCase();
    }
    List<HostVO> hosts = resourceManager.listHostsInClusterByStatus(clusterId, Status.Up);
    List<String> additionalNameFilters = getAdditionalNameFilters(cluster);
    List<UnmanagedInstanceResponse> responses = new ArrayList<>();
    for (HostVO host : hosts) {
        if (host.isInMaintenanceStates()) {
            continue;
        }
        List<String> managedVms = new ArrayList<>();
        managedVms.addAll(additionalNameFilters);
        managedVms.addAll(getHostManagedVms(host));
        GetUnmanagedInstancesCommand command = new GetUnmanagedInstancesCommand();
        command.setInstanceName(cmd.getName());
        command.setManagedInstancesNames(managedVms);
        Answer answer = agentManager.easySend(host.getId(), command);
        if (!(answer instanceof GetUnmanagedInstancesAnswer)) {
            continue;
        }
        GetUnmanagedInstancesAnswer unmanagedInstancesAnswer = (GetUnmanagedInstancesAnswer) answer;
        HashMap<String, UnmanagedInstanceTO> unmanagedInstances = new HashMap<>(unmanagedInstancesAnswer.getUnmanagedInstances());
        Set<String> keys = unmanagedInstances.keySet();
        for (String key : keys) {
            UnmanagedInstanceTO instance = unmanagedInstances.get(key);
            if (StringUtils.isNotEmpty(keyword) && !instance.getName().toLowerCase().contains(keyword)) {
                continue;
            }
            responses.add(createUnmanagedInstanceResponse(instance, cluster, host));
        }
    }
    ListResponse<UnmanagedInstanceResponse> listResponses = new ListResponse<>();
    listResponses.setResponses(responses, responses.size());
    return listResponses;
}
Also used : Account(com.cloud.user.Account) ListResponse(org.apache.cloudstack.api.response.ListResponse) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Cluster(com.cloud.org.Cluster) GetUnmanagedInstancesCommand(com.cloud.agent.api.GetUnmanagedInstancesCommand) HostVO(com.cloud.host.HostVO) UnmanagedInstanceResponse(org.apache.cloudstack.api.response.UnmanagedInstanceResponse) Answer(com.cloud.agent.api.Answer) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) PrepareUnmanageVMInstanceAnswer(com.cloud.agent.api.PrepareUnmanageVMInstanceAnswer) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) PermissionDeniedException(com.cloud.exception.PermissionDeniedException)

Example 2 with GetUnmanagedInstancesCommand

use of com.cloud.agent.api.GetUnmanagedInstancesCommand in project cloudstack by apache.

the class UnmanagedVMsManagerImplTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    AccountVO account = new AccountVO("admin", 1L, "", Account.ACCOUNT_TYPE_ADMIN, "uuid");
    UserVO user = new UserVO(1, "adminuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString(), User.Source.UNKNOWN);
    CallContext.register(user, account);
    UnmanagedInstanceTO instance = new UnmanagedInstanceTO();
    instance.setName("TestInstance");
    instance.setCpuCores(2);
    instance.setCpuCoresPerSocket(1);
    instance.setCpuSpeed(1000);
    instance.setMemory(1024);
    instance.setOperatingSystem("CentOS 7");
    List<UnmanagedInstanceTO.Disk> instanceDisks = new ArrayList<>();
    UnmanagedInstanceTO.Disk instanceDisk = new UnmanagedInstanceTO.Disk();
    instanceDisk.setDiskId("1000-1");
    instanceDisk.setLabel("DiskLabel");
    instanceDisk.setController("scsi");
    instanceDisk.setImagePath("[b6ccf44a1fa13e29b3667b4954fa10ee] TestInstance/ROOT-1.vmdk");
    instanceDisk.setCapacity(5242880L);
    instanceDisk.setDatastoreName("Test");
    instanceDisk.setDatastoreHost("Test");
    instanceDisk.setDatastorePath("Test");
    instanceDisk.setDatastoreType("NFS");
    instanceDisks.add(instanceDisk);
    instance.setDisks(instanceDisks);
    List<UnmanagedInstanceTO.Nic> instanceNics = new ArrayList<>();
    UnmanagedInstanceTO.Nic instanceNic = new UnmanagedInstanceTO.Nic();
    instanceNic.setNicId("NIC 1");
    instanceNic.setAdapterType("VirtualE1000E");
    instanceNic.setMacAddress("02:00:2e:0f:00:02");
    instanceNic.setVlan(1024);
    instanceNics.add(instanceNic);
    instance.setNics(instanceNics);
    instance.setPowerState(UnmanagedInstanceTO.PowerState.PowerOn);
    ClusterVO clusterVO = new ClusterVO(1L, 1L, "Cluster");
    clusterVO.setHypervisorType(Hypervisor.HypervisorType.VMware.toString());
    when(clusterDao.findById(Mockito.anyLong())).thenReturn(clusterVO);
    when(configurationDao.getValue(Mockito.anyString())).thenReturn(null);
    doNothing().when(resourceLimitService).checkResourceLimit(any(Account.class), any(Resource.ResourceType.class), anyLong());
    List<HostVO> hosts = new ArrayList<>();
    HostVO hostVO = Mockito.mock(HostVO.class);
    when(hostVO.isInMaintenanceStates()).thenReturn(false);
    hosts.add(hostVO);
    when(hostVO.checkHostServiceOfferingTags(Mockito.any())).thenReturn(true);
    when(resourceManager.listHostsInClusterByStatus(Mockito.anyLong(), Mockito.any(Status.class))).thenReturn(hosts);
    List<VMTemplateStoragePoolVO> templates = new ArrayList<>();
    when(templatePoolDao.listAll()).thenReturn(templates);
    List<VolumeVO> volumes = new ArrayList<>();
    when(volumeDao.findIncludingRemovedByZone(Mockito.anyLong())).thenReturn(volumes);
    List<VMInstanceVO> vms = new ArrayList<>();
    when(vmDao.listByHostId(Mockito.anyLong())).thenReturn(vms);
    when(vmDao.listByLastHostIdAndStates(Mockito.anyLong())).thenReturn(vms);
    GetUnmanagedInstancesCommand cmd = Mockito.mock(GetUnmanagedInstancesCommand.class);
    HashMap<String, UnmanagedInstanceTO> map = new HashMap<>();
    map.put(instance.getName(), instance);
    Answer answer = new GetUnmanagedInstancesAnswer(cmd, "", map);
    when(agentManager.easySend(Mockito.anyLong(), Mockito.any(GetUnmanagedInstancesCommand.class))).thenReturn(answer);
    DataCenterVO zone = Mockito.mock(DataCenterVO.class);
    when(zone.getId()).thenReturn(1L);
    when(dataCenterDao.findById(Mockito.anyLong())).thenReturn(zone);
    when(accountService.getActiveAccountById(Mockito.anyLong())).thenReturn(Mockito.mock(Account.class));
    List<UserVO> users = new ArrayList<>();
    users.add(Mockito.mock(UserVO.class));
    when(userDao.listByAccount(Mockito.anyLong())).thenReturn(users);
    VMTemplateVO template = Mockito.mock(VMTemplateVO.class);
    when(template.getId()).thenReturn(1L);
    when(template.getName()).thenReturn("Template");
    when(templateDao.findById(Mockito.anyLong())).thenReturn(template);
    when(templateDao.findByName(Mockito.anyString())).thenReturn(template);
    ServiceOfferingVO serviceOffering = Mockito.mock(ServiceOfferingVO.class);
    when(serviceOffering.getId()).thenReturn(1L);
    when(serviceOffering.isDynamic()).thenReturn(false);
    when(serviceOffering.getCpu()).thenReturn(instance.getCpuCores());
    when(serviceOffering.getRamSize()).thenReturn(instance.getMemory());
    when(serviceOffering.getSpeed()).thenReturn(instance.getCpuSpeed());
    when(serviceOfferingDao.findById(Mockito.anyLong())).thenReturn(serviceOffering);
    DiskOfferingVO diskOfferingVO = Mockito.mock(DiskOfferingVO.class);
    when(diskOfferingVO.getTags()).thenReturn("");
    when(diskOfferingVO.isCustomized()).thenReturn(false);
    when(diskOfferingVO.getDiskSize()).thenReturn(Long.MAX_VALUE);
    when(diskOfferingDao.findById(Mockito.anyLong())).thenReturn(diskOfferingVO);
    UserVmVO userVm = Mockito.mock(UserVmVO.class);
    when(userVm.getAccountId()).thenReturn(1L);
    when(userVm.getDataCenterId()).thenReturn(1L);
    when(userVm.getHostName()).thenReturn(instance.getName());
    when(userVm.getTemplateId()).thenReturn(1L);
    when(userVm.getHypervisorType()).thenReturn(Hypervisor.HypervisorType.VMware);
    when(userVm.getUuid()).thenReturn("abcd");
    when(userVm.isDisplayVm()).thenReturn(true);
    // Skip usage publishing and resource increment for test
    when(userVm.getType()).thenReturn(VirtualMachine.Type.Instance);
    userVm.setInstanceName(instance.getName());
    userVm.setHostName(instance.getName());
    StoragePoolVO poolVO = Mockito.mock(StoragePoolVO.class);
    when(poolVO.getDataCenterId()).thenReturn(1L);
    when(poolVO.getClusterId()).thenReturn(clusterVO.getId());
    List<StoragePoolVO> pools = new ArrayList<>();
    pools.add(poolVO);
    when(primaryDataStoreDao.listPoolByHostPath(Mockito.anyString(), Mockito.anyString())).thenReturn(pools);
    when(userVmManager.importVM(nullable(DataCenter.class), nullable(Host.class), nullable(VirtualMachineTemplate.class), nullable(String.class), nullable(String.class), nullable(Account.class), nullable(String.class), nullable(Account.class), nullable(Boolean.class), nullable(String.class), nullable(Long.class), nullable(Long.class), nullable(ServiceOffering.class), nullable(String.class), nullable(String.class), nullable(Hypervisor.HypervisorType.class), nullable(Map.class), nullable(VirtualMachine.PowerState.class))).thenReturn(userVm);
    when(volumeApiService.doesTargetStorageSupportDiskOffering(Mockito.any(StoragePool.class), Mockito.anyString())).thenReturn(true);
    NetworkVO networkVO = Mockito.mock(NetworkVO.class);
    when(networkVO.getGuestType()).thenReturn(Network.GuestType.L2);
    when(networkVO.getBroadcastUri()).thenReturn(URI.create(String.format("vlan://%d", instanceNic.getVlan())));
    when(networkVO.getDataCenterId()).thenReturn(1L);
    when(networkDao.findById(Mockito.anyLong())).thenReturn(networkVO);
    List<NetworkVO> networks = new ArrayList<>();
    networks.add(networkVO);
    when(networkDao.listByZone(Mockito.anyLong())).thenReturn(networks);
    doNothing().when(networkModel).checkNetworkPermissions(Mockito.any(Account.class), Mockito.any(Network.class));
    doNothing().when(networkModel).checkRequestedIpAddresses(Mockito.anyLong(), Mockito.any(Network.IpAddresses.class));
    NicProfile profile = Mockito.mock(NicProfile.class);
    Integer deviceId = 100;
    Pair<NicProfile, Integer> pair = new Pair<NicProfile, Integer>(profile, deviceId);
    when(networkOrchestrationService.importNic(nullable(String.class), nullable(Integer.class), nullable(Network.class), nullable(Boolean.class), nullable(VirtualMachine.class), nullable(Network.IpAddresses.class), anyBoolean())).thenReturn(pair);
    when(volumeManager.importVolume(Mockito.any(Volume.Type.class), Mockito.anyString(), Mockito.any(DiskOffering.class), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.any(VirtualMachine.class), Mockito.any(VirtualMachineTemplate.class), Mockito.any(Account.class), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyString(), Mockito.anyString())).thenReturn(Mockito.mock(DiskProfile.class));
    when(volumeDao.findByInstance(Mockito.anyLong())).thenReturn(volumes);
    List<UserVmResponse> userVmResponses = new ArrayList<>();
    UserVmResponse userVmResponse = new UserVmResponse();
    userVmResponse.setInstanceName(instance.getName());
    userVmResponses.add(userVmResponse);
    when(responseGenerator.createUserVmResponse(Mockito.any(ResponseObject.ResponseView.class), Mockito.anyString(), Mockito.any(UserVm.class))).thenReturn(userVmResponses);
    when(vmDao.findById(virtualMachineId)).thenReturn(virtualMachine);
    when(virtualMachine.getState()).thenReturn(VirtualMachine.State.Running);
    when(virtualMachine.getInstanceName()).thenReturn("i-2-7-VM");
    when(virtualMachine.getId()).thenReturn(virtualMachineId);
    VolumeVO volumeVO = mock(VolumeVO.class);
    when(volumeDao.findByInstance(virtualMachineId)).thenReturn(Collections.singletonList(volumeVO));
    when(volumeVO.getInstanceId()).thenReturn(virtualMachineId);
    when(volumeVO.getId()).thenReturn(virtualMachineId);
    when(nicDao.listByVmId(virtualMachineId)).thenReturn(Collections.singletonList(nicVO));
    when(nicVO.getNetworkId()).thenReturn(1L);
    when(networkDao.findById(1L)).thenReturn(networkVO);
}
Also used : Account(com.cloud.user.Account) StoragePool(com.cloud.storage.StoragePool) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AccountVO(com.cloud.user.AccountVO) GetUnmanagedInstancesCommand(com.cloud.agent.api.GetUnmanagedInstancesCommand) ServiceOfferingVO(com.cloud.service.ServiceOfferingVO) UserVm(com.cloud.uservm.UserVm) VolumeVO(com.cloud.storage.VolumeVO) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) Network(com.cloud.network.Network) VMTemplateStoragePoolVO(com.cloud.storage.VMTemplateStoragePoolVO) StoragePoolVO(org.apache.cloudstack.storage.datastore.db.StoragePoolVO) Matchers.anyBoolean(org.mockito.Matchers.anyBoolean) Status(com.cloud.host.Status) DataCenterVO(com.cloud.dc.DataCenterVO) NetworkVO(com.cloud.network.dao.NetworkVO) VirtualMachineTemplate(com.cloud.template.VirtualMachineTemplate) ServiceOffering(com.cloud.offering.ServiceOffering) VMInstanceVO(com.cloud.vm.VMInstanceVO) DiskProfile(com.cloud.vm.DiskProfile) UserVmResponse(org.apache.cloudstack.api.response.UserVmResponse) HostVO(com.cloud.host.HostVO) Matchers.anyLong(org.mockito.Matchers.anyLong) Map(java.util.Map) HashMap(java.util.HashMap) VirtualMachine(com.cloud.vm.VirtualMachine) UserVmVO(com.cloud.vm.UserVmVO) DiskOffering(com.cloud.offering.DiskOffering) VMTemplateVO(com.cloud.storage.VMTemplateVO) DiskOfferingVO(com.cloud.storage.DiskOfferingVO) Pair(com.cloud.utils.Pair) ClusterVO(com.cloud.dc.ClusterVO) Host(com.cloud.host.Host) NicProfile(com.cloud.vm.NicProfile) VMTemplateStoragePoolVO(com.cloud.storage.VMTemplateStoragePoolVO) Answer(com.cloud.agent.api.Answer) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) DataCenter(com.cloud.dc.DataCenter) UserVO(com.cloud.user.UserVO) Before(org.junit.Before)

Example 3 with GetUnmanagedInstancesCommand

use of com.cloud.agent.api.GetUnmanagedInstancesCommand in project cloudstack by apache.

the class VmwareResource method executeRequest.

@Override
public Answer executeRequest(Command cmd) {
    logCommand(cmd);
    Answer answer = null;
    NDC.push(getCommandLogTitle(cmd));
    try {
        long cmdSequence = _cmdSequence++;
        Date startTime = DateUtil.currentGMTTime();
        PropertyMapDynamicBean mbean = new PropertyMapDynamicBean();
        mbean.addProp("StartTime", DateUtil.getDateDisplayString(TimeZone.getDefault(), startTime));
        mbean.addProp("Command", _gson.toJson(cmd));
        mbean.addProp("Sequence", String.valueOf(cmdSequence));
        mbean.addProp("Name", cmd.getClass().getSimpleName());
        Class<? extends Command> clz = cmd.getClass();
        if (cmd instanceof NetworkElementCommand) {
            return _vrResource.executeRequest((NetworkElementCommand) cmd);
        } else if (clz == ReadyCommand.class) {
            answer = execute((ReadyCommand) cmd);
        } else if (clz == GetHostStatsCommand.class) {
            answer = execute((GetHostStatsCommand) cmd);
        } else if (clz == GetVmStatsCommand.class) {
            answer = execute((GetVmStatsCommand) cmd);
        } else if (clz == GetVmNetworkStatsCommand.class) {
            answer = execute((GetVmNetworkStatsCommand) cmd);
        } else if (clz == GetVmDiskStatsCommand.class) {
            answer = execute((GetVmDiskStatsCommand) cmd);
        } else if (cmd instanceof GetVolumeStatsCommand) {
            return execute((GetVolumeStatsCommand) cmd);
        } else if (clz == CheckHealthCommand.class) {
            answer = execute((CheckHealthCommand) cmd);
        } else if (clz == StopCommand.class) {
            answer = execute((StopCommand) cmd);
        } else if (clz == RebootRouterCommand.class) {
            answer = execute((RebootRouterCommand) cmd);
        } else if (clz == RebootCommand.class) {
            answer = execute((RebootCommand) cmd);
        } else if (clz == CheckVirtualMachineCommand.class) {
            answer = execute((CheckVirtualMachineCommand) cmd);
        } else if (clz == PrepareForMigrationCommand.class) {
            answer = execute((PrepareForMigrationCommand) cmd);
        } else if (clz == MigrateCommand.class) {
            answer = execute((MigrateCommand) cmd);
        } else if (clz == MigrateVmToPoolCommand.class) {
            answer = execute((MigrateVmToPoolCommand) cmd);
        } else if (clz == MigrateWithStorageCommand.class) {
            answer = execute((MigrateWithStorageCommand) cmd);
        } else if (clz == MigrateVolumeCommand.class) {
            answer = execute((MigrateVolumeCommand) cmd);
        } else if (clz == DestroyCommand.class) {
            answer = execute((DestroyCommand) cmd);
        } else if (clz == CreateStoragePoolCommand.class) {
            return execute((CreateStoragePoolCommand) cmd);
        } else if (clz == ModifyTargetsCommand.class) {
            answer = execute((ModifyTargetsCommand) cmd);
        } else if (clz == ModifyStoragePoolCommand.class) {
            answer = execute((ModifyStoragePoolCommand) cmd);
        } else if (clz == GetStoragePoolCapabilitiesCommand.class) {
            answer = execute((GetStoragePoolCapabilitiesCommand) cmd);
        } else if (clz == DeleteStoragePoolCommand.class) {
            answer = execute((DeleteStoragePoolCommand) cmd);
        } else if (clz == CopyVolumeCommand.class) {
            answer = execute((CopyVolumeCommand) cmd);
        } else if (clz == AttachIsoCommand.class) {
            answer = execute((AttachIsoCommand) cmd);
        } else if (clz == ValidateSnapshotCommand.class) {
            answer = execute((ValidateSnapshotCommand) cmd);
        } else if (clz == ManageSnapshotCommand.class) {
            answer = execute((ManageSnapshotCommand) cmd);
        } else if (clz == BackupSnapshotCommand.class) {
            answer = execute((BackupSnapshotCommand) cmd);
        } else if (clz == CreateVolumeFromSnapshotCommand.class) {
            answer = execute((CreateVolumeFromSnapshotCommand) cmd);
        } else if (clz == CreatePrivateTemplateFromVolumeCommand.class) {
            answer = execute((CreatePrivateTemplateFromVolumeCommand) cmd);
        } else if (clz == CreatePrivateTemplateFromSnapshotCommand.class) {
            answer = execute((CreatePrivateTemplateFromSnapshotCommand) cmd);
        } else if (clz == UpgradeSnapshotCommand.class) {
            answer = execute((UpgradeSnapshotCommand) cmd);
        } else if (clz == GetStorageStatsCommand.class) {
            answer = execute((GetStorageStatsCommand) cmd);
        } else if (clz == PrimaryStorageDownloadCommand.class) {
            answer = execute((PrimaryStorageDownloadCommand) cmd);
        } else if (clz == GetVncPortCommand.class) {
            answer = execute((GetVncPortCommand) cmd);
        } else if (clz == SetupCommand.class) {
            answer = execute((SetupCommand) cmd);
        } else if (clz == MaintainCommand.class) {
            answer = execute((MaintainCommand) cmd);
        } else if (clz == PingTestCommand.class) {
            answer = execute((PingTestCommand) cmd);
        } else if (clz == CheckOnHostCommand.class) {
            answer = execute((CheckOnHostCommand) cmd);
        } else if (clz == ModifySshKeysCommand.class) {
            answer = execute((ModifySshKeysCommand) cmd);
        } else if (clz == NetworkUsageCommand.class) {
            answer = execute((NetworkUsageCommand) cmd);
        } else if (clz == StartCommand.class) {
            answer = execute((StartCommand) cmd);
        } else if (clz == CheckSshCommand.class) {
            answer = execute((CheckSshCommand) cmd);
        } else if (clz == CheckNetworkCommand.class) {
            answer = execute((CheckNetworkCommand) cmd);
        } else if (clz == PlugNicCommand.class) {
            answer = execute((PlugNicCommand) cmd);
        } else if (clz == ReplugNicCommand.class) {
            answer = execute((ReplugNicCommand) cmd);
        } else if (clz == UnPlugNicCommand.class) {
            answer = execute((UnPlugNicCommand) cmd);
        } else if (cmd instanceof CreateVMSnapshotCommand) {
            return execute((CreateVMSnapshotCommand) cmd);
        } else if (cmd instanceof DeleteVMSnapshotCommand) {
            return execute((DeleteVMSnapshotCommand) cmd);
        } else if (cmd instanceof RevertToVMSnapshotCommand) {
            return execute((RevertToVMSnapshotCommand) cmd);
        } else if (clz == ResizeVolumeCommand.class) {
            return execute((ResizeVolumeCommand) cmd);
        } else if (clz == UnregisterVMCommand.class) {
            return execute((UnregisterVMCommand) cmd);
        } else if (cmd instanceof StorageSubSystemCommand) {
            checkStorageProcessorAndHandlerNfsVersionAttribute((StorageSubSystemCommand) cmd);
            return storageHandler.handleStorageCommands((StorageSubSystemCommand) cmd);
        } else if (clz == ScaleVmCommand.class) {
            return execute((ScaleVmCommand) cmd);
        } else if (clz == PvlanSetupCommand.class) {
            return execute((PvlanSetupCommand) cmd);
        } else if (clz == GetVmIpAddressCommand.class) {
            return execute((GetVmIpAddressCommand) cmd);
        } else if (clz == UnregisterNicCommand.class) {
            answer = execute((UnregisterNicCommand) cmd);
        } else if (clz == GetUnmanagedInstancesCommand.class) {
            answer = execute((GetUnmanagedInstancesCommand) cmd);
        } else if (clz == PrepareUnmanageVMInstanceCommand.class) {
            answer = execute((PrepareUnmanageVMInstanceCommand) cmd);
        } else if (clz == ValidateVcenterDetailsCommand.class) {
            answer = execute((ValidateVcenterDetailsCommand) cmd);
        } else if (clz == SetupPersistentNetworkCommand.class) {
            answer = execute((SetupPersistentNetworkCommand) cmd);
        } else if (clz == GetVmVncTicketCommand.class) {
            answer = execute((GetVmVncTicketCommand) cmd);
        } else {
            answer = Answer.createUnsupportedCommandAnswer(cmd);
        }
        if (cmd.getContextParam("checkpoint") != null) {
            answer.setContextParam("checkpoint", cmd.getContextParam("checkpoint"));
        }
        Date doneTime = DateUtil.currentGMTTime();
        mbean.addProp("DoneTime", DateUtil.getDateDisplayString(TimeZone.getDefault(), doneTime));
        mbean.addProp("Answer", _gson.toJson(answer));
        synchronized (this) {
            try {
                JmxUtil.registerMBean("VMware " + _morHyperHost.getValue(), "Command " + cmdSequence + "-" + cmd.getClass().getSimpleName(), mbean);
                _cmdMBeans.add(mbean);
                if (_cmdMBeans.size() >= MazCmdMBean) {
                    PropertyMapDynamicBean mbeanToRemove = _cmdMBeans.get(0);
                    _cmdMBeans.remove(0);
                    JmxUtil.unregisterMBean("VMware " + _morHyperHost.getValue(), "Command " + mbeanToRemove.getProp("Sequence") + "-" + mbeanToRemove.getProp("Name"));
                }
            } catch (Exception e) {
                if (s_logger.isTraceEnabled())
                    s_logger.trace("Unable to register JMX monitoring due to exception " + ExceptionUtil.toString(e));
            }
        }
    } finally {
        recycleServiceContext();
        NDC.pop();
    }
    if (s_logger.isTraceEnabled())
        s_logger.trace("End executeRequest(), cmd: " + cmd.getClass().getSimpleName());
    return answer;
}
Also used : MigrateVolumeCommand(com.cloud.agent.api.storage.MigrateVolumeCommand) RebootRouterCommand(com.cloud.agent.api.RebootRouterCommand) DeleteStoragePoolCommand(com.cloud.agent.api.DeleteStoragePoolCommand) ManageSnapshotCommand(com.cloud.agent.api.ManageSnapshotCommand) GetUnmanagedInstancesCommand(com.cloud.agent.api.GetUnmanagedInstancesCommand) MigrateCommand(com.cloud.agent.api.MigrateCommand) UnPlugNicCommand(com.cloud.agent.api.UnPlugNicCommand) GetVmDiskStatsCommand(com.cloud.agent.api.GetVmDiskStatsCommand) CreateVolumeFromSnapshotCommand(com.cloud.agent.api.CreateVolumeFromSnapshotCommand) GetVolumeStatsCommand(com.cloud.agent.api.GetVolumeStatsCommand) PrepareUnmanageVMInstanceCommand(com.cloud.agent.api.PrepareUnmanageVMInstanceCommand) CheckNetworkCommand(com.cloud.agent.api.CheckNetworkCommand) ScaleVmCommand(com.cloud.agent.api.ScaleVmCommand) PingTestCommand(com.cloud.agent.api.PingTestCommand) BackupSnapshotCommand(com.cloud.agent.api.BackupSnapshotCommand) GetVmVncTicketCommand(com.cloud.agent.api.GetVmVncTicketCommand) DestroyCommand(com.cloud.agent.api.storage.DestroyCommand) UnregisterVMCommand(com.cloud.agent.api.UnregisterVMCommand) NetworkUsageCommand(com.cloud.agent.api.NetworkUsageCommand) AttachIsoCommand(com.cloud.agent.api.AttachIsoCommand) GetVmStatsCommand(com.cloud.agent.api.GetVmStatsCommand) StopCommand(com.cloud.agent.api.StopCommand) DeleteVMSnapshotCommand(com.cloud.agent.api.DeleteVMSnapshotCommand) StorageSubSystemCommand(org.apache.cloudstack.storage.command.StorageSubSystemCommand) PrepareForMigrationCommand(com.cloud.agent.api.PrepareForMigrationCommand) ReadyCommand(com.cloud.agent.api.ReadyCommand) GetVmIpAddressCommand(com.cloud.agent.api.GetVmIpAddressCommand) UpgradeSnapshotCommand(com.cloud.agent.api.UpgradeSnapshotCommand) PropertyMapDynamicBean(com.cloud.utils.mgmt.PropertyMapDynamicBean) CheckOnHostCommand(com.cloud.agent.api.CheckOnHostCommand) RebootCommand(com.cloud.agent.api.RebootCommand) MigrateWithStorageCommand(com.cloud.agent.api.MigrateWithStorageCommand) CheckSshCommand(com.cloud.agent.api.check.CheckSshCommand) StartCommand(com.cloud.agent.api.StartCommand) GetStoragePoolCapabilitiesCommand(com.cloud.agent.api.GetStoragePoolCapabilitiesCommand) RevertToVMSnapshotCommand(com.cloud.agent.api.RevertToVMSnapshotCommand) PrimaryStorageDownloadCommand(com.cloud.agent.api.storage.PrimaryStorageDownloadCommand) CopyVolumeCommand(com.cloud.agent.api.storage.CopyVolumeCommand) NetworkElementCommand(com.cloud.agent.api.routing.NetworkElementCommand) ValidateVcenterDetailsCommand(com.cloud.agent.api.ValidateVcenterDetailsCommand) GetHostStatsCommand(com.cloud.agent.api.GetHostStatsCommand) CreateVMSnapshotCommand(com.cloud.agent.api.CreateVMSnapshotCommand) GetVmNetworkStatsCommand(com.cloud.agent.api.GetVmNetworkStatsCommand) MigrateVmToPoolCommand(com.cloud.agent.api.MigrateVmToPoolCommand) SetupPersistentNetworkCommand(com.cloud.agent.api.SetupPersistentNetworkCommand) ReplugNicCommand(com.cloud.agent.api.ReplugNicCommand) ModifySshKeysCommand(com.cloud.agent.api.ModifySshKeysCommand) CreatePrivateTemplateFromSnapshotCommand(com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand) ValidateSnapshotCommand(com.cloud.agent.api.ValidateSnapshotCommand) UnPlugNicCommand(com.cloud.agent.api.UnPlugNicCommand) PlugNicCommand(com.cloud.agent.api.PlugNicCommand) MaintainCommand(com.cloud.agent.api.MaintainCommand) PvlanSetupCommand(com.cloud.agent.api.PvlanSetupCommand) SetupCommand(com.cloud.agent.api.SetupCommand) Date(java.util.Date) ModifyStoragePoolCommand(com.cloud.agent.api.ModifyStoragePoolCommand) GetStorageStatsCommand(com.cloud.agent.api.GetStorageStatsCommand) ConnectException(java.net.ConnectException) IOException(java.io.IOException) RemoteException(java.rmi.RemoteException) InternalErrorException(com.cloud.exception.InternalErrorException) CloudException(com.cloud.exception.CloudException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ConfigurationException(javax.naming.ConfigurationException) UnregisterNicCommand(com.cloud.agent.api.UnregisterNicCommand) SetupPersistentNetworkAnswer(com.cloud.agent.api.SetupPersistentNetworkAnswer) ModifyTargetsAnswer(com.cloud.agent.api.ModifyTargetsAnswer) MigrateVmToPoolAnswer(com.cloud.agent.api.MigrateVmToPoolAnswer) GetVncPortAnswer(com.cloud.agent.api.GetVncPortAnswer) ManageSnapshotAnswer(com.cloud.agent.api.ManageSnapshotAnswer) CreatePrivateTemplateAnswer(com.cloud.agent.api.storage.CreatePrivateTemplateAnswer) GetVmVncTicketAnswer(com.cloud.agent.api.GetVmVncTicketAnswer) ModifyStoragePoolAnswer(com.cloud.agent.api.ModifyStoragePoolAnswer) MigrateVolumeAnswer(com.cloud.agent.api.storage.MigrateVolumeAnswer) GetVolumeStatsAnswer(com.cloud.agent.api.GetVolumeStatsAnswer) SetupAnswer(com.cloud.agent.api.SetupAnswer) GetVmStatsAnswer(com.cloud.agent.api.GetVmStatsAnswer) GetVmNetworkStatsAnswer(com.cloud.agent.api.GetVmNetworkStatsAnswer) StopAnswer(com.cloud.agent.api.StopAnswer) NetworkUsageAnswer(com.cloud.agent.api.NetworkUsageAnswer) Answer(com.cloud.agent.api.Answer) UnPlugNicAnswer(com.cloud.agent.api.UnPlugNicAnswer) CheckOnHostAnswer(com.cloud.agent.api.CheckOnHostAnswer) CheckHealthAnswer(com.cloud.agent.api.CheckHealthAnswer) RevertToVMSnapshotAnswer(com.cloud.agent.api.RevertToVMSnapshotAnswer) CopyVolumeAnswer(com.cloud.agent.api.storage.CopyVolumeAnswer) AttachIsoAnswer(com.cloud.agent.api.AttachIsoAnswer) CreateVMSnapshotAnswer(com.cloud.agent.api.CreateVMSnapshotAnswer) DeleteVMSnapshotAnswer(com.cloud.agent.api.DeleteVMSnapshotAnswer) MaintainAnswer(com.cloud.agent.api.MaintainAnswer) GetHostStatsAnswer(com.cloud.agent.api.GetHostStatsAnswer) CheckSshAnswer(com.cloud.agent.api.check.CheckSshAnswer) RebootAnswer(com.cloud.agent.api.RebootAnswer) GetStoragePoolCapabilitiesAnswer(com.cloud.agent.api.GetStoragePoolCapabilitiesAnswer) PrimaryStorageDownloadAnswer(com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer) StartAnswer(com.cloud.agent.api.StartAnswer) GetStorageStatsAnswer(com.cloud.agent.api.GetStorageStatsAnswer) MigrateAnswer(com.cloud.agent.api.MigrateAnswer) CreateVolumeFromSnapshotAnswer(com.cloud.agent.api.CreateVolumeFromSnapshotAnswer) CheckNetworkAnswer(com.cloud.agent.api.CheckNetworkAnswer) ReplugNicAnswer(com.cloud.agent.api.ReplugNicAnswer) PlugNicAnswer(com.cloud.agent.api.PlugNicAnswer) ScaleVmAnswer(com.cloud.agent.api.ScaleVmAnswer) MigrateWithStorageAnswer(com.cloud.agent.api.MigrateWithStorageAnswer) ResizeVolumeAnswer(com.cloud.agent.api.storage.ResizeVolumeAnswer) BackupSnapshotAnswer(com.cloud.agent.api.BackupSnapshotAnswer) CheckVirtualMachineAnswer(com.cloud.agent.api.CheckVirtualMachineAnswer) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) ValidateSnapshotAnswer(com.cloud.agent.api.ValidateSnapshotAnswer) ReadyAnswer(com.cloud.agent.api.ReadyAnswer) PrepareUnmanageVMInstanceAnswer(com.cloud.agent.api.PrepareUnmanageVMInstanceAnswer) PrepareForMigrationAnswer(com.cloud.agent.api.PrepareForMigrationAnswer) GetVmDiskStatsAnswer(com.cloud.agent.api.GetVmDiskStatsAnswer) GetVncPortCommand(com.cloud.agent.api.GetVncPortCommand) ModifyTargetsCommand(com.cloud.agent.api.ModifyTargetsCommand) CreatePrivateTemplateFromVolumeCommand(com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand) CheckVirtualMachineCommand(com.cloud.agent.api.CheckVirtualMachineCommand) CheckHealthCommand(com.cloud.agent.api.CheckHealthCommand)

Example 4 with GetUnmanagedInstancesCommand

use of com.cloud.agent.api.GetUnmanagedInstancesCommand in project cloudstack by apache.

the class UnmanagedVMsManagerImpl method importUnmanagedInstance.

@Override
public UserVmResponse importUnmanagedInstance(ImportUnmanagedInstanceCmd cmd) {
    final Account caller = CallContext.current().getCallingAccount();
    if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
        throw new PermissionDeniedException(String.format("Cannot perform this operation, Calling account is not root admin: %s", caller.getUuid()));
    }
    final Long clusterId = cmd.getClusterId();
    if (clusterId == null) {
        throw new InvalidParameterValueException(String.format("Cluster ID cannot be null"));
    }
    final Cluster cluster = clusterDao.findById(clusterId);
    if (cluster == null) {
        throw new InvalidParameterValueException(String.format("Cluster ID: %d cannot be found", clusterId));
    }
    if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) {
        throw new InvalidParameterValueException(String.format("VM import is currently not supported for hypervisor: %s", cluster.getHypervisorType().toString()));
    }
    final DataCenter zone = dataCenterDao.findById(cluster.getDataCenterId());
    final String instanceName = cmd.getName();
    if (StringUtils.isEmpty(instanceName)) {
        throw new InvalidParameterValueException(String.format("Instance name cannot be empty"));
    }
    if (cmd.getDomainId() != null && StringUtils.isEmpty(cmd.getAccountName())) {
        throw new InvalidParameterValueException("domainid parameter must be specified with account parameter");
    }
    final Account owner = accountService.getActiveAccountById(cmd.getEntityOwnerId());
    long userId = CallContext.current().getCallingUserId();
    List<UserVO> userVOs = userDao.listByAccount(owner.getAccountId());
    if (CollectionUtils.isNotEmpty(userVOs)) {
        userId = userVOs.get(0).getId();
    }
    VMTemplateVO template = null;
    final Long templateId = cmd.getTemplateId();
    if (templateId == null) {
        template = templateDao.findByName(VM_IMPORT_DEFAULT_TEMPLATE_NAME);
        if (template == null) {
            template = createDefaultDummyVmImportTemplate();
            if (template == null) {
                throw new InvalidParameterValueException(String.format("Default VM import template with unique name: %s for hypervisor: %s cannot be created. Please use templateid paramter for import", VM_IMPORT_DEFAULT_TEMPLATE_NAME, cluster.getHypervisorType().toString()));
            }
        }
    } else {
        template = templateDao.findById(templateId);
    }
    if (template == null) {
        throw new InvalidParameterValueException(String.format("Template ID: %d cannot be found", templateId));
    }
    final Long serviceOfferingId = cmd.getServiceOfferingId();
    if (serviceOfferingId == null) {
        throw new InvalidParameterValueException(String.format("Service offering ID cannot be null"));
    }
    final ServiceOfferingVO serviceOffering = serviceOfferingDao.findById(serviceOfferingId);
    if (serviceOffering == null) {
        throw new InvalidParameterValueException(String.format("Service offering ID: %d cannot be found", serviceOfferingId));
    }
    accountService.checkAccess(owner, serviceOffering, zone);
    try {
        resourceLimitService.checkResourceLimit(owner, Resource.ResourceType.user_vm, 1);
    } catch (ResourceAllocationException e) {
        LOGGER.error(String.format("VM resource allocation error for account: %s", owner.getUuid()), e);
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("VM resource allocation error for account: %s. %s", owner.getUuid(), StringUtils.defaultString(e.getMessage())));
    }
    String displayName = cmd.getDisplayName();
    if (StringUtils.isEmpty(displayName)) {
        displayName = instanceName;
    }
    String hostName = cmd.getHostName();
    if (StringUtils.isEmpty(hostName)) {
        if (!NetUtils.verifyDomainNameLabel(instanceName, true)) {
            throw new InvalidParameterValueException(String.format("Please provide hostname for the VM. VM name contains unsupported characters for it to be used as hostname"));
        }
        hostName = instanceName;
    }
    if (!NetUtils.verifyDomainNameLabel(hostName, true)) {
        throw new InvalidParameterValueException("Invalid VM hostname. VM hostname can contain ASCII letters 'a' through 'z', the digits '0' through '9', " + "and the hyphen ('-'), must be between 1 and 63 characters long, and can't start or end with \"-\" and can't start with digit");
    }
    if (cluster.getHypervisorType().equals(Hypervisor.HypervisorType.VMware) && Boolean.parseBoolean(configurationDao.getValue(Config.SetVmInternalNameUsingDisplayName.key()))) {
        // If global config vm.instancename.flag is set to true, then CS will set guest VM's name as it appears on the hypervisor, to its hostname.
        // In case of VMware since VM name must be unique within a DC, check if VM with the same hostname already exists in the zone.
        VMInstanceVO vmByHostName = vmDao.findVMByHostNameInZone(hostName, zone.getId());
        if (vmByHostName != null && vmByHostName.getState() != VirtualMachine.State.Expunging) {
            throw new InvalidParameterValueException(String.format("Failed to import VM: %s. There already exists a VM by the hostname: %s in zone: %s", instanceName, hostName, zone.getUuid()));
        }
    }
    final Map<String, Long> nicNetworkMap = cmd.getNicNetworkList();
    final Map<String, Network.IpAddresses> nicIpAddressMap = cmd.getNicIpAddressList();
    final Map<String, Long> dataDiskOfferingMap = cmd.getDataDiskToDiskOfferingList();
    final Map<String, String> details = cmd.getDetails();
    final boolean forced = cmd.isForced();
    List<HostVO> hosts = resourceManager.listHostsInClusterByStatus(clusterId, Status.Up);
    UserVm userVm = null;
    List<String> additionalNameFilters = getAdditionalNameFilters(cluster);
    for (HostVO host : hosts) {
        if (host.isInMaintenanceStates()) {
            continue;
        }
        List<String> managedVms = new ArrayList<>();
        managedVms.addAll(additionalNameFilters);
        managedVms.addAll(getHostManagedVms(host));
        GetUnmanagedInstancesCommand command = new GetUnmanagedInstancesCommand(instanceName);
        command.setManagedInstancesNames(managedVms);
        Answer answer = agentManager.easySend(host.getId(), command);
        if (!(answer instanceof GetUnmanagedInstancesAnswer)) {
            continue;
        }
        GetUnmanagedInstancesAnswer unmanagedInstancesAnswer = (GetUnmanagedInstancesAnswer) answer;
        HashMap<String, UnmanagedInstanceTO> unmanagedInstances = unmanagedInstancesAnswer.getUnmanagedInstances();
        if (MapUtils.isEmpty(unmanagedInstances)) {
            continue;
        }
        Set<String> names = unmanagedInstances.keySet();
        for (String name : names) {
            if (instanceName.equals(name)) {
                UnmanagedInstanceTO unmanagedInstance = unmanagedInstances.get(name);
                if (unmanagedInstance == null) {
                    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Unable to retrieve details for unmanaged VM: %s", name));
                }
                if (template.getName().equals(VM_IMPORT_DEFAULT_TEMPLATE_NAME)) {
                    String osName = unmanagedInstance.getOperatingSystem();
                    GuestOS guestOS = null;
                    if (StringUtils.isNotEmpty(osName)) {
                        guestOS = guestOSDao.listByDisplayName(osName);
                    }
                    GuestOSHypervisor guestOSHypervisor = null;
                    if (guestOS != null) {
                        guestOSHypervisor = guestOSHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion());
                    }
                    if (guestOSHypervisor == null && StringUtils.isNotEmpty(unmanagedInstance.getOperatingSystemId())) {
                        guestOSHypervisor = guestOSHypervisorDao.findByOsNameAndHypervisor(unmanagedInstance.getOperatingSystemId(), host.getHypervisorType().toString(), host.getHypervisorVersion());
                    }
                    if (guestOSHypervisor == null) {
                        if (guestOS != null) {
                            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Unable to find hypervisor guest OS ID: %s details for unmanaged VM: %s for hypervisor: %s version: %s. templateid parameter can be used to assign template for VM", guestOS.getUuid(), name, host.getHypervisorType().toString(), host.getHypervisorVersion()));
                        }
                        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Unable to retrieve guest OS details for unmanaged VM: %s with OS name: %s, OS ID: %s for hypervisor: %s version: %s. templateid parameter can be used to assign template for VM", name, osName, unmanagedInstance.getOperatingSystemId(), host.getHypervisorType().toString(), host.getHypervisorVersion()));
                    }
                    template.setGuestOSId(guestOSHypervisor.getGuestOsId());
                }
                userVm = importVirtualMachineInternal(unmanagedInstance, instanceName, zone, cluster, host, template, displayName, hostName, caller, owner, userId, serviceOffering, dataDiskOfferingMap, nicNetworkMap, nicIpAddressMap, details, cmd.getMigrateAllowed(), forced);
                break;
            }
        }
        if (userVm != null) {
            break;
        }
    }
    if (userVm == null) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to find unmanaged vm with name: %s in cluster: %s", instanceName, cluster.getUuid()));
    }
    return responseGenerator.createUserVmResponse(ResponseObject.ResponseView.Full, "virtualmachine", userVm).get(0);
}
Also used : Account(com.cloud.user.Account) VMTemplateVO(com.cloud.storage.VMTemplateVO) ArrayList(java.util.ArrayList) ServiceOfferingVO(com.cloud.service.ServiceOfferingVO) GetUnmanagedInstancesCommand(com.cloud.agent.api.GetUnmanagedInstancesCommand) UserVm(com.cloud.uservm.UserVm) ServerApiException(org.apache.cloudstack.api.ServerApiException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) GuestOS(com.cloud.storage.GuestOS) ResourceAllocationException(com.cloud.exception.ResourceAllocationException) Cluster(com.cloud.org.Cluster) VMInstanceVO(com.cloud.vm.VMInstanceVO) HostVO(com.cloud.host.HostVO) Answer(com.cloud.agent.api.Answer) GetUnmanagedInstancesAnswer(com.cloud.agent.api.GetUnmanagedInstancesAnswer) PrepareUnmanageVMInstanceAnswer(com.cloud.agent.api.PrepareUnmanageVMInstanceAnswer) GuestOSHypervisor(com.cloud.storage.GuestOSHypervisor) DataCenter(com.cloud.dc.DataCenter) UserVO(com.cloud.user.UserVO) PermissionDeniedException(com.cloud.exception.PermissionDeniedException)

Aggregations

Answer (com.cloud.agent.api.Answer)4 GetUnmanagedInstancesAnswer (com.cloud.agent.api.GetUnmanagedInstancesAnswer)4 GetUnmanagedInstancesCommand (com.cloud.agent.api.GetUnmanagedInstancesCommand)4 PrepareUnmanageVMInstanceAnswer (com.cloud.agent.api.PrepareUnmanageVMInstanceAnswer)3 HostVO (com.cloud.host.HostVO)3 Account (com.cloud.user.Account)3 ArrayList (java.util.ArrayList)3 DataCenter (com.cloud.dc.DataCenter)2 ServiceOfferingVO (com.cloud.service.ServiceOfferingVO)2 VMTemplateVO (com.cloud.storage.VMTemplateVO)2 UserVO (com.cloud.user.UserVO)2 UserVm (com.cloud.uservm.UserVm)2 VMInstanceVO (com.cloud.vm.VMInstanceVO)2 AttachIsoAnswer (com.cloud.agent.api.AttachIsoAnswer)1 AttachIsoCommand (com.cloud.agent.api.AttachIsoCommand)1 BackupSnapshotAnswer (com.cloud.agent.api.BackupSnapshotAnswer)1 BackupSnapshotCommand (com.cloud.agent.api.BackupSnapshotCommand)1 CheckHealthAnswer (com.cloud.agent.api.CheckHealthAnswer)1 CheckHealthCommand (com.cloud.agent.api.CheckHealthCommand)1 CheckNetworkAnswer (com.cloud.agent.api.CheckNetworkAnswer)1