Moving a VM to a removable USB disk and occasionally running from Proxmox

MagellanTX

New Member
Jun 19, 2024
5
1
3
Hello,

I am migrating from ESXi to Proxmox VE and while everything has been going very well, I do have one special case I can’t figure out how to do on Proxmox.

In ESXi, I have a Root CA server (a VM) that runs from a USB disk that gets mounted as an independent datastore. The entire VM (.vmx and .vmdk) exist only on that USB disk, and when removed, do not show up in the inventory. Twice a year, I mount the USB disk, mount the datastore, and import the .vmx so I can power-on the guest. When finished, I simply unregister (not delete) the VM, and dismount the datastore.

I am trying to do the same thing in Proxmox. I do have the VM already migrated to the Proxmox cluster but the disk currently exists in the Ceph pool, and I need to move it to the USB. As far as the LVM storage for the Proxmox host, I have successfully mounted an external USB drive and configured it for LVM storage. Unfortunately, that's about as far as I can get because initial testing shows that if I remove and re-add the storage, Proxmox treats it as ‘new’ and I cannot power up the machine. In addition, once I remove the USB, the VM itself still shows up in the inventory.

I’m not sure of the best way to proceed from here. Is there a good way to do this in Proxmox where I can have a machine stored on a USB disk, remove it (along with the VM entry in the inventory) and re-mount it later when I need to use it?

Thank You!
 
In addition, once I remove the USB, the VM itself still shows up in the inventory.
Yes, that's normal and due to the way it is implemented.

I’m not sure of the best way to proceed from here. Is there a good way to do this in Proxmox where I can have a machine stored on a USB disk, remove it (along with the VM entry in the inventory) and re-mount it later when I need to use it?
I cannot think of a better way than backing the VM up to the USB stick and delete it from PVE. If you need it, just restore it from the usb stick.
 
ESXi and Proxmox methodology are not 1:1.

You need to leave the storage defined, but you can disable it with commandline.

pvesm set storname --disable 0 # enables it, pass 1 to disable it

> I do have the VM already migrated to the Proxmox cluster but the disk currently exists in the Ceph pool, and I need to move it to the USB. As far as the LVM storage for the Proxmox host, I have successfully mounted an external USB drive and configured it for LVM storage

LVM is likely overkill for a single usb disk. You can probably just format the whole disk with XFS or use it as a single-disk ZFS pool, unless you plan on doing some weird things with lvm at some point.

Datacenter / Virtual machine / [click on vmid] / Hardware / [ click on virtual disk to move ] / [ click Disk Action button dropdown ] / Move Storage

If there is no actual hard requirement that the VM not show up in the inventory, just leave it there. Otherwise as LnxBil recommended, try just backing up + deleting the VM, and restoring it when needed.

Or, you could move the .conf file for the vm from /etc/pve/nodes/*/qemu-server to /root or something just to get it out of the way. But you may have to do a qm rescan when you move it back and re-enable the storage; have not tested this.
 
Last edited:
  • Like
Reactions: MagellanTX
ESXi and Proxmox methodology are not 1:1.

You need to leave the storage defined, but you can disable it with commandline.

pvesm set storname --disable 0 # enables it, pass 1 to disable it

> I do have the VM already migrated to the Proxmox cluster but the disk currently exists in the Ceph pool, and I need to move it to the USB. As far as the LVM storage for the Proxmox host, I have successfully mounted an external USB drive and configured it for LVM storage

LVM is likely overkill for a single usb disk. You can probably just format the whole disk with XFS or use it as a single-disk ZFS pool, unless you plan on doing some weird things with lvm at some point.

Datacenter / Virtual machine / [click on vmid] / Hardware / [ click on virtual disk to move ] / [ click Disk Action button dropdown ] / Move Storage

If there is no actual hard requirement that the VM not show up in the inventory, just leave it there. Otherwise as LnxBil recommended, try just backing up + deleting the VM, and restoring it when needed.

Or, you could move the .conf file for the vm from /etc/pve/nodes/*/qemu-server to /root or something just to get it out of the way. But you may have to do a qm rescan when you move it back and re-enable the storage; have not tested this.

This works very well - Thank You!!

I created an XFS filesystem and placed the VM on that. Since I only have to do this twice a year, I decided to store the .conf file on the drive as well so it stays out of the inventory the rest of the time.

Thanks again!
 
Last edited:
  • Like
Reactions: Kingneutron

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!