Skip to content
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

Add customImage mgmt and snapshot features #1190

Conversation

jihoon-seo
Copy link
Member

@jihoon-seo jihoon-seo commented Oct 5, 2022

[Create VM snapshot]

[Request]
cb-tumblebug/src/testclient/scripts/8.mcis/snapshot-vm.sh -n jhseo -c aws -r 1
POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis/${MCISID}/vm/${CONN_CONFIG[$INDEX,$REGION]}-1/snapshot

{
  "name": "<Specify name for new TB VM customImage (snapshot) object>"
}

[Response]

{
  "namespace": "ns01",
  "id": "aws-ap-southeast-1-jhseo",
  "name": "aws-ap-southeast-1-jhseo",
  "connectionName": "aws-ap-southeast-1",
  "sourceVmId": "aws-ap-southeast-1-1",
  "cspCustomImageId": "ami-036ec067a703254a7",
  "cspCustomImageName": "aws-ap-southeast-1-jhseo",
  "description": "",
  "creationDate": "2022-10-07T01:44:34Z",
  "status": "Unavailable"
}
  • 예를 들어 AWS의 경우 AMI status가 Unavailable에서 Available로 바뀌기까지 약 1~2분 소요됨
  • VM에 attach 되어 있던 RootDisk / DataDisk 각각의 볼륨 스냅샷도 CSP에 생성되나, SP/TB API로는 확인 불가함

[List customImage]

  • TB에서 List/Get customImage 함수를 호출하면, SP에 MyImage 정보를 조회하여, Status 필드를 업데이트하고 출력함

[Request]
cb-tumblebug/src/testclient/scripts/12.customImage/list-customimage.sh
GET http://$TumblebugServer/tumblebug/ns/$NSID/resources/customImage

[Response]

{
  "customImage": [
    {
      "namespace": "ns01",
      "id": "aws-ap-southeast-1-jhseo",
      "name": "aws-ap-southeast-1-jhseo",
      "connectionName": "aws-ap-southeast-1",
      "sourceVmId": "aws-ap-southeast-1-1",
      "cspCustomImageId": "ami-036ec067a703254a7",
      "cspCustomImageName": "aws-ap-southeast-1-jhseo",
      "description": "",
      "creationDate": "2022-10-07T01:44:34Z",
      "status": "Available"
    }
  ]
}

[List customImage IDs]

[Request]
cb-tumblebug/src/testclient/scripts/12.customImage/id-list-customimage.sh
GET http://$TumblebugServer/tumblebug/ns/$NSID/resources/customImage?option=id

[Response]

{
  "output": [
    "aws-ap-southeast-1-jhseo"
  ]
}

[Inspect customImage]

[Request]
cb-tumblebug/src/testclient/scripts/12.customImage/inspect-customimage.sh -n jhseo -c aws -r 1
POST http://$TumblebugServer/tumblebug/inspectResources

{
  "connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
  "resourceType": "customImage"
}

[Response]

{
  "connectionName": "aws-ap-southeast-1",
  "resourceType": "customImage",
  "systemMessage": "",
  "resourceOverview": {
    "onTumblebug": 1,
    "onSpider": 1,
    "onCspTotal": 1,
    "onCspOnly": 0
  },
  "resources": {
    "onTumblebug": {
      "count": 1,
      "info": [
        {
          "idByTb": "aws-ap-southeast-1-jhseo",
          "idByCsp": "ami-036ec067a703254a7",
          "nsId": "ns01",
          "objectKey": "/ns/ns01/resources/customImage/aws-ap-southeast-1-jhseo"
        }
      ]
    },
    "onSpider": {
      "count": 1,
      "info": [
        {
          "idBySp": "aws-ap-southeast-1-jhseo",
          "idByCsp": "ami-036ec067a703254a7"
        }
      ]
    },
    "onCspTotal": {
      "count": 1,
      "info": [
        {
          "idByCsp": "ami-036ec067a703254a7",
          "refNameOrId": "aws-ap-southeast-1-jhseo"
        }
      ]
    },
    "onCspOnly": {
      "count": 0,
      "info": null
    }
  }
}

[Delete customImage]

[Request]
cb-tumblebug/src/testclient/scripts/12.customImage/delete-customimage.sh -n jhseo -c aws -r 1
DELETE http://$TumblebugServer/tumblebug/ns/$NSID/resources/customImage/${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}

[Response]

{
  "message": "The customImage aws-ap-southeast-1-jhseo has been deleted"
}

@jihoon-seo jihoon-seo requested a review from seokho-son as a code owner October 5, 2022 10:19
@lgtm-com
Copy link

lgtm-com bot commented Oct 5, 2022

This pull request introduces 14 alerts when merging 873ebab into eb55a4a - view on LGTM.com

new alerts:

  • 13 for Log entries created from user input
  • 1 for Useless assignment to local variable

Copy link
Member

@seokho-son seokho-son left a comment

Choose a reason for hiding this comment

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

LGTM!

@seokho-son seokho-son merged commit b6fc917 into cloud-barista:main Oct 5, 2022
@jihoon-seo jihoon-seo deleted the 221005_Add_customImage_mgmt_and_snapshot_feature branch October 5, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants