fix multiple data disks booting issue on windows vm

This commit is contained in:
Edison Su 2012-01-13 18:36:53 -08:00
parent 1d352f1e2c
commit 15b57e6974
1 changed files with 8 additions and 0 deletions

View File

@ -2375,6 +2375,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
}
protected void createVbd(Connect conn, VirtualMachineTO vmSpec, String vmName, LibvirtVMDef vm) throws InternalErrorException, LibvirtException, URISyntaxException{
List<DiskDef> disks = new ArrayList<DiskDef>();
for (VolumeTO volume : vmSpec.getDisks()) {
KVMPhysicalDisk physicalDisk = null;
KVMStoragePool pool = null;
@ -2415,12 +2416,19 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusType, DiskDef.diskFmtType.QCOW2);
}
}
disks.add(devId, disk);
continue;
}
vm.getDevices().addDevice(disk);
}
for (DiskDef disk : disks) {
vm.getDevices().addDevice(disk);
}
if (vmSpec.getType() != VirtualMachine.Type.User) {
if (_sysvmISOPath != null) {
DiskDef iso = new DiskDef();