Re: [ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-26 Thread Doron Fediuck
Hi Indunil.

On Mon, Oct 26, 2015 at 10:10 AM, Indunil Jayasooriya 
wrote:

>
>
>> > Can I shedule a VM backup with Ovirt Manager GUI. If possible, Pls let
>> me
>> > know.
>>
>> Not at this moment, and this is not planned for the future, afaik.
>>
>>
> Thanks for the direct Answer. Why 's that? Can you guys go ahead without*
> EASY BACKUP Solution*, When other Products like VMWare are around?
>
> VMware provides a utility with similar functionality to oVirt's backup
tool.
In order to properly backup a VMWare setup and VMs you will need to pay
money for
the relevant backup product.


>
>> Did you play with the other SDK examples etc suggested during this thread?
>>
>> May I suggest that this is best done as a plugin/contribution to a backup
>> solution, not standalone. I guess most sites with more than a few hosts
>> use
>> some such solution - FOSS (amanda/bacula/backuppc/etc) or proprietary
>> (netbackup/backupexec/acronis/etc) - and backup of VMs (ovirt or other)
>> should be handled in this scope.
>>
>>
> I have used bacula before. My question is how to backup VMs running in
> Ovirt?
> When I can't pinpoint a VM Image? Will I have to take Whole storage such
> as NSF, ISCSI or SAN (i.e - FC)
>
> Them, How to restore?
>
>
> Could you pls answer?
>
>
> Using the backup API[1] you should be capable of scripting such a task.


[1] http://www.ovirt.org/Features/Backup_API


>
>> Searching the net I manage to find [1] and [2], which might be what
>> you want. Note that I never tried any of them myself.
>>
>> [1] https://github.com/ovirt-china/vm-backup-scheduler
>> [2] https://github.com/wefixit-AT/oVirtBackup
>>
>>
> Thank you very much for the above links?
>
>
>
> --
> cat /etc/motd
>
> Thank you
> Indunil Jayasooriya
> http://www.theravadanet.net/
> http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
> Fonts
>
>
> ___
> 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] schedule a VM backup in ovirt 3.5

2015-10-26 Thread Indunil Jayasooriya
>
> > Can I shedule a VM backup with Ovirt Manager GUI. If possible, Pls let me
> > know.
>
> Not at this moment, and this is not planned for the future, afaik.
>
>
Thanks for the direct Answer. Why 's that? Can you guys go ahead without*
EASY BACKUP Solution*, When other Products like VMWare are around?



> Did you play with the other SDK examples etc suggested during this thread?
>
> May I suggest that this is best done as a plugin/contribution to a backup
> solution, not standalone. I guess most sites with more than a few hosts use
> some such solution - FOSS (amanda/bacula/backuppc/etc) or proprietary
> (netbackup/backupexec/acronis/etc) - and backup of VMs (ovirt or other)
> should be handled in this scope.
>
>
I have used bacula before. My question is how to backup VMs running in
Ovirt?
When I can't pinpoint a VM Image? Will I have to take Whole storage such as
NSF, ISCSI or SAN (i.e - FC)

Them, How to restore?


Could you pls answer?




> Searching the net I manage to find [1] and [2], which might be what
> you want. Note that I never tried any of them myself.
>
> [1] https://github.com/ovirt-china/vm-backup-scheduler
> [2] https://github.com/wefixit-AT/oVirtBackup
>
>
Thank you very much for the above links?



-- 
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
Fonts
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-25 Thread Yedidyah Bar David
On Fri, Oct 23, 2015 at 6:46 AM, Indunil Jayasooriya
 wrote:
>
>
>
>>
>> If you know the name of the VM then you can find it, including its id,
>> doing a search:
>>
>> https://engine.example.com/ovirt-engine/api/vms?search=name%3Dmyvm
>
>
>   Thanks for the above info. It worked.
>
>>
>>
>> If you prefer to use a script, which is probably the right thing, then
>> you can do something like this, using the Python SDK:
>>
>
> Can I shedule a VM backup with Ovirt Manager GUI. If possible, Pls let me
> know.

Not at this moment, and this is not planned for the future, afaik.

Did you play with the other SDK examples etc suggested during this thread?

May I suggest that this is best done as a plugin/contribution to a backup
solution, not standalone. I guess most sites with more than a few hosts use
some such solution - FOSS (amanda/bacula/backuppc/etc) or proprietary
(netbackup/backupexec/acronis/etc) - and backup of VMs (ovirt or other)
should be handled in this scope.

Searching the net I manage to find [1] and [2], which might be what
you want. Note that I never tried any of them myself.

[1] https://github.com/ovirt-china/vm-backup-scheduler
[2] https://github.com/wefixit-AT/oVirtBackup

Best,

>
>
>>
>> ---8<---
>> #!/usr/bin/python
>>
>> from ovirtsdk.api import API
>> from ovirtsdk.xml import params
>>
>> # Connect to the server:
>> api = API(
>> url="https://engine.example.com/ovirt-engine/api;,
>> username="admin@internal",
>> password="**",
>> ca_file="/etc/pki/ovirt-engine/ca.pem",
>> debug=False
>> )
>>
>> # Find the VM:
>> vm = api.vms.get(name="myvm")
>>
>> # Print the id:
>> print(vm.get_id())
>>
>> # Disconnect:
>> api.disconnect()
>> --->8---
>>
>
> Many thanks for the above script. I ran it on Ovirt manager. It worked. It
> gave me the ID of my CentOS_71 VM that I want to backup.
>
>
>
>>
>> Once you have the VM you can create a snapshot like this:
>>
>> ---8<---
>> vm.snapshots.add(
>> params.Snapshot(description="My snapshot")
>> )
>> --->8---
>
>
> I rewrote the script in this way and ran it.
>
>
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> # Connect to the server:
> api = API(
> url="https://engine.example.com/ovirt-engine/api;,
> username="admin@internal",
> password="**",
> ca_file="/etc/pki/ovirt-
>>
>> engine/ca.pem",
>> debug=False
>> )
>>
>> # Find the VM:
>> vm = api.vms.get(name="myvm")
>>
>> # Print the id:
>> print(vm.get_id())
>>
>
>  vm.snapshots.add(
>  params.Snapshot(description="My snapshot")
>  )
>>
>> # Disconnect:
>> api.disconnect()
>
>
> No error was given. I have no idea whether snapshot wad added or NOT by the
> above script.
>
> I can't display it.
>
> How to display it?
>
> Then, How to backup the VM with this snaphot?
>
> Then, finally how to delete this snapshot? to delete the snapshot,
>
> I tried with below command. the did NOT worked.
>
>   vm.snapshots.delete()
>
> or
>   vm.snapshots.detach(
>
>  or
>   vm.snapshots.remove(
>
> I think I am have completed about 50% of this backup process. If you can
> write down the  above steps, It would be very grateful.
>
>
> I searched a whole lot. But , I still can't do it.
>
> These are the links I came across.
>
> https://github.com/laravot/backuprestoreapi/blob/master/example.py
>
> http://www.ovirt.org/Testing/PythonApi#Create_a_Basic_Environment_using_ovirt-engine-sdk
>
> this is your one
>
> http://users.ovirt.narkive.com/Z29BQWAD/ovirt-users-python-sdk-attach-disk-snapshot-to-another-virtual-machine
>
>
> Hmm,
>
> How to list the sanphot?
> how to backup the VM with snapshot?
> finally , how to remove this snapshot?
>
>
> Then. I think it will be OVER. Yesterday, I tried a lot.  but, NO success.
>
> Hope to hear from you.
>
>
>
>
>
>
>
>
>
>>
>> You can also use the Java SDK, if you prefer Java.
>>
>> --
>> 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.
>
>
>
>
> --
> cat /etc/motd
>
> Thank you
> Indunil Jayasooriya
> http://www.theravadanet.net/
> http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
> Fonts
>
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>



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


Re: [ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-23 Thread Patrick Russell
Using ovirt-node EL7 we’ve been able to live merge since 3.5.3 without any 
issues. 

-Patrick

> On Oct 23, 2015, at 12:24 AM, Christopher Cox  wrote:
> 
> On 10/22/2015 10:46 PM, Indunil Jayasooriya wrote:
> ...
>> 
>> Hmm,
>> 
>> *How to list the sanphot?
>> *
>> *how to backup the VM with snapshot?
>> *
>> *finally , how to remove this snapshot?
>> *
>> 
>> 
>> Then. I think it will be OVER. Yesterday, I tried a lot.  but, NO success.
>> 
>> Hope to hear from you.
> 
> Not exactly "help" but AFAIK, even with 3.5, there is no live merging of 
> snapshots so they can't be deleted unless the VM is down.  I know for large 
> snapshots that have been around for awhile removing them can take some time 
> too.
> 
> Others feel free to chime in...
> 
> 
> ___
> 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] schedule a VM backup in ovirt 3.5

2015-10-22 Thread Indunil Jayasooriya
> If you know the name of the VM then you can find it, including its id,
> doing a search:
>
> https://engine.example.com/ovirt-engine/api/vms?search=name%3Dmyvm
>

  Thanks for the above info. It worked.


>
> If you prefer to use a script, which is probably the right thing, then
> you can do something like this, using the Python SDK:
>
>
Can I shedule a VM backup with Ovirt Manager GUI. If possible, Pls let me
know.



> ---8<---
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> # Connect to the server:
> api = API(
> url="https://engine.example.com/ovirt-engine/api;,
> username="admin@internal",
> password="**",
> ca_file="/etc/pki/ovirt-engine/ca.pem",
> debug=False
> )
>
> # Find the VM:
> vm = api.vms.get(name="myvm")
>
> # Print the id:
> print(vm.get_id())
>
> # Disconnect:
> api.disconnect()
> --->8---
>
>
Many thanks for the above script. I ran it on Ovirt manager. It worked. It
gave me the ID of my CentOS_71 VM that I want to backup.




> Once you have the VM you can create a snapshot like this:
>
> ---8<---
> vm.snapshots.add(
> params.Snapshot(description="My snapshot")
> )
> --->8---
>

I rewrote the script in this way and ran it.


#!/usr/bin/python

from ovirtsdk.api import API
from ovirtsdk.xml import params

# Connect to the server:
api = API(
url="https://engine.example.com/ovirt-engine/api;,
username="admin@internal",
password="**",
ca_file="/etc/pki/ovirt-
>
> engine/ca.pem",
> debug=False
> )
>
> # Find the VM:
> vm = api.vms.get(name="myvm")
>
> # Print the id:
> print(vm.get_id())
>
>


*vm.snapshots.add(  params.Snapshot(description="My
snapshot") )*

>
> *# Disconnect: api.disconnect()*
>

No error was given. I have no idea whether snapshot wad added or NOT by the
above script.

I can't display it.

*How to display it?  *

Then, *How to backup the VM with this snaphot? *

Then, finally* how to delete this snapshot? *to delete the snapshot,

I tried with below command. the did NOT worked.



*vm.snapshots.delete() *or
  *vm.snapshots.detach(*

 or
  *vm.snapshots.remove(*

I think I am have completed about 50% of this backup process. If you can
write down the  above steps, It would be very grateful.


I searched a whole lot. But , I still can't do it.

These are the links I came across.

https://github.com/laravot/backuprestoreapi/blob/master/example.py

http://www.ovirt.org/Testing/PythonApi#Create_a_Basic_Environment_using_ovirt-engine-sdk

this is your one

http://users.ovirt.narkive.com/Z29BQWAD/ovirt-users-python-sdk-attach-disk-snapshot-to-another-virtual-machine


Hmm,


*How to list the sanphot? *

*how to backup the VM with snapshot? *

*finally , how to remove this snapshot? *


Then. I think it will be OVER. Yesterday, I tried a lot.  but, NO success.

Hope to hear from you.










> You can also use the Java SDK, if you prefer Java.
>
> --
> 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.
>



-- 
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
Fonts
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-22 Thread Christopher Cox

On 10/22/2015 10:46 PM, Indunil Jayasooriya wrote:
...


Hmm,

*How to list the sanphot?
*
*how to backup the VM with snapshot?
*
*finally , how to remove this snapshot?
*


Then. I think it will be OVER. Yesterday, I tried a lot.  but, NO success.

Hope to hear from you.


Not exactly "help" but AFAIK, even with 3.5, there is no live merging of 
snapshots so they can't be deleted unless the VM is down.  I know for large 
snapshots that have been around for awhile removing them can take some time too.


Others feel free to chime in...


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


Re: [ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-22 Thread Juan Hernández
On 10/22/2015 07:50 AM, Indunil Jayasooriya wrote:
> Hi list,
> 
> I want to *schedule a VM backup* in ovirt 3.5. I read below
> URL.
> 
> http://www.ovirt.org/Features/Backup-Restore_API_Integration#Full_VM_Backups
> 
> It gives an below example of VM backup
> 
> 
> Example for VM Backup
> 
>   * Use existing VM Snapshot/Create a vm snapshot (example): 
> 
>  URL = SERVER:PORT/api/vms/VM_ID/snapshots
>  Method = POST
>  (with Content-Type:application/xml header)
>  Body =
>  
>  Virtual Machine 1 - Snapshot For Backup
>  
> 
> 
> 
> But, How can I find the *VM_ID* of the VM that I want to backup?
> 
> How can I write this below format?
> 
>  URL = SERVER:PORT/api/vms/VM_ID/snapshots
> 
> MY Ovirt Engine manager is running on another PC. (let's say 
> engine.example.com  ) i can access it by typing 
> https://engine.example.com/
> 
> is it https://engine.example.com/api/vms/*VM_ID*/snapshots ? I can't access 
> it in firefox browser?
> 
> 
> Should I write a script? is there any Youtube video or doc that makes me to 
> understand this? 
> 
> Hope to hear from you.
> 

If you know the name of the VM then you can find it, including its id,
doing a search:

https://engine.example.com/ovirt-engine/api/vms?search=name%3Dmyvm

If you prefer to use a script, which is probably the right thing, then
you can do something like this, using the Python SDK:

---8<---
#!/usr/bin/python

from ovirtsdk.api import API
from ovirtsdk.xml import params

# Connect to the server:
api = API(
url="https://engine.example.com/ovirt-engine/api;,
username="admin@internal",
password="**",
ca_file="/etc/pki/ovirt-engine/ca.pem",
debug=False
)

# Find the VM:
vm = api.vms.get(name="myvm")

# Print the id:
print(vm.get_id())

# Disconnect:
api.disconnect()
--->8---

Once you have the VM you can create a snapshot like this:

---8<---
vm.snapshots.add(
params.Snapshot(description="My snapshot")
)
--->8---

You can also use the Java SDK, if you prefer Java.

-- 
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] schedule a VM backup in ovirt 3.5

2015-10-22 Thread Tomas Jelinek


- Original Message -
> From: "Indunil Jayasooriya" <induni...@gmail.com>
> To: users@ovirt.org
> Sent: Thursday, October 22, 2015 7:50:03 AM
> Subject: [ovirt-users] schedule a VM backup in ovirt 3.5
> 
> Hi list,
> 
> I want to schedule a VM backup in ovirt 3.5. I read below URL.
> 
> http://www.ovirt.org/Features/Backup-Restore_API_Integration#Full_VM_Backups
> 
> It gives an below example of VM backup
> 
> 
> Example for VM Backup
> 
> 
> * Use existing VM Snapshot/Create a vm snapshot (example):
> URL = SERVER:PORT/api/vms/VM_ID/snapshots
>  Method = POST
>  (with Content-Type:application/xml header)
>  Body =
>  
>  Virtual Machine 1 - Snapshot For Backup
>  
> 
> 
> But, How can I find the VM_ID of the VM that I want to backup?

look at:
https://engine.example.com/ovirt-engine/api/vms

it lists all the vms and shows both the VM name and it's ID

> 
> How can I write this below format?
> URL = SERVER:PORT/api/vms/VM_ID/snapshots
> 
> MY Ovirt Engine manager is running on another PC. (let's say
> engine.example.com ) i can access it by typing https://engine.example.com/
> 
> is it https://engine.example.com/api/vms/ VM_ID /snapshots ? I can't access
> it in firefox browser?

the correct address should be
https://engine.example.com/ovirt-engine/api/vms/ VM_ID /snapshots


> 
> Should I write a script? is there any Youtube video or doc that makes me to
> understand this?

it depends a lot on language you want to use. If you want to use for example 
python you could try this guide to python sdk
http://www.ovirt.org/Python-sdk

> 
> Hope to hear from you.
> 
> 
> 
> 
> 
> 
> 
> --
> cat /etc/motd
> 
> Thank you
> Indunil Jayasooriya
> http://www.theravadanet.net/
> http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala Fonts
> 
> 
> ___
> 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] schedule a VM backup in ovirt 3.5

2015-10-22 Thread Yedidyah Bar David
On Thu, Oct 22, 2015 at 8:50 AM, Indunil Jayasooriya
 wrote:
> Hi list,
>
> I want to schedule a VM backup in ovirt 3.5. I read below URL.
>
> http://www.ovirt.org/Features/Backup-Restore_API_Integration#Full_VM_Backups
>
> It gives an below example of VM backup
>
>
> Example for VM Backup
>
> Use existing VM Snapshot/Create a vm snapshot (example):
>
>  URL = SERVER:PORT/api/vms/VM_ID/snapshots

/api is deprecated [1]. Please use /ovirt-engine/api in all URLs.

IIUC it should still work, though.

The page above links also to a complete example (check "External
references" near the end). Did you check it?

You might also want to play with the examples in [2].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=961677
[2] http://www.ovirt.org/Python-sdk

>  Method = POST
>  (with Content-Type:application/xml header)
>  Body =
>  
>  Virtual Machine 1 - Snapshot For Backup
>  
>
>
>
> But, How can I find the VM_ID of the VM that I want to backup?
>
> How can I write this below format?
>
>  URL = SERVER:PORT/api/vms/VM_ID/snapshots
>
> MY Ovirt Engine manager is running on another PC. (let's say
> engine.example.com ) i can access it by typing https://engine.example.com/
>
> is it https://engine.example.com/api/vms/VM_ID/snapshots ? I can't access it
> in firefox browser?

You should be able to. Can you access /ovirt-engine/api ?

>
>
> Should I write a script? is there any Youtube video or doc that makes me to
> understand this?

Not sure.

Adding Juan, the SDK maintainer.

Best regards,

>
> Hope to hear from you.
>
>
>
>
>
>
>
>
> --
> cat /etc/motd
>
> Thank you
> Indunil Jayasooriya
> http://www.theravadanet.net/
> http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
> Fonts
>
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>



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


[ovirt-users] schedule a VM backup in ovirt 3.5

2015-10-21 Thread Indunil Jayasooriya
Hi list,

I want to *schedule a VM backup* in ovirt 3.5. I read below URL.


http://www.ovirt.org/Features/Backup-Restore_API_Integration#Full_VM_Backups

It gives an below example of VM backup


Example for VM Backup

   - Use existing VM Snapshot/Create a vm snapshot (example):

 URL = SERVER:PORT/api/vms/VM_ID/snapshots
 Method = POST
 (with Content-Type:application/xml header)
 Body =
 
 Virtual Machine 1 - Snapshot For Backup
 



But, How can I find the *VM_ID* of the VM that I want to backup?

How can I write this below format?

 URL = SERVER:PORT/api/vms/VM_ID/snapshots

MY Ovirt Engine manager is running on another PC. (let's say
engine.example.com ) i can access it by typing
https://engine.example.com/

is it https://engine.example.com/api/vms/*VM_ID*/snapshots ? I can't
access it in firefox browser?


Should I write a script? is there any Youtube video or doc that makes
me to understand this?

Hope to hear from you.








-- 
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html   -  Download Sinhala
Fonts
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users