ovirt-imageio/demos/upload-from-ova
Albert Esteve 723a2f2126 reuse: addheader python shebang files
Add SPDX header to files with format not
recognised by reuse, but with Python shebang.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2022-10-18 13:04:20 +02:00

54 lines
1.5 KiB
Python
Executable File

#!/usr/bin/python3
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Demonstrate ova support in imageio client.
Requirements:
- Must run in the ovirt-engine-sdk/sdk/examples directory.
- fedora-32.ova tar file must exist in the current directory
- A fedora-32.qcow2 compressed image must exist in the ova file.
- Engine url and credentials should be adapted to your environment
- Assumes active NFS storage domain named "nfs1"
- ovirt-imageio-client supporting ova must be installed, or path to
ovirt-imageio/daemon must be added to PYTHONPATH.
- demo.py from https://github.com/nirs/demo installed in PYTHONPATH.
"""
from demo import *
run("clear")
msg()
msg("### HOW TO UPLOAD A DISK FROM OVA FILE TO OVIRT ###")
msg()
msg("We have this ova file with compressed qcow2 image:")
msg()
run("tar", "tf", "fedora-32.ova")
msg()
run("du", "-hL", "fedora-32.ova")
msg()
msg("Let's upload the qcow2 image to oVirt...")
msg("Oh, wait! I want to convert it to raw format")
msg("actually raw preallocated disk on storage domain nfs1")
msg()
msg("will it blend?")
msg()
run("./upload_from_ova.py",
"--engine-url", "https://engine3",
"--username", "admin@internal",
"--password-file", "engine3-password",
"--cafile", "engine3.pem",
"--ova-disk-name", "fedora-32.qcow2",
"--disk-format", "raw",
"--sd-name", "nfs1",
"fedora-32.ova")
msg()
msg("How cool is that?", color=YELLOW)
msg()
msg("[Created with https://github.com/nirs/demo]", color=GREY)