-
Notifications
You must be signed in to change notification settings - Fork 36
[WIP] PowerVS import image from COS #453
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
[WIP] PowerVS import image from COS #453
Conversation
Tidy up before committing subsequent patches to these files.
Renaming this in preparation to add an API constant for getting a list of COS objects. Aligning the constant name with the API call name will keep things from getting confusing.
The "keep ova" option was useful when using COS as an intermediary between PowerVC and PowerVS. When importing directly from COS there no need to "keep" the object (and no good reason to delete it during this process either).
When importing an image into PowerVS from COS, the user needs to specify which object (image) to import. In the future it would out object that don't have one of the following supported extensions: .ova, .ova.gz, .tar, .tar.gz, .tgz, .ova.tgz
The image name value is given to the newly imported image. I believe this name must be unique to images within an PowerVS provider instance.
|
fyi @iv1111 |
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.
Looking good.
Change import field name/id to better match the MIQ data it represents.
Example of resulting 'values' hash passed to 'onSubmit':
values:
cos_container_id: "2"
cos_obj_id: "1"
disk_type_id_cos: "1"
image_name: "new_image_name"
obj_storage_id: "5",
provider_type: "COS",
timeout_cos: 3
The PowerVS image import API requires an 'osType' parameter when importing raw images. The allowable values are included in the API documentation[1]. [1]: https://cloud.ibm.com/apidocs/power-cloud#pcloud-v1-cloudinstances-cosimages-post
Some of the names changes from aea3659 don't match up to the cloud template import API parameters[1]. Matching them up allows for re-using some of the existing validation.
This field from the PowerVC source form was mistakenly changed in the last commit. Note: I'm pushing only fast-forward commits while this PR is a WIP. Later I'll rebase and consolidate.
This commit will be removed before ManageIQ#453 is out of WIP.
Should be pretty much done with the name changes. Again, I'll squash all of the name change commits before taking the PR out of WIP.
|
Checked commits jaywcarman/manageiq-providers-ibm_cloud@253ad50~...f56ca07 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
|
With the latest commits (#453 f56ca07, and ManageIQ/manageiq-api#1221 72444473) here's a view of the data passed into [59, 68] in /home/jwcarman/src/github.com/ManageIQ/manageiq-providers-ibm_cloud/app/models/manageiq/providers/ibm_cloud/power_virtual_servers/cloud_manager/template.rb
59: _log.error("image=[#{name}], error: #{e}")
60: end
61:
62: def self.raw_import_image(ext_management_system, options = {})
63: byebug
=> 64: session_id = SecureRandom.uuid
65: wrkfl_timeout = options['timeout'].to_i.hours
66:
67: cos = ExtManagementSystem.find(options['obj_storage_id'])
68: raise MiqException::Error, _("unable to find cloud object storage by this id '#{options['obj_storage_id']}'") if cos.nil?
(byebug) var args
ext_management_system = rdr-jwcarman-hcm-mon01-miq
options = {"src_provider_type"=>"ManageIQ::Providers::IbmCloud::ObjectStorage", "src_provider_id"=>"5", "os_type"=>"ibmi", "image_name"=>"new_image_name", "c...
(byebug) pp options
{"src_provider_type"=>"ManageIQ::Providers::IbmCloud::ObjectStorage",
"src_provider_id"=>"5",
"os_type"=>"ibmi",
"image_name"=>"new_image_name",
"cloud_volume_type_id"=>"2",
"timeout"=>3,
"cos_container_id"=>"2",
"src_image_id"=>"1",
"dst_provider_id"=>"2"}
{"src_provider_type"=>"ManageIQ::Providers::IbmCloud::ObjectStorage", "src_provider_id"=>"5", "os_type"=>"ibmi", "image_name"=>"new_image_name", "cloud_volume_type_id"=>"2", "timeout"=>3, "cos_container_id"=>"2", "src_image_id"=>"1", "dst_provider_id"=>"2"} |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
Depends on: