Add upload-to-image command to volume

Bug #1207615 reported by Steve Martinelli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Invalid
Undecided
Terry Howe
python-openstackclient
Fix Released
Low
Terry Howe

Bug Description

I don't believe we have this functionality to date, cinder has the following command for v1 (not sure about v2):

upload-to-image Upload volume to image service as image.

usage: cinder upload-to-image [--force <True|False>]
                              [--container-format <container-format>]
                              [--disk-format <disk-format>]
                              <volume-id> <image-name>

Upload volume to image service as image.

Positional arguments:
  <volume-id> ID of the volume to upload to an image
  <image-name> Name for created image

Optional arguments:
  --force <True|False> Optional flag to indicate whether to upload a volume
                        even if it's attached to an instance. (Default=False)
  --container-format <container-format>
                        Optional type for container format (Default=bare)
  --disk-format <disk-format>
                        Optional type for disk format (Default=raw)

Dean Troyer (dtroyer)
Changed in python-openstackclient:
importance: Undecided → Low
Terry Howe (thowe-g)
Changed in python-openstackclient:
assignee: nobody → Terry Howe (thowe-g)
status: New → In Progress
Terry Howe (thowe-g)
Changed in python-cinderclient:
assignee: nobody → Terry Howe (thowe-g)
status: New → Invalid
Revision history for this message
Terry Howe (thowe-g) wrote :

I killed the cinder component because, the cinder client supports the backup-create where you can create a volume from an image.

Revision history for this message
Terry Howe (thowe-g) wrote :

Just to clear the confusion (maybe I'm the only one confused by the scope of this request):

The glance client supports image upload with the --file option or you may pass the image in through stdin. From the help:

usage: glance image-create [--id <IMAGE_ID>] [--name <NAME>] [--store <STORE>]
...
  --file <FILE> Local file that contains disk image to be uploaded
                        during creation. Alternatively, images can be passed
                        to the client via stdin.

Revision history for this message
Terry Howe (thowe-g) wrote :

What I meant was cinder create takes an image reference, not backup-create.

Revision history for this message
Terry Howe (thowe-g) wrote :

Let me know if I'm missing something here Steve, but the "os volume create" command takes an image to create a volume from an image.

Changed in python-openstackclient:
status: In Progress → Invalid
Revision history for this message
Terry Howe (thowe-g) wrote :

The only thing I see missing is there is no "os image create" with a --volume option which should map to this upload-to-image command. I would actually access cinder to do the work.

Revision history for this message
Steve Martinelli (stevemar) wrote :

Terry, the command would let folks upload a cinder volume to glance, after creation.

Terry Howe (thowe-g)
Changed in python-openstackclient:
status: Invalid → In Progress
Revision history for this message
Terry Howe (thowe-g) wrote :

Okay, I'll investigate. Seems like it would be nicer to add the --volume option, but I don't know how that would work crossing from image to volume.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/76623

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/76623
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=e6e0dbf754c4dbc631e5c797b50d8032481a1a27
Submitter: Jenkins
Branch: master

commit e6e0dbf754c4dbc631e5c797b50d8032481a1a27
Author: Terry Howe <email address hidden>
Date: Wed Feb 26 12:13:01 2014 -0700

    Add --volume option to image create command

    Add ability to create an image from a volume.
    * Added --volume command to image create
    * Added --force option to image create
    * Added block to access volume manager in image create
    * Tests added for the volume option

    Change-Id: I3910a2b5e04acd0d15dd230747ba6ebca07aa316
    Closes-Bug: #1207615

Changed in python-openstackclient:
status: In Progress → Fix Committed
Dean Troyer (dtroyer)
Changed in python-openstackclient:
milestone: none → m4
Dean Troyer (dtroyer)
Changed in python-openstackclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.