move storage to another vm

astina

New Member
Aug 19, 2018
5
0
1
46
Hello,

after a bad manipulation of my son I've lose a VM (xpeno)

I've reinslaled a new VM but now I would like that this VM can acces to the old storage?

How can I do this?

(I want DATA:vm-102-disk-2,size=6000G on my pve-103 instead of pve-102)

prox.jpg

THX in advance
 
Last edited:
Fastest option is to edit 103.conf and add (and adapt) the line you find in 102.conf that are related to that disk (so 103 VM will point to 102 disk).
The problem is that if you then delete VM 102 it will delete the disk too...
If "DATA" is a file system, you could simply move and rename the disk under the directory of VM103 (i.e. cat /etc/pve/storage.cfg, have a look at path for DATA, and under that path/images you have 102 and 103 dir. Move the "disk file" from one dir to the other and add the corresponding line to 103.conf).
If DATA is block device, you have to be very careful and use i.e. dd to block-copy things around (very dangerous command if you don't know what are doing, I'm not able to help here).
 
Hi,
you can simply rename the disk to vm-103-disk-2 on the storage. The command depends on the storage type of DATA. For lvm use lvrename, for zfs use zfs rename.

Afterwards, use qm rescan to update the configuration files.
 

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!