-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ovirt-img: add upload-disk #108
Conversation
53ebfc5
to
933701f
Compare
933701f
to
cd07ad9
Compare
Just pushed to see how it looks in the PR and be able to close some threads and have a cleaner view of what's done. I want to see if I can add some tests for the new option types. |
ef8ecc5
to
ad6b767
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added note about the incremental backup flag.
c5dbb24
to
ed1e3a0
Compare
ed1e3a0
to
8c2f1ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
3c1301e
to
8df7ece
Compare
@nirs I followed all comments from the last review, you can see the most relevant changeset here: https://github.com/oVirt/ovirt-imageio/compare/8c2f1eecf04dc02da026173d5a7299d90708a20b..4267e85f6b6a99a7cc0a7bb7d7f80c09bbd1f21c The other pushes were only correcting commit messages. Table updated with content type for depicting ISO images. Except raw sparse on block storage, everything else is allowed with default arguments, so I think we are in a pretty good state! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
7302df9
to
5587dd4
Compare
I did one more split in the I hope the code is improved and not worsened with the change, but it makes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with iso images.
Add a new "add_disk" function to the _ovirt module for the ovirt-img tool. Add disk allows to create a new disk in the engine through an open connection. Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add UUID type for UUID normalization and parameter validation. Use it to verify disk_id in download-disk. Output: ovirt-img download-disk: error: argument disk_id: invalid UUID value: 'invalid-uuid-argument' Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add an additional argument to the options.add_sub_command function to optionally (True by default) add common transfer-related options to the command. Currently these options are "--max-workers" and "--buffer-size". Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add upload-disk sub-command for upload disks. $ ./ovirt-img upload-disk -h usage: ovirt-img upload-disk [-h] [-c CONFIG] [--engine-url ENGINE_URL] [--username USERNAME] [--password-file PASSWORD_FILE] [--cafile CAFILE] [--log-file LOG_FILE] [--log-level LOG_LEVEL] [--max-workers MAX_WORKERS] [--buffer-size BUFFER_SIZE] -s STORAGE_DOMAIN [-f {raw,qcow2}] [--preallocated] [--disk-id ID] filename positional arguments: filename Path to image to upload. Supported formats: raw, qcow2, iso. optional arguments: -h, --help show this help message and exit -c CONFIG, --config CONFIG If set, read specified section from the configuration file. --engine-url ENGINE_URL ovirt-engine URL. If not set, read from the specified config section (required). --username USERNAME ovirt-engine username. If not set, read from the specified config section (required). --password-file PASSWORD_FILE Read ovirt-engine password from file. If not set, read password from the specified config section, or prompt the user for the password. --cafile CAFILE Path to ovirt-engine CA certificate. If not set, read from the specified config section --log-file LOG_FILE Log to file instead of stderr. --log-level LOG_LEVEL Log level (choices: {debug, info, warning, error}, default: warning). --max-workers MAX_WORKERS Maximum number of workers (range: 1-8, default: 4). --buffer-size BUFFER_SIZE Buffer size per worker (range: 64k-16m, default: 4m). -s STORAGE_DOMAIN, --storage-domain STORAGE_DOMAIN Name of the storage domain. -f {raw,qcow2}, --format {raw,qcow2} Upload image format (default qcow2 for data disks and raw for iso disks). --preallocated Create preallocated disk. Required when using raw format on block based storage domain (iSCSI, FC). ISO images are always uploaded to preallocated disk. --disk-id ID A UUID for the new disk. If not specified oVirt will create a new UUID. $ ./ovirt-img upload-disk --config engine --storage-domain iscsi-sd disk1.qcow2 [ ---- ] 0 bytes, 0.00 s, 0 bytes/s | inspecting image [ ---- ] 0 bytes, 0.01 s, 0 bytes/s | creating disk [ ---- ] 0 bytes, 6.39 s, 0 bytes/s | creating transfer [ 38% ] 2.29 GiB, 15.99 s, 146.59 MiB/s | uploading image [ 100% ] 6.00 GiB, 22.88 s, 268.56 MiB/s | finalizing transfer [ 100% ] 6.00 GiB, 33.02 s, 186.07 MiB/s | upload completed Possible combinations: Content | Storage | Backup | Format | Allocation | Allowed ------- | ------- | ------ | ------ | ------------ | ------- data | block | yes | qcow | sparse | ✓ data | block | yes | qcow | preallocated | ✓ data | block | no | raw | sparse | x data | block | no | raw | preallocated | ✓ data | file | yes | qcow | sparse | ✓ data | file | yes | qcow | preallocated | ✓ data | file | no | raw | sparse | ✓ data | file | no | raw | sparse | ✓ iso | block | no | raw | preallocated | ✓ iso | file | no | raw | preallocated | ✓ Note: Source allocation policies omitted as they make no difference. Signed-off-by: Albert Esteve <aesteve@redhat.com>
5587dd4
to
7e39962
Compare
Add upload-disk sub-command for upload disks.
Possible combinations:
Note: Source allocation policies omitted as they make no difference.
Related: #72
Signed-off-by: Albert Esteve aesteve@redhat.com