LXC Container on different server than its drive

jgarrigues

New Member
Jun 1, 2022
3
0
1
I am not totally sure how this happened or how it is even possible but somehow my LXC Container and its virtual drive have ended up on different machines. We have 2 of what I will call head servers and 1 storage array. We just started to use LXC containers and discovered that they were stored locally on the heads instead of on our storage array because we are using ZFS over iscsi which does not support LXC containers. Last night we had a technical issue with our setup that I was not part of fixing. I came in today and found my container is on a different head from where it was yesterday and it was off. I tried to power it on and was given the following error "TASK ERROR: zfs error: cannot open 'rpool/data/subvol-803-disk-0': dataset does not exist". I looked at the server under CT volumes and confirmed the drive was not on that head. I then checked the other head and found the missing drive. My problem is I can't seem to migrate the LXC container to the head where its drive is currently located. ProxMox just tells me the drive is missing so the LXC container can't be moved. Is there a shell command I can use to move the drive to the head the LXC container is currently on or vice versa? I am still rather new to both ProxMox and LXC containers so any help would be greatly appreciated.
 
Hi,
what you can do is either:
  1. manually remove the volume(s) not present on the current node from the configuration (copy the line(s) somewhere else)
  2. migrate
  3. manually re-add the volume(s) to the configuration
or, if all volumes are on the other node:
  1. manually move the configuration file
    Code:
    mv /etc/pve/nodes/<wrong node>/lxc/<ID>.conf /etc/pve/nodes/<correct node>/lxc/<ID>.conf

As for why it happened: Did you maybe configure HA for the container? HA needs shared (or replicated ZFS) storage. If a node goes down, HA will try to recover the container on a different node. You can also limit the allowed nodes by using a HA group.
 

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!