Skip to content

Commit

Permalink
Fixed disk-expand non-existent VM issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav-gwit committed Apr 29, 2023
1 parent db4d4b9 commit 5ab08ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/vm_disk_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ var (
)

func diskExpandOffline(vmName string, diskImage string, expansionSize int) error {
vmFolder := getVmFolder(vmName)
vmConfigVar := vmConfig(vmName)
allVms := getAllVms()

if slices.Contains(allVms, vmName) {
_ = 0
} else {
return errors.New("vm was not found")
}

vmFolder := getVmFolder(vmName)
vmConfigVar := vmConfig(vmName)
if vmLiveCheck(vmName) {
return errors.New("vm has to be offline, due to the data loss possibility of online expansion")
}
Expand Down

0 comments on commit 5ab08ff

Please sign in to comment.