Non live migration

showiproute

Well-Known Member
Mar 11, 2020
615
32
48
36
Austria
Hello everyone,

I am looking for some guidance regarding migration of a VM + ZFS disks:

I would like to migrate a VM to another server without the live migration feature of all virtual disks as I do not have the same storage on the new server.
My plan would be to shutdown the VM, detach the virtual disks from the server, live migrate the VM configuration.
I would also like to unmount the physical HDDs and move them to the new server - currently they are all LVM-thin formatted.
After mounting the disks on the new server I would like to attach them as storage and rescan them for the existing virtual disks and reattach them to the migrated VM.

Is this possible in general?
 
So you have disks with ZFS and disks with ZFS, and want to move only the VMs on the ZFS disks to a new storage and move the LVM-formatted disks as a whole?

Generally, the easiest way is to just backup (vzdump) & restore.
 
Hello Dominic,

sorry maybe the thread name was not the best choose - I renamed it.
I have a big storage VM which has virtual disks on a couple of lvm-thin formatted drives as well as ZFS formatted disks.

The physical HDDs are not being used by any other VMs - so they are exclusive for my storage VM.

For ZFS based storage zpool export / import should work as the vmid of my VM will remain the same and therefore the ZVOL should be recognized on the new server.

But what about lvm-thin?
I do not know if there is a "lvm-thin export" function.


Regarding backup & restore: I do not have any additional storage which I could use as a temporay storage for any dumps.
 
Hmm this depends on how your volume groups looks exactly I guess.

If you want to experiment relatively safe: Create 2 PVE VMs and simulate your idea.
For example, if your have a virtual pve1 and a virtual pve2 then you can add a disk to pve1 and create a lvm-thin storage on it in the GUI of pve1. Then you create a VM on pve1 that uses that storage. You can then rename the disk that you have added to pve1 on your host so that it appears in pve2. This could be something like
lvrename group vm-110-disk-0 vm-111-disk-0 (when pve1 is vm-110 and pve2 is vm-111). Then run qm rescan and double click the new disk in the GUI to attach it. As soon as you have done that, you should see the disk in the GUI of pve2.

I just tried this for a simple Windows VM with a single disk on that disk/storage and (after moving the config file from pve1 to pve2) it started without problems.
 
Hi Dominic,

thanks for your advise.
I'll give that a try as soon as my new server arrives.

Whatever might be the outcome I'll update this thread to have it written down.
 
  • Like
Reactions: Dominic
So finally I've ended the migration.
In the end it was quite simple:

I made a screenshot of my VM configuration (maybe the most important detail) ;-)

After that I have detattched all the the virtual disks from the VM and removed the phyiscal drives via Proxmox GUI.
Then I exported the zpools and removed the physical disks.
Now I was able to delete the unattached VM disks without the risk of losing data - in the end I had a VM without any VM disks.

On my new server I remounted the zpools as well as my last lvmthin drive.
I added that storage configuration manually to /etc/pve/storage.cfg - worked like a charm.

Then qm rescan <vmid> and attached the disks according my previous screenshot.
 
  • Like
Reactions: Dominic
I made a screenshot of my VM configuration (maybe the most important detail) ;-)
Unfortunately, they are not visible. Could you maybe post qm config <vmid>?
 
Hi Dominic,

I did not post any picture - I just mentioned the steps I have completed which included making a screenshot of my local configuration for myself :)
 
  • Like
Reactions: Dominic

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!