使用:
$ virsh version
Compiled against library: libvirt 1.3.1
Using library: libvirt 1.3.1
Using API: QEMU 1.3.1
Running hypervisor: QEMU 2.5.0
$
$
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
我想使用 virsh 删除 libvirt 的 dhcp 租约条目。
$ virsh net-list
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
docker-machines active yes yes
$ virsh net-dhcp-leases docker-machines
Expiry Time MAC address Protocol IP address Hostname Client ID or DUID
-------------------------------------------------------------------------------------------------------------------
2017-05-10 16:15:38 52:54:00:8e:15:f5 ipv4 192.168.42.22/24 minikubecluster ff:c2:72:f6:09:00:02:00:00:ab:11:af:a8:d1:af:21:23:5c:49
2017-05-10 16:09:57 52:54:00:c6:51:45 ipv4 192.168.42.23/24 registry 01:52:54:00:c6:51:45
我尝试使用不同的选项virsh net-update delete
,但总是收到此错误:
couldn't locate a matching dhcp host entry in network 'docker-machines'
这是因为 libvirt 的租约文件发生了变化(它们以网络接口命名,格式为 JSON)吗?如果是这样,那么我该怎么做?
答案1
删除子命令的工作方式与添加子命令相同。
virsh net-update docker-machines delete ip-dhcp-host \
"<host mac='52:54:00:8e:15:f5' \
name='minikubecluster' ip='192.168.42.22' />" \
--live --config