ec2-register – Client.InvalidManifest: Invalid block device mapping: Invalid device name ‘/dev/xvda’

Views: 2665

ec2-register give:

Client.InvalidManifest: Invalid block device mapping: Invalid device name ‘/dev/xvda’

The solution was found at https://forums.aws.amazon.com/message.jspa?messageID=243692

We have pre-configured MongoDB with XFS as well as Passworded Security. To install go to AWS – Secure MongoDB 3.4 on XFS for superior performance

I mostly followed instructions at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-instance-store.html

ec2-register charming-amis/charming-LAMP-swap/image.manifest.xml -n charming-LAMP-swap-ami –virtualization-type hvm  –region us-west-1

An earlier step needed to be:

ec2-bundle-vol -c /tmp/cert/charming-LAMP-with-swap-certificate.pem -k /tmp/cert/charming-LAMP-with-swap.pem -u USER_ID_FROM_IAM -r x86_64 -B root=/dev/xvda

-B root=/dev/xvda – is what was missing

  1. ec2-bundle-vol -c /tmp/cert/charming-LAMP-with-swap-certificate.pem -k /tmp/cert/charming-LAMP-with-swap.pem -uUSER_ID_FROM_IAM  -r x86_64 -B root=/dev/xvda
  2. wait a few minutes
  3. copy and edit
  4. sudo cp /tmp/image.manifest.xml /tmp/image.manifest.xml.bak
  5. sudo xmllint –format /tmp/image.manifest.xml.bak > /tmp/image.manifest.xml
  6. add – before  </block_device_mapping>
  7. <mapping>
            <virtual>ephemeral1</virtual>
            <device>xvda</device>
          </mapping>
  8. ec2-upload-bundle -b charming-amis/charming-LAMP-swap -m /tmp/image.manifest.xml -a user-id-in-pem-file -s secret-key-in-pem-file
  9. You can remove the tmp files now or later
    1. sudo rm /tmp/image.manifest.xml /tmp/image.part.* /tmp/image
  10. I moved over to another computer where I have the keys in the ENV – becuase it didnt know  “-o” for id
  11. ec2-register charming-amis/charming-LAMP-swap/image.manifest.xml -n charming-LAMP-swap-ami –virtualization-type hvm –region us-west-1 –
  12. still invalid block –  Client.InvalidManifest: Invalid block device mapping: Invalid device name ‘/dev/xvda1

 

 

Leave a Reply