move cloudinit driver without reboot VM

Dzung

Well-Known Member
Feb 20, 2019
89
2
48
34
Hello!
I want to move cloudint driver from local storage to share storage, on webgui I not found option but when I used command it can move to new storage, but it can not delete on old storage, so when I migrate vm to new node it show error.
anyone have solution to move disk cloudinit without reboot vm.
this is my step to move disk:
Code:
root@pve02:/etc/pve/qemu-server# qm move_disk 1269 ide0 storageshare --delete
create full clone of drive ide0 (vmlocal:vm-1269-cloudinit)
  Logical volume "vm-1269-cloudinit" created.
Use of uninitialized value $completion in string eq at /usr/share/perl5/PVE/QemuServer.pm line 7252.
lvremove 'vmlocal/vm-1269-cloudinit' error:   Logical volume vmlocal/vm-1269-cloudinit in use.
on 1269.conf
Code:
ide0: storagem1:vm-1269-cloudinit,media=cdrom,size=4M
when migrate it still error
Code:
2021-10-13 14:38:12 starting migration of VM 1269 to node 'pve1' ()
2021-10-13 14:38:14 ERROR: Problem found while scanning volumes - storage 'vmlocal' is not available on node 'pve1'
2021-10-13 14:38:14 aborting phase 1 - cleanup resources
2021-10-13 14:38:14 ERROR: migration aborted (duration 00:00:04): Problem found while scanning volumes - storage 'vmlocal' is not available on node 'pve1'
TASK ERROR: migration aborted
I rescan it show disk is unused disk, but I can not remove
Code:
qm rescan --vmid 1269
 
Last edited:
There's a workaround to do that, but it involves regenerating the cloud-init disk.
To do so first set the drive to `none` by running qm set <vmid> --ide<N> none and then qm set <vmid> --ide<N> <Storage>:cloudinit .
Replace <vmid> with the VM ID, <N> with the number of the drive, in the case above `0` and <Storage> with your target storage.
 
There's a workaround to do that, but it involves regenerating the cloud-init disk.
To do so first set the drive to `none` by running qm set <vmid> --ide<N> none and then qm set <vmid> --ide<N> <Storage>:cloudinit .
Replace <vmid> with the VM ID, <N> with the number of the drive, in the case above `0` and <Storage> with your target storage.
thank you
 
There's a workaround to do that, but it involves regenerating the cloud-init disk.
To do so first set the drive to `none` by running qm set <vmid> --ide<N> none and then qm set <vmid> --ide<N> <Storage>:cloudinit .
Replace <vmid> with the VM ID, <N> with the number of the drive, in the case above `0` and <Storage> with your target storage.
That works. But why is this not build into "qm move_disk" or possible via GUI?