Closed junessi closed 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
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.
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"
Implemented in a slightly different way upstream. This formally rejected, content-wise merged.
fixed POST request to stop an ECS. fixed create image command to create a image from a stopped ECS via instance-id