Bug 888408 - Unable to add raw image to Glance
Summary: Unable to add raw image to Glance
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 2.0 (Folsom)
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: RHOS Maint
QA Contact: Yaniv Kaul
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-18 16:30 UTC by Martin Magr
Modified: 2013-07-04 02:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-20 10:35:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Magr 2012-12-18 16:30:06 UTC
Description of problem:
I was able to add cirros QCOW2 image [1]:
[para@virtual-rhel-beta ~(keystone_admin)]$ glance add name=cirros-0.3.0-x86_64 is_public=true disk_format=qcow2 container_format=bare < cirros-0.3.0-x86_64-disk.img 
Added new image with ID: 48853af8-7302-4ee4-995e-dcb045d92201

But I was unable to do the same with my RHEL test image in RAW format: 
[para@virtual-rhel-beta ~(keystone_admin)]$ sudo qemu-img info test.img
image: test.img
file format: raw
virtual size: 2.0G (2147483648 bytes)
disk size: 1.2G

[para@virtual-rhel-beta ~(keystone_admin)]$ sudo glance add disk_format=raw container_format=bare is_public=true name="test-image" < test.img 
You must provide a username via either --os-username or env[OS_USERNAME]

[1] https://launchpadlibrarian.net/83305348/cirros-0.3.0-x86_64-disk.img

Version-Release number of selected component (if applicable):
[para@virtual-rhel-beta ~(keystone_admin)]$ rpm -qa *glance
python-glance-2012.2.1-1.el6ost.noarch
openstack-glance-2012.2.1-1.el6ost.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create RAW image
2. Try to add it using Glance CLI
  
Actual results:
Image is not added.

Expected results:
Add image or throw relevant exception.

Additional info:
None

Comment 2 Eoghan Glynn 2012-12-18 21:21:51 UTC
Hi John,

The "You must provide a username via either --os-username or env[OS_USERNAME]" error message suggests an issue with environment variables not being propagated.

Have you tried with the sudo -E (preserve environment) option?

Cheers,
Eoghan

Comment 3 Martin Magr 2012-12-20 09:51:25 UTC
Hi Eoghan,

 if this question is for me :), then no I didn't try it with -E. Will try.

Martin

Comment 4 Martin Magr 2012-12-20 10:35:02 UTC
Works with -E. Closing.


Note You need to log in before you can comment on or make changes to this bug.