Skip to content

Conversation

@jaywcarman
Copy link
Member

@jaywcarman jaywcarman commented Apr 27, 2023

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.
@jaywcarman
Copy link
Member Author

fyi @iv1111

@jaywcarman jaywcarman requested a review from iv1111 April 28, 2023 16:21
Copy link
Contributor

@iv1111 iv1111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.

jaywcarman added 7 commits May 1, 2023 09:51
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.
@miq-bot
Copy link
Member

miq-bot commented May 3, 2023

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
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@jaywcarman
Copy link
Member Author

With the latest commits (#453 f56ca07, and ManageIQ/manageiq-api#1221 72444473) here's a view of the data passed into ManageIQ::Providers::CloudManager::Template.import_image_queue:

[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"}

@miq-bot
Copy link
Member

miq-bot commented Aug 7, 2023

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 stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@miq-bot miq-bot closed this Nov 13, 2023
@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants