Re: [ovirt-users] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-26 Thread Juan Hernández
On 07/26/2016 08:53 AM, Yaniv Kaul wrote:
> 
> 
> On Mon, Jul 25, 2016 at 4:36 PM, Ondra Machacek  > wrote:
> 
> You actually have to run method 'activate()'[1] on VM disk.
> 
> So it will look like this:
> 
>  api.vms.get(VM0_NAME).disks.get(DISK1_NAME).activate()
> 
> [1]
> 
> https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=src/ovirtsdk/infrastructure/brokers.py;h=7def8a5adea3357d31827f754a1e644b70de146d;hb=sdk_3.6#l31779
> 
> 
> Thanks.
> I've ended up adding 'active=True' to the disk when adding it - and it
> seems to do the same. Is that correct?
> Y.
>  

Yes, it is correct.

Note also that in general setting a property of an object in the SDK
doesn't do anything, you need to call the "update" method:

  disk = api.vms.get(VM0_NAME).disks.get(DISK1_NAME)
  disk.set_active(true)
  disk.update()

> 
> 
> 
> On 07/25/2016 03:13 PM, Yaniv Kaul wrote:
> 
> After successfully attaching a disk and verifying its status is
> in 'ok',
> I've tried:
> api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)
> 
> But it doesn't really activate it. What's the correct way to
> activate it?
> (It works well via the UI).
> 
> TIA,
> Y.

-- 
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] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-25 Thread Ondra Machacek

You actually have to run method 'activate()'[1] on VM disk.

So it will look like this:

 api.vms.get(VM0_NAME).disks.get(DISK1_NAME).activate()

[1] 
https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=src/ovirtsdk/infrastructure/brokers.py;h=7def8a5adea3357d31827f754a1e644b70de146d;hb=sdk_3.6#l31779


On 07/25/2016 03:13 PM, Yaniv Kaul wrote:

After successfully attaching a disk and verifying its status is in 'ok',
I've tried:
api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)

But it doesn't really activate it. What's the correct way to activate it?
(It works well via the UI).

TIA,
Y.


___
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] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-25 Thread Elad Ben Aharon
What's the VM status when you try to activate the disk?

On Mon, Jul 25, 2016 at 4:23 PM, Barak Korren  wrote:

> On 25 July 2016 at 16:13, Yaniv Kaul  wrote:
> > After successfully attaching a disk and verifying its status is in 'ok',
> > I've tried:
> > api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)
> >
> > But it doesn't really activate it. What's the correct way to activate it?
> > (It works well via the UI).
> >
> The same approach pretty much works for me:
> (v3 sdk vs v4.x engine)
>
>
> https://code.engineering.redhat.com/gerrit/#/c/79691/1/fabric_ci/do/ovirt/vm.py
>
>
> --
> Barak Korren
> bkor...@redhat.com
> RHEV-CI Team
> ___
> 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] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-25 Thread Barak Korren
On 25 July 2016 at 16:23, Barak Korren  wrote:
> On 25 July 2016 at 16:13, Yaniv Kaul  wrote:
>> After successfully attaching a disk and verifying its status is in 'ok',
>> I've tried:
>> api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)
>>
>> But it doesn't really activate it. What's the correct way to activate it?
>> (It works well via the UI).
>>
> The same approach pretty much works for me:
> (v3 sdk vs v4.x engine)
>
> https://code.engineering.redhat.com/gerrit/#/c/79691/1/fabric_ci/do/ovirt/vm.py
>
>
A couple of things to note though:
1. A disk's name is not unique, so not good for looking up by
2. "vm.disks.get(id=foo)" doe not seem to work right ATM as far as
   looking at 'disk.active' goes so I used:
   "vm.disks.list(id=foo)[0]"

-- 
Barak Korren
bkor...@redhat.com
RHEV-CI Team
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-25 Thread Barak Korren
On 25 July 2016 at 16:13, Yaniv Kaul  wrote:
> After successfully attaching a disk and verifying its status is in 'ok',
> I've tried:
> api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)
>
> But it doesn't really activate it. What's the correct way to activate it?
> (It works well via the UI).
>
The same approach pretty much works for me:
(v3 sdk vs v4.x engine)

https://code.engineering.redhat.com/gerrit/#/c/79691/1/fabric_ci/do/ovirt/vm.py


-- 
Barak Korren
bkor...@redhat.com
RHEV-CI Team
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] How do I activate a hot-plugged disk (in v3 Python SDK) ?

2016-07-25 Thread Yaniv Kaul
After successfully attaching a disk and verifying its status is in 'ok',
I've tried:
api.vms.get(VM0_NAME).disks.get(DISK1_NAME).set_active(True)

But it doesn't really activate it. What's the correct way to activate it?
(It works well via the UI).

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