how to create a image from a running instance

asked 2016-07-27 09:57:12 -0500

victorming888 gravatar image

I have created an instance and installed some software onto it. Now I need to create a snapshot or image to reserve its status, so that other fellows can use it as a template to create the samiliar instances. The first idea is use OpenStack's nova api -- Create Image (createImage Action):

     POST   http://controller:8774/v2/servers/{server_id}/action
     with {server_id} replaced by the running instance's id and following json entity:
    "createImage" : {
        "name" : "foo-image",
        "metadata": {
            "meta_var": "meta_val"

but the server report 404: service not found. My OpenStack version is Liberty, and the controller's hostname is 'controller'. The token is added to the POST's head as required. Anybody can help?

edit retag flag offensive close merge delete


Have you examined the output of nova --debug image-create SERVER_NAME foo-image for hints? Or can you use the CLI to accomplish this task instead of the API?

barry.davis gravatar imagebarry.davis ( 2016-07-28 13:55:28 -0500 )edit

I run the commdn "nova --debug image-create ..." and this works. The debug output is "POST http://controller:8774/v2/%7Btenant_uuid/%7Bserver_uuid%7D/action%22 (http://controller:8774/v2/{tenant_uui...). I know how to make the http request. Thank you for comments!

victorming888 gravatar imagevictorming888 ( 2016-08-01 08:03:49 -0500 )edit