@@ -1371,36 +1371,20 @@ export default {
13711371 }
13721372
13731373 this .serviceOffering = _ .find (this .options .serviceOfferings , (option ) => option .id === instanceConfig .computeofferingid )
1374- if (this .serviceOffering ? .diskofferingid ) {
1375- if (iso) {
1376- this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === this .serviceOffering .diskofferingid )
1377- } else {
1378- instanceConfig .overridediskofferingid = this .serviceOffering .diskofferingid
1379- }
1380- }
1381- if (! iso && this .diskSelected ) {
1382- this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .diskofferingid )
1383- }
1384- if (this .rootDiskSelected ? .id ) {
1385- instanceConfig .overridediskofferingid = this .rootDiskSelected .id
1386- }
1374+
1375+ instanceConfig .overridediskofferingid = this .rootDiskSelected ? .id || this .serviceOffering ? .diskofferingid
13871376 if (instanceConfig .overridediskofferingid ) {
13881377 this .overrideDiskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .overridediskofferingid )
13891378 } else {
13901379 this .overrideDiskOffering = null
13911380 }
13921381
1393- if (! iso && this .diskSelected ) {
1382+ if (iso && this .serviceOffering ? .diskofferingid ) {
1383+ this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === this .serviceOffering .diskofferingid )
1384+ } else if (! iso && this .diskSelected ) {
13941385 this .diskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .diskofferingid )
13951386 }
1396- if (this .rootDiskSelected ? .id ) {
1397- instanceConfig .overridediskofferingid = this .rootDiskSelected .id
1398- }
1399- if (instanceConfig .overridediskofferingid ) {
1400- this .overrideDiskOffering = _ .find (this .options .diskOfferings , (option ) => option .id === instanceConfig .overridediskofferingid )
1401- } else {
1402- this .overrideDiskOffering = null
1403- }
1387+
14041388 this .zone = _ .find (this .options .zones , (option ) => option .id === instanceConfig .zoneid )
14051389 this .affinityGroups = _ .filter (this .options .affinityGroups , (option ) => _ .includes (instanceConfig .affinitygroupids , option .id ))
14061390 this .networks = this .getSelectedNetworksWithExistingConfig (_ .filter (this .options .networks , (option ) => _ .includes (instanceConfig .networkids , option .id )))
@@ -1679,6 +1663,7 @@ export default {
16791663 this .showRootDiskSizeChanger = false
16801664 } else {
16811665 this .rootDiskSelected = null
1666+ this .form .overridediskofferingid = undefined
16821667 }
16831668 this .showOverrideDiskOfferingOption = val
16841669 },
@@ -1926,7 +1911,6 @@ export default {
19261911 if (this .loading .deploy ) return
19271912 this .formRef .value .validate ().then (async () => {
19281913 const values = toRaw (this .form )
1929-
19301914 if (! values .templateid && ! values .isoid ) {
19311915 this .$notification .error ({
19321916 message: this .$t (' message.request.failed' ),
@@ -2016,7 +2000,7 @@ export default {
20162000 if (this .selectedTemplateConfiguration ) {
20172001 deployVmData[' details[0].configurationId' ] = this .selectedTemplateConfiguration .id
20182002 }
2019- if (! this .serviceOffering .diskofferingstrictness && values .overridediskofferingid ) {
2003+ if (! this .serviceOffering .diskofferingstrictness && values .overridediskofferingid && ! values . isoid ) {
20202004 deployVmData .overridediskofferingid = values .overridediskofferingid
20212005 if (values .rootdisksize && values .rootdisksize > 0 ) {
20222006 deployVmData .rootdisksize = values .rootdisksize
0 commit comments