Bug 911957
| Summary: | Cannot add Network to interface without static IP (None or DHCP fail) | ||
|---|---|---|---|
| Product: | [Retired] oVirt | Reporter: | Yamakasi <yamakasi.014> |
| Component: | ovirt-engine-webadmin | Assignee: | Nobody's working on this, feel free to take it <nobody> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.2 | CC: | acathrow, bilias, danken, demchenko.ya, ecohen, iheim, mgoldboi, pzhukov |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | network | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-07-26 14:12:00 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
We had the same problem with vdsm-4.10.3-0.28.18.el6.x86_64
I guess it comes from:
/usr/share/vdsm/configNetwork.py:878
if not netmask:
netmask = "255.255.255.0"
???
A change like the following solves this problem:
if ipaddr and not netmask:
netmask = "255.255.255.0"
Giannis
Same problem with vdsm.x86_64 4.10.3-0.30.19.el6
It seems the root of the problem from this: "bootProtocol=NONE, address=, subnet=, gateway=null", every operand but "gateway" set as "", while "gateway" set as "null"
and in /usr/share/vdsm/configNetwork.py:813 :
if netmask or gateway:
raise ConfigNetworkError(ne.ERR_BAD_ADDR,
"Specified netmask or gateway but not ip")
i presume "null" counts as word, so evaluation "if exist" gateway resolved as "true", so exception is raised.
So solution to this would be either pass "gateway=" (without "null" word, as other operands) in engine or change configNetwork.py check to count "null" as false.
(In reply to comment #1) > We had the same problem with vdsm-4.10.3-0.28.18.el6.x86_64 > > I guess it comes from: > /usr/share/vdsm/configNetwork.py:878 > > if not netmask: > netmask = "255.255.255.0" > > ??? > > A change like the following solves this problem: > if ipaddr and not netmask: > netmask = "255.255.255.0" > > Giannis This piece of code does not come from stock vdsm, but from http://www.dreyou.org/ovirt/vdsm32.patch. Do you see any problem if you revert the following patch? diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 53debfa..c8a80f1 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -873,6 +873,11 @@ def addNetwork(network, vlan=None, bonding=None, nics=None, ipaddr=None, _netinfo = netinfo.NetInfo() bridged = utils.tobool(bridged) + # Hack here, netmask may be not defined, if this happen, + # set netmask to 255.255.255.0 + if not netmask: + netmask = "255.255.255.0" + if mtu: mtu = int(mtu) From my opinion
In the command: eth2 {id=713f2687-6d84-4010-9076-fbfc67cf6831, vdsId=033febb8-4f52-4253-bb6d-a8807816affd, name=eth2, macAddress=00:1c:c4:d8:cb:36, networkName=LAN_TEST, bondName=null, bootProtocol=NONE, address=, subnet=, gateway=null, mtu=0, bridged=false, speed=1000, type=0, networkImplementationDetails=null}],
removedNetworks=[],
gateway=null
Should be:
gateway=
to follow format of address and subnet parameters. So it's ovirt-engine side, not vdsm.
(In reply to comment #3) Yes - reverted patch did the job, without it I was able to add network with bootproto=none. sorry for wrong assumptions... |
Description of problem: Add a network to an interface and set the IP to NONE or DHCP. In both cases you get the following error while saving the made settings: Error while executing action Setup Networks: Illegal or Incomplete IP Address When setting a static IP things are fine. Version-Release number of selected component (if applicable): 3.2 How reproducible: Steps to Reproduce: 1. Create a Network 2. Add Network to an interface of a host 3. Set IP to None or DHCP. Actual results: eth2 {id=713f2687-6d84-4010-9076-fbfc67cf6831, vdsId=033febb8-4f52-4253-bb6d-a8807816affd, name=eth2, macAddress=00:1c:c4:d8:cb:36, networkName=LAN_TEST, bondName=null, bootProtocol=NONE, address=, subnet=, gateway=null, mtu=0, bridged=false, speed=1000, type=0, networkImplementationDetails=null}], removedNetworks=[], removedBonds=[]), log id: 7a99dbd1 2013-02-12 23:31:08,783 INFO [org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand] (ajp--127.0.0.1-8702-10) [7289062c] FINISH, SetupNetworksVDSCommand, log id: 7a99dbd1 2013-02-12 23:31:09,796 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (ajp--127.0.0.1-8702-10) [7289062c] org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException: VDSGenericException: VDSNetworkException: Specified netmask or gateway but not ip 2013-02-12 23:31:09,797 ERROR [org.ovirt.engine.core.vdsbroker.VDSCommandBase] (ajp--127.0.0.1-8702-10) [7289062c] Command SetupNetworksVDS execution failed. Exception: VDSNetworkException: VDSGenericException: VDSNetworkException: Specified netmask or gateway but not ip 2013-02-12 23:31:09,798 ERROR [org.ovirt.engine.core.bll.network.host.SetupNetworksCommand] (ajp--127.0.0.1-8702-10) [7289062c] Command org.ovirt.engine.core.bll.network.host.SetupNetworksCommand throw Vdc Bll exception. With error message VdcBLLException: org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException: VDSGenericException: VDSNetworkException: Specified netmask or gateway but not ip Expected results: No Error! Additional info: