bug 8204: mgt server needs to pass down iso info before migration, if the vm has ISO attached

status 8204: resolved fixed
This commit is contained in:
Edison Su 2011-02-02 19:11:30 -05:00
parent b12444bb64
commit 4ea260cafd
2 changed files with 24 additions and 0 deletions

View File

@ -1674,6 +1674,15 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
}
}
}
/*setup disks, e.g for iso*/
VolumeTO[] volumes = vm.getDisks();
for (VolumeTO volume : volumes) {
if (volume.getType() == Volume.VolumeType.ISO) {
getVolumePath(conn, volume);
}
}
synchronized (_vms) {
_vms.put(vm.getName(), State.Migrating);
}
@ -1683,6 +1692,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
return new PrepareForMigrationAnswer(cmd, e.toString());
} catch (InternalErrorException e) {
return new PrepareForMigrationAnswer(cmd, e.toString());
} catch (URISyntaxException e) {
return new PrepareForMigrationAnswer(cmd, e.toString());
}
}

View File

@ -2356,6 +2356,19 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
StoragePool pool = _storagePoolDao.findById(vol.getPoolId());
vm.addDisk(new VolumeTO(vol, pool));
}
if (vm.getType() == VirtualMachine.Type.User) {
UserVmVO userVM = (UserVmVO)vm.getVirtualMachine();
if (userVM.getIsoId() != null) {
Pair<String, String> isoPathPair = getAbsoluteIsoPath(userVM.getIsoId(), userVM.getDataCenterId());
if (isoPathPair != null) {
String isoPath = isoPathPair.first();
VolumeTO iso = new VolumeTO(vm.getId(), Volume.VolumeType.ISO, StorageResourceType.STORAGE_POOL, StoragePoolType.ISO, null, null, null, isoPath,
0, null, null);
vm.addDisk(iso);
}
}
}
}
@Override