Skip to content

Commit ec228e9

Browse files
authored
Merge pull request #809 from sjyu1/ablestack-europa
디스크연결 오류 수정
2 parents 6617228 + eb68c48 commit ec228e9

2 files changed

Lines changed: 9 additions & 34 deletions

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ protected synchronized void attachOrDetachDisk(final Connect conn, final boolean
14551455
throws LibvirtException, InternalErrorException {
14561456
attachOrDetachDisk(conn, attach, vmName, attachingDisk, devId, serial, bytesReadRate, bytesReadRateMax, bytesReadRateMaxLength,
14571457
bytesWriteRate, bytesWriteRateMax, bytesWriteRateMaxLength, iopsReadRate, iopsReadRateMax, iopsReadRateMaxLength, iopsWriteRate,
1458-
iopsWriteRateMax, iopsWriteRateMaxLength, cacheMode, encryptDetails, provider, krbdpath, shareable, kvdoEnable, details, controllerInfo);
1458+
iopsWriteRateMax, iopsWriteRateMaxLength, cacheMode, encryptDetails, provider, krbdpath, shareable, kvdoEnable, 0l, details, controllerInfo);
14591459
}
14601460

14611461
/**

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9891,11 +9891,6 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
98919891
throw new CloudRuntimeException("Create instance from backup is not supported for this provider.");
98929892
}
98939893

9894-
BackupProvider backupProvider = backupManager.getBackupProviderForOffering(backup.getBackupOfferingId());
9895-
if (backupProvider != null && "bx".equalsIgnoreCase(backupProvider.getName())) {
9896-
throw new CloudRuntimeException("Create instance from backup is not supported for this provider.");
9897-
}
9898-
98999894
DataCenter targetZone = _dcDao.findById(cmd.getZoneId());
99009895
if (targetZone == null) {
99019896
throw new InvalidParameterValueException("Unable to find zone by id=" + cmd.getZoneId());
@@ -10046,13 +10041,6 @@ public UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnav
1004610041
additonalParams.put(VirtualMachineProfile.Param.ReturnAfterVolumePrepare, true);
1004710042

1004810043
try {
10049-
BackupVO backup = backupDao.findById(cmd.getBackupId());
10050-
BackupProvider backupProvider = backupManager.getBackupProviderForOffering(backup.getBackupOfferingId());
10051-
if (backupProvider != null && "bx".equalsIgnoreCase(backupProvider.getName())) {
10052-
vm = _vmDao.findById(vmId);
10053-
return vm;
10054-
}
10055-
1005610044
Pair<UserVmVO, Map<VirtualMachineProfile.Param, Object>> vmParamPair = null;
1005710045
vmParamPair = startVirtualMachine(vmId, null, null, null, additonalParams, null);
1005810046
vm = vmParamPair.first();
@@ -11032,27 +11020,14 @@ public Pair<Boolean, String> restoreVMFromBxBackup(CreateVMFromBxBackupCmd cmd)
1103211020
}
1103311021

1103411022
BackupProvider backupProvider = backupManager.getBackupProviderForOffering(backup.getBackupOfferingId());
11035-
if (backupProvider != null && "bx".equalsIgnoreCase(backupProvider.getName())) {
11036-
Pair<Boolean, String> result = backupProvider.restoreBackupToVM(cmd.getBackupId(), cmd.getName());
11037-
logger.debug(">>>restoreVMFromBxBackup result: {}", result);
11038-
if (result == null || !Boolean.TRUE.equals(result.first())) {
11039-
if (result != null && StringUtils.isNotEmpty(result.second())) {
11040-
throw new CloudRuntimeException(String.format("Failed to create Instance from backup %s using bx provider. Error: %s", backup.getUuid(), result.second()));
11041-
}
11042-
throw new CloudRuntimeException(String.format("Failed to create Instance from backup %s using bx provider.", backup.getUuid()));
11043-
}
11044-
11045-
// logger.debug(">>>allocateVMFromBackup cmd.getName: {}", cmd.getName());
11046-
// VMInstanceVO vmInstance = _vmInstanceDao.findVMByInstanceName(cmd.getName());
11047-
// logger.debug(">>>allocateVMFromBackup vmInstance: {}", vmInstance);
11048-
// UserVm vm = (UserVm) vmInstance;
11049-
// logger.debug(">>>allocateVMFromBackup vm: {}", vm);
11050-
// if (vm == null) {
11051-
// throw new CloudRuntimeException(String.format("Unable to find restored Instance created from backup %s using bx provider.", backup.getUuid()));
11052-
// }
11053-
return result;
11054-
} else {
11055-
throw new CloudRuntimeException("Create instance from backup is not supported for this provider.");
11023+
Pair<Boolean, String> result = backupProvider.restoreBackupToVM(cmd.getBackupId(), cmd.getName());
11024+
if (result == null || !Boolean.TRUE.equals(result.first())) {
11025+
if (result != null && StringUtils.isNotEmpty(result.second())) {
11026+
throw new CloudRuntimeException(String.format("Failed to create Instance from backup %s using bx provider. Error: %s", backup.getUuid(), result.second()));
11027+
}
11028+
throw new CloudRuntimeException(String.format("Failed to create Instance from backup %s using bx provider.", backup.getUuid()));
1105611029
}
11030+
11031+
return result;
1105711032
}
1105811033
}

0 commit comments

Comments
 (0)