Bug 595323
Summary: | Can't change dhcp settings of network without stopping network. | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Neil Wilson <neil> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | unspecified | CC: | boris.savelev, casmith, crobinso, jtomko, xen-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-16 15:18:57 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Neil Wilson
2010-05-24 11:34:01 UTC
The virNetworkUpdate API allows changing the dhcp hosts now: commit fe7872827f0451fcc8f6618269f5ed13a2feeb67 Author: Laine Stump <laine> AuthorDate: 2012-09-19 07:38:43 -0400 Commit: Laine Stump <laine> CommitDate: 2012-09-20 22:20:22 -0400 virsh: new net-update command This command uses the new virNetworkUpdate() API to modify an existing network definition, and optionally have those modifications take effect immediately without restarting the network. An example usage: virsh net-update mynet add-last ip-dhcp-host \ "<host mac='00:11:22:33:44:55' ip='192.168.122.45'/>" \ --live --config If you like, you can instead put the xml into a file, and call like this: virsh net-update mynet add ip-dhcp-host /tmp/myxml.xml --live --config virsh will autodetect whether the argument is itself an xml element, or if it's a file, by looking at the first character - the first character of an xml element is always "<", and the first character of a file is almost always *not* "<" (in the rare case that it is, the user could specify "./<filename..."). A --parent-index option is also available (to give the index within a list of parent objects, e.g. the index of the parent <ip> element when updating ip-dhcp-host elements), but is optional and at least for now will probably be used rarely. --live, --config, and --current options - if you specify --live, only the live state of the network will be updated. If you also specify --config, then the persistent configuration will also be updated; these two commands can be given separately, or both together. If you don't specify either (you can optionally specify "--current" for the same effect), then the "current" config will be updated (i.e. if the network is active, then only its live config is affected, but if the network is inactive, only the persistent config is affected). git describe: v0.10.2-rc1-38-gfe78728 contains: v0.10.2-rc2~3 And the dhcp range as well: commit 1100f61074b9024fbbc5fb548392fbc99e9e5ca4 Author: Laine Stump <laine> AuthorDate: 2012-09-20 22:25:40 -0400 Commit: Daniel Veillard <veillard> CommitDate: 2012-09-21 11:54:16 +0800 network: backend for virNetworkUpdate of dhcp range The dhcp range element is contained in the <dhcp> element of one of a network's <ip> elements. There can be multiple <range> elements. Because there are only two attributes (start and end), and those are exactly what you would use to identify a particular range, it doesn't really make sense to modify an existing element, so VIR_NETWORK_UPDATE_COMMAND_MODIFY isn't supported for this section, only ADD_FIRST, ADD_LAST, and DELETE. Since virsh already has support for understanding all the defined sections, this new backend is automatically supported by virsh. You would use it like this: virsh net-update mynet add ip-dhcp-range \ "<range start='1.2.3.4' end='1.2.3.20'/>" --live --config The bridge driver also already supports all sections, so it's doing the correct thing in this case as well - since the dhcp range is placed on the dnsmasq commandline, the bridge driver recreates the dnsmasq commandline, and re-runs dnsmasq whenever a range is added/deleted (and AFFECT_LIVE is specified in the flags). git describe: v0.10.2-rc1-39-g1100f61 contains: v0.10.2-rc2~2 |