La agrupación de una AMI a partir de una instancia ec2 en ejecución falla

I'm trying to create my own AMI based upon a 64-bit Ubuntu 11.10 EBS AMI. However, the commands fails as seen below. I've googled for this specific error and have drawn a blank.

¿Alguien puede ayudar aquí?

    $ sudo ec2-bundle-vol -u XXXXXXX -c foo.pem -k bar.pem -d /persistent/ami/2012-02-02-0634/

    Please specify a value for arch [x86_64]: 
    Copying / into the image file /persistent/ami/2012-02-02-0634/image...
    1+0 records in
    1+0 records out
    1048576 bytes (1.0 MB) copied, 0.00215727 s, 486 MB/s
    mke2fs 1.41.14 (22-Dec-2010)
    loop: can't delete device /dev/loop0: No such device or address
    ERROR: execution failed: "rsync -rlpgoD -t -r -S -l --exclude /var/www --exclude /sys/kernel/debug --exclude /sys/kernel/security --exclude /sys --exclude /var/log/mysql --exclude /var/lib/mysql --exclude / --exclude /proc --exclude /etc/apache2 --exclude /etc/mysql --exclude /sys/fs/fuse/connections --exclude /dev/pts --exclude /dev --exclude /etc/php5 --exclude /var/lib/php5 --exclude /dev --exclude /media --exclude /mnt --exclude /proc --exclude /sys --exclude /etc/udev/rules.d/70-persistent-net.rules --exclude /etc/udev/rules.d/z25_persistent-net.rules --exclude /persistent/ami/2012-02-02-0634/image --exclude /mnt/img-mnt -X /* /mnt/img-mnt 2>&1 > /dev/null"

preguntado el 02 de febrero de 12 a las 11:02

3 Respuestas

Para una Amazon EBS-Backed Instance it is nowadays much simpler (and thus recommended) to facilitate the single dedicated API call ec2-crear-imagen en lugar de ec2-bundle-vol, which can alternatively and conveniently done via the AWS Management Console as well, as outlined in Crear una imagen a partir de una instancia en ejecución - please be aware that by default EC2 attempts to cleanly shut down the instance before image creation and reboots the instance afterwards.

This is obviously generally preferable, however, it can be avoided via the command line indeed, if so desired:

If you prefer the instance not be rebooted, you can use the Amazon EC2 command line tools to create the image [...]. The ec2-crear-imagen command has a --no-reboot option.

¡Buena suerte!

Respondido 02 Feb 12, 17:02

Interesting. But is ec2-create-image smart enough to exclude certain directories like ec2-bundle-vol ? I'll have to wait to try it out since my running instance is already in production and I can't shut it down. - hilo inactivo

Respondido 13 Abr '17, 15:04

I had the same problem, and the solution was really simple... rsync was not installed on my machine...

contestado el 22 de mayo de 13 a las 19:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.