In this video, I'll show you how to Back Up an Oracle Linux Virtualization Manager Virtual
Machine by using the REST API. The backup procedure consist of:
Creating a snapshot of the virtual machine you want to back up.
Get the snapshot ID which is used in subsequent steps.
Get the disk ID of the snapshot which is also used in a subsequent step.
Attach the shapshot to a backup virtual machine as an active disk attachment.
This backup virtual machine has software for managing the backup installed on it.
Backup software is provided by an independent software provider.
Refer to the oVirt Ecosystem at https://catalog.redhat.com for supported backup vendors.
Use the backup software on the backup virtual machine to back up the data on the snapshot
disk. I'll assume you are familiar with using the
REST API and have already the obtained the CA certificate used by the server and saved
it to a local file. But if not, check out the previous video on
Getting Started with the REST API. The first two steps of the backup procedure,
creating a snapshot of the VM you want to back up, and getting the snapshot ID were
demonstrated in the "Getting Started with the REST API" video.
But I'll quickly review the curl commands used in that video.
This curl command creates a snapshot of the virtual machine you want to back up.
The name of the snapshot is "backup". And here you provide the VM ID of the virtual
machine. This curl command gets the snapshot IDs of
all snapshots for this virtual machine. I've extracted the snapshot ID of our "backup"
snapshot from the output and I'll save this information, as well as the VM ID of the virtual
machine we created a snapshot of, in a notepad for future reference.
The next thing we need to do is get the disk ID of the snapshot.
I'll open up my terminal window and I've created a script which contains the curl command to
get the disk ID. Provide the CA certificate file.
The HTTP method in this command is GET. Provide the header lines and the user login
information. And provide this https line, with the name
of your API server, slash ovirt-engine, slash api, slash vms, slash the VM ID of the VM
that we want to back up, slash snapshots, slash the snapshot ID that we created in this
video, slash disks. I'll copy the VM ID from my notepad and paste
it. And I'll copy the snapshot ID from my notepad
and paste. Now I'll save the file, then run this script
to get the disk ID. The output shows the disk ID.
I'll copy it and save it to my notepad for future reference.
Finally, we need to attach the snapshot to a backup virtual machine as an active disk
attachment. I'll open up my terminal window and I've created
a script which contains the curl command to attach the snapshot.
Again you need to provide the CA certificate file and the user login information.
The HTTP method in this command is POST. Provide the header lines.
Information required for the disk_attachment data includes the disk ID and the snapshot
ID. I'll copy this disk ID from my notepad and
paste it. And I'll copy the snapshot ID from my notepad
and paste it. We also need the disk interface type and,
for the https line, we need the VM ID of the backup virtual machine.
This is a VM that is running Backup software, provided by an independent software vendor,
I mentioned earlier in this video. In this video, my backup VM is named backup_vm.
I'll browse the General tab and copy the VM ID and paste it into my notepad and also paste
it into my script. And I'll browse the Disks tab to get the disk
interface type, which is virtio. Also notice there is a single disk attached
to this VM. After we run this script, we'll see that a
second disk is attached. Now I'll update my script with this information,
entering virtio as the interface for the disk_attachment data.
I'll save the file and run the script. I'll browse the Disks tab for my backup vm,
refresh the screen, and now I have the second disk.
Hovering my mouse over the entry shows that this is attached to 2 VMs, the VM that I took
a snapshot of, test-vlan02-b, and my backup VM that is running the Backup software.
I'm not going to demonstrate this step, but you can now use the backup software installed
on the backup virtual machine to back up the data on the snapshot disk.
After you've backed up the data, you can perform a couple of clean-up steps using the REST
API. This curl command removes the snapshot disk
attachment from the backup virtual machine. Provide the VM ID of the backup virtual machine,
not the virtual machine that we made the snapshot of, and provide the snapshot ID.
And this curl command deletes the snapshot. Here you provide the VM ID of the virtual
machine that we made the snapshot of and provide the snapshot ID.
This concludes this presentation. Thank you for watching.