Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt-img command line tool #72

Closed
ahadas opened this issue May 24, 2022 · 1 comment
Closed

ovirt-img command line tool #72

ahadas opened this issue May 24, 2022 · 1 comment
Labels
enhancement Enhancing the system by adding new feature or improving performance or reliability
Milestone

Comments

@ahadas
Copy link
Member

ahadas commented May 24, 2022

Uploading an image is complex process, requiring:

  • detecting the image type (qcow2, raw, iso)
  • creating a disk using the SDK, with the right format, sparse, initial_size
    and provional_size, which depend on the storage domain type
  • checking if the current host can be used for the transfer
  • starting a transfer on the current host if possible
  • if the transfer be started on the current host, the user have to choose the
    transfer_url or the proxy_url.
  • uploading the file using imageio REST API.
  • cancel transfer on failures

We have example code and documentation for some of the steps, but building
a correct upload application is too complicated. Even virt-v2v did not get it
right yet, after few month of development, with help form the oVirt team.

Uploading disks with several snapshots is even more complex.

It does not make sense that all users will have to write this code and make the
same errors.

The upload and download examples in the SDK are usually wrong, outdated, and do
not use the latest features offered by imageio. They do not have any automated
tests so they are likely to break after every update.

The upload and download examples also contain huge amount of duplicate code, and
require too much time to maintain.

Finally the ansible modules are using the outdated example code and need extra
maintenance and testing.

All these issues can be solved by providing a command line tool that does
everything for you.

Something like:

ovirt-img upload --storage my-storage my-image.qcow2 https://example.com/

The command will:

  • read engine username and password from standard locations in a secure way
  • inspect the image properties and create disk property, matching the storage
    domain capabilities to the image type
  • inspect the current host and start the upload on it if posible
  • if the transfer cannot be started on current host, select the best transfer
    destination
  • upload the data efficiently, supporting sparse images
  • handle failures properly, avoiding leaving paused transfers
  • support resuming if the upload was aborted
  • show proper progress during upload

The data path part is already implemented in https://gerrit.ovirt.org/c/94216/

Original bug: https://bugzilla.redhat.com/1626262

@nirs
Copy link
Member

nirs commented Aug 3, 2022

First version completed by #116. We will open new issues for additional commands.

@nirs nirs closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing the system by adding new feature or improving performance or reliability
Projects
None yet
Development

No branches or pull requests

2 participants