Re: [ovirt-users] ovirt 3.6 python sdk how to find logical network from a host nic?

2016-08-16 Thread Huan He (huhe)
Hi Juan,

Thanks! It works. 

One more question, do you know how to do ³save network configuration² in
the api? I did the following

Params.Action(force=1, check_connectivity=1, host_nics=host_nics)

but the gui says the network configuration is not saved. I can¹t find any
relevant params in the Action.

Thanks,
Huan


On 8/13/16, 5:09 AM, "Juan Hernández" <jhern...@redhat.com> wrote:

>On 08/13/2016 12:17 AM, Huan He (huhe) wrote:
>> Assuming the logical network ovirtmgmt has been configured in host NIC
>> enp6s0.
>> 
>> host = api.hosts.get(Œhost-123¹)
>> host_nic = host.nics.get(Œenp6s0¹)
>> 
>> How to get the logical network name ovirtmgmt?
>> 
>> I basically need to find ovirtmgmt is configured in which NIC.
>> 
>> Thanks,
>> Huan
>> 
>
>To do this first you need to find the identifier of the "ovirtmgmt"
>network of the relevant cluster (the same network name can be used in
>multiple clusters) and then iterate the network attachments to find
>which network interfaces are connected to that network. Something like
>this:
>
>---8<---
># Find the host:
>host_name = 'myhost'
>host = api.hosts.get(name=host_name)
>
># Find the identifier of the cluster that the host belongs to:
>cluster_id = host.get_cluster().get_id()
>
># Find the networks available in the cluster, and locate the one
># ones with the name we are looking for:
>network_name = 'ovirtmgmt'
>network_ids = []
>networks = api.clusters.get(id=cluster_id).networks.list()
>for network in networks:
>if network.get_name() == network_name:
>network_ids.append(network.get_id())
>
># Find the network interface of the host that has the network attached:
>nic_ids = []
>network_attachments = host.networkattachments.list()
>for network_attachment in network_attachments:
>if network_attachment.get_network().get_id() in network_ids:
>nic_ids.append(network_attachment.get_host_nic().get_id())
>
># Print the details of the nics:
>for nic_id in nic_ids:
>nic = host.nics.get(id=nic_id)
>print(nic.get_name())
>--->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.

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] ovirt 3.6 python sdk how to find logical network from a host nic?

2016-08-12 Thread Huan He (huhe)
Assuming the logical network ovirtmgmt has been configured in host NIC enp6s0.

host = api.hosts.get('host-123')
host_nic = host.nics.get('enp6s0')

How to get the logical network name ovirtmgmt?

I basically need to find ovirtmgmt is configured in which NIC.

Thanks,
Huan

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Cannot locate vdsm package, possible cause is incorrect channels

2016-08-08 Thread Huan He (huhe)
I wonder if it has something to do with the centos version? I have


[root@host-182 ~]# uname -a

Linux host-182 2.6.32-642.3.1.el6.x86_64 #1 SMP Tue Jul 12 18:30:56 UTC 2016 
x86_64 x86_64 x86_64 GNU/Linux

[root@host-182 ~]# more /etc/redhat-release

CentOS release 6.8 (Final)

[root@host-182 ~]#


From: Cisco Employee >
Date: Monday, August 8, 2016 at 4:51 PM
To: users >
Subject: Cannot locate vdsm package, possible cause is incorrect channels

I have ovirt engine 3.6 on centos 6.5 and tried to add centos 6.5 host.

I used the command below to install the host

yum localinstall 
http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release36.rpm


The ovirt repo are listed below.


I tried to uncomment out the baseurl, still got the same issue. Any idea?

It looks to me it failed to find the vdsm pkgs.

Thanks,
Huan


[root@host-182 yum.repos.d]# more ovirt-3.6*.repo

::

ovirt-3.6-dependencies.repo

::

[ovirt-3.6-epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6=$basearch

failovermethod=priority

enabled=1

includepkgs=epel-release,python-uinput,puppet,python-lockfile,python-cpopen,python-ordereddict,python-pthreading,python-inotify,python-argparse,novnc,python-ply,

python-kitchen,python-daemon,python-websockify,livecd-tools,spice-html5,mom,python-IPy,python-ioprocess,ioprocess,safelease,rubygem-rgen,ovirt-guest-agent,pyxatt

r,userspace-rcu

gpgcheck=1

gpgkey=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6


[ovirt-3.6-jpackage-6.0-generic]

name=JPackage 6.0, for generic

mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic=free=6.0

enabled=1

gpgcheck=1

includepkgs=dom4j,isorelax,jaxen,jdom,msv,msv-xsdlib,relaxngDatatype,servicemix-specs,tomcat5-servlet-2.4-api,ws-jaxme,xalan-j2,xml-commons,xml-commons-jaxp-1.2-

apis,xml-commons-resolver11,xom,xpp2,xpp3,antlr3,stringtemplate

gpgkey=http://www.jpackage.org/jpackage.asc


[ovirt-3.6-centos-gluster37]

name=CentOS-$releasever - Gluster 3.7

baseurl=http://mirror.centos.org/centos/$releasever/storage/$basearch/gluster-3.7/

gpgcheck=1

enabled=1

gpgkey=https://raw.githubusercontent.com/CentOS-Storage-SIG/centos-release-storage-common/master/RPM-GPG-KEY-CentOS-SIG-Storage


[ovirt-3.6-patternfly1-noarch-epel]

name=Copr repo for patternfly1 owned by patternfly

baseurl=http://copr-be.cloud.fedoraproject.org/results/patternfly/patternfly1/epel-6-$basearch/

enabled=1

skip_if_unavailable=1

gpgcheck=0


[virtio-win-stable]

name=virtio-win builds roughly matching what was shipped in latest RHEL

baseurl=http://fedorapeople.org/groups/virt/virtio-win/repo/stable

enabled=1

skip_if_unavailable=1

gpgcheck=0

::

ovirt-3.6.repo

::

[ovirt-3.6]

name=Latest oVirt 3.6 Release

#baseurl=http://resources.ovirt.org/pub/ovirt-3.6/rpm/el$releasever/

mirrorlist=http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-3.6-el$releasever

enabled=1

skip_if_unavailable=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-ovirt-3.6

[root@host-182 yum.repos.d]#

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] Cannot locate vdsm package, possible cause is incorrect channels

2016-08-08 Thread Huan He (huhe)
I have ovirt engine 3.6 on centos 6.5 and tried to add centos 6.5 host.

I used the command below to install the host

yum localinstall 
http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release36.rpm


The ovirt repo are listed below.


I tried to uncomment out the baseurl, still got the same issue. Any idea?

It looks to me it failed to find the vdsm pkgs.

Thanks,
Huan


[root@host-182 yum.repos.d]# more ovirt-3.6*.repo

::

ovirt-3.6-dependencies.repo

::

[ovirt-3.6-epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6=$basearch

failovermethod=priority

enabled=1

includepkgs=epel-release,python-uinput,puppet,python-lockfile,python-cpopen,python-ordereddict,python-pthreading,python-inotify,python-argparse,novnc,python-ply,

python-kitchen,python-daemon,python-websockify,livecd-tools,spice-html5,mom,python-IPy,python-ioprocess,ioprocess,safelease,rubygem-rgen,ovirt-guest-agent,pyxatt

r,userspace-rcu

gpgcheck=1

gpgkey=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6


[ovirt-3.6-jpackage-6.0-generic]

name=JPackage 6.0, for generic

mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic=free=6.0

enabled=1

gpgcheck=1

includepkgs=dom4j,isorelax,jaxen,jdom,msv,msv-xsdlib,relaxngDatatype,servicemix-specs,tomcat5-servlet-2.4-api,ws-jaxme,xalan-j2,xml-commons,xml-commons-jaxp-1.2-

apis,xml-commons-resolver11,xom,xpp2,xpp3,antlr3,stringtemplate

gpgkey=http://www.jpackage.org/jpackage.asc


[ovirt-3.6-centos-gluster37]

name=CentOS-$releasever - Gluster 3.7

baseurl=http://mirror.centos.org/centos/$releasever/storage/$basearch/gluster-3.7/

gpgcheck=1

enabled=1

gpgkey=https://raw.githubusercontent.com/CentOS-Storage-SIG/centos-release-storage-common/master/RPM-GPG-KEY-CentOS-SIG-Storage


[ovirt-3.6-patternfly1-noarch-epel]

name=Copr repo for patternfly1 owned by patternfly

baseurl=http://copr-be.cloud.fedoraproject.org/results/patternfly/patternfly1/epel-6-$basearch/

enabled=1

skip_if_unavailable=1

gpgcheck=0


[virtio-win-stable]

name=virtio-win builds roughly matching what was shipped in latest RHEL

baseurl=http://fedorapeople.org/groups/virt/virtio-win/repo/stable

enabled=1

skip_if_unavailable=1

gpgcheck=0

::

ovirt-3.6.repo

::

[ovirt-3.6]

name=Latest oVirt 3.6 Release

#baseurl=http://resources.ovirt.org/pub/ovirt-3.6/rpm/el$releasever/

mirrorlist=http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-3.6-el$releasever

enabled=1

skip_if_unavailable=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-ovirt-3.6

[root@host-182 yum.repos.d]#

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] storage domain operation python api sample codes needed

2016-08-04 Thread Huan He (huhe)
Hi Ondra,

Thinking about to upgrade to v4, but I can’t find host nic and bonding
example in the link you provided
https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples

Thanks,
Huan


On 8/4/16, 12:13 PM, "Ondra Machacek" <omach...@redhat.com> wrote:

>On 08/04/2016 08:17 PM, Huan He (huhe) wrote:
>> Thanks Ondra.
>>
>> I am able to do the storage, but stuck in the host nic. I have rhvm 4.0
>> beta, and the sdk seems still v3.6.
>
>If you have version 4.0, then there is sdk4, which you should use.
>The name of the rpm is python-ovirt-engine-sdk4.
>
>Or it's in pip:
>
>  https://pypi.python.org/pypi/ovirt-engine-sdk-python
>
>>
>> Who knows where I can find the sample and doc for v3?
>
>I am afraid there is no, but you can inpire for example here:
>
> 
>https://github.com/oVirt/ovirt-system-tests/blob/master/basic_suite_master
>/test-scenarios/002_bootstrap.py#L136
>
>>
>> Thanks,
>> Huan
>>
>>
>> On 8/2/16, 11:56 PM, "Ondra Machacek" <omach...@redhat.com> wrote:
>>
>>> On 08/02/2016 10:53 PM, Huan He (huhe) wrote:
>>>> Hi,
>>>>
>>>> I can¹t figure out how to do the following, a sample code will be
>>>> helpful.
>>>>
>>>> Put a storage domain in maintenance mode
>>>> Detach the storage domain
>>>> Remove the storage domain
>>>
>>> Are you looking for v4 or v3 examples?
>>> Those are completelly different SDKs so examples will be different as
>>> well.
>>> For v4 you can inspire here:
>>>
>>>  https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples
>>>
>>>>
>>>> By the way, do you have an API doc or wiki?
>>>
>>> There is for v4:
>>>
>>>  https://jhernand.fedorapeople.org/ovirt-api-explorer/#/
>>>
>>> not sure about v3
>>>
>>>>
>>>> Thanks,
>>>> Huab
>>>>
>>>>
>>>>
>>>> ___
>>>> Users mailing list
>>>> Users@ovirt.org
>>>> http://lists.ovirt.org/mailman/listinfo/users
>>>>
>>

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] storage domain operation python api sample codes needed

2016-08-04 Thread Huan He (huhe)
Thanks Ondra. 

I am able to do the storage, but stuck in the host nic. I have rhvm 4.0
beta, and the sdk seems still v3.6.

Who knows where I can find the sample and doc for v3?

Thanks,
Huan


On 8/2/16, 11:56 PM, "Ondra Machacek" <omach...@redhat.com> wrote:

>On 08/02/2016 10:53 PM, Huan He (huhe) wrote:
>> Hi,
>>
>> I can¹t figure out how to do the following, a sample code will be
>>helpful.
>>
>> Put a storage domain in maintenance mode
>> Detach the storage domain
>> Remove the storage domain
>
>Are you looking for v4 or v3 examples?
>Those are completelly different SDKs so examples will be different as
>well.
>For v4 you can inspire here:
>
>  https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples
>
>>
>> By the way, do you have an API doc or wiki?
>
>There is for v4:
>
>  https://jhernand.fedorapeople.org/ovirt-api-explorer/#/
>
>not sure about v3
>
>>
>> Thanks,
>> Huab
>>
>>
>>
>> ___
>> Users mailing list
>> Users@ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/users
>>

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] storage domain operation python api sample codes needed

2016-08-02 Thread Huan He (huhe)
Hi,

I can't figure out how to do the following, a sample code will be helpful.

Put a storage domain in maintenance mode
Detach the storage domain
Remove the storage domain

By the way, do you have an API doc or wiki?

Thanks,
Huab

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users