I can't migrate a virtual machine between nodes

integart

Member
Sep 13, 2017
15
0
21
40
Hello, I want to migrate an online virtual machine from one node to another and get the message like below. What is going on?

Task viewer: VM 1008 - Migrate

OutputStatus

Stop
Sep 26 10:36:52 starting migration of VM 1008 to node 'node-112' (X.X.X.X)
Sep 26 10:36:52 found local disk 'local-lvm:vm-1008-disk-1' (via storage)
Sep 26 10:36:52 copying disk images
lvcreate 'pve/vm-1008-disk-1' error: Logical volume "vm-1008-disk-1" already exists in volume group "pve"
Sep 26 10:36:53 ERROR: Failed to sync data - command '/usr/bin/ssh root@X.X.X.X pvesm alloc local-lvm 1008 vm-1008-disk-1 314572800' failed: exit code 5
Sep 26 10:36:53 aborting phase 1 - cleanup resources
Sep 26 10:36:53 ERROR: found stale volume copy 'local-lvm:vm-1008-disk-1' on node 'node-112'
Sep 26 10:36:53 ERROR: migration aborted (duration 00:00:02): Failed to sync data - command '/usr/bin/ssh root@172.30.10.112 pvesm alloc local-lvm 1008 vm-1008-disk-1 314572800' failed: exit code 5
TASK ERROR: migration aborted
 
it seems on the target node is already an logical volume 'vm-1008-disk-1' in the volume group 'pve', so it aborts instead of copying it over
 
the first question to answer would be 'why is it there',
you could of course delete it, but then the (possibly important) data of it is gone
 
Well I only have 4 nodes in the cluster and 3 that is trying to migrate the machine I have the same message.
 
Hello, I want to migrate an online virtual machine from one node to another and get the message like below. What is going on?

Task viewer: VM 1008 - Migrate

OutputStatus

Stop
Sep 26 10:36:52 starting migration of VM 1008 to node 'node-112' (X.X.X.X)
Sep 26 10:36:52 found local disk 'local-lvm:vm-1008-disk-1' (via storage)
Sep 26 10:36:52 copying disk images
lvcreate 'pve/vm-1008-disk-1' error: Logical volume "vm-1008-disk-1" already exists in volume group "pve"
Sep 26 10:36:53 ERROR: Failed to sync data - command '/usr/bin/ssh root@X.X.X.X pvesm alloc local-lvm 1008 vm-1008-disk-1 314572800' failed: exit code 5
Sep 26 10:36:53 aborting phase 1 - cleanup resources
Sep 26 10:36:53 ERROR: found stale volume copy 'local-lvm:vm-1008-disk-1' on node 'node-112'
Sep 26 10:36:53 ERROR: migration aborted (duration 00:00:02): Failed to sync data - command '/usr/bin/ssh root@172.30.10.112 pvesm alloc local-lvm 1008 vm-1008-disk-1 314572800' failed: exit code 5
TASK ERROR: migration aborted
Hi,
online migration without --with-local-disks??

Are the local-lvm:vm-1008-disk-1 is active? Post the vm-config please:
Code:
cat /etc/pve/qemu-server/1008.conf
and also the lvs-output from the source and destination-node
Code:
lvs
Perhaps the content of /etc/pve/storage.cfg will be helpfull too.

Udo
 
cat /etc/pve/qemu-server/1008.conf
bios: seabios
boot: cdn
bootdisk: sata0
cores: 3
cpulimit: 6
ide0: none,media=cdrom
localtime: 1
memory: 4592
name: Terminal-106
net0: bridge=vmbr0,e1000=62:37:34:66:37:39
numa: 0
ostype: w2k8
sata0: data-2-0:1008/vm-1008-disk-1.raw,cache=writeback,size=300G
smbios1: uuid=41635ec6-06de-4132-98b8-23c7e7831d19
sockets: 2
vcpus: 6

root@node-114:~# lvs (source)
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 811.23g 0.79 0.81
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
vm-1002-disk-1 pve Vwi-a-tz-- 50.00g data 3.15
vm-1008-disk-1 pve Vwi-a-tz-- 300.00g data 1.62

root@node-112:~# lvs (destination)
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 811.23g 1.32 1.07
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
vm-1002-disk-1 pve Vwi-a-tz-- 50.00g data 11.78
vm-1008-disk-1 pve Vwi-a-tz-- 300.00g data 1.62

root@node-114:~# cat /etc/pve/storage.cfg
dir: local
path /var/lib/vz
content vztmpl,iso,backup

lvmthin: local-lvm
vgname pve
thinpool data
content rootdir,images

nfs: data-2-0
export /mnt/data-2-0
path /mnt/pve/data-2-0
server 172.30.10.50
maxfiles 30
content rootdir,vztmpl,images,backup,iso
options vers=3
 
cat /etc/pve/qemu-server/1008.conf
...
sata0: data-2-0:1008/vm-1008-disk-1.raw,cache=writeback,size=300G
Hi,
you use the disk on the nfs-storage not on the local-lvm.
Due the missing "unused0: local-lvm:..." looks that you manual edit the config-file!
root@node-114:~# lvs (source)
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 811.23g 0.79 0.81
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
vm-1002-disk-1 pve Vwi-a-tz-- 50.00g data 3.15
vm-1008-disk-1 pve Vwi-a-tz-- 300.00g data 1.62

root@node-112:~# lvs (destination)
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 811.23g 1.32 1.07
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
vm-1002-disk-1 pve Vwi-a-tz-- 50.00g data 11.78
vm-1008-disk-1 pve Vwi-a-tz-- 300.00g data 1.62
the logical volume is on both nodes active but not open - mean not in use.
So it's should be safe to remove the lv vm-1008-disk-1 on this (all?) nodes.

Udo
 
I understand that in this situation I have to remove these local disks from the node as seen after executing the lvs command?