Skip to content

Commit

Permalink
proxmox: handle 1gb< disks
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Dec 30, 2024
1 parent ba8711a commit 49ccc4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kvirt/providers/proxmox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def create(
if index < len(initial_disks):
current_diskname = initial_disks[index]['name']
current_disksize = int(initial_disks[index]['size'])
if disksize != current_disksize:
if disksize != current_disksize and current_disksize > 1:
pprint(f"Waiting for image disk {index} to be resized")
new_vm.resize.put(disk=diskname, size=f"{disksize}G")
vm_data[current_diskname] = initial_disks[index]['full']
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def _get_current_disks(self, vm_config):
disk_data = vm_config[entry].split(',')
path = disk_data[0]
disktype, disksize = disk_data[-1].split('=')
disksize = int(disksize.replace('G', ''))
disksize = 1 if disksize.endswith('M') else int(disksize.replace('G', ''))
if disktype == 'media':
continue
disks.append({'name': device, 'size': disksize, 'path': path, 'full': vm_config[entry]})
Expand Down

0 comments on commit 49ccc4d

Please sign in to comment.