Skip to content

Commit 6b098ce

Browse files
committed
Minor bug fix in UserVmManagerImpl
1 parent 17ecc5a commit 6b098ce

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9096,6 +9096,7 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
90969096
}
90979097
}
90989098

9099+
Long size = null;
90999100
Long diskOfferingId = cmd.getDiskOfferingId();
91009101
if (diskOfferingId != null) {
91019102
if (!isIso) {
@@ -9119,6 +9120,7 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
91199120
}
91209121
diskOfferingId = rootDiskOfferingInfo.getDiskOffering().getId();
91219122
updateDetailsWithRootDiskAttributes(cmd.getDetails(), rootDiskOfferingInfo);
9123+
size = rootDiskOfferingInfo.getSize();
91229124
}
91239125

91249126
if (!isIso && overrideDiskOfferingId == null) {
@@ -9190,7 +9192,9 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
91909192

91919193
String name = cmd.getName();
91929194
String displayName = cmd.getDisplayName();
9193-
Long size = cmd.getSize();
9195+
if (size == null) {
9196+
size = cmd.getSize();
9197+
}
91949198
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap();
91959199
List<String> sshKeyPairs = new ArrayList<String>();
91969200
String ipAddress = cmd.getIpAddress();

ui/src/components/view/DeployVMFromBackup.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,17 +2257,15 @@ export default {
22572257
this.form.startvm = true
22582258
this.selectedZone = this.zoneId
22592259
this.form.zoneid = this.zoneId
2260+
this.form.clusterid = undefined
2261+
this.form.podid = undefined
2262+
this.form.hostid = undefined
22602263
this.form.templateid = undefined
22612264
this.form.isoid = undefined
2262-
2263-
if (this.dataPreFill.isIso) {
2264-
this.tabKey = 'isoid'
2265-
} else if (this.isoId) {
2265+
this.tabKey = 'templateid'
2266+
if (this.isoId) {
22662267
this.tabKey = 'isoid'
2267-
} else {
2268-
this.tabKey = 'templateid'
22692268
}
2270-
22712269
_.each(this.params, (param, name) => {
22722270
if (this.networkId && name === 'networks') {
22732271
param.options = {

ui/src/views/storage/CreateVMFromBackup.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export default {
132132
type: volume.type,
133133
diskofferingid: this.diskofferingids[index]
134134
})).filter(volume => volume.type === 'ROOT')
135+
if (this.dataPreFill.isIso) {
136+
this.dataPreFill.diskofferingid = rootdisksdetails[0].diskofferingid
137+
this.dataPreFill.size = rootdisksdetails[0].size
138+
}
135139
if (this.serviceOffering.diskofferingid === rootdisksdetails[0].diskofferingid || this.dataPreFill.isIso) {
136140
this.dataPreFill.overridediskoffering = false
137141
} else {

0 commit comments

Comments
 (0)