Skip to content

Commit 0bb73af

Browse files
authored
Merge pull request #656 from jschoiRR/mold-main#2025
[Mold API] 복제기능 오류 수정(2개 이상 데이터디스크를 붙일 경우 에러), 볼륨 생성시 DeviceId 값 지정 추가
2 parents 67a8241 + b3c16f1 commit 0bb73af

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5937,7 +5937,7 @@ private LicenseCheckerResponse checkLicense(HostVO host) {
59375937
// "License error for host " + host.getName(),
59385938
// "License check failed: " + errorMessage
59395939
// );
5940-
} else {
5940+
} else {
59415941
boolean isExpired = jsonNode.get("expiry_date").asBoolean();
59425942
boolean isIssued = jsonNode.get("issued_date").asBoolean();
59435943
String expiryDateStr = jsonNode.get("expired").asText();
@@ -5987,7 +5987,7 @@ private LicenseCheckerResponse checkLicense(HostVO host) {
59875987
connection.disconnect();
59885988
}
59895989
}
5990-
return response;
5990+
return response;
59915991
} catch (Exception e) {
59925992
logger.error("Error checking license for host: " + host.getId(), e);
59935993
throw new CloudRuntimeException("라이선스 체크 실패: " + e.getMessage());

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9864,7 +9864,7 @@ public Optional<UserVm> cloneVirtualMachine(CloneVMCmd cmd) throws ResourceAlloc
98649864
_snapshotDao.update(snapVO.getId(), snapVO);
98659865
}
98669866
VolumeVO newVol = cloneVolumeFromSnapToDB(curVmAccount, true, zoneId, diskOfferingId, provisioningType, size, minIops, maxIops, parentRootVolume, rootVolumeName,
9867-
_uuidMgr.generateUuid(Volume.class, null), new HashMap<>(), Volume.Type.ROOT);
9867+
_uuidMgr.generateUuid(Volume.class, null), new HashMap<>(), Volume.Type.ROOT, 0L);
98689868
VolumeVO rootVolume = (VolumeVO) _volumeService.cloneVolumeFromSnapshot(newVol, snapVO.getId(), curVm.getId());
98699869
if (rootVolume == null) {
98709870
throw new CloudRuntimeException("Creation of root volume is not queried. The virtual machine cannot be cloned!");
@@ -9907,16 +9907,13 @@ public Optional<UserVm> cloneVirtualMachine(CloneVMCmd cmd) throws ResourceAlloc
99079907
VolumeVO newDataDiskVol = null;
99089908
try {
99099909
newDataDiskVol = cloneVolumeFromSnapToDB(curVmAccount, true, zoneId, diskOfferingId, provisioningType, size, minIops, maxIops, parentDataDiskVolume, dataVolumeName,
9910-
_uuidMgr.generateUuid(Volume.class, null), new HashMap<>(), Volume.Type.DATADISK);
9910+
_uuidMgr.generateUuid(Volume.class, null), new HashMap<>(), Volume.Type.DATADISK, parentDataDiskVolume.getDeviceId());
99119911
VolumeVO dataDiskVolume = (VolumeVO) _volumeService.cloneVolumeFromSnapshot(newDataDiskVol, snapVO.getId(), curVm.getId());
99129912
if (dataDiskVolume == null) {
99139913
throw new CloudRuntimeException("Creation of root volume is not queried. The virtual machine cannot be cloned!");
99149914
}
99159915
createdVolumes.add(dataDiskVolume);
9916-
9917-
for (VolumeVO createdVol : createdVolumes) {
9918-
_volumeService.attachVolumeToVM(cmd.getEntityId(), createdVol.getId(), createdVol.getDeviceId(), false);
9919-
}
9916+
_volumeService.attachVolumeToVM(cmd.getEntityId(), dataDiskVolume.getId(), dataDiskVolume.getDeviceId(), false);
99209917
} catch (CloudRuntimeException e){
99219918
logger.warn("data disk process failed during clone, clearing the temporary resources...");
99229919
for (VolumeVO dataDiskToClear : createdVolumes) {
@@ -10033,7 +10030,7 @@ public UserVm createCloneVM(CloneVMCmd cmd, Long rootVolumeId) throws Concurrent
1003310030
private VolumeVO cloneVolumeFromSnapToDB(final Account owner, final Boolean displayVolume, final Long zoneId, final Long diskOfferingId,
1003410031
final Storage.ProvisioningType provisioningType, final Long size, final Long minIops, final Long maxIops,
1003510032
final VolumeVO parentVolume, final String volumeName, final String uuid, final Map<String, String> details,
10036-
Volume.Type volType) {
10033+
Volume.Type volType, final Long deviceId) {
1003710034
return Transaction.execute((TransactionCallback<VolumeVO>) status -> {
1003810035
VolumeVO volume = new VolumeVO(volumeName, -1, -1, -1, -1, Long.valueOf(-1), null, null, provisioningType, 0, volType);
1003910036
volume.setPoolId(null);
@@ -10049,9 +10046,8 @@ private VolumeVO cloneVolumeFromSnapToDB(final Account owner, final Boolean disp
1004910046
volume.setInstanceId(null);
1005010047
volume.setUpdated(new Date());
1005110048
volume.setDisplayVolume(displayVolume);
10052-
if (volType == Volume.Type.ROOT) {
10053-
volume.setDeviceId(0L);
10054-
}
10049+
volume.setDeviceId(deviceId);
10050+
1005510051
if (parentVolume != null) {
1005610052
volume.setTemplateId(parentVolume.getTemplateId());
1005710053
volume.setFormat(parentVolume.getFormat());

ui/src/components/view/AnnotationsTab.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
</template>
4242
<template #actions>
4343
<a-popconfirm
44+
placement="topLeft"
4445
:title="this.$localStorage.get('LOCALE') == 'ko_KR' ?
4546
(item.adminsonly ? $t('label.annotation.everyone') : $t('label.adminsonly')) + $t('label.make') + '?' :
4647
$t('label.make') + ' ' + (item.adminsonly ? $t('label.annotation.everyone') : $t('label.adminsonly')) + '?'"
@@ -61,13 +62,14 @@
6162
</a-comment>
6263
<template #actions>
6364
<a-popconfirm
64-
:title="$t('label.remove.annotation')"
65+
placement="topRight"
66+
:title="$t('message.remove.annotation')"
6567
v-if="'removeAnnotation' in $store.getters.apis && isAdminOrAnnotationOwner(item)"
6668
key="visibility"
6769
@confirm="deleteNote(item)"
6870
:okText="$t('label.yes')"
6971
:cancelText="$t('label.no')" >
70-
<delete-two-tone shape="circle" two-tone-color="#eb2f96" />
72+
<a-button type="primary" shape="circle" danger><template #icon><delete-outlined /></template></a-button>
7173
</a-popconfirm>
7274
</template>
7375
</a-list-item>

ui/src/components/view/DetailsTab.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ export default {
427427
fetchDetails () {
428428
let details = this.$route.meta.details
429429
430-
console.log('details :>> ', details)
431430
if (!details) {
432431
return
433432
}

0 commit comments

Comments
 (0)