使用virsh删除libvirt的dhcp租约条目

问题描述 投票:2回答:1

使用:

$ 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)?如果是这样,那我该怎么办呢?

libvirt dnsmasq
1个回答
0
投票

动态租约很难使用virsh删除。

删除var / lib / libvirt / dnsmasq / virbr0。*文件将适用于默认网络。假设所有功能均已关闭,即所有虚拟机均已关闭

sudo rm var/lib/libvirt/dnsmasq/virbr0.*
© www.soinside.com 2019 - 2024. All rights reserved.