Clone VM and exclude a disk

Egeus

New Member
Feb 7, 2018
5
0
1
33
Hello,
one of my VMs has got normal virtual hard disk (for the operating system) and a huge storage backend, which is directly attached via the VMs-config file (scsi1: /dev/disk/by-id/....., backup=0, size_=....K).

If I do a system update I normally clone the VM, change the MAC and hostname, and test the update procedure on the clone. If everything works fine I will do the update on the original VM.

The problem for me is now that I can't clone the VM (Error: unable to parse volume ID '/dev/disk/by-id...'(500)). Furthermore I dont want to clone the whole data-storage - only the virtual Hard-Disk with the operating-system (scsi0).

I know, that is not exactly that what a clone should do, but is there any possibility to clone a VM and exclue a drive? Or is there any other way I should go?

Thank you very much!
 
Depending on your Storage (ZFS, thinLVM), you can create a snapshot of the os disk by hand and update the VM directly (rollback if problems). Or use a backup/restore and select 'no backup' in the GUI on the big storage disk.
 
Thank you for you're answer.
The last time I did the big system updates I did it exactly that way but there are two big problems:
1. If there are problems in the update (which took a little bit longer to find out how to be fixed) the productive machine is down the whole time. Furthermore I had to change system settings that no external user could change data in that time.
2. If the update break something I had to use the backup - but what happend if the backup is not working or the disk for the backups is failing in exactly that moment (and you know - it will fail in exactly that situation)? There is now way how to check if the backup is working 100%!

So in my opinion is always the best way on those virtual enviroments to clone the machine, edit IP and hostname, check if everything is working 100% and only in that case touch the original VM. And not test on the original VM and if something is not working destroy it with a hopefully and never checked backup...
 
Hi!

Did you find a solution? I have exactly the same scenario - Nextcloud server with 12Tb iSCSI storage (so I cannot make a snapshot because iSCSI storage doesn't support it). I would like to create same server with the small storage for upgrade tests, so I need to exclude 12Tb disk from configuration.
Cloning individual disks anf attaching it to new VM would be fine too .
 
Hi,
Hi!

Did you find a solution? I have exactly the same scenario - Nextcloud server with 12Tb iSCSI storage (so I cannot make a snapshot because iSCSI storage doesn't support it). I would like to create same server with the small storage for upgrade tests, so I need to exclude 12Tb disk from configuration.
Cloning individual disks anf attaching it to new VM would be fine too .
you can either:
  • Shut down the VM, detach the large disk, make a clone (the detached disk won't be copied), re-attach the large disk, start the VM.
  • Re-create a second VM with the same settings, but no disk. Then run qm set <ID of new VM> -<drive key> <target storage ID>:0,import-from=<volume ID of the old VM's disk>. This also works while the original VM is running.
    But it's hard to read, so here is a concrete example: qm set 356 -scsi0 dir:0,import-from=zfs:vm-104-disk-0 will clone the disk vm-104-disk-0 on the storage called zfs to a new disk on the storage called dir and attach it to the SCSI 0 bus for VM 356.
 
Hi,

you can either:
  • Shut down the VM, detach the large disk, make a clone (the detached disk won't be copied), re-attach the large disk, start the VM.
  • Re-create a second VM with the same settings, but no disk. Then run qm set <ID of new VM> -<drive key> <target storage ID>:0,import-from=<volume ID of the old VM's disk>. This also works while the original VM is running.
    But it's hard to read, so here is a concrete example: qm set 356 -scsi0 dir:0,import-from=zfs:vm-104-disk-0 will clone the disk vm-104-disk-0 on the storage called zfs to a new disk on the storage called dir and attach it to the SCSI 0 bus for VM 356.
Thanks, will try this on wekend.
 

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!