cloud-barista / cb-spider

CB-Spider offers a unified view and interface for multi-cloud management.
https://github.com/cloud-barista/cb-spider/wiki
Apache License 2.0
31 stars 47 forks source link

[Spider AdminWeb] MyImage NameId is specified when creating VM with MyImage using AdminWeb, resulting in Error. #1139

Open innodreamer opened 5 months ago

innodreamer commented 5 months ago

What happened : CB-Spider AdminWeb으로 MyImage를 이용해 VM 생성시 아래와 같이 UI에서 MyImage SystemID가 아닌 NameID가 지정되어, VM 생성 과정 중 request parameter 확인 과정에서 MyImage 정보를 찾을 수 없는 오류 발생 image

[12:17:25 PM] curl -sX GET http://localhost:1024/spider/vm -H 'Content-Type: application/json' -d '{"ConnectionName": "nhncloud-kr-pyeongchon1"}'
[12:17:25 PM]    ==> {"vm":[]}

[12:18:21 PM] curl -sX POST http://192.168.56.1:1024/spider/vm -H 'Content-Type: application/json' -d '{ "ConnectionName" : "nhncloud-kr-pyeongchon1", "ReqInfo" : { "Name" : "myimg-vm-01", "ImageType" : "MyImage", "ImageName" : "win-myimage-1", "VMSpecName" : "m2.c4m8", "VPCName" : "vpc-01", "SubnetName" : "subnet-01", "SecurityGroupNames" : ["sg-01"], "DataDiskNames" : [], "KeyPairName" : "keypair-01", "VMUserId" : "Administrator", "VMUserPasswd" : "cbarista3535&*" }}'

[12:18:21 PM]    ==> {"message":"Failed to Get NHN Cloud My Image Info. [Resource not found: [GET https://kr2-api-image-infrastructure.nhncloudservice.com/v2/images/win-myimage-1], error message: {\"code\":\"404\", \"message\": \"Not Found\"}]"}

(참고) AdminWeb에서 PublicImage로 VM 생성시는 UI에서 Image SystemID가 지정되므로 오류가 발생하지 않음. image

What you expected to happen : PublicImage의 경우와 같이 AdminWeb UI에서 MyImage SystemID를 지정하면 오류가 발생하지 않음.

How to reproduce it (as minimally and precisely as possible) : AdminWeb으로 평촌 region에서 Windows OS VM의 MyImage를 생성 후 그 MyImage로 VM 생성 테스트를 진행했음.

powerkimhub commented 5 months ago

@innodreamer

https://github.com/cloud-barista/cb-spider/blob/e57f3aad16ca5a96f21d25ebc82f272ddfe6caa6/cloud-control-manager/cloud-driver/drivers/nhncloud/resources/MyImageHandler.go#L195

innodreamer commented 5 months ago

@powerkimhub 아... local에는 MyImageHandler에 CheckWindowsImage()가 구현되어있고, 그 부분에서 MyImage SystemID에 NameID가 지정되어 오류가 발생하는것 같습니다.

아래는 driver에서 확인되는 오류 메시지입니다.

[CLOUD-BARISTA].[ERROR]: 2024-04-02 13:26:24 MyImageHandler.go:210, github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/drivers/nhncloud/resources.(*NhnCloudMyImageHandler).CheckWindowsImage() - Failed to Get NHN Cloud My Image Info. [Resource not found: [GET https://kr2-api-image-infrastructure.nhncloudservice.com/v2/images/win-myimage-1], error message: {"code":"404", "message": "Not Found"}] 

어제 구현한 코드 PR 올리겠습니다.

powerkimhub commented 2 weeks ago

@innodreamer