Move VM effektiv

TErxleben

Renowned Member
Oct 20, 2008
215
11
83
I've installed a VM (PBS) on an external USB drive on PVE-A. Now I want to connect this drive to PVE-B and start the VM there. What's the best way to proceed? Please don't give me any advice using vzdump. We're talking about at least 16 TB.
 
You don't provide much info on "installed a VM (PBS) on an external USB drive on PVE-A", was this USB drive part of the Proxmox backend storage or was this USB drive passed through to the VM etc.

But in theory, what you need to do; setup a similar configuration in PVE-B of backend storage etc. that covers that VM, copy the VM config file to PVE-B (& any other files that may be necessary), & you should be able to run that VM as usual. In short: you will need to manually replicate your original scenario & setup from node A to node B.

In any event, if that USB drive indeed needs to be setup as part of the Proxmox storage backend, you will need to ensure that the drive does not get wiped during its' configuration on node B.

BTW, if all you are trying to accomplish, is to retrieve backup files from that USB drive to node B, then you may not need to do any of the above, & life maybe a lot simpler.
 
You don't provide much info on "installed a VM (PBS) on an external USB drive on PVE-A", was this USB drive part of the Proxmox backend storage or was this USB drive passed through to the VM etc.

But in theory, what you need to do; setup a similar configuration in PVE-B of backend storage etc. that covers that VM, copy the VM config file to PVE-B (& any other files that may be necessary), & you should be able to run that VM as usual. In short: you will need to manually replicate your original scenario & setup from node A to node B.

In any event, if that USB drive indeed needs to be setup as part of the Proxmox storage backend, you will need to ensure that the drive does not get wiped during its' configuration on node B.

BTW, if all you are trying to accomplish, is to retrieve backup files from that USB drive to node B, then you may not need to do any of the above, & life maybe a lot simpler.
It's a manually mounted drive at (pve)system level and then made available as a directory in the GUI (i.e., mount /dev/xyz /mnt/usb).
I simply want to make a massive backup available as quickly as possible once the actual PBS server (or host of pbs) crashes.
 
Last edited:
Assuming a regular FS on that drive, If you just manually mount that external drive on node B, you should be able to locate the requested backup file.
 
So you created a virtual disk for that VM located within the Proxmox directory storage of node A?
If so, as I have said above, you will need to recreate the same structure within node B, copy over the VM's config file, & you should be able to start up the VM.

Alternatively, you should be able to mount that virtual disk on node B (or any linux OS) & have access to its filesystem, without actually running the VM. The exact operation needed will depend on the virtual disks format.
 
That's right. The VM was created on the external media. My question is, how can I make it available most elegantly after plugging it into another host? I don't want to "prepare" various potential hosts. I want to plug in the media, have it accessible via the GUI, and use it. All without the vzdump detour. I'm also happy with a CLI solution and editing the relevant conf files (you can then script it). But which ones would I need to touch?
 
The elegant (& correct) way, would be to have the backup file itself - (not the VM's virtual disk) - stored on a regular external USB drive, this can then be easily accessed from any other node. I do this myself, often.

Any else will not be as elegant.

But which ones would I need to touch?
You did not provide the VM's config - so hard to say. The conf file for the VM should be in: /etc/pve/nodes/<node>/qemu-server/<vmid>.conf
But at a minimum - you will need to create a new VM with a similar config on node B. It does not have to have the same VMID. You then have to check which storages it relies on - and recreate these on the new node.
 
The following procedure works well for me:
  • Create a mount point for the USB drive on each desired PVE. For example, /mnt/pbs.
  • Then mount this point as storage in these PVEs as a directory.
  • Copy the corresponding conf (/etc/pve/nodes/<node>/qemu-server/<vmid>.conf) to all PVEs.
  • After connecting and mounting the external drive to the desired PVE, you can start the VM without any problems.
It would be even much more elegant if the VM, in this case the PBS, could obtain its IP address via DHCP.
 
Last edited:
Then mount this point as storage in these PVEs as a directory.
Have you tested what happens - when you reboot a node that does not have that external USB drive connected but has that (external) storage defined in the Proxmox backend.
 
This host creates directories (images, dump in my case) in the mount point. The VM is grayed/stopped in webgui. After mounting the drive the VM is accessible again.
 
Last edited:
This host creates directories (images, dump in my case) in the mount point.
Exactly my point - you will probably end up filling up your local storage with this data. Your host directory will not be checking whether the actual drive is mounted or not. You & the system will soon have it difficult to discern if the data in that mountpoint is local or external. If it "overfills" the local storage - you will soon loose access to the node.

This is asking for trouble - I would not be doing this as I said above. But each to his own.
 
Oh no no. Your scenario could happen if you use my construct, for example, as storage for virtual machine dumps. But here, the PBS VM itself is located on the disk. If that's not there, the VM won't run and can't use any storage space. I only allowed dumps so I can manually save data there. Those who are nervous can limit themselves to images.
 
It would be even much more elegant if the VM, in this case the PBS, could obtain its IP address via DHCP.
Although servers should as a rule have a fixed-static IP address it should be possible - although unrecommended. You can search many threads on this forum on the subject. You must also consider that the DNS name will fully resolve the PBS instance so that PVE can connect to PBS without the actual IP address. I have no experience with this.

Here is an elegant blog on PVE with DHCP.
 
It's like the nineties. These days, there are only very few services that should be run with a fixed IP address. PVE and even less so PBS are definitly not among them. Do you think a hosting provider sets the IP addresses of its customer servers manually? The DHCP option for PVE/PBS would be extremely helpful. Those who don't want to or can't do it can simply assign addresses manually. I certainly wish there was a DHCP option that wouldn't require manual fiddling.
 
Last edited: