File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ func (c *client) GetOrCreateVMInstance(
274
274
func (c * client ) DestroyVMInstance (csMachine * infrav1.CloudStackMachine ) error {
275
275
// Attempt deletion regardless of machine state.
276
276
p := c .csAsync .VirtualMachine .NewDestroyVirtualMachineParams (* csMachine .Spec .InstanceID )
277
- volIDs , err := c .listVMInstanceVolumeIDs (* csMachine .Spec .InstanceID )
277
+ volIDs , err := c .listVMInstanceDatadiskVolumeIDs (* csMachine .Spec .InstanceID )
278
278
if err != nil {
279
279
return err
280
280
}
@@ -303,9 +303,10 @@ func (c *client) DestroyVMInstance(csMachine *infrav1.CloudStackMachine) error {
303
303
return errors .New ("VM deletion in progress" )
304
304
}
305
305
306
- func (c * client ) listVMInstanceVolumeIDs (instanceID string ) ([]string , error ) {
306
+ func (c * client ) listVMInstanceDatadiskVolumeIDs (instanceID string ) ([]string , error ) {
307
307
p := c .cs .Volume .NewListVolumesParams ()
308
308
p .SetVirtualmachineid (instanceID )
309
+ // VM root volumes are destroyed automatically, no need to explicitly include
309
310
p .SetType ("DATADISK" )
310
311
311
312
listVOLResp , err := c .csAsync .Volume .ListVolumes (p )
You can’t perform that action at this time.
0 commit comments