1
2
3 import time
4
5 from starcluster import exception
6 from starcluster.logger import log
7
8 from completers import InstanceCompleter
9
10
12 """
13 ebsimage [options] <instance-id> <image_name>
14
15 Create a new EBS image (AMI) from a running EC2 instance
16
17 Example:
18
19 $ starcluster ebsimage i-999999 my-new-image-ebs
20
21 NOTE: It should now be safe to create an image from an instance launched by
22 StarCluster. If you have issues please submit a bug report to the mailing
23 list.
24 """
25 names = ['ebsimage', 'eimg']
26
27 image_name = None
28 is_ebs_backed = None
29
31 parser.add_option(
32 "-d", "--description", dest="description", action="store",
33 type="string",
34 default="Image created @ %s" % time.strftime("%Y%m%d%H%M"),
35 help="short description of this AMI")
36 parser.add_option(
37 "-D", "--snapshot-description", dest="snapshot_description",
38 action="store", type="string",
39 default="Snapshot created @ %s" % time.strftime("%Y%m%d%H%M"),
40 help="short description for new EBS snapshot")
41 parser.add_option(
42 "-k", "--kernel-id", dest="kernel_id", action="store",
43 type="string", default=None,
44 help="kernel id for the new AMI")
45 parser.add_option(
46 "-r", "--ramdisk-id", dest="ramdisk_id", action="store",
47 type="string", default=None,
48 help="ramdisk id for the new AMI")
49 parser.add_option(
50 "-s", "--root-volume-size", dest="root_vol_size", type="int",
51 action="callback", default=15, callback=self._positive_int,
52 help="size of root volume (only used when creating an " + \
53 "EBS image from an S3 instance)")
54
58
73