LXC Migrated after power failure but storage did not copy

Tmanok

Renowned Member
Hi everyone,

I have a fairly simple problem. Power to some personal PVE servers was lost and when it came back one of my LXC's configured for HA was "migrated" and attempted to boot but failed to... I took a look to find out what happened and noticed that it was on local storage of the first server before the power failure due to maintenance I performed recently (I forgot to put it on shared storage after). It came as a surprise that despite it being "stuck" on the local storage of the first server, it still moved the config to another server.... However, I'm now left with my LXC config on one server and my LXC storage on another server.

The only solution I can think of is:
  1. Create a "fake" local storage on a directory called the same thing as the original storage.
  2. Copy the LXC files from the first server to the current server that it lives on.
OR
  1. Fence the LXC to the current node and the original node, then reboot the current node and see if it fixes itself...
OR
  1. Restore from backup but lose time consuming work put into it during the recent maintenance ¯\_(ツ)_/¯
Is there a better way to remedy this situation?
Thanks,


Tmanok
 
Update for everyone:

I solved it by copying the virtual disk file for the VM as briefly summarized in the first option. It looked like this:
Server A contains virtual disk in /mnt/sdb1/images/115/
Server B contains no virtual disk files but own the configuration.

  1. Create a mount point sufficient to store the LXC's virtual disk files on Server B.
    Add disk or NAS mount point to /mnt/sdb1, I had a spare disk that I formatted remotely using the PVE node GUI and then mounted it to that directory on Server B only using the datacentre GUI.
  2. On Server B:
    Code:
    scp -r servera:/mnt/sdb1/images/115/ /mnt/sdb1/images/
  3. On Server B: Start LXC (test)
  4. On Server B: Login to services hosted by LXC and verify everything works
  5. On Server B: Shut down LXC and migrated disk to shared storage
  6. Cluster task: Migrate LXC to original owner
  7. Delete local copies after creating a PBS backup of LXC

Thanks,


Tmanok
 
I am still interested in determining how to add an existing LXC root disk to a new LXC. It seems like a rather odd limitation that you can't recreate an LXC using its root disk, there must be a way that I've simply missed in my search online.

Thanks,

Tmanok
 

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!