ossobv / proxmove

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

Don't power on virtual machine after migration if it wasn't in a running state #40

Closed vilitux closed 2 years ago

vilitux commented 2 years ago

Currently, when a machine is migrated, it's powered on when migration finishes.

In some cases you might want to move VM's that are currently powered down, e.g. when local available disk storage is low but you don't want to purge the powered down VM yet.

wdoekes commented 2 years ago

Is --skip-start not a good option for you?

I could make it not autostart here:

--- a/proxmove
+++ b/proxmove
@@ -2148,6 +2148,8 @@ class VmMover(object):
         # Start VM.
         if self.opt_skip_start:
             log.debug('Not starting VM as requested')
+        elif not src_vm.was_running():
+            log.debug('Not starting VM as requested')
         else:
             dst_vm.ensure_started()

(Or something along those lines.)

But if you have an error and are resuming an upload, you would not have a way of forcing a start when completed.

If you simply add --skip-start when moving an offline VM, I think it fits your usecase.