why glance-upload ok, euca-upload error

Asked by wallace

When i tried to use swift to store glance image,
uec-publish-tarball ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz mybucket
works not well
I know uec command exactly follow three steps: euca-bundle-image euca-upload-bundle euca-register
while doing the three commands step by step, I found the error orrurs dong euca-register,
glance show 9
URI: http://0.0.0.0/images/9
Id: 9
Public: No
Name: None
Status: active
Size: 0
Location: swift+https://system:abc:abc@192.168.20.77:8080/auth/v1.0//glance/9
Disk format: aki
Container format: aki
Property 'image_location': otherbucket/kernel.manifest.xml
Property 'image_state': available
Property 'project_id': admin
Property 'architecture': x86_64

Size = NULL, it not good. but I found the image in swift object container,also can download well. WHY

At last, I follow someone's advice, using glance-upload instand, all works ok
Can anyone tell me the differences and the error reason . Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Pipes
Solved:
Last query:
Last reply:
Revision history for this message
Jay Pipes (jaypipes) said :
#1

Unfortunately, I don't know what the error might have been when you used euca-register-image unless you post the nova-compute log file section that shows debugging information... can you pastebin that?

Thanks!
-jay

Revision history for this message
wallace (mczhou82) said :
#2

Thank you jay

2011-11-29 19:38:42,979 DEBUG nova.utils [-] Running cmd (subprocess): sudo tune2fs -c 0 -i 0 /dev/nbd15 from (pid=2177) execute /usr/lib/pymodules/python2.6/nova/utils.py:152
2011-11-29 19:38:42,989 DEBUG nova.utils [-] Result was 1 from (pid=2177) execute /usr/lib/pymodules/python2.6/nova/utils.py:167
2011-11-29 19:38:42,989 DEBUG nova.utils [-] Running cmd (subprocess): sudo qemu-nbd -d /dev/nbd15 from (pid=2177) execute /usr/lib/pymodules/python2.6/nova/utils.py:152
2011-11-29 19:38:43,000 WARNING nova.virt.libvirt_conn [-] instance instance-00000005: ignoring error injecting data into image 29 (Unexpected error while running command.
Command: sudo tune2fs -c 0 -i 0 /dev/nbd15
Exit code: 1
Stdout: 'tune2fs 1.41.11 (14-Mar-2010)\n'
Stderr: "tune2fs: Invalid argument while trying to open /dev/nbd15\r\nCouldn't find valid filesystem superblock.\n")
2011-11-29 19:38:43,698 ERROR nova.exception [-] Uncaught exception
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 87, in wrapped
(nova.exception): TRACE: return f(*args, **kw)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt/connection.py", line 582, in spawn
(nova.exception): TRACE: domain = self._create_new_domain(xml)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt/connection.py", line 1168, in _create_new_domain
(nova.exception): TRACE: domain.createWithFlags(launch_flags)
(nova.exception): TRACE: File "/usr/lib/python2.6/dist-packages/libvirt.py", line 337, in createWithFlags
(nova.exception): TRACE: if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
(nova.exception): TRACE: libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/0
(nova.exception): TRACE: qemu: could not load kernel '/var/lib/nova/instances/instance-00000005/kernel': Inappropriate ioctl for device
(nova.exception): TRACE:
(nova.exception): TRACE:
2011-11-29 19:38:43,724 ERROR nova.compute.manager [-] Instance '5' failed to spawn. Is virtualization enabled in the BIOS? Details: internal error Process exited while reading console log output: char device redirected to /dev/pts/0
qemu: could not load kernel '/var/lib/nova/instances/instance-00000005/kernel': Inappropriate ioctl for device
(nova.compute.manager): TRACE: Traceback (most recent call last):
(nova.compute.manager): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 428, in _run_instance
(nova.compute.manager): TRACE: network_info, block_device_info)
(nova.compute.manager): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 118, in wrapped
(nova.compute.manager): TRACE: raise Error(str(e))
(nova.compute.manager): TRACE: Error: internal error Process exited while reading console log output: char device redirected to /dev/pts/0
(nova.compute.manager): TRACE: qemu: could not load kernel '/var/lib/nova/instances/instance-00000005/kernel': Inappropriate ioctl for device
(nova.compute.manager): TRACE:
(nova.compute.manager): TRACE:
2011-11-29 19:38:43,863 DEBUG nova.compute.manager [-] Checking state of instance-00000005 from (pid=2177) _update_state /usr/lib/pymodules/python2.6/nova/compute/manager.py:174
2011-11-29 19:39:05,196 INFO nova.compute.manager [-] Found instance 'instance-00000005' in DB but no VM. State=5, so setting state to shutoff.

Revision history for this message
wallace (mczhou82) said :
#3

I think the log error occured as image size =0
 glance show 29
URI: http://0.0.0.0/images/29
Id: 29
Public: No
Name: None
Status: active
Size: 0
Location: swift+https://test:abc:abc@192.168.20.77:8080/auth/v1.0//glance2/29
Disk format: ami
Container format: ami
Property 'image_location': testbucket/ttylinux-uec-amd64-12.1_2.6.35-22_1.img.manifest.xml
Property 'image_state': available
Property 'kernel_id': 27
Property 'ramdisk_id': 28
Property 'architecture': x86_64
Property 'project_id': admin

but swift stat Bytes: 35452925 also download well

Revision history for this message
Best Jay Pipes (jaypipes) said :
#4

Hmm, so it seems like the upload of the file to Glance originally make not have properly marked the size in the registry database. It is likely that you ran into this bug:

https://bugs.launchpad.net/glance/+bug/891738

I'd recommend *either* manually changing that image's size to 35452925 using an SQL command:

UPDATE images SET size = 35452925 WHERE id = "29"

or deleting the image from Glance, ensuring you have the latest version of Glance (with the fix for the size=0 bug above), and uploading again...

-jay

Revision history for this message
wallace (mczhou82) said :
#5

Thanks Jay Pipes, that solved my question.