Using --block-device-mapping option breaks euca-bundle-image

Bug #544706 reported by Garrett Holmstrom
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
euca2ools
Fix Released
Undecided
Unassigned
euca2ools (Fedora)
Fix Released
Medium

Bug Description

euca-bundle-image prints a traceback when the "--block-device-mapping" option is specified.

Following are details simply copypasted from Fedora's bug report.

euca-bundle-image -i $IMAGE --cert=$EC2CERT --privatekey=$EC2PK
--user=$EC2AWSUSER -r $BASEARCH --block-device-mapping
ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3 --kernel $KERNEL --ramdisk
$RAMDISK
--ec2cert=/root/EC2/support/ec2-ami-tools-1.3-31780/etc/ec2/amitools/cert-ec2.pem

Actual results:
Traceback (most recent call last):
  File "/usr/bin/euca-bundle-image", line 228, in <module>
    main()
  File "/usr/bin/euca-bundle-image", line 210, in main
    mapping = get_block_devs(mapping)
  File "/usr/bin/euca-bundle-image", line 89, in get_block_devs
    mapping_pairs = mapping.split(',')
AttributeError: 'list' object has no attribute 'split'

Specifying the block-device-mapping as:

--block-device-mapping='ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3'

also fails

Related branches

Revision history for this message
In , Robert (robert-redhat-bugs-1) wrote :

Description of problem:
euca-bundle-image does not successfully complete when using option --block-device-mapping

Version-Release number of selected component (if applicable):
euca2ools.noarch 0:1.2-1.fc12

How reproducible:
Always

Steps to Reproduce:
1. euca-bundle-image -i $IMAGE --cert=$EC2CERT --privatekey=$EC2PK --user=$EC2AWSUSER -r $BASEARCH --block-device-mapping ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3 --kernel $KERNEL --ramdisk $RAMDISK --ec2cert=/root/EC2/support/ec2-ami-tools-1.3-31780/etc/ec2/amitools/cert-ec2.pem

Actual results:
Traceback (most recent call last):
  File "/usr/bin/euca-bundle-image", line 228, in <module>
    main()
  File "/usr/bin/euca-bundle-image", line 210, in main
    mapping = get_block_devs(mapping)
  File "/usr/bin/euca-bundle-image", line 89, in get_block_devs
    mapping_pairs = mapping.split(',')
AttributeError: 'list' object has no attribute 'split'

Expected results:
A bundle

Additional info:
euca-bundle-vol likely has the same problem

Revision history for this message
In , Robert (robert-redhat-bugs-1) wrote :

Specifying the block-device-mapping as:

--block-device-mapping='ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3'

also fails

Revision history for this message
In , Robert (robert-redhat-bugs-1) wrote :

Patch for ec2-bundle-image:

87c87
< def get_block_devs(mapping):
---
> def get_block_devs(mapstring):
89c89
< mapping_pairs = mapping.split(',')
---
> mapping_pairs = mapstring.split(',')

Revision history for this message
Garrett Holmstrom (gholms) wrote :
Revision history for this message
In , Garrett (garrett-redhat-bugs) wrote :

Although I don't have anything I can use to test --block-device-mapping, it's pretty obvious why this is broken. ;-)

I'll add a patch for this to the next release. Please test it and comment in bodhi when it hits updates-testing.

Revision history for this message
Neil Soman (neilsoman) wrote :

Thanks. Fixed in revno 271.

Changed in euca2ools:
status: New → Fix Committed
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/euca2ools-1.2-2.fc13

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/euca2ools-1.2-2.fc12

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update euca2ools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/euca2ools-1.2-2.fc12

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update euca2ools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/euca2ools-1.2-2.fc13

Revision history for this message
In , Robert (robert-redhat-bugs-1) wrote :

Tested in the F12 testing repository and it works correctly.

Revision history for this message
In , Garrett (garrett-redhat-bugs) wrote :

If you would, after testing the package in updates-testing please provide feedback at http://admin.fedoraproject.org/updates/euca2ools-1.2-2.fc12 by giving comments and/or a +1 or -1 rating. After the update gets enough feedback it can be pushed to the stable repository.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

euca2ools-1.2-2.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
rajkumarwaghmare (rajkumarwaghmare) wrote :

 in --block-device-mapping ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3
are all(ami, root, ephemeral0,swap) needed to be specified?
I mean what id i dont specify ephemeral0?

How to decide value of ephemeral0 in guest OS?

Changed in euca2ools:
status: Fix Committed → Fix Released
Changed in euca2ools (Fedora):
importance: Unknown → Medium
status: Unknown → 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.