[ovirt-shell] update hostnic/nic ???

--_000_5697777B2050209dmcamcnetworkscom_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGksDQoNCkZpcnN0IEkgY3JlYXRlZCBhIGJvbmRpbmcgaW50ZXJmYWNlOg0KDQojIGFkZCBuaWMg LS1wYXJlbnQtaG9zdC1uYW1lIHNlcnZlcjAxIC0tbmFtZSBib25kMCAtLW5ldHdvcmstbmFtZSBW TEFONjAyIC0tYm9uZGluZy1zbGF2ZXMtaG9zdF9uaWMgaG9zdF9uaWMubmFtZT1lbm8xIC0tYm9u ZGluZy1zbGF2ZXMtaG9zdF9uaWMgaG9zdF9uaWMubmFtZT1lbm8yDQoNClRoaXMgd29ya3MgZ3Jl YXQgYnV0IG5vIElQIGlzIHNldCBvbiBWTEFONjAyLg0KDQpUaGVuIEknbSB0cnlpbmcgdG8gYWRk IGFuIGlwIGFkZHJlc3MgdG8gYSBuZXR3b3JrIHdpdGggdGhlIGZvbGxvd2luZyBjb21tYW5kOg0K DQojIHVwZGF0ZSBob3N0bmljIC0tcGFyZW50LWhvc3QtbmFtZSBzZXJ2ZXIwMSAtLW5ldHdvcmst bmFtZSBWTEFONjAyIC0tYm9vdF9wcm90b2NvbCBzdGF0aWMgLS1pcC1hZGRyZXNzIDEwLjEwLjEw LjEwIC0taXAtbmV0bWFzayAyNTUuMjU1LjI1NS4wDQoNCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IEVSUk9SID09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgd3JvbmcgbnVtYmVyIG9mIGFyZ3VtZW50cywgdHJ5ICdoZWxwIHVwZGF0ZScgZm9yIGhl bHAuDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQ0KDQpMb29raW5nIGF0IHRoaXMgZG9jdW1lbnQgaHR0cHM6Ly9hY2Nlc3MucmVkaGF0LmNvbS9k b2N1bWVudGF0aW9uL2VuLVVTL1JlZF9IYXRfRW50ZXJwcmlzZV9WaXJ0dWFsaXphdGlvbi8zLjYt QmV0YS9odG1sL1JIRVZNX1NoZWxsX0d1aWRlL25pYy5odG1sIEkgbmVlZCB0byB1c2UgIm5pYyIg aW5zdGVhZCBvZiAiaG9zdG5pYyIgYnV0IHRoZW4gSSBkb24ndCBoYXZlIHRoZSBvcHRpb25zIHRv IHNheSB0aGlzIGlzIGEgLS1wYXJlbnQtaG9zdC1uYW1lLiBPbmx5IFZNIHJlbGF0ZWQgY29tbWFu ZCBvcHRpb25zLg0KDQpTbyBJIHRoaW5rIHRoZSBkb2N1bWVudGF0aW9uIGlzIGJlaGluZC4NCg0K Q2FuIHNvbWVib2R5IGhlbHAgbWUgd2l0aCB3aGF0IHRoZSBjb21tYW5kIGlzIHRvIGFkZCBhIElQ IHRvIGEgVkxBTi9OZXR3b3JrIGZvciBhIGhvc3Q/DQoNCg0KLS0NCktpbmQgcmVnYXJkcywNCg0K SnVycmnDq24gQmxvZW1lbg0KDQpUaGlzIG1lc3NhZ2UgKGluY2x1ZGluZyBhbnkgYXR0YWNobWVu dHMpIG1heSBjb250YWluIGluZm9ybWF0aW9uIHRoYXQgaXMgcHJpdmlsZWdlZCBvciBjb25maWRl bnRpYWwuIElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQsIHBsZWFzZSBub3Rp ZnkgdGhlIHNlbmRlciBhbmQgZGVsZXRlIHRoaXMgZW1haWwgaW1tZWRpYXRlbHkgZnJvbSB5b3Vy IHN5c3RlbXMgYW5kIGRlc3Ryb3kgYWxsIGNvcGllcyBvZiBpdC4gWW91IG1heSBub3QsIGRpcmVj dGx5IG9yIGluZGlyZWN0bHksIHVzZSwgZGlzY2xvc2UsIGRpc3RyaWJ1dGUsIHByaW50IG9yIGNv cHkgdGhpcyBlbWFpbCBvciBhbnkgcGFydCBvZiBpdCBpZiB5b3UgYXJlIG5vdCB0aGUgaW50ZW5k ZWQgcmVjaXBpZW50DQo= --_000_5697777B2050209dmcamcnetworkscom_ Content-Type: text/html; charset="utf-8" Content-ID: <DED479EC8EDE1E4F9CD5EE636812330C@chellomedia.com> Content-Transfer-Encoding: base64 PGh0bWw+DQo8aGVhZD4NCjxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0i dGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij4NCjwvaGVhZD4NCjxib2R5IHRleHQ9IiMwMDAwMDAi IGJnY29sb3I9IiNGRkZGRkYiPg0KPHR0PkhpLDxicj4NCjxicj4NCkZpcnN0IEkgY3JlYXRlZCBh IGJvbmRpbmcgaW50ZXJmYWNlOjxicj4NCjxicj4NCiMgYWRkIG5pYyAtLXBhcmVudC1ob3N0LW5h bWUgc2VydmVyMDEgLS1uYW1lIGJvbmQwIC0tbmV0d29yay1uYW1lIFZMQU42MDIgLS1ib25kaW5n LXNsYXZlcy1ob3N0X25pYyBob3N0X25pYy5uYW1lPWVubzEgLS1ib25kaW5nLXNsYXZlcy1ob3N0 X25pYyBob3N0X25pYy5uYW1lPWVubzI8YnI+DQo8YnI+DQpUaGlzIHdvcmtzIGdyZWF0IGJ1dCBu byBJU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b3IgY29uZmlkZW50aWFsLiBJZiB5b3UgYXJlIG5vdCB0aGUgaW50ZW5kZWQg cmVjaXBpZW50LCBwbGVhc2Ugbm90aWZ5IHRoZSBzZW5kZXIgYW5kIGRlbGV0ZSB0aGlzIGVtYWls IGltbWVkaWF0ZWx5IGZyb20geW91ciBzeXN0ZW1zIGFuZCBkZXN0cm95IGFsbCBjb3BpZXMgb2Yg aXQuIFlvdSBtYXkgbm90LA0KIGRpcmVjdGx5IG9yIGluZGlyZWN0bHksIHVzZSwgZGlzY2xvc2Us IGRpc3RyaWJ1dGUsIHByaW50IG9yIGNvcHkgdGhpcyBlbWFpbCBvciBhbnkgcGFydCBvZiBpdCBp ZiB5b3UgYXJlIG5vdCB0aGUgaW50ZW5kZWQgcmVjaXBpZW50DQo8L2JvZHk+DQo8L2h0bWw+DQo= --_000_5697777B2050209dmcamcnetworkscom_--

On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote:
Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 --bonding-slaves-host_nic host_nic.name=eno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the following command:
# update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
============================================================================================================== ERROR ============================================================================================================
wrong number of arguments, try 'help update' for help. ================================================================================================================================================================================================================================
Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a VLAN/Network for a host?
The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". -- 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.

--_000_569792F28080605dmcamcnetworkscom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On 14-01-16 12:16, Juan Hern=E1ndez wrote: On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D wrong number of arguments, try 'help update' for help. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualiza= tion/3.6-Beta/html/RHEVM_Shell_Guide/nic.html I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". Thanks! That works! Another question: Now I got the message that my network is out-of-sync. How can i force withi= n the ovirt-shell that it syncs the networks? This message (including any attachments) may contain information that is pr= ivileged or confidential. If you are not the intended recipient, please not= ify the sender and delete this email immediately from your systems and dest= roy all copies of it. You may not, directly or indirectly, use, disclose, d= istribute, print or copy this email or any part of it if you are not the in= tended recipient --_000_569792F28080605dmcamcnetworkscom_ Content-Type: text/html; charset="Windows-1252" Content-ID: <02CCC87D1338064BA29E9E828A9E926F@chellomedia.com> Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1= 252"> </head> <body text=3D"#000000" bgcolor=3D"#FFFFFF"> <br> <div class=3D"moz-cite-prefix"> <title></title> On 14-01-16 12:16, Juan Hern=E1ndez wrote:<br> </div> <blockquote cite=3D"mid:5697839B.6000708@redhat.com" type=3D"cite"> <pre wrap=3D"">On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document <a class=3D"moz-txt-link-freetext" href=3D"https://access.redhat.com/docume= ntation/en-US/Red_Hat_Enterprise_Virtualization/3.6-Beta/html/RHEVM_Shell_G= uide/nic.html">https://access.redhat.com/documentation/en-US/Red_Hat_Enterp= rise_Virtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html</a> I need to use "nic" instead of "hostnic" but then I don= 't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? </pre> </blockquote> <pre wrap=3D""> The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that= you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". </pre> </blockquote> <small>Thanks! That works!<br> <br> Another question:<br> <br> Now I got the message that my network is out-of-sync. How can i force withi= n the ovirt-shell that it syncs the networks?<br> </small>This message (including any attachments) may contain information th= at is privileged or confidential. If you are not the intended recipient, pl= ease notify the sender and delete this email immediately from your systems = and destroy all copies of it. You may not, directly or indirectly, use, disclose, distribute, print or copy = this email or any part of it if you are not the intended recipient </body> </html> --_000_569792F28080605dmcamcnetworkscom_--

--_000_569794843020301dmcamcnetworkscom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On 14-01-16 12:16, Juan Hern=E1ndez wrote: On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D wrong number of arguments, try 'help update' for help. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualiza= tion/3.6-Beta/html/RHEVM_Shell_Guide/nic.html I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". Thanks! That works! Another question: Now I got the message that my network is out-of-sync. How can i force withi= n the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident What I want to say is: Now I got the message that my network is out-of-sync. How can i force withi= n the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears.... But when I check the box "Sync Network" within the VLAN602 options it gets = pushed to the host. Is there a difference between the both? And how do I run both via ovirt-she= ll? This message (including any attachments) may contain information that is pr= ivileged or confidential. If you are not the intended recipient, please not= ify the sender and delete this email immediately from your systems and dest= roy all copies of it. You may not, directly or indirectly, use, disclose, d= istribute, print or copy this email or any part of it if you are not the in= tended recipient --_000_569794843020301dmcamcnetworkscom_ Content-Type: text/html; charset="Windows-1252" Content-ID: <86608565C9BAB145A717DAD5FDF08AC7@chellomedia.com> Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1= 252"> </head> <body text=3D"#000000" bgcolor=3D"#FFFFFF"> <blockquote cite=3D"mid:569792F2.8080605@dmc.amcnetworks.com" type=3D"cite"=
<br> <div class=3D"moz-cite-prefix"> <title></title> On 14-01-16 12:16, Juan Hern=E1ndez wrote:<br> </div> <blockquote cite=3D"mid:5697839B.6000708@redhat.com" type=3D"cite"> <pre wrap=3D"">On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Hi,
First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document <a moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext" href=3D"https:/= /access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.= 6-Beta/html/RHEVM_Shell_Guide/nic.html">https://access.redhat.com/documenta= tion/en-US/Red_Hat_Enterprise_Virtualization/3.6-Beta/html/RHEVM_Shell_Guid= e/nic.html</a> I need to use "nic" instead of "hostnic" but then I don= 't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? </pre> </blockquote> <pre wrap=3D"">The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that= you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". </pre> </blockquote> <small>Thanks! That works!<br> <br> Another question:<br> <br> Now I got the message that my network is out-of-sync. How can i force withi= n the ovirt-shell that it syncs the networks?<br> </small></blockquote> <br> <small>hmz.... pressed sent by accident<br> <br> What I want to say is:<br> <br> </small><small>Now I got the message that my network is out-of-sync. How ca= n i force within the ovirt-shell that it syncs the networks?<br> Because when I press "Sync All Networks" the IP address disappear= s....<br> <br> But when I check the box "Sync Network" within the VLAN602 option= s it gets pushed to the host.<br> <br> Is there a difference between the both? And how do I run both via ovirt-she= ll?<br> <br> <br> <big></big><br> </small><br> This message (including any attachments) may contain information that is pr= ivileged or confidential. If you are not the intended recipient, please not= ify the sender and delete this email immediately from your systems and dest= roy all copies of it. You may not, directly or indirectly, use, disclose, distribute, print or copy this emai= l or any part of it if you are not the intended recipient </body> </html> --_000_569794843020301dmcamcnetworkscom_--

On 01/14/2016 01:28 PM, Bloemen, Jurriën wrote:
On 14-01-16 12:16, Juan Hernández wrote:
On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote:
Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 --bonding-slaves-host_nic host_nic.name=eno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the following command:
# update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
============================================================================================================== ERROR ============================================================================================================
wrong number of arguments, try 'help update' for help. ================================================================================================================================================================================================================================
Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a VLAN/Network for a host?
The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC".
Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks?
hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell. If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this: ---8<--- #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask="255.255.255.0" address="10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name="mode" value="4"/> <option name="miimon" value="100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8--- If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this: ---8<--- #!/usr/bin/python from ovirtsdk.api import API from ovirtsdk.xml import params # Connect to the server: api = API( url="https://engine.example.com/ovirt-engine/api", username="admin@internal", password="...", ca_file="/etc/pki/ovirt-engine/ca.pem", debug=True ) # Find the host: host = api.hosts.get(name="myhost") # Set up the networks: host.setupnetworks( params.Action( modified_bonds=params.HostNics( host_nic=[ params.HostNIC( name="bond0", bonding=params.Bonding( options=params.Options( option=[ params.Option(name="mode", value="4"), params.Option(name="miimon", value="100"), ], ), slaves=params.Slaves( host_nic=[ params.HostNIC(name="eth1"), params.HostNIC(name="eth2"), ], ), ), ), ], ), modified_network_attachments=params.NetworkAttachments( network_attachment=[ params.NetworkAttachment( network=params.Network(name="VLAN602"), host_nic=params.HostNIC(name="bond0"), ip_address_assignments=params.IpAddressAssignments( ip_address_assignment=[ params.IpAddressAssignment( assignment_method="static", ip=params.IP( address="10.10.10.10", netmask="255.255.255.0", ), ), ], ), ), ], ), ), ) # Close the connection: api.disconnect() ---8<--- -- 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.

--_000_5698EDE73020607dmcamcnetworkscom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On 15-01-16 12:20, Juan Hern=E1ndez wrote: On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote: On 14-01-16 12:16, Juan Hern=E1ndez wrote: On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D wrong number of arguments, try 'help update' for help. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualiza= tion/3.6-Beta/html/RHEVM_Shell_Guide/nic.html I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". Thanks! That works! Another question: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident What I want to say is: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears.... But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host. Is there a difference between the both? And how do I run both via ovirt-shell? The "sync network" operation is not supported by ovirt-shell. If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this: ---8<--- #!/bin/sh -ex url=3D"https://engine.example.com/ovirt-engine/api"<https://engine.example.= com/ovirt-engine/api> user=3D"admin@internal" password=3D"..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask=3D"255.255.255.0" address=3D"10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name=3D"mode" value=3D"4"/> <option name=3D"miimon" value=3D"100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8--- If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this: ---8<--- #!/usr/bin/python from ovirtsdk.api import API from ovirtsdk.xml import params # Connect to the server: api =3D API( url=3D"https://engine.example.com/ovirt-engine/api"<https://engine.exam= ple.com/ovirt-engine/api>, username=3D"admin@internal", password=3D"...", ca_file=3D"/etc/pki/ovirt-engine/ca.pem", debug=3DTrue ) # Find the host: host =3D api.hosts.get(name=3D"myhost") # Set up the networks: host.setupnetworks( params.Action( modified_bonds=3Dparams.HostNics( host_nic=3D[ params.HostNIC( name=3D"bond0", bonding=3Dparams.Bonding( options=3Dparams.Options( option=3D[ params.Option(name=3D"mode", value=3D"4"), params.Option(name=3D"miimon", value=3D"100"), ], ), slaves=3Dparams.Slaves( host_nic=3D[ params.HostNIC(name=3D"eth1"), params.HostNIC(name=3D"eth2"), ], ), ), ), ], ), modified_network_attachments=3Dparams.NetworkAttachments( network_attachment=3D[ params.NetworkAttachment( network=3Dparams.Network(name=3D"VLAN602"), host_nic=3Dparams.HostNIC(name=3D"bond0"), ip_address_assignments=3Dparams.IpAddressAssignments( ip_address_assignment=3D[ params.IpAddressAssignment( assignment_method=3D"static", ip=3Dparams.IP( address=3D"10.10.10.10", netmask=3D"255.255.255.0", ), ), ], ), ), ], ), ), ) # Close the connection: api.disconnect() ---8<--- Wow! Thanks for the effort. I will have a look at it and try it in a differ= ent way via xml or sdk. Thanks! This message (including any attachments) may contain information that is pr= ivileged or confidential. If you are not the intended recipient, please not= ify the sender and delete this email immediately from your systems and dest= roy all copies of it. You may not, directly or indirectly, use, disclose, d= istribute, print or copy this email or any part of it if you are not the in= tended recipient --_000_5698EDE73020607dmcamcnetworkscom_ Content-Type: text/html; charset="Windows-1252" Content-ID: <C85DB7D69D351E48AEAE2CBFD1E3D5CC@chellomedia.com> Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1= 252"> </head> <body text=3D"#000000" bgcolor=3D"#FFFFFF"> <br> <div class=3D"moz-cite-prefix">On 15-01-16 12:20, Juan Hern=E1ndez wrote:<b= r> </div> <blockquote cite=3D"mid:5698D5F1.3070300@redhat.com" type=3D"cite"> <pre wrap=3D"">On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote: </pre> <blockquote type=3D"cite"> <blockquote type=3D"cite"> <pre wrap=3D""> On 14-01-16 12:16, Juan Hern=E1ndez wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document <a class=3D"moz-txt-link-freetext" href=3D"https://access.redhat.com/docume= ntation/en-US/Red_Hat_Enterprise_Virtualization/3.6-Beta/html/RHEVM_Shell_G= uide/nic.html">https://access.redhat.com/documentation/en-US/Red_Hat_Enterp= rise_Virtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html</a> I need to use "nic" instead of "hostnic" but then I don= 't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? </pre> </blockquote> <pre wrap=3D"">The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 Note that the it is "nic" instead of "hostnic" and that= you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". </pre> </blockquote> <pre wrap=3D"">Thanks! That works! Another question: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? </pre> </blockquote> <pre wrap=3D""> hmz.... pressed sent by accident What I want to say is: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappear= s.... But when I check the box "Sync Network" within the VLAN602 option= s it gets pushed to the host. Is there a difference between the both? And how do I run both via ovirt-shell? </pre> </blockquote> <pre wrap=3D""> The "sync network" operation is not supported by ovirt-shell. If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. = These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this: ---8<--- #!/bin/sh -ex url=3D<a class=3D"moz-txt-link-rfc2396E" href=3D"https://engine.example.com= /ovirt-engine/api">"https://engine.example.com/ovirt-engine/api"<= /a> user=3D"admin@internal" password=3D"..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask=3D"255.255.255.0" address=3D"10.10.= 10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name=3D"mode" value=3D"4"/> <option name=3D"miimon" value=3D"100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8--- If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this: ---8<--- #!/usr/bin/python from ovirtsdk.api import API from ovirtsdk.xml import params # Connect to the server: api =3D API( url=3D<a class=3D"moz-txt-link-rfc2396E" href=3D"https://engine.example= .com/ovirt-engine/api">"https://engine.example.com/ovirt-engine/api&qu= ot;</a>, username=3D"admin@internal", password=3D"...", ca_file=3D"/etc/pki/ovirt-engine/ca.pem", debug=3DTrue ) # Find the host: host =3D api.hosts.get(name=3D"myhost") # Set up the networks: host.setupnetworks( params.Action( modified_bonds=3Dparams.HostNics( host_nic=3D[ params.HostNIC( name=3D"bond0", bonding=3Dparams.Bonding( options=3Dparams.Options( option=3D[ params.Option(name=3D"mode", value=3D"4"= ;), params.Option(name=3D"miimon", value=3D"100&= quot;), ], ), slaves=3Dparams.Slaves( host_nic=3D[ params.HostNIC(name=3D"eth1"), params.HostNIC(name=3D"eth2"), ], ), ), ), ], ), modified_network_attachments=3Dparams.NetworkAttachments( network_attachment=3D[ params.NetworkAttachment( network=3Dparams.Network(name=3D"VLAN602"), host_nic=3Dparams.HostNIC(name=3D"bond0"), ip_address_assignments=3Dparams.IpAddressAssignments( ip_address_assignment=3D[ params.IpAddressAssignment( assignment_method=3D"static", ip=3Dparams.IP( address=3D"10.10.10.10", netmask=3D"255.255.255.0", ), ), ], ), ), ], ), ), ) # Close the connection: api.disconnect() ---8<--- </pre> </blockquote> <small>Wow! Thanks for the effort. I will have a look at it and try it in a= different way via xml or sdk.<br> <br> Thanks!<br> </small><br> This message (including any attachments) may contain information that is pr= ivileged or confidential. If you are not the intended recipient, please not= ify the sender and delete this email immediately from your systems and dest= roy all copies of it. You may not, directly or indirectly, use, disclose, distribute, print or copy this emai= l or any part of it if you are not the intended recipient </body> </html> --_000_5698EDE73020607dmcamcnetworkscom_--

On 15-01-16 12:20, Juan Hernández wrote:
On 01/14/2016 01:28 PM, Bloemen, Jurriën wrote:
On 14-01-16 12:16, Juan Hernández wrote:
On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote:
Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 --bonding-slaves-host_nic host_nic.name=eno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the following command:
# update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
============================================================================================================== ERROR ============================================================================================================
wrong number of arguments, try 'help update' for help. ================================================================================================================================================================================================================================
Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a VLAN/Network for a host?
The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC".
Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this:
---8<--- #!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..."
curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask="255.255.255.0" address="10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name="mode" value="4"/> <option name="miimon" value="100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8---
If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this:
---8<--- #!/usr/bin/python
from ovirtsdk.api import API from ovirtsdk.xml import params
# Connect to the server: api = API( url="https://engine.example.com/ovirt-engine/api", username="admin@internal", password="...", ca_file="/etc/pki/ovirt-engine/ca.pem", debug=True )
# Find the host: host = api.hosts.get(name="myhost")
# Set up the networks: host.setupnetworks( params.Action( modified_bonds=params.HostNics( host_nic=[ params.HostNIC( name="bond0", bonding=params.Bonding( options=params.Options( option=[ params.Option(name="mode", value="4"), params.Option(name="miimon", value="100"), ], ), slaves=params.Slaves( host_nic=[ params.HostNIC(name="eth1"), params.HostNIC(name="eth2"), ], ), ), ), ], ), modified_network_attachments=params.NetworkAttachments( network_attachment=[ params.NetworkAttachment( network=params.Network(name="VLAN602"), host_nic=params.HostNIC(name="bond0"), ip_address_assignments=params.IpAddressAssignments( ip_address_assignment=[ params.IpAddressAssignment( assignment_method="static", ip=params.IP( address="10.10.10.10", netmask="255.255.255.0", ), ), ], ), ), ], ), ), )
# Close the connection: api.disconnect() ---8<---
Hi Juan, The Python SDK sollution gives an error: Unexpected error: 'Host' object has no attribute 'setupnetworks' I'm using oVirt 3.6 Regards, Jurriën This message (including any attachments) may contain information that is privileged or confidential. If you are not the intended recipient, please notify the sender and delete this email immediately from your systems and destroy all copies of it. You may not, directly or indirectly, use, disclose, distribute, print or copy this email or any part of it if you are not the intended recipient

On 01/20/2016 11:31 AM, Bloemen, Jurriën wrote:
On 15-01-16 12:20, Juan Hernández wrote:
On 01/14/2016 01:28 PM, Bloemen, Jurriën wrote:
On 14-01-16 12:16, Juan Hernández wrote:
On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote:
Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 --bonding-slaves-host_nic host_nic.name=eno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the following command:
# update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
============================================================================================================== ERROR ============================================================================================================
wrong number of arguments, try 'help update' for help. ================================================================================================================================================================================================================================
Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a VLAN/Network for a host?
The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC".
Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this:
---8<--- #!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..."
curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask="255.255.255.0" address="10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name="mode" value="4"/> <option name="miimon" value="100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8---
If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this:
---8<--- #!/usr/bin/python
from ovirtsdk.api import API from ovirtsdk.xml import params
# Connect to the server: api = API( url="https://engine.example.com/ovirt-engine/api", username="admin@internal", password="...", ca_file="/etc/pki/ovirt-engine/ca.pem", debug=True )
# Find the host: host = api.hosts.get(name="myhost")
# Set up the networks: host.setupnetworks( params.Action( modified_bonds=params.HostNics( host_nic=[ params.HostNIC( name="bond0", bonding=params.Bonding( options=params.Options( option=[ params.Option(name="mode", value="4"), params.Option(name="miimon", value="100"), ], ), slaves=params.Slaves( host_nic=[ params.HostNIC(name="eth1"), params.HostNIC(name="eth2"), ], ), ), ), ], ), modified_network_attachments=params.NetworkAttachments( network_attachment=[ params.NetworkAttachment( network=params.Network(name="VLAN602"), host_nic=params.HostNIC(name="bond0"), ip_address_assignments=params.IpAddressAssignments( ip_address_assignment=[ params.IpAddressAssignment( assignment_method="static", ip=params.IP( address="10.10.10.10", netmask="255.255.255.0", ), ), ], ), ), ], ), ), )
# Close the connection: api.disconnect() ---8<---
Hi Juan,
The Python SDK sollution gives an error:
Unexpected error: 'Host' object has no attribute 'setupnetworks'
I'm using oVirt 3.6
And what version of the Python SDK? Support for "setupnetworks" was added in 3.6.0.0, make sure you have at least that version. -- 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.

On 20-01-16 12:24, Juan Hernández wrote:
On 01/20/2016 11:31 AM, Bloemen, Jurriën wrote:
On 15-01-16 12:20, Juan Hernández wrote:
On 01/14/2016 01:28 PM, Bloemen, Jurriën wrote:
On 14-01-16 12:16, Juan Hernández wrote:
On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote: > Hi, > > First I created a bonding interface: > > # add nic --parent-host-name server01 --name bond0 --network-name > VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 > --bonding-slaves-host_nic host_nic.name=eno2 > > This works great but no IP is set on VLAN602. > > Then I'm trying to add an ip address to a network with the following > command: > > # update hostnic --parent-host-name server01 --network-name VLAN602 > --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 > > ============================================================================================================== > ERROR > ============================================================================================================ > > wrong number of arguments, try 'help update' for help. > ================================================================================================================================================================================================================================ > > Looking at this document > https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... > I need to use "nic" instead of "hostnic" but then I don't have the > options to say this is a --parent-host-name. Only VM related command > options. > > So I think the documentation is behind. > > Can somebody help me with what the command is to add a IP to a > VLAN/Network for a host? > > The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0
Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC".
Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this:
---8<--- #!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..."
curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask="255.255.255.0" address="10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name="mode" value="4"/> <option name="miimon" value="100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8---
If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this:
---8<--- #!/usr/bin/python
from ovirtsdk.api import API from ovirtsdk.xml import params
# Connect to the server: api = API( url="https://engine.example.com/ovirt-engine/api", username="admin@internal", password="...", ca_file="/etc/pki/ovirt-engine/ca.pem", debug=True )
# Find the host: host = api.hosts.get(name="myhost")
# Set up the networks: host.setupnetworks( params.Action( modified_bonds=params.HostNics( host_nic=[ params.HostNIC( name="bond0", bonding=params.Bonding( options=params.Options( option=[ params.Option(name="mode", value="4"), params.Option(name="miimon", value="100"), ], ), slaves=params.Slaves( host_nic=[ params.HostNIC(name="eth1"), params.HostNIC(name="eth2"), ], ), ), ), ], ), modified_network_attachments=params.NetworkAttachments( network_attachment=[ params.NetworkAttachment( network=params.Network(name="VLAN602"), host_nic=params.HostNIC(name="bond0"), ip_address_assignments=params.IpAddressAssignments( ip_address_assignment=[ params.IpAddressAssignment( assignment_method="static", ip=params.IP( address="10.10.10.10", netmask="255.255.255.0", ), ), ], ), ), ], ), ), )
# Close the connection: api.disconnect() ---8<---
Hi Juan,
The Python SDK sollution gives an error:
Unexpected error: 'Host' object has no attribute 'setupnetworks'
I'm using oVirt 3.6
And what version of the Python SDK? Support for "setupnetworks" was added in 3.6.0.0, make sure you have at least that version.
I have ovirt-engine-sdk-python-3.6.0.0-0.16.20150713.git8c2cf30.el6.noarch This message (including any attachments) may contain information that is privileged or confidential. If you are not the intended recipient, please notify the sender and delete this email immediately from your systems and destroy all copies of it. You may not, directly or indirectly, use, disclose, distribute, print or copy this email or any part of it if you are not the intended recipient

On 01/20/2016 02:03 PM, Bloemen, Jurriën wrote:
On 20-01-16 12:24, Juan Hernández wrote:
On 01/20/2016 11:31 AM, Bloemen, Jurriën wrote:
On 15-01-16 12:20, Juan Hernández wrote:
On 01/14/2016 01:28 PM, Bloemen, Jurriën wrote:
On 14-01-16 12:16, Juan Hernández wrote: > On 01/14/2016 11:24 AM, Bloemen, Jurriën wrote: >> Hi, >> >> First I created a bonding interface: >> >> # add nic --parent-host-name server01 --name bond0 --network-name >> VLAN602 --bonding-slaves-host_nic host_nic.name=eno1 >> --bonding-slaves-host_nic host_nic.name=eno2 >> >> This works great but no IP is set on VLAN602. >> >> Then I'm trying to add an ip address to a network with the following >> command: >> >> # update hostnic --parent-host-name server01 --network-name VLAN602 >> --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 >> >> ============================================================================================================== >> ERROR >> ============================================================================================================ >> >> wrong number of arguments, try 'help update' for help. >> ================================================================================================================================================================================================================================ >> >> Looking at this document >> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualizat... >> I need to use "nic" instead of "hostnic" but then I don't have the >> options to say this is a --parent-host-name. Only VM related command >> options. >> >> So I think the documentation is behind. >> >> Can somebody help me with what the command is to add a IP to a >> VLAN/Network for a host? >> >> > The command should be like this: > > # update nic bond0 --parent-host-name server01 --network-name VLAN602 > --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.0 > > Note that the it is "nic" instead of "hostnic" and that you need to > specify the name of that NIC, in this case "bond0". > > The command will work if you type it like that, but auto-completion > won't work. This is a bug in the CLI, indirectly caused by the fact that > the name of the URL segment used in the RESTAPI is "nics" (from > /hosts/{host:id}/*nics*) but the name of the XML schema complex type is > "HostNIC". > Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this:
---8<--- #!/bin/sh -ex
url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..."
curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask="255.255.255.0" address="10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name="mode" value="4"/> <option name="miimon" value="100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8---
If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this:
---8<--- #!/usr/bin/python
from ovirtsdk.api import API from ovirtsdk.xml import params
# Connect to the server: api = API( url="https://engine.example.com/ovirt-engine/api", username="admin@internal", password="...", ca_file="/etc/pki/ovirt-engine/ca.pem", debug=True )
# Find the host: host = api.hosts.get(name="myhost")
# Set up the networks: host.setupnetworks( params.Action( modified_bonds=params.HostNics( host_nic=[ params.HostNIC( name="bond0", bonding=params.Bonding( options=params.Options( option=[ params.Option(name="mode", value="4"), params.Option(name="miimon", value="100"), ], ), slaves=params.Slaves( host_nic=[ params.HostNIC(name="eth1"), params.HostNIC(name="eth2"), ], ), ), ), ], ), modified_network_attachments=params.NetworkAttachments( network_attachment=[ params.NetworkAttachment( network=params.Network(name="VLAN602"), host_nic=params.HostNIC(name="bond0"), ip_address_assignments=params.IpAddressAssignments( ip_address_assignment=[ params.IpAddressAssignment( assignment_method="static", ip=params.IP( address="10.10.10.10", netmask="255.255.255.0", ), ), ], ), ), ], ), ), )
# Close the connection: api.disconnect() ---8<---
Hi Juan,
The Python SDK sollution gives an error:
Unexpected error: 'Host' object has no attribute 'setupnetworks'
I'm using oVirt 3.6
And what version of the Python SDK? Support for "setupnetworks" was added in 3.6.0.0, make sure you have at least that version.
I have ovirt-engine-sdk-python-3.6.0.0-0.16.20150713.git8c2cf30.el6.noarch
Then you need to update. That is a pre-release, and it doesn't contain the "setupnetworks" support. -- 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.

On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote:
On 14-01-16 12:16, Juan Hern=E1ndez wrote:
On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote:
Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the followin= g command:
# update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.25= 5.255.0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =20 wrong number of arguments, try 'help update' for help. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
Looking at this document https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Vi= rtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related comman= d options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a VLAN/Network for a host?
The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLA= N602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255= .255.0
Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact =
This is a multi-part message in MIME format. --------------3C1AEAC84EB8A9617AC38ED6 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Hi I managed to create my dhcp hostnic thanks to the python script, but=20 the same with ovirt-shell: * [oVirt shell (connected) # add networkattachment --parent-host-name taal --network-name brv106 --host_nic-name enp2s0f0 =3D> OK but I didn't find any way to add boot protocol to DHCP * [oVirt shell (connected)]# add networkattachment --parent-host-name taal --network-name brv106 --host_nic-name enp2s0f0 --ip_address_assignments-ip_address_assignment dhcp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D "dhcp" is invalid segment at option=20 "--ip_address_assignments-ip_address_assignment". * [oVirt shell (connected)]# update nic enp3s0f0 --parent-host-name zonda --network-name brv106 --boot_protocol dhcp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D status: 405 reason: Method Not Allowed detail: Should be much simpler via CLI to do such a thing, what's wrong there? Le 15/01/2016 =E0 12:20, Juan Hern=E1ndez a =E9crit : that
the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type= is "HostNIC".
Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host.
Is there a difference between the both? And how do I run both via ovirt-shell?
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, an= d eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like thi= s:
---8<--- #!/bin/sh -ex
url=3D"https://engine.example.com/ovirt-engine/api" user=3D"admin@internal" password=3D"..."
curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask=3D"255.255.255.0" address=3D"10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name=3D"mode" value=3D"4"/> <option name=3D"miimon" value=3D"100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8---
If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this:
---8<--- #!/usr/bin/python
from ovirtsdk.api import API from ovirtsdk.xml import params
# Connect to the server: api =3D API( url=3D"https://engine.example.com/ovirt-engine/api", username=3D"admin@internal", password=3D"...", ca_file=3D"/etc/pki/ovirt-engine/ca.pem", debug=3DTrue )
# Find the host: host =3D api.hosts.get(name=3D"myhost")
# Set up the networks: host.setupnetworks( params.Action( modified_bonds=3Dparams.HostNics( host_nic=3D[ params.HostNIC( name=3D"bond0", bonding=3Dparams.Bonding( options=3Dparams.Options( option=3D[ params.Option(name=3D"mode", value=3D"4"), params.Option(name=3D"miimon", value=3D"100"), ], ), slaves=3Dparams.Slaves( host_nic=3D[ params.HostNIC(name=3D"eth1"), params.HostNIC(name=3D"eth2"), ], ), ), ), ], ), modified_network_attachments=3Dparams.NetworkAttachments( network_attachment=3D[ params.NetworkAttachment( network=3Dparams.Network(name=3D"VLAN602"), host_nic=3Dparams.HostNIC(name=3D"bond0"), ip_address_assignments=3Dparams.IpAddressAssignments( ip_address_assignment=3D[ params.IpAddressAssignment( assignment_method=3D"static", ip=3Dparams.IP( address=3D"10.10.10.10", netmask=3D"255.255.255.0", ), ), ], ), ), ], ), ), )
# Close the connection: api.disconnect() ---8<---
--=20 Nathana=EBl Blanchet Supervision r=E9seau P=F4le Infrastrutures Informatiques 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 =09 T=E9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr --------------3C1AEAC84EB8A9617AC38ED6 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable <html> <head> <meta content=3D"text/html; charset=3Dwindows-1252" http-equiv=3D"Content-Type"> </head> <body bgcolor=3D"#FFFFFF" text=3D"#000000"> <p>Hi I managed to create my dhcp hostnic thanks to the python script, but the same with ovirt-shell:</p> <ul> <li>[oVirt shell (connected) # add networkattachment --parent-host-name taal --network-name brv106 --host_nic-name enp2s0f0 =3D> OK but I didn't find any way to add boot protoco= l to DHCP</li> </ul> <ul> <li>[oVirt shell (connected)]# add networkattachment --parent-host-name taal --network-name brv106 --host_nic-name enp2s0f0 --ip_address_assignments-ip_address_assignment dhcp</li> </ul> <p>=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "dhcp"= is invalid segment at option "--ip_address_assignments-ip_address_assignment".<br> </p> <ul> <li>[oVirt shell (connected)]# update nic enp3s0f0 --parent-host-name zonda --network-name brv106 --boot_protocol dhcp</li> </ul> <p>=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br> =A0 status: 405<br> =A0 reason: Method Not Allowed<br> =A0 detail:<br> </p> <br> Should be much simpler via CLI to do such a thing, what's wrong there?<br> <br> <div class=3D"moz-cite-prefix">Le 15/01/2016 =E0 12:20, Juan Hern=E1n= dez a =E9crit=A0:<br> </div> <blockquote cite=3D"mid:5698D5F1.3070300@redhat.com" type=3D"cite"> <pre wrap=3D"">On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote: </pre> <blockquote type=3D"cite"> <blockquote type=3D"cite"> <pre wrap=3D""> On 14-01-16 12:16, Juan Hern=E1ndez wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wro= te: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Hi, First I created a bonding interface: # add nic --parent-host-name server01 --name bond0 --network-name VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1 --bonding-slaves-host_nic host_nic.name=3Deno2 This works great but no IP is set on VLAN602. Then I'm trying to add an ip address to a network with the following command: # update hostnic --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.= 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D = =20 wrong number of arguments, try 'help update' for help. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at this document <a class=3D"moz-txt-link-freetext" href=3D"https://access.redhat.com/docu= mentation/en-US/Red_Hat_Enterprise_Virtualization/3.6-Beta/html/RHEVM_She= ll_Guide/nic.html">https://access.redhat.com/documentation/en-US/Red_Hat_= Enterprise_Virtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html</a> I need to use "nic" instead of "hostnic" but then I don't have the options to say this is a --parent-host-name. Only VM related command options. So I think the documentation is behind. Can somebody help me with what the command is to add a IP to a VLAN/Network for a host? </pre> </blockquote> <pre wrap=3D"">The command should be like this: # update nic bond0 --parent-host-name server01 --network-name VLAN602 --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.= 0 Note that the it is "nic" instead of "hostnic" and that you need to specify the name of that NIC, in this case "bond0". The command will work if you type it like that, but auto-completion won't work. This is a bug in the CLI, indirectly caused by the fact that the name of the URL segment used in the RESTAPI is "nics" (from /hosts/{host:id}/*nics*) but the name of the XML schema complex type is "HostNIC". </pre> </blockquote> <pre wrap=3D"">Thanks! That works! Another question: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? </pre> </blockquote> <pre wrap=3D""> hmz.... pressed sent by accident What I want to say is: Now I got the message that my network is out-of-sync. How can i force within the ovirt-shell that it syncs the networks? Because when I press "Sync All Networks" the IP address disappears.... But when I check the box "Sync Network" within the VLAN602 options it gets pushed to the host. Is there a difference between the both? And how do I run both via ovirt-shell? </pre> </blockquote> <pre wrap=3D""> The "sync network" operation is not supported by ovirt-shell. If you want to set the network configuration, and make it persistent, then you will need to use one of the "setupNetworks" operations. These aren't fully usable with ovirt-shell either, so if you want to use it you will need to use directly the API or one of the SDKs. For example, lets assume that you have a host with network interfaces eth0, eth1, and eth2, and that you want to configure eth1 and eth2 as a bond, to put your VLAN and IP address on top. You can do that with a script like this: ---8<--- #!/bin/sh -ex url=3D<a class=3D"moz-txt-link-rfc2396E" href=3D"https://engine.example.c= om/ovirt-engine/api">"https://engine.example.com/ovirt-engine/api"</a> user=3D"admin@internal" password=3D"..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <action> <modified_network_attachments> <network_attachment> <network> <name>VLAN602</name> </network> <host_nic> <name>bond0</name> </host_nic> <ip_address_assignments> <assignment_method>static</assignment_method> <ip_address_assignment> <ip netmask=3D"255.255.255.0" address=3D"10.10.10.10"/> </ip_address_assignment> </ip_address_assignments> </network_attachment> </modified_network_attachments> <modified_bonds> <host_nic> <name>bond0</name> <bonding> <options> <option name=3D"mode" value=3D"4"/> <option name=3D"miimon" value=3D"100"/> </options> <slaves> <host_nic> <name>eth1</name> </host_nic> <host_nic> <name>eth2</name> </host_nic> </slaves> </bonding> </host_nic> </modified_bonds> </action> ' \ "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" --->8--- If you prefer to use one of the SDKs, the Python SDK for example, then it should look like this: ---8<--- #!/usr/bin/python from ovirtsdk.api import API from ovirtsdk.xml import params # Connect to the server: api =3D API( url=3D<a class=3D"moz-txt-link-rfc2396E" href=3D"https://engine.examp= le.com/ovirt-engine/api">"https://engine.example.com/ovirt-engine/api"</a=
, username=3D"admin@internal", password=3D"...", ca_file=3D"/etc/pki/ovirt-engine/ca.pem", debug=3DTrue )
# Find the host: host =3D api.hosts.get(name=3D"myhost") # Set up the networks: host.setupnetworks( params.Action( modified_bonds=3Dparams.HostNics( host_nic=3D[ params.HostNIC( name=3D"bond0", bonding=3Dparams.Bonding( options=3Dparams.Options( option=3D[ params.Option(name=3D"mode", value=3D"4"), params.Option(name=3D"miimon", value=3D"100"), ], ), slaves=3Dparams.Slaves( host_nic=3D[ params.HostNIC(name=3D"eth1"), params.HostNIC(name=3D"eth2"), ], ), ), ), ], ), modified_network_attachments=3Dparams.NetworkAttachments( network_attachment=3D[ params.NetworkAttachment( network=3Dparams.Network(name=3D"VLAN602"), host_nic=3Dparams.HostNIC(name=3D"bond0"), ip_address_assignments=3Dparams.IpAddressAssignments( ip_address_assignment=3D[ params.IpAddressAssignment( assignment_method=3D"static", ip=3Dparams.IP( address=3D"10.10.10.10", netmask=3D"255.255.255.0", ), ), ], ), ), ], ), ), ) # Close the connection: api.disconnect() ---8<--- </pre> </blockquote> <br> <pre class=3D"moz-signature" cols=3D"72">--=20 Nathana=EBl Blanchet Supervision r=E9seau P=F4le Infrastrutures Informatiques 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 =09 T=E9l. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:blanchet@abes.fr">bl= anchet@abes.fr</a> </pre> </body> </html> --------------3C1AEAC84EB8A9617AC38ED6--
participants (3)
-
Bloemen, Jurriën
-
Juan Hernández
-
Nathanaël Blanchet