Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 888408

Summary: Unable to add raw image to Glance
Product: Red Hat OpenStack Reporter: Martin Magr <mmagr>
Component: openstack-glanceAssignee: RHOS Maint <rhos-maint>
Status: CLOSED WORKSFORME QA Contact: Yaniv Kaul <ykaul>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0 (Folsom)CC: eglynn, jkt
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 10:35:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.