@@ -1331,36 +1331,20 @@ export default {
13311331 }
13321332
13331333 this .serviceOffering = _ .find (this .options .serviceOfferings , (option ) => option .id === instanceConfig .computeofferingid )
1334- if (this .serviceOffering ? .diskofferingid ) {
1335- if (iso) {
1336- this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === this .serviceOffering .diskofferingid )
1337- } else {
1338- instanceConfig .overridediskofferingid = this .serviceOffering .diskofferingid
1339- }
1340- }
1341- if (! iso && this .diskSelected ) {
1342- this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .diskofferingid )
1343- }
1344- if (this .rootDiskSelected ? .id ) {
1345- instanceConfig .overridediskofferingid = this .rootDiskSelected .id
1346- }
1334+
1335+ instanceConfig .overridediskofferingid = this .rootDiskSelected ? .id || this .serviceOffering ? .diskofferingid
13471336 if (instanceConfig .overridediskofferingid ) {
13481337 this .overrideDiskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .overridediskofferingid )
13491338 } else {
13501339 this .overrideDiskOffering = null
13511340 }
13521341
1353- if (! iso && this .diskSelected ) {
1342+ if (iso && this .serviceOffering ? .diskofferingid ) {
1343+ this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === this .serviceOffering .diskofferingid )
1344+ } else if (! iso && this .diskSelected ) {
13541345 this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .diskofferingid )
13551346 }
1356- if (this .rootDiskSelected ? .id ) {
1357- instanceConfig .overridediskofferingid = this .rootDiskSelected .id
1358- }
1359- if (instanceConfig .overridediskofferingid ) {
1360- this .overrideDiskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .overridediskofferingid )
1361- } else {
1362- this .overrideDiskOffering = null
1363- }
1347+
13641348 this .zone = _ .find (this .options .zones , (option ) => option .id === instanceConfig .zoneid )
13651349 this .affinityGroups = _ .filter (this .options .affinityGroups , (option ) => _ .includes (instanceConfig .affinitygroupids , option .id ))
13661350 this .networks = this .getSelectedNetworksWithExistingConfig (_ .filter (this .options .networks , (option ) => _ .includes (instanceConfig .networkids , option .id )))
@@ -1637,6 +1621,7 @@ export default {
16371621 this .showRootDiskSizeChanger = false
16381622 } else {
16391623 this .rootDiskSelected = null
1624+ this .form .overridediskofferingid = undefined
16401625 }
16411626 this .showOverrideDiskOfferingOption = val
16421627 },
@@ -1875,7 +1860,6 @@ export default {
18751860 if (this .loading .deploy ) return
18761861 this .formRef .value .validate ().then (async () => {
18771862 const values = toRaw (this .form )
1878-
18791863 if (! values .templateid && ! values .isoid ) {
18801864 this .$notification .error ({
18811865 message: this .$t (' message.request.failed' ),
@@ -1962,7 +1946,7 @@ export default {
19621946 if (this .selectedTemplateConfiguration ) {
19631947 deployVmData[' details[0].configurationId' ] = this .selectedTemplateConfiguration .id
19641948 }
1965- if (! this .serviceOffering .diskofferingstrictness && values .overridediskofferingid ) {
1949+ if (! this .serviceOffering .diskofferingstrictness && values .overridediskofferingid && ! values . isoid ) {
19661950 deployVmData .overridediskofferingid = values .overridediskofferingid
19671951 if (values .rootdisksize && values .rootdisksize > 0 ) {
19681952 deployVmData .rootdisksize = values .rootdisksize
0 commit comments