1MIGRATE-EBS-IMAGE(1) User Contributed Perl Documentation MIGRATE-EBS-IMAGE(1)
2
3
4
6 migrate-ebs-image.pl Copy an EBS-backed Amazon Image from one
7 region to another
8
10 % migrate-ebs-image.pl --from us-east-1 --to ap-southeast-1 ami-123456
11
13 This script copies an EBS-backed Unix/Linux/windows AMI located in the
14 EC2 region indicated by --from to the region indicated by --to. All
15 associated volume snapshots, including LVM and RAID volumes, are
16 migrated as well.
17
18 If --from is omitted, then the source region is derived from the
19 endpoint URL contained in the EC2_URL environment variable. The --to
20 option is required.
21
22 This script works with any EBS backed image, including Linux PVM, Linux
23 HVM (cluster) and Windows images. It will not work with any instance-
24 store backed image. To migrate such instances, please see one of the
25 recipes listed online, for example:
26
27 http://www.dowdandassociates.com/content/howto-move-ec2-instance-store-ami-one-region-another
28
30 Options can be abbreviated. For example, you can use -l for
31 --list-regions and -b for --block-device-mapping:
32
33 --from Region in which the AMI is currently located (e.g. "us-east-1")
34 --to Region to which the AMI is to be copied (e.g. "us-west-1") REQUIRED
35 --access_key EC2 access key
36 --secret_key EC2 secret key
37 --block_device_mapping
38 Add additional block devices to the image.
39 --endpoint EC2 URL (defaults to http://ec2.amazonaws.com/)
40 --kernel Force assignment of kernel in destination image.
41 --ramdisk Force assignment of ramdisk in destination image.
42 --quiet Quench status messages
43 --list_regions List the EC2 regions
44
45 The --block-device-mapping (-b) option is used to add ephemeral storage
46 to the destination image. Amazon's API doesn't describe ephemeral
47 volumes that are associated with images, and so this information is not
48 copied from the source to the destination image, requiring you to add
49 it back manually. The value of the argument is a block device mapping
50 string in the same format as described for the command line program
51 ec2-register:
52
53 migrate-ebs-image.pl -f us-east-1 -t ap-southeast-1 \
54 -b /dev/sdy=ephemeral0 \
55 ami-123456
56
57 Ordinarily the script attempts to guess the correct matching kernel and
58 ramdisk for the destination image based on approximate string matching.
59 You can override these values by manually specifying the kernel and/or
60 ramdisk ID in the destination region. Note that no checking is
61 performed that the values you provide are correct.
62
64 The following environment variables are used if the corresponding
65 options are not present:
66
67 EC2_ACCESS_KEY your access key
68 EC2_SECRET_KEY your secret key
69 EC2_URL the desired region endpoint
70
72 This script is part of the Perl VM::EC2 package. To install from the
73 command line:
74
75 % perl -MCPAN -e 'install VM::EC2'
76 % migrate-ebs-image.pl --from us-east-1 --to ap-southeast-1 ami-123456
77
79 This script launches two "m1.small" instances, one each in the source
80 and destination regions. It also creates transient volumes in both
81 regions to hold the root volume and all other EBS snapshots associated
82 with the image. Running it will incur charges for instance run time and
83 data storage.
84
85 In addition, this script will transfer data from one region to another
86 across the internet, incurring internet data out fees on the source
87 side, and internet data in fees on the destination side. Volumes that
88 contain a filesystem, such as ext4 or ntfs, are copied from source to
89 destination using rsync. Volumes that are part of a RAID or LVM volume
90 are copied at the block level using gzip and dd via the secure shell.
91 In general, rsync will be much faster and parsimonious of network
92 bandwidth than block copying!
93
95 VM::EC2, VM::EC2::Staging::Manager
96
98 Lincoln Stein, lincoln.stein@gmail.com
99
100 Copyright (c) 2012 Ontario Institute for Cancer Research
101
102 This package and its accompanying libraries is free software; you can
103 redistribute it and/or modify it under the terms of the GPL (either
104 version 1, or at your option, any later version) or the Artistic
105 License 2.0. Refer to LICENSE for the full license text. In addition,
106 please see DISCLAIMER.txt for disclaimers of warranty.
107
108
109
110perl v5.38.0 2023-07-21 MIGRATE-EBS-IMAGE(1)