Search in sources :

Example 1 with ReflectionUse

use of com.cloud.utils.ReflectionUse in project cloudstack by apache.

the class VirtualMachineManagerImpl method orchestrateReconfigure.

@ReflectionUse
private Pair<JobInfo.Status, String> orchestrateReconfigure(final VmWorkReconfigure work) throws Exception {
    final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId());
    if (vm == null) {
        s_logger.info("Unable to find vm " + work.getVmId());
    }
    assert vm != null;
    final ServiceOffering newServiceOffering = _offeringDao.findById(vm.getId(), work.getNewServiceOfferingId());
    reConfigureVm(vm.getUuid(), newServiceOffering, work.isSameHost());
    return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
}
Also used : ServiceOffering(com.cloud.offering.ServiceOffering) JobInfo(org.apache.cloudstack.jobs.JobInfo) Pair(com.cloud.utils.Pair) ReflectionUse(com.cloud.utils.ReflectionUse)

Example 2 with ReflectionUse

use of com.cloud.utils.ReflectionUse in project cloudstack by apache.

the class VirtualMachineManagerImpl method orchestrateStorageMigration.

@ReflectionUse
private Pair<JobInfo.Status, String> orchestrateStorageMigration(final VmWorkStorageMigration work) throws Exception {
    final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId());
    if (vm == null) {
        s_logger.info("Unable to find vm " + work.getVmId());
    }
    assert vm != null;
    final StoragePool pool = (PrimaryDataStoreInfo) dataStoreMgr.getPrimaryDataStore(work.getDestStoragePoolId());
    orchestrateStorageMigration(vm.getUuid(), pool);
    return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
}
Also used : PrimaryDataStoreInfo(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo) StoragePool(com.cloud.storage.StoragePool) JobInfo(org.apache.cloudstack.jobs.JobInfo) Pair(com.cloud.utils.Pair) ReflectionUse(com.cloud.utils.ReflectionUse)

Example 3 with ReflectionUse

use of com.cloud.utils.ReflectionUse in project cloudstack by apache.

the class VolumeApiServiceImpl method orchestrateTakeVolumeSnapshot.

@ReflectionUse
private Pair<JobInfo.Status, String> orchestrateTakeVolumeSnapshot(VmWorkTakeVolumeSnapshot work) throws Exception {
    Account account = _accountDao.findById(work.getAccountId());
    orchestrateTakeVolumeSnapshot(work.getVolumeId(), work.getPolicyId(), work.getSnapshotId(), account, work.isQuiesceVm(), work.getLocationType());
    return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(work.getSnapshotId()));
}
Also used : Account(com.cloud.user.Account) JobInfo(org.apache.cloudstack.jobs.JobInfo) Pair(com.cloud.utils.Pair) ReflectionUse(com.cloud.utils.ReflectionUse)

Example 4 with ReflectionUse

use of com.cloud.utils.ReflectionUse in project cloudstack by apache.

the class VirtualMachineManagerImpl method orchestrateAddVmToNetwork.

@ReflectionUse
private Pair<JobInfo.Status, String> orchestrateAddVmToNetwork(final VmWorkAddVmToNetwork work) throws Exception {
    final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId());
    if (vm == null) {
        s_logger.info("Unable to find vm " + work.getVmId());
    }
    assert vm != null;
    final Network network = _networkDao.findById(work.getNetworkId());
    final NicProfile nic = orchestrateAddVmToNetwork(vm, network, work.getRequestedNicProfile());
    return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, _jobMgr.marshallResultObject(nic));
}
Also used : JobInfo(org.apache.cloudstack.jobs.JobInfo) Network(com.cloud.network.Network) Pair(com.cloud.utils.Pair) ReflectionUse(com.cloud.utils.ReflectionUse)

Aggregations

Pair (com.cloud.utils.Pair)4 ReflectionUse (com.cloud.utils.ReflectionUse)4 JobInfo (org.apache.cloudstack.jobs.JobInfo)4 Network (com.cloud.network.Network)1 ServiceOffering (com.cloud.offering.ServiceOffering)1 StoragePool (com.cloud.storage.StoragePool)1 Account (com.cloud.user.Account)1 PrimaryDataStoreInfo (org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo)1