[ovirt-users] Re: oVirt Python SDK and monitor export as OVA task

2020-02-27 Thread Gianluca Cecchi
On Thu, Feb 27, 2020 at 5:29 PM Strahil Nikolov 
wrote:
[snip]

> >I could be wrong, but I didn't find any ansible module  to do this with
> >Ansible playbooks: I can only save all the VM, that in my case wouldn't
> >be
> >necessary and instead time and storage wasting.
>
> [snip]

>
> Hi Gianluca,
>
> Did you check:
> https://github.com/silverorange/ovirt_ansible_backup
>
>
> Best Regards,
> Strahil Nikolov
>

Yes Strahil, I did check. I also checked his review with improvements made
in collaboration with Martin and I also gave my feedback to Jayme on the
list.
But as you can notice from my words I left above, it doesn't apply to my
scenario.
I want to create a snapshot of the VM but not with all its disks, but only
with the boot one.
And this in my opinion is not feasible with Ansible ovirt modules.
Coming back to the subject of this thread, in his original playbook Jayme
tests when the export file passes from ova.tmp extension to .ova and uses
that in his wait_for module to consider the job as completed.
My alternate proposal was to query the "job" table of the engine database
to check when the related job status becomes "FINISHED".
Probably I have to start from the poll_events.py sdk example to check when
I get the event that the export as ova has finished.
Any hint or alternate way through the python SDK will be appreciated.

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/5VDIGFUYQQKQA52AH52CKMBKFPFRVN3T/


[ovirt-users] Re: oVirt Python SDK and monitor export as OVA task

2020-02-27 Thread Strahil Nikolov
On February 27, 2020 5:32:15 PM GMT+02:00, Gianluca Cecchi 
 wrote:
>Hello,
>sometimes I have environments (typically with Oracle RDBMS on virtual
>machines) where there is one boot disk and one (often big, such as
>500Gb or
>more) data disk.
>The data disk has already its application backup (typically RMAN) and I
>want to complement it with a backup of only the boot disk of the
>operating
>system and VM configuration.
>I'm almost done completing a script using oVirt Python SDK and sharing
>for
>comments.
>I could be wrong, but I didn't find any ansible module  to do this with
>Ansible playbooks: I can only save all the VM, that in my case wouldn't
>be
>necessary and instead time and storage wasting.
>The basic steps are:
>- make a snapshot of the target vm, composed only by the boot disk
>- clone the snapshot
>- export the clone as OVA
>- delete clone
>- delete snapshot
>
>There are some things to discuss about, probably when I will share the
>overall job (such as the name to give to the boot disk, if not using
>the
>bootable flag, the way to import the OVA in case of actual need, where
>you
>will have to comment out some fs entries related to missing disks,
>ecc.).
>The only thing missing is how to monitor the export to ova task that,
>as
>with Ansible, it completes almost immediately, while the export is
>actually
>altready running.
>I need to monitor it, so only at its real end I can run the last 2
>steps of
>the above list of tasks.
>
>Can you give me any hint? Not found very much in guide or docs on the
>web.
>I'm currently using a sleep because my boot disk is about 20Gb in size
>and
>I know that in less than 2 minutes it normally completes.
>
>The export as ova is very similar to what found in the examples and
>they
>don't contain a monitor for it but only the connection.close() call:
>
>cloned_vm_service.export_to_path_on_host(
>host=types.Host(id=host.id),
>directory = export_as_ova_dir,
>filename = cloned_vm.name + '.ova'
>)
>
>Thanks in advance,
>Gianluca

Hi Gianluca,

Did you check:
https://github.com/silverorange/ovirt_ansible_backup


Best Regards,
Strahil Nikolov
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/647WHAVH3DHDQYEHZW7K55M3LVACJ72X/


[ovirt-users] Re: oVirt Python SDK and monitor export as OVA task

2020-02-27 Thread Jayme
Gianluca,

This is not a direct solution to your problem, but for my project here:
https://github.com/silverorange/ovirt_ansible_backup was recently updated
to make use the ovirt_event_info Ansible module to determine the state of
the export. I'm not sure how to do the same in python directly, but I'm
sure it'd be possible. Unfortunately my solution is a full VM backup
including all disks which I understand is not your goal here.

I have used vProtect in the past to backup VMs and it has the ability to
specify which VM disks to include in the backup. That may be an option for
you to explore.

- Jayme

On Thu, Feb 27, 2020 at 11:33 AM Gianluca Cecchi 
wrote:

> Hello,
> sometimes I have environments (typically with Oracle RDBMS on virtual
> machines) where there is one boot disk and one (often big, such as 500Gb or
> more) data disk.
> The data disk has already its application backup (typically RMAN) and I
> want to complement it with a backup of only the boot disk of the operating
> system and VM configuration.
> I'm almost done completing a script using oVirt Python SDK and sharing for
> comments.
> I could be wrong, but I didn't find any ansible module  to do this with
> Ansible playbooks: I can only save all the VM, that in my case wouldn't be
> necessary and instead time and storage wasting.
> The basic steps are:
> - make a snapshot of the target vm, composed only by the boot disk
> - clone the snapshot
> - export the clone as OVA
> - delete clone
> - delete snapshot
>
> There are some things to discuss about, probably when I will share the
> overall job (such as the name to give to the boot disk, if not using the
> bootable flag, the way to import the OVA in case of actual need, where you
> will have to comment out some fs entries related to missing disks, ecc.).
> The only thing missing is how to monitor the export to ova task that, as
> with Ansible, it completes almost immediately, while the export is actually
> altready running.
> I need to monitor it, so only at its real end I can run the last 2 steps
> of the above list of tasks.
>
> Can you give me any hint? Not found very much in guide or docs on the web.
> I'm currently using a sleep because my boot disk is about 20Gb in size and
> I know that in less than 2 minutes it normally completes.
>
> The export as ova is very similar to what found in the examples and they
> don't contain a monitor for it but only the connection.close() call:
>
> cloned_vm_service.export_to_path_on_host(
> host=types.Host(id=host.id),
> directory = export_as_ova_dir,
> filename = cloned_vm.name + '.ova'
> )
>
> Thanks in advance,
> Gianluca
>
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/66AFZIU4GTQRJSZR5F5P2OR6ZS6IBDP7/
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/RL3BU5JXG4IN4XRJU3XFRMVGQFK7VIFY/


[ovirt-users] Re: Ovirt Python - SDK

2018-11-13 Thread Brad Riemann
What version of the sdk are you using? Are you running this on an non-ovirt 
server/workstation? Can you list out the packages installed for *ovirt* ?

Brad Riemann
Sr. System Architect
Cloud5 Communications
brad.riem...@cloud5.com
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/F4OPSFQJWGACZWJUML4J2Y6GNPU5FSI6/


[ovirt-users] Re: Ovirt Python - SDK

2018-11-13 Thread Hari Prasanth Loganathan
Thanks, Valentin and Brad.

I modified the UDS code to support ovirtSDK4, so everything works as
expected now.
Your thoughts are much appreciated.

On Tue, Nov 13, 2018 at 3:23 PM Valentin Bajrami <
valentin.bajr...@target-holding.nl> wrote:

> Hi Hari,
>
> It would be best to create a venv(virtual environment) as follows:
>
> python3 -m venv ovirtsdk
>
> Then while in ovirtsdk venv directory you can use pip to install the
> following packages:
>
> - ovirt-engine-sdk-python==4.2.9
> - pycurl==7.43.0.2
>
> Install these packages using:
>
> pip install ovirt-engine-sdk-python==4.2.9 pycurl==7.43.0.2
>
>
> Then, when you run your code use,  ovirtsdk/bin/python yourcode_py
>
> Let me know if this works for you!
> On 11/13/18 4:37 AM, Hari Prasanth Loganathan wrote:
>
> Also, If I downgrade the
>
> pip install ovirt-engine-sdk-python==3.6.9.2
>
> then I get this error : ImportError: No module named ovirtsdk4
>
> Thanks,
> Hari
>
> On Tue, Nov 13, 2018 at 8:57 AM Hari Prasanth Loganathan <
> hariprasant...@msystechnologies.com> wrote:
>
>> Hi Brad,
>> ovirt-engine-sdk-python 4.2.9
>> It is running in the non-ovirt environment. No Ovirt Packages are
>> installed in this.
>>
>> Thanks,
>> Hari
>>
>>
>>
>> On Tue, 13 Nov 2018 at 2:50 AM, Brad Riemann 
>> wrote:
>>
>>> What version of the sdk are you using? Are you running this on an
>>> non-ovirt server/workstation? Can you list out the packages installed for *
>>> *ovirt** ?
>>>
>>>
>>>
>>> Brad Riemann
>>>
>>> Sr. System Architect
>>>
>>> Cloud5 Communications
>>>
>>> brad.riem...@cloud5.com
>>>
>>
> DISCLAIMER - *MSysTechnologies LLC*
>
> This email message, contents and its attachments may contain confidential,
> proprietary or legally privileged information and is intended solely for
> the use of the individual or entity to whom it is actually intended. If you
> have erroneously received this message, please permanently delete it
> immediately and notify the sender. If you are not the intended recipient of
> the email message,you are notified strictly not to disseminate,distribute
> or copy this e-mail.E-mail transmission cannot be guaranteed to be secure
> or error-free as Information could be intercepted, corrupted, lost,
> destroyed, incomplete or contain viruses and MSysTechnologies LLC accepts
> no liability for the contents and integrity of this mail or for any damage
> caused by the limitations of the e-mail transmission.
>
>
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct: 
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives: 
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/LBLFNSDKR75L4LIF6BDD2BNB5OL42PCB/
>
> --
> Met vriendelijke groeten,
>
> Valentin Bajrami
> Target Holding
>
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/FIV6RDKMW6LDOJCRAHS5E6NR2BY4MKFR/
>

-- 


DISCLAIMER - *MSysTechnologies LLC* 



This email message, contents and 
its attachments may contain confidential, proprietary or legally privileged 
information and is intended solely for the use of the individual or entity 
to whom it is actually intended. If you have erroneously received this 
message, please permanently delete it immediately and notify the sender. If 
you are not the intended recipient of the email message,you are notified 
strictly not to disseminate,distribute or copy this e-mail.E-mail 
transmission cannot be guaranteed to be secure or error-free as Information 
could be intercepted, corrupted, lost, destroyed, incomplete or contain 
viruses and MSysTechnologies LLC accepts no liability for the contents and 
integrity of this mail or for any damage caused by the limitations of the 
e-mail transmission.

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/Q5EK75TAKAJAGADAFGDJRF7OXEPCOZA4/


[ovirt-users] Re: Ovirt Python - SDK

2018-11-13 Thread Valentin Bajrami
Hi Hari,

It would be best to create a venv(virtual environment) as follows:

python3 -m venv ovirtsdk

Then while in ovirtsdk venv directory you can use pip to install the
following packages:

- ovirt-engine-sdk-python==4.2.9
- pycurl==7.43.0.2 

Install these packages using:

pip install ovirt-engine-sdk-python==4.2.9 pycurl==7.43.0.2


Then, when you run your code use,  ovirtsdk/bin/python yourcode_py

Let me know if this works for you!

On 11/13/18 4:37 AM, Hari Prasanth Loganathan wrote:
> Also, If I downgrade the
>
> pip install ovirt-engine-sdk-python==3.6.9.2
>
> then I get this error : ImportError: No module named ovirtsdk4
>
> Thanks,
> Hari
>
> On Tue, Nov 13, 2018 at 8:57 AM Hari Prasanth Loganathan
>  > wrote:
>
> Hi Brad,
>
>
>   ovirt-engine-sdk-python 4.2.9
>
> It is running in the non-ovirt environment. No Ovirt Packages are
> installed in this.
>
> Thanks,
> Hari
>
>
>
> On Tue, 13 Nov 2018 at 2:50 AM, Brad Riemann
> mailto:brad.riem...@cloud5.com>> wrote:
>
> What version of the sdk are you using? Are you running this on
> an non-ovirt server/workstation? Can you list out the packages
> installed for **ovirt** ?
>
>  
>
> Brad Riemann
>
> Sr. System Architect
>
> Cloud5 Communications
>
> brad.riem...@cloud5.com 
>
>
> DISCLAIMER- *MSysTechnologies LLC*
>
> This email message, contents and its attachments may contain
> confidential, proprietary or legally privileged information and is
> intended solely for the use of the individual or entity to whom it is
> actually intended. If you have erroneously received this message,
> please permanently delete it immediately and notify the sender. If you
> are not the intended recipient of the email message,you are notified
> strictly not to disseminate,distribute or copy this e-mail.E-mail
> transmission cannot be guaranteed to be secure or error-free as
> Information could be intercepted, corrupted, lost, destroyed,
> incomplete or contain viruses and MSysTechnologies LLC accepts no
> liability for the contents and integrity of this mail or for any
> damage caused by the limitations of the e-mail transmission.
>
>
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct: 
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives: 
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/LBLFNSDKR75L4LIF6BDD2BNB5OL42PCB/

-- 
Met vriendelijke groeten,

Valentin Bajrami
Target Holding 

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/FIV6RDKMW6LDOJCRAHS5E6NR2BY4MKFR/


[ovirt-users] Re: Ovirt Python - SDK

2018-11-12 Thread Hari Prasanth Loganathan
Also, If I downgrade the

pip install ovirt-engine-sdk-python==3.6.9.2

then I get this error : ImportError: No module named ovirtsdk4

Thanks,
Hari

On Tue, Nov 13, 2018 at 8:57 AM Hari Prasanth Loganathan <
hariprasant...@msystechnologies.com> wrote:

> Hi Brad,
> ovirt-engine-sdk-python 4.2.9
> It is running in the non-ovirt environment. No Ovirt Packages are
> installed in this.
>
> Thanks,
> Hari
>
>
>
> On Tue, 13 Nov 2018 at 2:50 AM, Brad Riemann 
> wrote:
>
>> What version of the sdk are you using? Are you running this on an
>> non-ovirt server/workstation? Can you list out the packages installed for *
>> *ovirt** ?
>>
>>
>>
>> Brad Riemann
>>
>> Sr. System Architect
>>
>> Cloud5 Communications
>>
>> brad.riem...@cloud5.com
>>
>

-- 


DISCLAIMER - *MSysTechnologies LLC* 



This email message, contents and 
its attachments may contain confidential, proprietary or legally privileged 
information and is intended solely for the use of the individual or entity 
to whom it is actually intended. If you have erroneously received this 
message, please permanently delete it immediately and notify the sender. If 
you are not the intended recipient of the email message,you are notified 
strictly not to disseminate,distribute or copy this e-mail.E-mail 
transmission cannot be guaranteed to be secure or error-free as Information 
could be intercepted, corrupted, lost, destroyed, incomplete or contain 
viruses and MSysTechnologies LLC accepts no liability for the contents and 
integrity of this mail or for any damage caused by the limitations of the 
e-mail transmission.

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/LBLFNSDKR75L4LIF6BDD2BNB5OL42PCB/


[ovirt-users] Re: Ovirt Python - SDK

2018-11-12 Thread Hari Prasanth Loganathan
Hi Brad,
ovirt-engine-sdk-python 4.2.9
It is running in the non-ovirt environment. No Ovirt Packages are installed
in this.

Thanks,
Hari



On Tue, 13 Nov 2018 at 2:50 AM, Brad Riemann 
wrote:

> What version of the sdk are you using? Are you running this on an
> non-ovirt server/workstation? Can you list out the packages installed for *
> *ovirt** ?
>
>
>
> Brad Riemann
>
> Sr. System Architect
>
> Cloud5 Communications
>
> brad.riem...@cloud5.com
>

-- 


DISCLAIMER - *MSysTechnologies LLC* 



This email message, contents and 
its attachments may contain confidential, proprietary or legally privileged 
information and is intended solely for the use of the individual or entity 
to whom it is actually intended. If you have erroneously received this 
message, please permanently delete it immediately and notify the sender. If 
you are not the intended recipient of the email message,you are notified 
strictly not to disseminate,distribute or copy this e-mail.E-mail 
transmission cannot be guaranteed to be secure or error-free as Information 
could be intercepted, corrupted, lost, destroyed, incomplete or contain 
viruses and MSysTechnologies LLC accepts no liability for the contents and 
integrity of this mail or for any damage caused by the limitations of the 
e-mail transmission.

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/ZDS7LAAD4J2U6PNVCZPLR5U6L3CZWLBL/