ossobv / proxmove

Migrate virtual machines between different Proxmox VE clusters with minimal downtime
270 stars 31 forks source link

support for VM with two disks (e.g. SCSI and EFI) #31

Closed ak2k closed 3 years ago

ak2k commented 3 years ago

Thank you for this utility!

I noticed that when moving a VM that had a mounted SCSI disk as well as an EFI disk, the EFI disk was left behind.

I may have misconfigured something, or it may have been that UEFI isn't supported, but I wanted to mention in case it was an unexpected edge case that you would value hearing about.

wdoekes commented 3 years ago

Thank you for the report.

That behaviour is not intentional. Without digging into this deeply, I wouldn't know how/why and EFI disk would exist. It's all SCSI/VirtIO right? One large disk and one small one. I don't see why PVE/proxmove would care what is on it. (And proxmove has successfully been used on VMs with multiple disks.)

If you can reproduce and show the (sanitized) --debug output, maybe the problem is easy to spot/fix.

ak2k commented 3 years ago

My pleasure!

As far as I understand, the UEFI disk is needed if you are running the OVMF/UEFI bios type (instead of SeaBios). I did this because documentation suggested it to be necessary for PCI passthrough.

Screen Shot 2021-02-08 at 1 00 35 PM

Regrettably I no longer have the debug output, but I do recall that it didn't appear in any of the discovered/reported disks as though it was not seen by the utility. I could always create a new OVMF VM with an associated UEFI disk in Proxmox, as I expect this to be perfectly reproducible, but I wonder if it would be necessary for you to have it locally for you to try to understand the API command necessary for proxmox to report that device so that you could flag it for transfer.

In the proxmox host config, the line is, "efidisk0: local-zfs:vm-101-disk-1,size=1M".

wdoekes commented 3 years ago

efidisk0: local-zfs:vm-101-disk-1,size=1M

That's useful info indeed.

In that case it should be a matter of adding 'efidisk' to https://github.com/ossobv/proxmove/blob/master/proxmove#L49.

ak2k commented 1 year ago

Please excuse my long-delayed follow-up.

It looks like this ended up not working, as the efidisk line can't have "discard=on"

2023-03-02 23:38:12,771: INFO: Volume transferring/conversion 100% (is/was) complete!
2023-03-02 23:38:12,776: ERROR: Issue when adding volume to new VM: 'rpool-vmdata:vm-1000-disk-0,discard=on,size=1M'
Traceback (most recent call last):
  File "/tmp/proxmove/bin/proxmove", line 1494, in create_volume
    self.api_vm.config.put(**{volume_key: new_properties})
  File "/tmp/proxmove/lib/python3.9/site-packages/proxmoxer/core.py", line 175, in put
    return self(args)._request("PUT", data=data)
  File "/tmp/proxmove/lib/python3.9/site-packages/proxmoxer/core.py", line 149, in _request
    raise ResourceException(
proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'efidisk0': 'invalid format - format error\nefidisk0.discard: property is not defined in schema and the schema does not allow additional properties\n'}
Traceback (most recent call last):
  File "/tmp/proxmove/bin/proxmove", line 2420, in <module>
    main()
  File "/tmp/proxmove/bin/proxmove", line 2416, in main
    vmmover.run(options.dry_run)
  File "/tmp/proxmove/bin/proxmove", line 2038, in run
    self.move_vm(vm, translator, dry_run)
  File "/tmp/proxmove/bin/proxmove", line 2081, in move_vm
    dst_vm = self._start_moving_vm(src_vm, translator)
  File "/tmp/proxmove/bin/proxmove", line 2106, in _start_moving_vm
    self._move_vm_volumes(src_vm, dst_vm, move_mode=self.MOVE_INITIAL)
  File "/tmp/proxmove/bin/proxmove", line 2165, in _move_vm_volumes
    self._move_vm_volume(src_vm, dst_vm, volume_key, volume, move_mode)
  File "/tmp/proxmove/bin/proxmove", line 2179, in _move_vm_volume
    dst_vm.create_volume(
  File "/tmp/proxmove/bin/proxmove", line 1494, in create_volume
    self.api_vm.config.put(**{volume_key: new_properties})
  File "/tmp/proxmove/lib/python3.9/site-packages/proxmoxer/core.py", line 175, in put
    return self(args)._request("PUT", data=data)
  File "/tmp/proxmove/lib/python3.9/site-packages/proxmoxer/core.py", line 149, in _request
    raise ResourceException(
proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'efidisk0': 'invalid format - format error\nefidisk0.discard: property is not defined in schema and the schema does not allow additional properties\n'}
wdoekes commented 1 year ago

Ok. That would be a separate issue then, caused by: https://github.com/ossobv/proxmove/blob/18fcd8dfed316c70341255c0c3166a8229ac3b85/proxmove#L1860-L1876

You could disable that by adding and False here: https://github.com/ossobv/proxmove/blob/18fcd8dfed316c70341255c0c3166a8229ac3b85/proxmove#L1867

For a better fix, the volume type would need to be available in the translator so it can skip setting discard=on if it sees type efidisk.

ak2k commented 1 year ago

Thank you once again for the assistance. That resolved my (separate) issue.