dansoar66
Contributor
Contributor

storage vmotion with vro fails

hello I am retreiving an storage vmotion script in vro but this WF does not work because of incompatibility  between vsan and the linked clone disk format

the vm is a linked clone with a sesparceformat disk format and this format is incompatible with vSan

the action to build the relocateSpec is bellow

in line 25 the diskformat member of the backing is sent to the relocateSpec

can some one help me to find the way to change the value of the property backing.diskformat to "redologFormat

this will allow the storage vmotion

try {

// get the profile spec

System.warn(pbmPolicy);

System.log(vm.sdkConnection.name);

var vmDefinedProfileSpec = new VcVirtualMachineDefinedProfileSpec(pbmPolicy,null,null);

var profileSpecs = [vmDefinedProfileSpec];

System.log(profileSpecs);

//simpleCheckParams();

System.warn(datastore.name)

var relocateSpec = new VcVirtualMachineRelocateSpec();

relocateSpec.datastore = datastore.reference;

// spec for the vm home

relocateSpec.profile = profileSpecs;

// spec for the disks

System.warn(vm.name);

var devices = vm.config.hardware.device;

var relocateSpecDiskLocators = [];

for (var i in devices) {

  if ( devices[i] instanceof VcVirtualDisk) {

   // create the relocator

   var relocateSpecDiskLocator = new VcVirtualMachineRelocateSpecDiskLocator();

   relocateSpecDiskLocator.datastore = datastore;

   System.log(devices[i].backing.deltaDiskFormat);

   relocateSpecDiskLocator.diskBackingInfo = devices[i].backing;

   relocateSpecDiskLocator.diskId = devices[i].key;

   relocateSpecDiskLocator.profile = profileSpecs;

   // add to array

   relocateSpecDiskLocators.push(relocateSpecDiskLocator);

  }

}

// add to relocatespec

relocateSpec.disk = relocateSpecDiskLocators;

}

catch (ex) {

throw "Unable to create VcVirtualMachineRelocateSpec: " + ex;

}

0 Kudos
0 Replies