cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tutkowski, Mike" <>
Subject Re: Cannot migrate VMware VM with root disk to host in different cluster (CloudStack 4.10)
Date Thu, 23 Mar 2017 13:47:01 GMT
This looks a little suspicious to me (in VmwareResource before we call VirtualMachineMO.changeDatastore):

                morDsAtTarget = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(tgtHyperHost,
                morDsAtSource = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost,
                if (morDsAtTarget == null) {
                    String msg = "Unable to find the target datastore: " + filerTo.getUuid()
+ " on target host: " + tgtHyperHost.getHyperHostName() + " to execute MigrateWithStorageCommand";
                    throw new Exception(msg);

We use filerTo.getUuid() when trying to get a pointer to both the target and source datastores.
Since filerTo.getUuid() has the UUID for the target datastore, that works for morDsAtTarget,
but morDsAtSource ends up being null.

For some reason, we only check if morDsAtTarget is null (I’m not sure why we don’t check
if morDsAtSource is null, too).

On 3/23/17, 7:31 AM, "Tutkowski, Mike" <> wrote:

    The CloudStack API that the GUI is invoking is migrateVirtualMachineWithVolume (which
is expected since I’m asking to migrate a VM from a host in one cluster to a host in another
    A MigrateWithStorageCommand is sent to VmwareResource, which eventually calls VirtualMachineMO.changeDatastore.
        public boolean changeDatastore(VirtualMachineRelocateSpec relocateSpec) throws Exception
            ManagedObjectReference morTask = _context.getVimClient().getService().relocateVMTask(_mor,
relocateSpec, VirtualMachineMovePriority.DEFAULT_PRIORITY);
            boolean result = _context.getVimClient().waitForTask(morTask);
            if (result) {
                return true;
            } else {
                s_logger.error("VMware RelocateVM_Task to change datastore failed due to "
+ TaskMO.getTaskFailureInfo(_context, morTask));
            return false;
    The parameter, VirtualMachineRelocateSpec, looks like this: (datastore-66 is the target datastore)
    The following error message is returned:
    Required property datastore is missing from data object of type VirtualMachineRelocateSpecDiskLocator
    while parsing serialized DataObject of type vim.vm.RelocateSpec.DiskLocator
    at line 1, column 327
    while parsing property "disk" of static type ArrayOfVirtualMachineRelocateSpecDiskLocator
    while parsing serialized DataObject of type vim.vm.RelocateSpec
    at line 1, column 187
    while parsing call information for method RelocateVM_Task
    at line 1, column 110
    while parsing SOAP body
    at line 1, column 102
    while parsing SOAP envelope
    at line 1, column 38
    while parsing HTTP request for method relocate
    on object of type vim.VirtualMachine
    at line 1, column 0
    On 3/22/17, 11:50 PM, "Sergey Levitskiy" <> wrote:
        Can you trace which API call being used and what parameters were specified? migrateVirtualMachineWithVolumeAttempts
vs migrateVirtualMachine

View raw message