Hi
I am struggling finding a way (at least the most proper / valid one) on how to move the raw disk space of a VM (after detaching it) to another VM (on the same or different server)
My installation is based on zfs. I Installed two Win10 VMs and I gave the first one (VM id 102) a second storage from local-zfs space (one disk only) from it's hardware tab, just by adding that storage (options of storage were discard, didn t check backup and it was 15G) This storage was seeing inside the VM as a second hard drive and was partitioned with the well known Win NTFS. This storage has some data inside . I am trying to figure out how
1.After detaching the extra storage how to re-attach it to the same VM (GUI only has the option to detach it not re attach it)
2.How to attach it to another VM (Win of course since it is formatted with NTFS)
what I did was:
#zfs list ->to check the name of the disk
NAME USED AVAIL REFER MOUNTPOINT
rpool 77.6G 147G 104K /rpool
rpool/ROOT 30.9G 147G 96K /rpool/ROOT
rpool/ROOT/pve-1 30.9G 147G 30.9G /
rpool/data 46.7G 147G 104K /rpool/data
rpool/data/subvol-101-disk-0 2.17G 3.83G 2.17G /rpool/data/subvol-101-disk-0
rpool/data/vm-100-disk-0 987M 147G 987M -
rpool/data/vm-100-disk-1 80K 147G 80K -
rpool/data/vm-102-disk-0 17.1G 147G 17.1G -
rpool/data/vm-102-disk-1 12.3G 147G 12.3G -
rpool/data/vm-103-disk-0 14.2G 147G 14.2G -
The disk I am interested in is the rpool/data/vm-102-disk-1
# ls -la /dev/zvol/rpool/data/vm-102-disk-1* -> in order to see the the partitions of the disk
lrwxrwxrwx 1 root root 13 Mar 14 00:56 /dev/zvol/rpool/data/vm-102-disk-1 -> ../../../zd48
lrwxrwxrwx 1 root root 15 Mar 14 00:56 /dev/zvol/rpool/data/vm-102-disk-1-part1 -> ../../../zd48p1
As it seems (and it is logical) there is the vm-102-disk-1-part1 partition and this is the formatted with NTFS
Now here I have two more questions
a)vm-102-disk-1 and vm-102-disk-1-part1 are images? Do they have a file type or because they are raw images they havent?
b)Why at the end each partition has a corresponding device letter like zd48 and zd48p1. Is it used anywhere? Is it usable somehow?
I was successful but trying to mount that part-1 partition with the below command doesn t help much to my use case scenario.
#mount -o ro /dev/zvol/rpool/data/vm-102-disk-1-part1 /mnt/extradisk/ (extradisk folder I created to mount that extra storage)
Indeed contents of that storage were visible
/mnt/extradisk# ls
'$RECYCLE.BIN' kali-linux-2021.4a-installer-amd64.iso
511.23-notebook-win10-win11-64bit-international-dch-whql.exe 'linuxmint-20.3-mate-64bit (1).iso'
AnyDesk.msi proxmox-backup-server_2.1-1.iso
debian-amd64-netinst-3cx.iso proxmox-ve_7.1-2.iso
deepin-desktop-community-23-nightly-amd64.iso 'System Volume Information'
GeForce_Experience_v3.24.0.126.exe ubuntu-20.04.3-live-server-amd64.iso
Of course that doesn t get me anywhere. Also mounting with a filesystem like
mount -o ro -t zfs /dev/zvol/rpool/data/vm-102-disk-1-part1 /mnt/extradisk/
won t help much, right?
What worked was go to VM100 and from hardware tab detach the storage. At the same time I had terminal to the path
/etc/pve/qemu-server where I copied the line referring to that extra storage local-zfs:vm-102-disk-1,cache=writeback,discard=on,size=15G
After detaching it a new line created to the 100 VM which was unused0: local-zfs:vm-102-disk-1
So with both VMs closed I opened the 103.conf and added the like local-zfs:vm-102-disk-1,cache=writeback,discard=on,size=15G
saved refresh gui and 103 VM had that extra storage of VM 101. Maybe that answers my first two question but if I wanted to move that storage to another node
I have to treat that storage as a file in order to mv or cp it the other side. Well how am I supposed to achieve this?
Thank you
I am struggling finding a way (at least the most proper / valid one) on how to move the raw disk space of a VM (after detaching it) to another VM (on the same or different server)
My installation is based on zfs. I Installed two Win10 VMs and I gave the first one (VM id 102) a second storage from local-zfs space (one disk only) from it's hardware tab, just by adding that storage (options of storage were discard, didn t check backup and it was 15G) This storage was seeing inside the VM as a second hard drive and was partitioned with the well known Win NTFS. This storage has some data inside . I am trying to figure out how
1.After detaching the extra storage how to re-attach it to the same VM (GUI only has the option to detach it not re attach it)
2.How to attach it to another VM (Win of course since it is formatted with NTFS)
what I did was:
#zfs list ->to check the name of the disk
NAME USED AVAIL REFER MOUNTPOINT
rpool 77.6G 147G 104K /rpool
rpool/ROOT 30.9G 147G 96K /rpool/ROOT
rpool/ROOT/pve-1 30.9G 147G 30.9G /
rpool/data 46.7G 147G 104K /rpool/data
rpool/data/subvol-101-disk-0 2.17G 3.83G 2.17G /rpool/data/subvol-101-disk-0
rpool/data/vm-100-disk-0 987M 147G 987M -
rpool/data/vm-100-disk-1 80K 147G 80K -
rpool/data/vm-102-disk-0 17.1G 147G 17.1G -
rpool/data/vm-102-disk-1 12.3G 147G 12.3G -
rpool/data/vm-103-disk-0 14.2G 147G 14.2G -
The disk I am interested in is the rpool/data/vm-102-disk-1
# ls -la /dev/zvol/rpool/data/vm-102-disk-1* -> in order to see the the partitions of the disk
lrwxrwxrwx 1 root root 13 Mar 14 00:56 /dev/zvol/rpool/data/vm-102-disk-1 -> ../../../zd48
lrwxrwxrwx 1 root root 15 Mar 14 00:56 /dev/zvol/rpool/data/vm-102-disk-1-part1 -> ../../../zd48p1
As it seems (and it is logical) there is the vm-102-disk-1-part1 partition and this is the formatted with NTFS
Now here I have two more questions
a)vm-102-disk-1 and vm-102-disk-1-part1 are images? Do they have a file type or because they are raw images they havent?
b)Why at the end each partition has a corresponding device letter like zd48 and zd48p1. Is it used anywhere? Is it usable somehow?
I was successful but trying to mount that part-1 partition with the below command doesn t help much to my use case scenario.
#mount -o ro /dev/zvol/rpool/data/vm-102-disk-1-part1 /mnt/extradisk/ (extradisk folder I created to mount that extra storage)
Indeed contents of that storage were visible
/mnt/extradisk# ls
'$RECYCLE.BIN' kali-linux-2021.4a-installer-amd64.iso
511.23-notebook-win10-win11-64bit-international-dch-whql.exe 'linuxmint-20.3-mate-64bit (1).iso'
AnyDesk.msi proxmox-backup-server_2.1-1.iso
debian-amd64-netinst-3cx.iso proxmox-ve_7.1-2.iso
deepin-desktop-community-23-nightly-amd64.iso 'System Volume Information'
GeForce_Experience_v3.24.0.126.exe ubuntu-20.04.3-live-server-amd64.iso
Of course that doesn t get me anywhere. Also mounting with a filesystem like
mount -o ro -t zfs /dev/zvol/rpool/data/vm-102-disk-1-part1 /mnt/extradisk/
won t help much, right?
What worked was go to VM100 and from hardware tab detach the storage. At the same time I had terminal to the path
/etc/pve/qemu-server where I copied the line referring to that extra storage local-zfs:vm-102-disk-1,cache=writeback,discard=on,size=15G
After detaching it a new line created to the 100 VM which was unused0: local-zfs:vm-102-disk-1
So with both VMs closed I opened the 103.conf and added the like local-zfs:vm-102-disk-1,cache=writeback,discard=on,size=15G
saved refresh gui and 103 VM had that extra storage of VM 101. Maybe that answers my first two question but if I wanted to move that storage to another node
I have to treat that storage as a file in order to mv or cp it the other side. Well how am I supposed to achieve this?
Thank you
Last edited: