opentelekomcloud / otc-tools

(Deprecated) Simple bash/curl/jq based command line tool using the OpenStack and OTC specific REST APIs.
Creative Commons Attribution Share Alike 4.0 International
27 stars 17 forks source link

fixed create image and stop ecs functions #21

Closed junessi closed 7 years ago

junessi commented 7 years ago

fixed POST request to stop an ECS. fixed create image command to create a image from a stopped ECS via instance-id

garloff commented 7 years ago

Hi Cricketlong, Thanks for your PR! I can not just merge -- the changes to images create do not seem correct to me. The current implementation works fine: You can use it to create an image in glance and then in a second step upload the image file (either via s3 or directly). Your patch seems to enable another use case: Creating an image from a VM. A good addition, but it should not overwrite and break the old functionality. -- Kurt

junessi commented 7 years ago

Yes, my patch is to create an image from instance. I think we should add one option "--source" which has two allowed values: "ecs" and "imagefile". "imagefile" is for the current implementation which create an image from S3 and "ecs" is to create new image from stopped instance. I need this feature to automate the creation of an image, include starting instance, installing custom packets, configuration, stop vm and creating image.

junessi commented 7 years ago

hi, garloff, I added the options for source: ecs|imagefile. The old funtionality stays unchanged. to use the old funtionality: otc images create --source imagefile ...(some options) to create an image from an stopped instance: otc images create --source ecs --image-name "test" --instance-id <id> --image-description "test"

garloff commented 7 years ago

Implemented in a slightly different way upstream. This formally rejected, content-wise merged.