lnxbil/docker-machine-driver-proxmox-ve

Next VM id doesn't mean there will be disk available

pietrushnic opened this issue · 3 comments

I'm not sure about this assumption, but it looks like vm disk name is generated automatically without checking if it is available:

Error creating machine: Error in driver during machine creation: status code was '500' and error is
500 lvcreate 'pve/vm-100-disk-1' error:   Logical Volume "vm-100-disk-1" already exists in volume group "pve"
notifying bugsnag: [Error creating machine: Error in driver during machine creation: status code was '500' and error is
500 lvcreate 'pve/vm-100-disk-1' error:   Logical Volume "vm-100-disk-1" already exists in volume group "pve"]
++ docker-machine env new-drv-test
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "": dial tcp: missing address
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

Yes, I also encountered this if the previous run failed somehow.

The question is how to react:

  • abort (as of now, but maybe with a nicer error message)
  • remove the disk in case of an error while creating (only applies to errors directly resulting from running the driver, not from having a disk coincidentally)
  • remove the disk and create a new one

I really don't know. Safest approach is to abort and let the human decide if it's save to remove it?

@lnxbil I'm not proxmox expert, can't we use other disk or increase vmid to generate next free?

@lnxbil I'm not proxmox expert, can't we use other disk or increase vmid to generate next free?

That are also viable options I haven't thought of. Thank you. Using the next free id without a disk is a viable option, I guess. I'll have a look at that.