Disks Migrate from one VM to another in LVM-Thin

Tacioandrade

Renowned Member
Sep 14, 2012
120
17
83
Vitória da Conquista, Brazil
Hello, I was looking for a way to migrate a particular disk from VM 101 to VM 103 in a simplified way, without having to use the dd command to overwrite the data on the target VM, searching Google found in the documentation the following command:

# lvchange --deltag pve-vm-400 --addtag pve-vm-2300 pve/vm-2300-disk-1

Using the modified command, it presents the following error:

# lvchange --deltag pve-vm-101 --addtag pve-vm-103 pve/vm-103-disk-0
Failed to find logical volume "pve/vm-103-disk-0"

Does anyone know what I went wrong? I thought it was the storage, but when I run the following command works, but the disk 101 is not moved to 103.

# lvchange --deltag pve-vm-101 --addtag pve-vm-103 pve/vm-101-disk-0
Logical volume pve/vm-101-disk-0 changed.

Thanks in advance for your help.
 
What is the output of
Code:
lvs
lvs -o lv_tags pve/vm-103-disk-1
lvs -o lv_tags pve/vm-101-disk-0
 
What is the output of
Code:
lvs
lvs -o lv_tags pve/vm-103-disk-1
lvs -o lv_tags pve/vm-101-disk-0

Disk vm-103-disk-1 does not exist, I would like to move disk vm-101-disk-1 to VM 103, turning it into vm-103-disk-1

Apparently the TAG has changed, but the HD still appears on VM 101 and not 103

root@pve01:~# lvs -o lv_tags pve/vm-103-disk-1
Failed to find logical volume "pve/vm-103-disk-1"
root@pve01:~# lvs -o lv_tags pve/vm-101-disk-0
LV Tags
pve-vm-103

upload_2019-7-25_18-8-43.png

upload_2019-7-25_18-9-2.png
 
Would anyone know how to do this?

In case I just want to migrate the vm-101-disk-0 disk to VM 103, no matter what ID it gets, I just wanted to have a simplified way to move or copy the hard drive from one VM to another.
 
I guess you found this step 5 of the documentation? It says
If you're using this option (...), then you have to update the disk's tag.
However, we're not using this option as default. When you add a new hard disk on an lvm storage no tag is set. The whole step 5 is, as the heading suggests, only a fixup for if tags are used.

I've just added a new section about moving disks in LVM storages to the wiki. It should answer your question and I'd be delighted at your feedback.
 
  • Like
Reactions: Tacioandrade
I guess you found this step 5 of the documentation? It says

However, we're not using this option as default. When you add a new hard disk on an lvm storage no tag is set. The whole step 5 is, as the heading suggests, only a fixup for if tags are used.

I've just added a new section about moving disks in LVM storages to the wiki. It should answer your question and I'd be delighted at your feedback.

It worked perfectly, thank you very much for updating the documentation !!!
 
  • 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!