CLOUDSTACK-6452: Failed to Live Migrate VM across clusters with Xenserver 6.2.5.

This commit is contained in:
Sanjay Tripathi 2014-04-25 16:36:40 +05:30
parent 42b5e1858c
commit cf4db845ff
1 changed files with 10 additions and 7 deletions

View File

@ -60,6 +60,7 @@ import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.api.to.VolumeTO;
import com.cloud.network.Networks.TrafficType;
import com.cloud.resource.ServerResource;
import com.cloud.storage.Volume;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.VirtualMachine.State;
@ -110,13 +111,15 @@ public class XenServer610Resource extends XenServer602Resource {
}
for (DiskTO volumeTo : volumes) {
VolumeObjectTO vol = (VolumeObjectTO)volumeTo.getData();
Long deviceId = volumeTo.getDiskSeq();
VDI vdi = deviceIdToVdiMap.get(deviceId.toString());
VolumeObjectTO newVol = new VolumeObjectTO();
newVol.setPath(vdi.getUuid(connection));
newVol.setId(vol.getId());
volumeToList.add(newVol);
if (volumeTo.getType() != Volume.Type.ISO) {
VolumeObjectTO vol = (VolumeObjectTO)volumeTo.getData();
Long deviceId = volumeTo.getDiskSeq();
VDI vdi = deviceIdToVdiMap.get(deviceId.toString());
VolumeObjectTO newVol = new VolumeObjectTO();
newVol.setPath(vdi.getUuid(connection));
newVol.setId(vol.getId());
volumeToList.add(newVol);
}
}
} catch (Exception e) {
s_logger.error("Unable to get the updated VDI paths of the migrated vm " + e.toString(), e);