69
69
an administrator for ease of installing software.
71
71
You do need to have an RSA keypair to get the initial password for a
72
Windows machine, even though you can't use it to log in later.
73
``ec2-get-password`` takes the full path to the private key to obtain the
74
password from Amazon, and ``ec2-add-keypair`` creates a named keypair at
75
Amazon and returns the private path. One keypair is all that is needed.
76
This is distinct from the account identifier - likely due to the different
77
toolchains in use (the keypairs are used for unix ssh keys, and I (Robert)
78
suspect a rather unix friendly core at Amazon).
79
Once a custom image is made with a saved password, you can skip using
80
``ec2-get-password`` (which is only needed for Windows anyway).
72
Windows machine, even though you can't use it to log in later. As a quirk
73
of the tools(?) ``ec2-get-password`` needs the full path to the keypair
74
but ``ec2-add-keypair`` just wants part of the name. I guess this is
75
distinct from the account identifier because the image is relatively
76
untrusted(?). If the password is already set in the image, this shouldn't
82
79
It would be nice if rdesktop could use private key authentication but
99
96
`Amazon EC2 API tools`_ (needs-packaging `bug 330930`_)
101
* Create an Amazon Web Services account, sign up for S3 and EC2, and do
102
the various steps to create authentication devices.
104
98
* Create a private key and certificate for yourself.
105
99
Check these environment variables are set and exported, e.g. by setting
106
100
them in the file ``~/.aws``. Make sure the files are private.::
108
export EC2_PRIVATE_KEY=~/.ec2/pk-XXXXXX.pem
109
export EC2_CERT=~/.ec2/cert-XXXXXX.pem
110
export EC2_HOME=~/build/ec2-api-tools-1.3-30349
111
export AWS_SECRET_ACCESS_KEY=XXXXXXXXX
112
export AWS_ACCESS_KEY_ID=XXXXXXXXXXX
113
export EC2_KEYPAIR_NAME=XXXXXXXXX
114
export PATH=$PATH:$EC2_HOME/bin
115
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
116
ssh-add ~/.ec2/id_rsa
118
You can now '. ~/.aws' to get the ec2 commands available.
120
* (Unix images only) run ec2-add-keypair SOMENAME, e.g. 'bzr'. Put the
121
result (minus the first line) somewhere like ~/.ec2/id_rsa and chmod go-rw.
123
* A useful Unix image is `ami-bdfe19d4`_, Eric Hammonds 64-bit Ubuntu image.
102
EC2_PRIVATE_KEY=~/.ec2/pk-XXXXXX.pem
103
EC2_CERT=~/.ec2/cert-XXXXXX.pem
104
EC2_HOME=~/build/ec2-api-tools-1.3-30349
105
AWS_SECRET_ACCESS_KEY=XXXXXXXXX
106
AWS_ACCESS_KEY_ID=XXXXXXXXXXX
107
PATH=$PATH:$EC2_HOME/bin
108
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
125
110
* Install the rdesktop client, to actually access the machine.
112
* Create an Amazon Web Services account, sign up for S3 and EC2, and do
113
the various steps to create authentication devices
127
115
* Possibly read some of the `EC2 documentation`_ for background.
129
.. _`bug 330930`: https://bugs.edge.launchpad.net/ubuntu/+bug/330930
130
.. _`Amazon EC2 API tools`:
117
.. _`bug 330930`: https://bugs.edge.launchpad.net/ubuntu/+bug/330930
118
.. _`Amazon EC2 API tools`:
131
119
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=368&categoryID=88
132
120
.. _`EC2 documentation`: http://aws.amazon.com/
134
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1762&categoryID=101
136
122
* Create a security group for your that allows rdesktop access and icmp with::
138
124
ec2-add-group desolation-group -d 'bzr win32 build machine'
139
125
ec2-authorize desolation-group -p 3389 -s 1.2.3.4/32
140
126
ec2-authorize desolation-group -t -1:-1 -P icmp
142
128
Add your public IP there. You can repeat that command to allow others
149
135
1. Get the right AMI image ID from another developer.
151
137
1. Start the instance::
153
139
ec2-run-instances $image_id -g desolation-group
155
141
This will print out some information including the image id, something
158
144
1. Actually starting the machine will take a few minutes. Once it's in
159
145
the *running* state, get the machine's public IP with ::
171
157
To save a system snapshot as an image
172
158
-------------------------------------
174
1. Bundle the current state. *Doing this will reboot the machine.*
160
1. Bundle the current state. *Doing this will reboot the machine.*
175
161
You need to choose a unique s3 bucket name,
176
typically based on a domain or email address, which can contain
162
typically based on a domain or email address, which can contain
177
163
any number of images. You also need a name unique within the bucket
178
for this image, like ``desolation-vs2008-20090219``. And finally
164
for this image, like ``desolation-vs2008-20090219``. And finally
179
165
it needs your AWS S3 access key and secret key, which should be set in
182
168
ec2-bundle-instance -b ec2.sourcefrog.net \
183
169
-p desolation-vs2008-2009021 \
184
170
-o "$AWS_ACCESS_KEY_ID" \
185
-w "$AWS_SECRET_ACCESS_KEY"
171
-w "$AWS_SECRET_ACCESS_KEY"
187
173
1. This will take several minutes: You can check progress with ::