使用:
$ 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
我试过不同的select使用virsh net-update delete ,但我不断收到此错误:
couldn't locate a matching dhcp host entry in network 'docker-machines'
这是因为libvirt的租约文件被更改(它们是以networking接口命名的,格式是JSON)? 如果是这样,那我该怎么做呢?
delete子命令的作用方式与add子命令相同。
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
Libvirt – networking – virsh net-update