image import fails with service instance not found when name is passed
What happened:
Image import to a PowerVS service instance fails when name is passed with instance not found error and succeeds when ID is passed.
What you expected to happen: Image import to succeed
How to reproduce it (as minimally and precisely as possible):
export IBMCLOUD_API_KEY=<>
pvsadm image import -n ibm-pvs-3-serviceInstance -b power-oss-bucket -o capibm-powervs-centos-streams8-1-28-4.ova.gz -r us-south --pvs-image-name capibm-powervs-centos-streams8-1-28-4 --public-bucket
Error: instance: ibm-pvs-3-serviceInstance not found
Anything else we need to know?:
On enabling debug logs, I could see that search with name passed via -n(indicating name of the PowerVS service instance) is being searched against COS instances. Sample output:
I0229 01:22:24.762968 145132 pvmclient.go:69] Service ID: c2e6f56f-f292-4cf3-b5a4-6ff8ef5892dd, region_id: global, Name: dhar-hyp-iks-cos
I0229 01:22:24.762997 145132 pvmclient.go:70] crn: crn:v1:bluemix:public:cloud-object-storage:global:a/c265c8cefda241ca9c107adcbbacaa84:c2e6f56f-f292-4cf3-b5a4-6ff8ef5892dd::
I0229 01:22:24.763020 145132 pvmclient.go:69] Service ID: f05943b1-fc01-45ae-9ad6-9fe4d4a44b92, region_id: global, Name: power-images-cos
I0229 01:22:24.763031 145132 pvmclient.go:70] crn: crn:v1:bluemix:public:cloud-object-storage:global:a/c265c8cefda241ca9c107adcbbacaa84:f05943b1-fc01-45ae-9ad6-9fe4d4a44b92::
I0229 01:22:24.763044 145132 pvmclient.go:69] Service ID: 23286650-4fab-4433-bd88-e4626c280867, region_id: jp-tok, Name: logs-tokyo-Zo
...
Ideally shouldn't it list and search against the PowerVS service instances?
Environment:
- pvsadm version (use
pvsadm version): latest build from main - Environment - On-Prem or IBM PowerVS: IBM PowerVS
- OS (e.g:
cat /etc/os-release): CentOS Stream 9 - Kernel (e.g.
uname -a): 5.14.0 - Others:
/cc @KeerthanaAP @kishen-v
@Amulyam24
I tried importing image using the service instance name option with latest code and didn't face this issue.
% ./pvsadm image import -n rdr-openshift-dev -b power-oss-bucket -o capibm-powervs-centos-streams8-1-28-4.ova.gz -r us-south --pvs-image-name capibm-powervs-centos-streams8-1-28-4 --public-bucket -k <key>
I0306 15:17:17.885490 21102 import.go:203] Image Import Job in-progress, current state: queued
I0306 15:19:20.997993 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:21:19.587298 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:23:20.259771 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:25:20.378923 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:27:19.853301 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:29:19.326709 21102 import.go:203] Image Import Job in-progress, current state: running
I0306 15:31:24.298760 21102 import.go:220] Retriving image details
I0306 15:31:24.298821 21102 import.go:224] Importing Image capibm-powervs-centos-streams8-1-28-4 is currently in active state, Please check the Progress in the IBM Cloud UI
Thank you for verifying it @KeerthanaAP, I will retry and let you know.
@Amulyam24 how machine service instances you have in your account, hope we aren't dealing with the paging issue here?!
@KeerthanaAP lets check if we are handling the paging properly or not.
@Amulyam24 how machine service instances you have in your account, hope we aren't dealing with the paging issue here?!
@mkumatag, currently, the number of service instances in the account are less than 10 accommodated within a page.
@KeerthanaAP, I was able to import it to the same instance you mentioned rdr-openshift-dev by passing name
However, I haven't been successful with the other instances.
Created a new PowerVS service instance called test-instance as shown below
pvsadm image import -n test-instance -b power-oss-bucket -o capibm-powervs-centos-streams8-1-28-4.ova.gz -r us-south --pvs-image-name capibm-image --public-bucket
Error: instance: test-instance not found
# Image import passed when ID is passed
pvsadm image import -i 4184a31d-803c-400f-8afb-c8d144e0e411 -b power-oss-bucket -o capibm-powervs-centos-streams8-1-28-4.ova.gz -r us-south --pvs-image-name capibm-image --public-bucket
I0307 04:46:47.718238 207256 import.go:203] Image Import Job in-progress, current state: queued
Same issue occurs when I try with capi-pvs-21-serviceInstance
Interesting, lets debug further..
/assign
I had observed that the bluemix-go API returns only 100 entries when queried. I'm unsure if with resourcecontrollerv2 and the recent changes has addressed this issue.
As there has been an new type composite_instance that has been introduced, we may fail to list them while we may search instances of type service_instance. This has been fixed by querying instances by ID, rather than type.
Please keep us posted if the issue persists.
Ref: https://github.com/openshift/installer/pull/8479
Please feel free to re-open if the issue persists. /close
@kishen-v: Closing this issue.
In response to this:
Please feel free to re-open if the issue persists. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.