Merge lp:~zulcss/vmbuilder/vmbuilder-jaunty-ec2 into lp:vmbuilder/trunk
- vmbuilder-jaunty-ec2
- Merge into trunk
Proposed by
Chuck Short
Status: | Needs review |
---|---|
Proposed branch: | lp:~zulcss/vmbuilder/vmbuilder-jaunty-ec2 |
Merge into: | lp:vmbuilder/trunk |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~zulcss/vmbuilder/vmbuilder-jaunty-ec2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Soren Hansen | Needs Fixing | ||
Ubuntu Virtualisation team | Pending | ||
Review via email: mp+6208@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Soren Hansen (soren) wrote : | # |
Revision history for this message
Soren Hansen (soren) wrote : | # |
I just noticed I forgot the "tag" my review or whatever you want to call it, so doing so now.
review:
Needs Fixing
Unmerged revisions
- 335. By Chuck Short
-
Add readme to show how to run vmbuilder for ec2
- 334. By Chuck Short
-
Add missing default for landscape-client
- 333. By Chuck Short
-
Fix jaunty
- 332. By Chuck Short
-
Update aki/ari for jaunty
- 331. By Chuck Short
-
juanty needs hvc0
- 330. By Chuck Short
-
Added warning about out dated AKI and ARI
- 329. By Chuck Short
-
Update AKI and ARI for hardy again *sigh*
- 328. By Chuck Short
-
Add landscape-client support for ec2
- 327. By Chuck Short
-
Clean up intrepid
- 326. By Chuck Short
-
Update i386 AKI and ARI for hardy
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'VMBuilder/plugins/ec2/README' |
2 | --- VMBuilder/plugins/ec2/README 1970-01-01 00:00:00 +0000 |
3 | +++ VMBuilder/plugins/ec2/README 2009-05-04 13:58:48 +0000 |
4 | @@ -0,0 +1,14 @@ |
5 | +This is the command to use to create an ec2 image with vmbuilder: |
6 | + |
7 | +Note: you must have ec2-ami-tools installed. |
8 | + |
9 | +sudo vmbuilder xen ubuntu --suite={hardy,intrepid} --ec2 \ |
10 | + --ec2-cert=<place where your ec2 cert is> \ |
11 | + --ec2-key=<place where your ec2 key is> \ |
12 | + --ec2-access-key=<your aws access key> \ |
13 | + --ec2-secret-key=<your aws secret key> \ |
14 | + --ec2-user=<your aws # number> \ |
15 | + --ec2-bucket=<your ec2 bucket name> \ |
16 | + --ec2-prefix=<image prefix> \ |
17 | + --ec2-version="Description of your EC2 image" \ |
18 | + --debug |
19 | |
20 | === modified file 'VMBuilder/plugins/ec2/__init__.py' |
21 | --- VMBuilder/plugins/ec2/__init__.py 2008-11-28 11:18:43 +0000 |
22 | +++ VMBuilder/plugins/ec2/__init__.py 2009-05-01 19:24:18 +0000 |
23 | @@ -36,6 +36,7 @@ |
24 | group.add_option('--ec2-secret-key', metavar='SECRET_ID', help='AWS secret access key.') |
25 | group.add_option('--ec2-kernel','--ec2-aki', metavar='AKI', help='EC2 AKI (kernel) to use.') |
26 | group.add_option('--ec2-ramdisk','--ec2-ari', metavar='ARI', help='EC2 ARI (ramdisk) to use.') |
27 | + group.add_option('--ec2-version',metavar='EC2_VER',help='Specifity the EC2 image version.') |
28 | self.vm.register_setting_group(group) |
29 | |
30 | def preflight_check(self): |
31 | @@ -59,17 +60,45 @@ |
32 | |
33 | if not self.vm.ec2_kernel: |
34 | logging.debug('No ec2-aki choosen setting to default. Use --ec2-kernel to change this') |
35 | - if self.vm.arch == 'amd64': |
36 | - self.vm.ec2_kernel = 'aki-d314f0ba' |
37 | - else: |
38 | - self.vm.ec2_kernel = 'aki-af14f0c6' |
39 | + if self.vm.suite == 'hardy': |
40 | + if self.vm.arch == 'amd64': |
41 | + self.vm.ec2_kernel = 'aki-a27493cb' |
42 | + else: |
43 | + self.vm.ec2_kernel = 'aki-a17493c8' |
44 | + elif self.vm.suite == 'intrepid': |
45 | + if self.vm.arch == 'amd64': |
46 | + self.vm.ec2_kernel = 'aki-20c12649' |
47 | + else: |
48 | + self.vm.ec2_kernel = 'aki-20c12649' |
49 | + elif self.vm.suite == 'jaunty': |
50 | + if self.vm.arch == 'amd64': |
51 | + self.vm.ec2_kernel = 'aki-d653b4bf' |
52 | + else: |
53 | + self.vm.ec2_kernel = 'aki-c553b4ac' |
54 | + |
55 | + logging.info('%s - AKI to be used.' %(self.vm.ec2_kernel)) |
56 | + logging.info('WARNING! You might be using an outdated AKI. Please check xxx') |
57 | |
58 | if not self.vm.ec2_ramdisk: |
59 | logging.debug('No ec2-ari choosen setting to default. Use --ec2-ramdisk to change this.') |
60 | - if self.vm.arch == 'amd64': |
61 | - self.vm.ec2_ramdisk = 'ari-d014f0b9' |
62 | - else: |
63 | - self.vm.ec2_ramdisk = 'ari-ac14f0c5' |
64 | + if self.vm.suite == 'hardy': |
65 | + if self.vm.arch == 'amd64': |
66 | + self.vm.ec2_ramdisk = 'ari-b87493d1' |
67 | + else: |
68 | + self.vm.ec2_ramdisk = 'ari-ae7493c7' |
69 | + elif self.vm.suite == 'intrepid': |
70 | + if self.vm.arch == 'amd64': |
71 | + self.vm.ec2_ramdisk = 'ari-0ac12663' |
72 | + else: |
73 | + self.vm.ec2_ramdisk = 'ari-21c12648' |
74 | + elif self.vm.suite == 'jaunty': |
75 | + if self.vm.arch == 'amd64': |
76 | + self.vm.ec2_ramdisk = 'ari-d753b4be' |
77 | + else: |
78 | + self.vm.ec2_ramdisk = 'ari-c253b4ab' |
79 | + |
80 | + logging .info('%s - ARI to be used.'%(self.vm.ec2_ramdisk)) |
81 | + logging.info('WARNING! You might be using an outdated AKI. Please check xxx') |
82 | |
83 | if not self.vm.ec2_bucket: |
84 | raise VMBuilderUserError('When building for EC2 you must provide an S3 bucket to hold the AMI') |
85 | @@ -80,29 +109,28 @@ |
86 | if not self.vm.ec2_secret_key: |
87 | raise VMBuilderUserError('When building for EC2 you must provide your AWS secret access key.') |
88 | |
89 | - |
90 | - if not self.vm.addpkg: |
91 | - self.vm.addpkg = [] |
92 | - |
93 | - self.vm.addpkg += ['openssh-server'] |
94 | - self.vm.addpkg += ['ec2-init'] |
95 | - self.vm.addpkg += ['openssh-server'] |
96 | - self.vm.addpkg += ['ec2-modules'] |
97 | - self.vm.addpkg += ['server^'] |
98 | - self.vm.addpkg += ['standard^'] |
99 | - |
100 | - if not self.vm.ppa: |
101 | - self.vm.ppa = [] |
102 | - |
103 | - self.vm.ppa += ['ubuntu-ec2'] |
104 | + logging.info('Installing common software') |
105 | + self.install_common() |
106 | + if self.vm.suite == 'hardy': |
107 | + self.install_hardy() |
108 | + elif self.vm.suite == 'intrepid': |
109 | + self.install_intrepid() |
110 | + elif self.vm.suite == 'jaunty': |
111 | + self.install_jaunty() |
112 | |
113 | def post_install(self): |
114 | if not self.vm.ec2: |
115 | return |
116 | |
117 | logging.info("Running ec2 postinstall") |
118 | - self.install_from_template('/etc/event.d/xvc0', 'upstart') |
119 | - self.run_in_target('passwd', '-l', self.vm.user) |
120 | + logging.info("Running common post install") |
121 | + if self.vm.suite == 'hardy': |
122 | + self.postinstall_hardy() |
123 | + elif self.vm.suite == 'intrepid': |
124 | + self.postinstall_intrepid() |
125 | + elif self.vm.suite == 'jaunty': |
126 | + self.postinstall_jaunty() |
127 | + self.postinstall_common() |
128 | |
129 | def deploy(self): |
130 | if not self.vm.ec2: |
131 | @@ -121,4 +149,112 @@ |
132 | |
133 | return True |
134 | |
135 | + def install_common(self): |
136 | + if not self.vm.ec2: |
137 | + return False |
138 | + |
139 | + if not self.vm.addpkg: |
140 | + self.vm.addpkg = [] |
141 | + |
142 | + logging.info('Installing common software.') |
143 | + self.vm.addpkg += ['openssh-server', |
144 | + 'ec2-init', |
145 | + 'standard^', |
146 | + 'ec2-ami-tools', |
147 | + 'update-motd', |
148 | + 'curl', |
149 | + 'screen', |
150 | + 'screen-profiles'] |
151 | + |
152 | + if not self.vm.ppa: |
153 | + self.vm.ppa = [] |
154 | + |
155 | + self.vm.ppa += ['ubuntu-on-ec2'] |
156 | + |
157 | + def install_hardy(self): |
158 | + if not self.vm.ec2: |
159 | + return False |
160 | + |
161 | + logging.info('Installing software for hardy.') |
162 | + self.vm.addpkg += ['ruby', |
163 | + 'libc6-xen', |
164 | + 'libopenssl-ruby'] |
165 | + |
166 | + |
167 | + def postinstall_hardy(self): |
168 | + if not self.vm.ec2: |
169 | + return False |
170 | + |
171 | + logging.info('Running post-install for hardy') |
172 | + # work around for libc6/xen bug in hardy. |
173 | + self.install_from_template('/etc/ld.so.conf.d/libc6-xen.conf', 'xen-ld-so-conf') |
174 | + self.run_in_target('apt-get', 'remove', '-y', 'libc6-i686') |
175 | + |
176 | + self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd-hardy') |
177 | + self.install_from_template('/etc/event.d/xvc0', 'xvc0') |
178 | + self.run_in_target('update-rc.d', '-f', 'hwclockfirst.sh', 'remove') |
179 | + |
180 | + def install_intrepid(self): |
181 | + if not self.vm.ec2: |
182 | + return False |
183 | + |
184 | + logging.info('Installing software for intrepid') |
185 | + self.vm.addpkg += ['ec2-modules', |
186 | + 'ruby', |
187 | + 'libopenssl-ruby', |
188 | + 'server^', |
189 | + 'policykit', |
190 | + 'landscape-common', |
191 | + 'landscape-client'] |
192 | + |
193 | + def postinstall_intrepid(self): |
194 | + if not self.vm.ec2: |
195 | + return False |
196 | + |
197 | + logging.info('Running post-install for intrepid') |
198 | + self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd-intrepid') |
199 | + self.install_from_template('/etc/default/landscape-client', 'landscape_client') |
200 | + |
201 | + def install_jaunty(self): |
202 | + if not self.vm.ec2: |
203 | + return False |
204 | + |
205 | + logging.info('Installing software for jaunty') |
206 | + self.vm.addpkg += ['ec2-modules', |
207 | + 'ruby1.8', |
208 | + 'server^', |
209 | + 'libopenssl-ruby1.8', |
210 | + 'landscape-common', |
211 | + 'landscape-client'] |
212 | + |
213 | + def postinstall_jaunty(self): |
214 | + if not self.vm.ec2: |
215 | + return False |
216 | + |
217 | + logging.info('Running post-install for jaunty') |
218 | + self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd-intrepid') |
219 | + self.install_from_template('/etc/default/landscape-client', 'landscape_client') |
220 | + self.install_from_template('/etc/event.d/hvc0', 'hvc0') |
221 | + |
222 | + def postinstall_common(self): |
223 | + if not self.vm.ec2: |
224 | + return False |
225 | + |
226 | + logging.info('Running common post-install') |
227 | + self.install_from_template('/etc/ssh/sshd_config', 'sshd_config') |
228 | + self.run_in_target('chpasswd', '-e', stdin='ubuntu:!\n') |
229 | + # this makes my skin crawl |
230 | + self.install_from_template('/etc/sudoers', 'sudoers') |
231 | + # this doesnt |
232 | + self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd') |
233 | + self.install_from_template('/etc/ec2_version', 'ec2_version', { 'version' : self.vm.ec2_version }) |
234 | + |
235 | + self.run_in_target('rm', '-f', '/etc/localtime') |
236 | + self.run_in_target('ln', '-s', '/usr/share/zoneinfo/UTC', '/etc/localtime') |
237 | + |
238 | + self.run_in_target('usermod', '-u', '135', 'ubuntu') |
239 | + self.run_in_target('chown', '-R', 'ubuntu', '/home/ubuntu') |
240 | + |
241 | + self.run_in_target('update-rc.d', '-f', 'hwclock.sh', 'remove') |
242 | + |
243 | register_plugin(EC2) |
244 | |
245 | === added file 'VMBuilder/plugins/ec2/templates/51_update-motd-hardy.tmpl' |
246 | --- VMBuilder/plugins/ec2/templates/51_update-motd-hardy.tmpl 1970-01-01 00:00:00 +0000 |
247 | +++ VMBuilder/plugins/ec2/templates/51_update-motd-hardy.tmpl 2009-03-24 16:33:47 +0000 |
248 | @@ -0,0 +1,10 @@ |
249 | +#!/bin/sh |
250 | + |
251 | +echo "---------------------------------------------------------------------" |
252 | +echo "At the moment, only the core of the system is installed. To tune the " |
253 | +echo "system to your needs, you can choose to install one or more " |
254 | +echo "predefined collections of software by running the following " |
255 | +echo "command: " |
256 | +echo " " |
257 | +echo " sudo tasksel " |
258 | +echo "---------------------------------------------------------------------" |
259 | |
260 | === added file 'VMBuilder/plugins/ec2/templates/51_update-motd-intrepid.tmpl' |
261 | --- VMBuilder/plugins/ec2/templates/51_update-motd-intrepid.tmpl 1970-01-01 00:00:00 +0000 |
262 | +++ VMBuilder/plugins/ec2/templates/51_update-motd-intrepid.tmpl 2009-03-24 16:33:47 +0000 |
263 | @@ -0,0 +1,10 @@ |
264 | +#!/bin/sh |
265 | + |
266 | +echo "---------------------------------------------------------------------" |
267 | +echo "At the moment, only the core of the system is installed. To tune the " |
268 | +echo "system to your needs, you can choose to install one or more " |
269 | +echo "predefined collections of software by running the following " |
270 | +echo "command: " |
271 | +echo " " |
272 | +echo " sudo tasksel --section server " |
273 | +echo "---------------------------------------------------------------------" |
274 | |
275 | === added file 'VMBuilder/plugins/ec2/templates/51_update-motd-jaunty.tmpl' |
276 | --- VMBuilder/plugins/ec2/templates/51_update-motd-jaunty.tmpl 1970-01-01 00:00:00 +0000 |
277 | +++ VMBuilder/plugins/ec2/templates/51_update-motd-jaunty.tmpl 2009-03-24 16:33:47 +0000 |
278 | @@ -0,0 +1,10 @@ |
279 | +#!/bin/sh |
280 | + |
281 | +echo "---------------------------------------------------------------------" |
282 | +echo "At the moment, only the core of the system is installed. To tune the " |
283 | +echo "system to your needs, you can choose to install one or more " |
284 | +echo "predefined collections of software by running the following " |
285 | +echo "command: " |
286 | +echo " " |
287 | +echo " sudo tasksel --section server " |
288 | +echo "---------------------------------------------------------------------" |
289 | |
290 | === added file 'VMBuilder/plugins/ec2/templates/ec2_version.tmpl' |
291 | --- VMBuilder/plugins/ec2/templates/ec2_version.tmpl 1970-01-01 00:00:00 +0000 |
292 | +++ VMBuilder/plugins/ec2/templates/ec2_version.tmpl 2009-03-24 16:33:47 +0000 |
293 | @@ -0,0 +1,1 @@ |
294 | +$version |
295 | |
296 | === added file 'VMBuilder/plugins/ec2/templates/hvc0.tmpl' |
297 | --- VMBuilder/plugins/ec2/templates/hvc0.tmpl 1970-01-01 00:00:00 +0000 |
298 | +++ VMBuilder/plugins/ec2/templates/hvc0.tmpl 2009-03-26 17:13:31 +0000 |
299 | @@ -0,0 +1,16 @@ |
300 | +# hvc0 - getty |
301 | +# |
302 | +# This service maintains a getty on tty1 from the point the system is |
303 | +# started until it is shut down again. |
304 | + |
305 | +start on stopped rc2 |
306 | +start on stopped rc3 |
307 | +start on stopped rc4 |
308 | +start on stopped rc5 |
309 | + |
310 | +stop on runlevel 0 |
311 | +stop on runlevel 1 |
312 | +stop on runlevel 6 |
313 | + |
314 | +respawn |
315 | +exec /sbin/getty 38400 hvc0 |
316 | |
317 | === added file 'VMBuilder/plugins/ec2/templates/landscape_client.tmpl' |
318 | --- VMBuilder/plugins/ec2/templates/landscape_client.tmpl 1970-01-01 00:00:00 +0000 |
319 | +++ VMBuilder/plugins/ec2/templates/landscape_client.tmpl 2009-04-07 12:51:57 +0000 |
320 | @@ -0,0 +1,1 @@ |
321 | +CLOUD=1 |
322 | |
323 | === added file 'VMBuilder/plugins/ec2/templates/sshd_config.tmpl' |
324 | --- VMBuilder/plugins/ec2/templates/sshd_config.tmpl 1970-01-01 00:00:00 +0000 |
325 | +++ VMBuilder/plugins/ec2/templates/sshd_config.tmpl 2009-03-24 16:33:47 +0000 |
326 | @@ -0,0 +1,77 @@ |
327 | +# Package generated configuration file |
328 | +# See the sshd(8) manpage for details |
329 | + |
330 | +# What ports, IPs and protocols we listen for |
331 | +Port 22 |
332 | +# Use these options to restrict which interfaces/protocols sshd will bind to |
333 | +#ListenAddress :: |
334 | +#ListenAddress 0.0.0.0 |
335 | +Protocol 2 |
336 | +# HostKeys for protocol version 2 |
337 | +HostKey /etc/ssh/ssh_host_rsa_key |
338 | +HostKey /etc/ssh/ssh_host_dsa_key |
339 | +#Privilege Separation is turned on for security |
340 | +UsePrivilegeSeparation yes |
341 | + |
342 | +# Lifetime and size of ephemeral version 1 server key |
343 | +KeyRegenerationInterval 3600 |
344 | +ServerKeyBits 768 |
345 | + |
346 | +# Logging |
347 | +SyslogFacility AUTH |
348 | +LogLevel INFO |
349 | + |
350 | +# Authentication: |
351 | +LoginGraceTime 120 |
352 | +PermitRootLogin yes |
353 | +StrictModes yes |
354 | + |
355 | +RSAAuthentication yes |
356 | +PubkeyAuthentication yes |
357 | +#AuthorizedKeysFile %h/.ssh/authorized_keys |
358 | + |
359 | +# Don't read the user's ~/.rhosts and ~/.shosts files |
360 | +IgnoreRhosts yes |
361 | +# For this to work you will also need host keys in /etc/ssh_known_hosts |
362 | +RhostsRSAAuthentication no |
363 | +# similar for protocol version 2 |
364 | +HostbasedAuthentication no |
365 | +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication |
366 | +#IgnoreUserKnownHosts yes |
367 | + |
368 | +# To enable empty passwords, change to yes (NOT RECOMMENDED) |
369 | +PermitEmptyPasswords no |
370 | + |
371 | +# Change to yes to enable challenge-response passwords (beware issues with |
372 | +# some PAM modules and threads) |
373 | +ChallengeResponseAuthentication no |
374 | + |
375 | +# Change to no to disable tunnelled clear text passwords |
376 | +PasswordAuthentication no |
377 | + |
378 | +# Kerberos options |
379 | +#KerberosAuthentication no |
380 | +#KerberosGetAFSToken no |
381 | +#KerberosOrLocalPasswd yes |
382 | +#KerberosTicketCleanup yes |
383 | + |
384 | +# GSSAPI options |
385 | +#GSSAPIAuthentication no |
386 | +#GSSAPICleanupCredentials yes |
387 | + |
388 | +X11Forwarding yes |
389 | +X11DisplayOffset 10 |
390 | +PrintMotd no |
391 | +PrintLastLog yes |
392 | +TCPKeepAlive yes |
393 | +#UseLogin no |
394 | + |
395 | +#MaxStartups 10:30:60 |
396 | +#Banner /etc/issue.net |
397 | + |
398 | +# Allow client to pass locale environment variables |
399 | +AcceptEnv LANG LC_* |
400 | + |
401 | +Subsystem sftp /usr/lib/openssh/sftp-server |
402 | + |
403 | +UsePAM yes |
404 | |
405 | === added file 'VMBuilder/plugins/ec2/templates/sudoers.tmpl' |
406 | --- VMBuilder/plugins/ec2/templates/sudoers.tmpl 1970-01-01 00:00:00 +0000 |
407 | +++ VMBuilder/plugins/ec2/templates/sudoers.tmpl 2009-03-24 16:33:47 +0000 |
408 | @@ -0,0 +1,23 @@ |
409 | +# /etc/sudoers |
410 | +# |
411 | +# This file MUST be edited with the 'visudo' command as root. |
412 | +# |
413 | +# See the man page for details on how to write a sudoers file. |
414 | +# |
415 | + |
416 | +Defaults env_reset |
417 | + |
418 | +# Uncomment to allow members of group sudo to not need a password |
419 | +# %sudo ALL=NOPASSWD: ALL |
420 | + |
421 | +# Host alias specification |
422 | + |
423 | +# User alias specification |
424 | + |
425 | +# Cmnd alias specification |
426 | + |
427 | +# User privilege specification |
428 | +root ALL=(ALL) ALL |
429 | +ubuntu ALL=(ALL) NOPASSWD:ALL |
430 | + |
431 | +# Members of the admin group may gain root privileges |
432 | |
433 | === removed file 'VMBuilder/plugins/ec2/templates/upstart.tmpl' |
434 | --- VMBuilder/plugins/ec2/templates/upstart.tmpl 2008-11-11 18:28:57 +0000 |
435 | +++ VMBuilder/plugins/ec2/templates/upstart.tmpl 1970-01-01 00:00:00 +0000 |
436 | @@ -1,16 +0,0 @@ |
437 | -# tty1 - getty |
438 | -# |
439 | -# This service maintains a getty on tty1 from the point the system is |
440 | -# started until it is shut down again. |
441 | - |
442 | -start on stopped rc2 |
443 | -start on stopped rc3 |
444 | -start on stopped rc4 |
445 | -start on stopped rc5 |
446 | - |
447 | -stop on runlevel 0 |
448 | -stop on runlevel 1 |
449 | -stop on runlevel 6 |
450 | - |
451 | -respawn |
452 | -exec /sbin/getty 38400 xvc0 |
453 | |
454 | === added file 'VMBuilder/plugins/ec2/templates/xen-ld-so-conf.tmpl' |
455 | --- VMBuilder/plugins/ec2/templates/xen-ld-so-conf.tmpl 1970-01-01 00:00:00 +0000 |
456 | +++ VMBuilder/plugins/ec2/templates/xen-ld-so-conf.tmpl 2009-03-24 16:33:47 +0000 |
457 | @@ -0,0 +1,1 @@ |
458 | +hwcap 0 nosegneg |
459 | |
460 | === added file 'VMBuilder/plugins/ec2/templates/xvc0.tmpl' |
461 | --- VMBuilder/plugins/ec2/templates/xvc0.tmpl 1970-01-01 00:00:00 +0000 |
462 | +++ VMBuilder/plugins/ec2/templates/xvc0.tmpl 2009-03-26 17:13:31 +0000 |
463 | @@ -0,0 +1,16 @@ |
464 | +# xvc0 - getty |
465 | +# |
466 | +# This service maintains a getty on tty1 from the point the system is |
467 | +# started until it is shut down again. |
468 | + |
469 | +start on stopped rc2 |
470 | +start on stopped rc3 |
471 | +start on stopped rc4 |
472 | +start on stopped rc5 |
473 | + |
474 | +stop on runlevel 0 |
475 | +stop on runlevel 1 |
476 | +stop on runlevel 6 |
477 | + |
478 | +respawn |
479 | +exec /sbin/getty 38400 xvc0 |
480 | |
481 | === modified file 'VMBuilder/plugins/firstscripts/__init__.py' |
482 | --- VMBuilder/plugins/firstscripts/__init__.py 2008-09-30 13:01:58 +0000 |
483 | +++ VMBuilder/plugins/firstscripts/__init__.py 2009-03-24 13:22:36 +0000 |
484 | @@ -41,11 +41,17 @@ |
485 | |
486 | if self.vm.firstboot: |
487 | logging.debug("Checking if firstboot script %s exists" % (self.vm.firstboot,)) |
488 | + if not(os.access(self.vm.firstboot, os.X_OK)): |
489 | + raise MBuilderUserError("The first-boot script is not executable") |
490 | + |
491 | if not(os.path.isfile(self.vm.firstboot)): |
492 | raise VMBuilderUserError('The path to the first-boot script is invalid: %s. Make sure you are providing a full path.' % self.vm.firstboot) |
493 | |
494 | if self.vm.firstlogin: |
495 | logging.debug("Checking if first login script %s exists" % (self.vm.firstlogin,)) |
496 | + if not(os.access(self.vm.firstlogin, os.X_OK)): |
497 | + raise VMBuilderUserError("The first-login script is not executable") |
498 | + |
499 | if not(os.path.isfile(self.vm.firstlogin)): |
500 | raise VMBuilderUserError('The path to the first-login script is invalid: %s. Make sure you are providing a full path.' % self.vm.firstlogin) |
501 | |
502 | |
503 | === modified file 'VMBuilder/plugins/ubuntu/dapper.py' |
504 | --- VMBuilder/plugins/ubuntu/dapper.py 2008-12-16 15:29:50 +0000 |
505 | +++ VMBuilder/plugins/ubuntu/dapper.py 2009-03-24 13:30:11 +0000 |
506 | @@ -81,6 +81,9 @@ |
507 | logging.debug("Installing ssh keys") |
508 | self.install_authorized_keys() |
509 | |
510 | + logging.debug("Install xen kernel") |
511 | + self.install_xen_kernel() |
512 | + |
513 | logging.debug("Installing extra packages") |
514 | self.install_extras() |
515 | |
516 | |
517 | === modified file 'VMBuilder/plugins/ubuntu/hardy.py' |
518 | --- VMBuilder/plugins/ubuntu/hardy.py 2008-11-06 15:36:18 +0000 |
519 | +++ VMBuilder/plugins/ubuntu/hardy.py 2009-03-24 15:28:46 +0000 |
520 | @@ -18,13 +18,30 @@ |
521 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
522 | # |
523 | import suite |
524 | +import logging |
525 | +import VMBuilder |
526 | +from VMBuilder.util import run_cmd |
527 | from VMBuilder.plugins.ubuntu.gutsy import Gutsy |
528 | |
529 | class Hardy(Gutsy): |
530 | virtio_net = True |
531 | |
532 | def xen_kernel_path(self): |
533 | - return '/boot/vmlinuz-2.6.24-19-xen' |
534 | + rcmd = run_cmd('chroot', self.destdir, 'dpkg', '-S', 'xen') |
535 | + temp = rcmd[0].split(": ") |
536 | + xen_kernel = temp[0].split("linux-image-") |
537 | + path = '/boot/vmlinuz-%s' %xen_kernel |
538 | + return path |
539 | |
540 | def xen_ramdisk_path(self): |
541 | - return '/boot/initrd.img-2.6.24-19-xen' |
542 | + rcmd = run_cmd('chroot', self.destdir, 'dpkg', '-S', 'xen') |
543 | + temp = rcmd[0].split(": ") |
544 | + xen_ramdisk = temp[0].split("linux-image-") |
545 | + path = '/boot/initrd.img-%s' %xen_ramdisk |
546 | + return path |
547 | + |
548 | + def install_xen_kernel(self): |
549 | + import VMBuilder.plugins.xen |
550 | + |
551 | + if isinstance(self.vm.hypervisor, VMBuilder.plugins.xen.Xen): |
552 | + self.run_in_target('apt-get', '-y', '--force-yes', 'install', 'linux-image-xen') |
553 | |
554 | === modified file 'VMBuilder/plugins/ubuntu/intrepid.py' |
555 | --- VMBuilder/plugins/ubuntu/intrepid.py 2009-02-17 14:39:16 +0000 |
556 | +++ VMBuilder/plugins/ubuntu/intrepid.py 2009-03-24 15:28:46 +0000 |
557 | @@ -35,3 +35,8 @@ |
558 | run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) |
559 | run_cmd('sed', '-ie', 's/^# groot.*/# groot=%s/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) |
560 | run_cmd('sed', '-ie', '/^# kopt_2_6/ d', '%s/boot/grub/menu.lst' % self.destdir) |
561 | + def install_xen_kernel(self): |
562 | + import VMBuilder.plugins.xen |
563 | + |
564 | + if isinstance(self.vm.hypervisor, VMBuilder.plugins.xen.Xen): |
565 | + logging.info('Skipping Xen kernel installation.') |
566 | |
567 | === modified file 'VMBuilder/plugins/ubuntu/jaunty.py' |
568 | --- VMBuilder/plugins/ubuntu/jaunty.py 2008-12-04 16:27:22 +0000 |
569 | +++ VMBuilder/plugins/ubuntu/jaunty.py 2009-03-24 15:28:46 +0000 |
570 | @@ -31,3 +31,9 @@ |
571 | run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) |
572 | run_cmd('sed', '-ie', 's/^# groot.*/# groot=%s/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) |
573 | run_cmd('sed', '-ie', '/^# kopt_2_6/ d', '%s/boot/grub/menu.lst' % self.destdir) |
574 | + |
575 | + def install_xen_kernel(self): |
576 | + import VMBuilder.plugins.xen |
577 | + |
578 | + if isinstance(self.vm.hypervisor, VMBuilder.plugins.xen.Xen): |
579 | + logging.info('Skipping Xen kernel installation.') |
580 | |
581 | === modified file 'VMBuilder/plugins/ubuntu/templates/sources.list.tmpl' |
582 | --- VMBuilder/plugins/ubuntu/templates/sources.list.tmpl 2008-11-28 09:59:59 +0000 |
583 | +++ VMBuilder/plugins/ubuntu/templates/sources.list.tmpl 2009-03-24 13:15:03 +0000 |
584 | @@ -9,7 +9,7 @@ |
585 | |
586 | #if $ppa |
587 | #for $p in $ppa |
588 | -deb http://ppa.launchpad.net/$p/ubuntu $suite #slurp |
589 | +deb http://ppa.launchpad.net/$p/ppa/ubuntu $suite #slurp |
590 | #echo ' '.join($components) |
591 | |
592 | #end for |
593 | |
594 | === modified file 'debian/control' |
595 | --- debian/control 2008-12-16 13:39:21 +0000 |
596 | +++ debian/control 2009-03-24 13:17:11 +0000 |
597 | @@ -9,7 +9,7 @@ |
598 | |
599 | Package: python-vm-builder |
600 | Architecture: all |
601 | -Depends: kvm (>= 1:69) | qemu, debootstrap (>= 1.0.9), parted, kpartx, ubuntu-keyring, ${python:Depends}, python-cheetah, devscripts |
602 | +Depends: kvm (>= 1:69) | qemu, debootstrap (>= 1.0.9), parted, kpartx, ubuntu-keyring, ${python:Depends}, python-cheetah, devscripts, rsync |
603 | Recommends: python-libvirt |
604 | XB-Python-Version: ${python:Versions} |
605 | Description: VM builder |
606 | |
607 | === modified file 'debian/python-vm-builder-ec2.install' |
608 | --- debian/python-vm-builder-ec2.install 2008-10-20 22:09:39 +0000 |
609 | +++ debian/python-vm-builder-ec2.install 2009-03-24 14:03:02 +0000 |
610 | @@ -1,1 +1,1 @@ |
611 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/ec2 |
612 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/ec2 |
613 | |
614 | === modified file 'debian/python-vm-builder.install' |
615 | --- debian/python-vm-builder.install 2008-10-21 08:14:00 +0000 |
616 | +++ debian/python-vm-builder.install 2009-03-24 14:15:32 +0000 |
617 | @@ -1,12 +1,12 @@ |
618 | debian/tmp/etc |
619 | debian/tmp/usr/bin/vmbuilder |
620 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/*.py |
621 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/*.py |
622 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/cli |
623 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/firstscripts |
624 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/kvm |
625 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/libvirt |
626 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/postinst |
627 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/ubuntu |
628 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/xen |
629 | -debian/tmp/usr/lib/python2.5/site-packages/VMBuilder/plugins/vmware |
630 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/*.py |
631 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/*.py |
632 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/cli |
633 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/firstscripts |
634 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/kvm |
635 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/libvirt |
636 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/postinst |
637 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/ubuntu |
638 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/xen |
639 | +debian/tmp/usr/lib/python*/*-packages/VMBuilder/plugins/vmware |
On Wed, May 06, 2009 at 11:29:59AM -0000, Soren Hansen wrote:
> You have been requested to review the proposed merge of lp:~zulcss/vmbuilder/vmbuilder-jaunty-ec2 into lp:vmbuilder.
> === added file 'VMBuilder/ plugins/ ec2/README' plugins/ ec2/README 1970-01-01 00:00:00 +0000 plugins/ ec2/README 2009-05-04 13:58:48 +0000
> --- VMBuilder/
> +++ VMBuilder/
> @@ -0,0 +1,14 @@
> +This is the command to use to create an ec2 image with vmbuilder:
> +
> +Note: you must have ec2-ami-tools installed.
Yes, ec2-ami-tools are required, but it seems odd to put that in the
README. Lots of other packages are needed, and they (like ec2-ami-tools)
are listed as dependencies of the package. If you care about people who
use vmbuilder outside the context of Ubuntu, you could add a preflight
check to make sure the ami tools are installed, and bail out if not.
> + {hardy, intrepid} --ec2 \ key=<your aws access key> \ key=<your aws secret key> \ "Description of your EC2 image" \ plugins/ ec2/__init_ _.py' plugins/ ec2/__init_ _.py 2008-11-28 11:18:43 +0000 plugins/ ec2/__init_ _.py 2009-05-01 19:24:18 +0000 option( '--ec2- secret- key', metavar= 'SECRET_ ID', help='AWS secret access key.') option( '--ec2- kernel' ,'--ec2- aki', metavar='AKI', help='EC2 AKI (kernel) to use.') option( '--ec2- ramdisk' ,'--ec2- ari', metavar='ARI', help='EC2 ARI (ramdisk) to use.') option( '--ec2- version' ,metavar= 'EC2_VER' ,help=' Specifity the EC2 image version.')
> +sudo vmbuilder xen ubuntu --suite=
> + --ec2-cert=<place where your ec2 cert is> \
> + --ec2-key=<place where your ec2 key is> \
> + --ec2-access-
> + --ec2-secret-
> + --ec2-user=<your aws # number> \
> + --ec2-bucket=<your ec2 bucket name> \
> + --ec2-prefix=<image prefix> \
> + --ec2-version=
> + --debug
>
> === modified file 'VMBuilder/
> --- VMBuilder/
> +++ VMBuilder/
> @@ -36,6 +36,7 @@
> group.add_
> group.add_
> group.add_
> + group.add_
Please use spaces instead of tabs. Note: This is far from the only occurrence of this problem.
> self.vm. register_ setting_ group(group) check(self) :
>
> def preflight_
> @@ -59,17 +60,45 @@
>
> if not self.vm.ec2_kernel:
> logging.debug('No ec2-aki choosen setting to default. Use --ec2-kernel to change this')
> - if self.vm.arch == 'amd64':
> - self.vm.ec2_kernel = 'aki-d314f0ba'
> - else:
> - self.vm.ec2_kernel = 'aki-af14f0c6'
> + if self.vm.suite == 'hardy':
> + if self.vm.arch == 'amd64':
> + self.vm.ec2_kernel = 'aki-a27493cb'
> + else:
> + self.vm.ec2_kernel = 'aki-a17493c8'
> + elif self.vm.suite == 'intrepid':
> + if self.vm.arch == 'amd64':
> + self.vm.ec2_kernel = 'aki-20c12649'
> + else:
> + self.vm.ec2_kernel = 'aki-20c12649'
> + elif self.vm.suite == 'jaunty':
> + if self.vm.arch == 'amd64':
> + self.vm.ec2_kernel = 'aki-d653b4bf'
> + else:
> + s...