[ovirt-users] problem setting up bonding via rest in ovirt 3.6.6.2

Juan Hernández jhernand at redhat.com
Tue Aug 9 21:06:14 UTC 2016


On 08/09/2016 05:14 PM, Sven Kieske wrote:
> Hi,
> 
> I'd like to setup host network in the following way:
> 
> I have 4 interfaces: eth0, eno1, eno2, eno3
> 
> ovirtmgmt network resides on eth0 and is working.
> 
> Now I want to setup a bonding with the slave interfaces
> eno2 and eno3 via the hosts "setupnetworks" function:
> 
> URL:
> 
> https://engine-fqdn/api/hosts/9cdcc85b-dd87-4dcf-9275-b993ee5b5e9c/nics/setupnetworks
> 

You are using "nics/setupnetworks", which is the old and deprecated
method. You should try to use "hosts/{host:id}/setupnetworks" instead.
For example, with curl:

---8<---
#!/bin/bash -ex

url="https://engine-fqdn/api"
user="admin at internal"
password="..."

curl \
--verbose \
--request POST \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Version: 3" \
--data '
{
  "modified_bonds": {
    "host_nic": [
      {
        "name": "bond0",
        "bonding": {
          "options": {
            "option": [
              {
                "name": "mode",
                "value": "1"
              },
              {
                "name": "miimon",
                "value": "100"
              }
            ]
          },
          "slaves": {
            "host_nic": [
              {
                "name": "eth1"
              },
              {
                "name": "eth2"
              }
            ]
          }
        }
      }
    ]
  }
}
' \
"${url}/hosts/5d6741c0-d5f3-44f6-9ff5-fce2a3e8fe02/setupnetworks"
--->8---

Other than that you request looks correct and I think it should work.

NOTE: Consider using "/ovirt-engine/api" as "/api" won't work with
version 4 of the engine.

> Request:
> 
> {
>     "modified_bonds": {
>         "host_nic": [{
>             "name": "bond0",
>             "bonding": {
>                 "options": {
>                     "option": [{
>                         "name": "mode",
>                         "value": "1"
>                     }, {
>                         "name": "miimon",
>                         "value": "100"
>                     }]
>                 },
>                 "slaves": {
>                     "host_nic": [{
>                         "name": "eno2"
>                     }, {
>                         "name": "eno3"
>                     }]
>                 }
>             }
>         }]
>     }
> }
> 
> Response from ovirt-engine:
> 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <fault>
>     <reason>Incomplete parameters</reason>
>     <detail>Action [hostNics] required for setupNetworks</detail>
> </fault>
> 
> When I look at the rsdl docs this seems perfectly fine.
> 
> 
> I tried google with this error condition but it didn't return anything
> useful unfortunately.
> 
> Your help would be greatly appreciated.
> 
> The official RH docs also do not mention anything else:
> 
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.6/html-single/REST_API_Guide/index.html#Multiple_Network_Setup_Action
> 
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.6/html-single/REST_API_Guide/index.html#Bonded_Interfaces
> 
> Also this tool doesn't seem to mention anything else:
> 
> https://jhernand.fedorapeople.org/ovirt-api-explorer/#/services/host/methods/setup_networks
> 

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160809/c325a77d/attachment-0001.sig>


More information about the Users mailing list