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