I need help.
I apologize in advance for my English - I am translating the text using an online translator
I will tell you about how the problem appeared - it may be important information.
I, periodically, move from one dedicated server to another.
I do it this way: I install LXD on the new server with the following commands:
apt install -y wget curl jq htop unzip snap snapd tmux
snap install lxd
apt install -y zfsutils-linux
source /etc/environment
I create a preseed.yaml file with the following content:
config:
images.auto_update_cached: "false"
images.auto_update_interval: "0"
networks:
- config:
ipv4.address: auto
ipv6.address: auto
description: ""
name: lxdbr0
type: ""
project: default
storage_pools:
- config:
size: 3000GB
description: ""
name: pool-1
driver: zfs
profiles:
- config: {}
description: ""
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: pool-1
size: 20GB
type: disk
name: default
projects: []
cluster: null
Next, I created snapshots on the old server:
lxc snapshot proxy3 proxy3
I copied the profiles to the new server:
lxc profile copy proxy HostName-4:proxy
I copied the LXD containers to the new server:
lxc copy proxy3/proxy3 Hostname:proxy3
Started containers on the new server.
lxc start proxy3
I don’t think I forgot to write anything (it all worked)…
But this time it happened that I deleted the old server before I did the container migration.
But I backed up the containers beforehand:
tar cvfz /var/snap/myserver.tar.gz .
Now about the actions after which the problem arose:
- Installed LXD on a new server:
apt install -y wget curl jq htop unzip snap snapd tmux
snap install lxd
apt install -y zfsutils-linux
source /etc/environment
preseed.yaml
config:
images.auto_update_cached: "false"
images.auto_update_interval: "0"
networks:
- config:
ipv4.address: auto
ipv6.address: auto
description: ""
name: lxdbr0
type: ""
project: default
storage_pools:
- config:
size: 3000GB
description: ""
name: pool-1
driver: zfs
profiles:
- config: {}
description: ""
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: pool-1
size: 20GB
type: disk
name: default
projects: []
cluster: null
- Downloaded the myserver.tar.gz archive to the new server;
- Unpacked the archive:
sudo tar xvfz /tmp/myserver.tar.gz -C /var/snap/lxd/common/lxd
- Started LXD:
sudo snap start lxd
After that, entering the following commands nothing is displayed (empty):
lxc ls
lxc storage ls
Rebooting the server
I enter a command:
lxc ls
gives a list of all my containers that are currently stopped.
I enter a command:
lxc storage ls
displays zfs, the path to the pool and the status UNAVAILABLE
When I try to run any container, I get an error:
Error: Storage pool “pool-1” unavailable on this server
When entering a command:
lxd recover
It gives out an error:
Error: Failed validation request: Failed mounting pool “pool-1”: Failed to run: zpool import -f -d /var/snap/lxd/common/lxd/disks pool-1: exit status 1 (cannot import ‘pool-1’: I/O error)
zfs list
displays a message: no datasets available
Please help solve this problem