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

Barak Korren bkorren at redhat.com
Mon Jul 25 13:26:57 UTC 2016


On 25 July 2016 at 16:23, Barak Korren <bkorren at redhat.com> wrote:
> On 25 July 2016 at 16:13, Yaniv Kaul <ykaul at redhat.com> 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
bkorren at redhat.com
RHEV-CI Team



More information about the Users mailing list