Thank you!!

Thanks to Maikl P  I find the solution:
action nic $IF_NAME --host-identifier $HOST_ID attach --network-name $NET_NAME
Moti Asayag, thank you for links provided.

Kind regards,
Vladimir Pakhomov



2014-10-05 17:19 GMT+04:00 Moti Asayag <masayag@redhat.com>:
----- Original Message -----
> From: "Vladimir Pakhomov" <pakhomov.vladimir@gmail.com>
> To: users@ovirt.org
> Sent: Sunday, October 5, 2014 1:26:12 PM
> Subject: [ovirt-users] using ovirt-shell to attach defind network to hosts
>
> Hi,
>
> I would like to implement a script that would attach a newly created network
> to all hosts in cluster. Unfortunately I cannot find anything about that in
> documentation. Is it possible to attach network to host using CLI/REST API?

If the case is for attaching a network to all of the hosts on the cluster,
you can use the 'network labels' feature in which you label the host nics
with a label, and once you mark a network with the same label, it will be
auto-configured on the hosts. This will allow you just to label networks
in order to configure them on the hosts without a need to access the hosts.

http://www.ovirt.org/Features/NetworkLabels#REST
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.4/html-single/Administration_Guide/index.html#sect-Network_Labels

For configuring networks manually on the host you can use the setupnetworks
api, which allows you to configure the destination network topology for the host.
See "Configure bond with several networks" example from:
http://www.ovirt.org/Testing/PythonApi#Networking

I've also added several more examples here:
https://motiasayag.wordpress.com/category/ovirt/ovirt-engine-sdk-python/setup-networks/


>
> Kind regards,
> Vladimir Pakhomov
>
> _______________________________________________
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>