Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2017-02-02 Thread Nathanaël Blanchet
Hi I managed to create my dhcp hostnic thanks to the python script, but 
the same with ovirt-shell:


 * [oVirt shell (connected) # add networkattachment --parent-host-name
   taal --network-name brv106 --host_nic-name enp2s0f0 => 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

  === ERROR 
=
 "dhcp" is invalid segment at option 
"--ip_address_assignments-ip_address_assignment".


 * [oVirt shell (connected)]# update nic enp3s0f0 --parent-host-name
   zonda --network-name brv106 --boot_protocol dhcp

  === ERROR 
=

  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 à 12:20, Juan Hernández a écrit :

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_Virtualization/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="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 '

   
 
   
 VLAN602
   
   
 bond0
   
   
 static
 
   
 
   
 
   
   
 
   

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-20 Thread Bloemen , Jurriën
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_Virtualization/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="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 '
> 
>
>  
>
>  VLAN602
>
>
>  bond0
>
>
>  static
>  
>
>  
>
>  
>
>
>  
>bond0
>
>  
>
>
>  
>  
>
>  eth1
>
>
>  eth2
>
>  
>
>  
> 
>   
> ' \
> "${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 = 

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-20 Thread Juan Hernández
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_Virtualization/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="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 '
>> 
>>
>>  
>>
>>  VLAN602
>>
>>
>>  bond0
>>
>>
>>  static
>>  
>>
>>  
>>
>>  
>>
>>
>>  
>>bond0
>>
>>  
>>
>>
>>  
>>  
>>
>>  eth1
>>
>>
>>  eth2
>>
>>  
>>
>>  
>> 
>>   
>> ' \
>> "${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(
>>  

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-20 Thread Bloemen , Jurriën

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_Virtualization/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="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 '
>>> 
>>> 
>>>   
>>> 
>>>   VLAN602
>>> 
>>> 
>>>   bond0
>>> 
>>> 
>>>   static
>>>   
>>> 
>>>   
>>> 
>>>   
>>> 
>>> 
>>>   
>>> bond0
>>> 
>>>   
>>> 
>>> 
>>>   
>>>   
>>> 
>>>   eth1
>>> 
>>> 
>>>   eth2
>>> 
>>>   
>>> 
>>>   
>>>  
>>>
>>> ' \
>>> "${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks"
>>> --->8---
>>>
>>> If you prefer to use one of the SDKs, the 

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-20 Thread Juan Hernández
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_Virtualization/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="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 '
 
 
   
 
   VLAN602
 
 
   bond0
 
 
   static
   
 
   
 
   
 
 
   
 bond0
 
   
 
 
   
   
 
   eth1
 
 
   eth2
 

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-15 Thread Bloemen , Jurriën

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_Virtualization/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="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 '

  

  
VLAN602
  
  
bond0
  
  
static

  

  

  
  

  bond0
  

  
  


  
eth1
  
  
eth2
  

  

   
 
' \
"${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"),
  ],
),

Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-15 Thread Juan Hernández
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_Virtualization/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="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 '

  

  
VLAN602
  
  
bond0
  
  
static

  

  

  
  

  bond0
  

  
  


  
eth1
  
  
eth2
  

  

   
 
' \
"${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(

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

2016-01-14 Thread Bloemen , Jurriën
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_Virtualization/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?


--
Kind regards,

Jurriën Bloemen

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
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-14 Thread Juan Hernández
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_Virtualization/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".

-- 
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.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-14 Thread Bloemen , Jurriën

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_Virtualization/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?




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
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] [ovirt-shell] update hostnic/nic ???

2016-01-14 Thread Bloemen , Jurriën

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_Virtualization/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?
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
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users