我在一台笔记本电脑 (x86_64) 上运行 Ubuntu 22.04,上面有七个 Ubuntu 22.04 实例。它们都运行良好;六个仍然运行良好。
但是,其中一个不再启动。当我发出以下命令时:
multipass start CurrentLTS
//OR multipass shell CurrentLTS
我立即收到以下错误:
[2022-12-22T10:48:40.491] [error] [lxd request] Operation completed with error: (400) Failed start validation for device "eth0": Instance DNS name "currentlts" already used on network
start failed: Operation completed with error: (400) Failed start validation for device "eth0": Instance DNS name "currentlts" already used on network
没有命名的实例currentlts
或任何名称接近的实例。multipass info CurrentLTS
输出如下:
Name: CurrentLTS
State: Stopped
IPv4: --
Release: --
Image hash: 6159291f6783 (Ubuntu 22.04 LTS)
Load: --
Disk usage: --
Memory usage: --
Mounts: --
如果我运行该start
命令,-vvvv
我会得到以下输出:
[2022-12-22T11:05:42.970] [trace] [lxd request] Requesting LXD: GET unix://multipass/var/snap/lxd/common/lxd/[email protected]/virtual-machines/CurrentLTS/state?project=multipass
[2022-12-22T11:05:42.973] [trace] [lxd request] Got reply: {
"error": "",
"error_code": 0,
"metadata": {
"cpu": {
"usage": 0
},
"disk": null,
"memory": {
"swap_usage": 0,
"swap_usage_peak": 0,
"usage": 0,
"usage_peak": 0
},
"network": null,
"pid": 0,
"processes": 0,
"status": "Stopped",
"status_code": 102
},
"operation": "",
"status": "Success",
"status_code": 200,
"type": "sync"
}
[2022-12-22T11:05:42.973] [trace] [CurrentLTS] Got LXD container state: CurrentLTS is Stopped
[2022-12-22T11:05:42.973] [trace] [lxd request] Requesting LXD: GET unix://multipass/var/snap/lxd/common/lxd/[email protected]/virtual-machines/CurrentLTS/state?project=multipass
[2022-12-22T11:05:42.975] [trace] [lxd request] Got reply: {
"error": "",
"error_code": 0,
"metadata": {
"cpu": {
"usage": 0
},
"disk": null,
"memory": {
"swap_usage": 0,
"swap_usage_peak": 0,
"usage": 0,
"usage_peak": 0
},
"network": null,
"pid": 0,
"processes": 0,
"status": "Stopped",
"status_code": 102
},
"operation": "",
"status": "Success",
"status_code": 200,
"type": "sync"
}
[2022-12-22T11:05:42.975] [trace] [CurrentLTS] Got LXD container state: CurrentLTS is Stopped
[2022-12-22T11:05:42.975] [trace] [lxd request] Requesting LXD: GET unix://multipass/var/snap/lxd/common/lxd/[email protected]/virtual-machines/CurrentLTS/state?project=multipass
[2022-12-22T11:05:42.978] [trace] [lxd request] Got reply: {
"error": "",
"error_code": 0,
"metadata": {
"cpu": {
"usage": 0
},
"disk": null,
"memory": {
"swap_usage": 0,
"swap_usage_peak": 0,
"usage": 0,
"usage_peak": 0
},
"network": null,
"pid": 0,
"processes": 0,
"status": "Stopped",
"status_code": 102
},
"operation": "",
"status": "Success",
"status_code": 200,
"type": "sync"
}
[2022-12-22T11:05:42.978] [trace] [CurrentLTS] Got LXD container state: CurrentLTS is Stopped
[2022-12-22T11:05:42.978] [trace] [lxd request] Requesting LXD: PUT unix://multipass/var/snap/lxd/common/lxd/[email protected]/virtual-machines/CurrentLTS/state?project=multipass
[2022-12-22T11:05:42.978] [trace] [lxd request] Sending data: {"action":"start"}
[2022-12-22T11:05:42.985] [trace] [lxd request] Got reply: {
"error": "",
"error_code": 0,
"metadata": {
"class": "task",
"created_at": "2022-12-22T11:05:42.98045405-05:00",
"description": "Starting instance",
"err": "",
"id": "5edff0b7-c80c-4949-9c2a-3c8c4fe13d79",
"location": "none",
"may_cancel": false,
"metadata": null,
"resources": {
"instances": [
"/1.0/instances/CurrentLTS"
]
},
"status": "Running",
"status_code": 103,
"updated_at": "2022-12-22T11:05:42.98045405-05:00"
},
"operation": "/1.0/operations/5edff0b7-c80c-4949-9c2a-3c8c4fe13d79",
"status": "Operation created",
"status_code": 100,
"type": "async"
}
[2022-12-22T11:05:42.985] [trace] [lxd request] Requesting LXD: GET unix://multipass/var/snap/lxd/common/lxd/[email protected]/operations/5edff0b7-c80c-4949-9c2a-3c8c4fe13d79/wait?project=multipass
[2022-12-22T11:05:42.989] [trace] [lxd request] Got reply: {
"error": "",
"error_code": 0,
"metadata": {
"class": "task",
"created_at": "2022-12-22T11:05:42.98045405-05:00",
"description": "Starting instance",
"err": "Failed start validation for device \"eth0\": Instance DNS name \"currentlts\" already used on network",
"id": "5edff0b7-c80c-4949-9c2a-3c8c4fe13d79",
"location": "none",
"may_cancel": false,
"metadata": null,
"resources": {
"instances": [
"/1.0/instances/CurrentLTS"
]
},
"status": "Failure",
"status_code": 400,
"updated_at": "2022-12-22T11:05:42.98045405-05:00"
},
"operation": "",
"status": "Success",
"status_code": 200,
"type": "sync"
}
[2022-12-22T11:05:42.990] [error] [lxd request] Operation completed with error: (400) Failed start validation for device "eth0": Instance DNS name "currentlts" already used on network
start failed: Operation completed with error: (400) Failed start validation for device "eth0": Instance DNS name "currentlts" already used on network`
这可能是什么原因造成的?这个实例是所有七个实例中最老的,上面有一些关键的应用程序。我已经没有办法了。
如果无法启动它,有没有办法从中恢复数据?
Ubuntu 22.04 is running latest updates
multipass version 1.10.1
multipassd version 1.10.1
lxd version: 5.9
答案1
我偶然发现了实例映像,并将其复制并写入外部驱动器。我能够访问所有我以为已经丢失的应用程序文件。
以下是我找到该图像的方法。我尝试运行lxd recover
事件,尽管我知道这不是正确的命令,但在退出命令之前它显示了以下内容:
# lxd recover
This LXD server currently has the following storage pools:
- multipass (backend="dir", source="/var/snap/lxd/common/lxd/storage-pools/multipass")
Would you like to recover another storage pool? (yes/no) [default=no]:
然后我查看了存储池:
# ls /var/snap/lxd/common/lxd/storage-pools/multipass
buckets containers containers-snapshots custom custom-snapshots images virtual-machines virtual-machines-snapshots
然后:
# ls /var/snap/lxd/common/lxd/storage-pools/multipass/virtual-machines/multipass_CurrentLTS
agent-client.crt agent-client.key agent.crt agent.key backup.yaml config config.iso metadata.yaml qemu.nvram root.img templates
我估计实例映像肯定是root.img
这样的,所以我复制了 118GB 的文件,并使用 Archive Manager 将其写入外部硬盘。现在我可以访问这些文件了。
有人知道恢复实例的最佳方法吗?或者我应该删除实例,安装一个带有所需软件的新实例,然后将应用程序文件复制到其中?