[SOLVED] How to replace a qcow2 file

jfmanamtr

New Member
Jul 9, 2020
9
10
3
42
Ok. So, I am a little new to Proxmox. I have found this as an alternative to running VMWare. So far it is great. I had a cluster setup (2 pve nodes (pve-manager/6.2-6/ee1d7754) & 2 nfs freenas nodes) & was running a ubuntu vm hosting grafana. I kept the qcow2 file off the freenas system in hopes of putting that drive back into place (don't want to go back through the setup & the historical data will be nice).

My new setup is 2 pve nodes ( runnig pve-manager/6.2-6/ee1d7754) clustered running zfs for the storage. I have created the ubuntu vm on the cluster, but I am not sure how to replace the qcow2 file on this new zfs. I can see the file on the zfs running the following:

Code:
pvesm list storage2
Volid                  Format  Type               Size VMID
storage2:vm-100-disk-0 raw     images     536870912000 100
storage2:vm-100-disk-1 raw     images    8796093022208 100
storage2:vm-101-disk-0 raw     images     268435456000 101 <- this is the file I want to replace.

But I am not sure how to accomplish this. I can't seem to find it documented. So any help would be greatly appreciated. Just let me know if you need anything else.
 
PVE is not always using files for disk storage. It depends on the underlying storage. On a ZFS based storage, ZFS datasets of the type ZVOL are used for VM disks.

You can use the qm importdisk command [0] to import another disk image file to any storage.

In your case it will be most likely qm importdisk 101 /path/to/old_disk.qcow2 storage2

The disk should show up as an unused disk in the hardware panel of the VM. From there on you can just attach it, or remove the other one and attach only the imported one.

[0] https://pve.proxmox.com/pve-docs/qm.1.html
 
Moayad - Thanks for your reply. That will be useful information in the future. The disk was already in qcow2 format. But I have other disks that I will need to convert.

Aaron - Thank you. That worked like I needed. I couldn't find that command. I am not 100% familiar with Proxmox & qemu. I need to work on that a lot better.

I will mark this resolved.
 
  • Like
Reactions: aaron

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!