[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. 72c8e53f3bf6d06b31972668eefa7747148aeefd
David Wendt
dcrkid at yahoo.com
Thu Jun 18 22:03:21 UTC 2009
The following commit has been merged in the master branch:
commit 8cbea0beafd1e468ee2719a896dbeeca87bf3815
Author: David Wendt <dcrkid at yahoo.com>
Date: Wed Jun 17 16:54:29 2009 -0400
Synching git branch with remote bzr branch.
diff --git a/VMBuilder/__init__.py b/VMBuilder/__init__.py
index f44eea1..ef97ca8 100644
--- a/VMBuilder/__init__.py
+++ b/VMBuilder/__init__.py
@@ -1,14 +1,13 @@
#!/usr/bin/python
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/disk.py b/VMBuilder/disk.py
index 9dd482f..96040d3 100644
--- a/VMBuilder/disk.py
+++ b/VMBuilder/disk.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/distro.py b/VMBuilder/distro.py
index 0c62a29..6e322d2 100644
--- a/VMBuilder/distro.py
+++ b/VMBuilder/distro.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/exception.py b/VMBuilder/exception.py
index dc4f09c..33099ea 100644
--- a/VMBuilder/exception.py
+++ b/VMBuilder/exception.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/frontend.py b/VMBuilder/frontend.py
index 4dad024..16e7941 100644
--- a/VMBuilder/frontend.py
+++ b/VMBuilder/frontend.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/hypervisor.py b/VMBuilder/hypervisor.py
index 6a104a6..23679e8 100644
--- a/VMBuilder/hypervisor.py
+++ b/VMBuilder/hypervisor.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/log.py b/VMBuilder/log.py
index 4551cbe..ed89959 100644
--- a/VMBuilder/log.py
+++ b/VMBuilder/log.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/__init__.py b/VMBuilder/plugins/__init__.py
index 67ef9cf..6f79260 100644
--- a/VMBuilder/plugins/__init__.py
+++ b/VMBuilder/plugins/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/cli/__init__.py b/VMBuilder/plugins/cli/__init__.py
index 8601b08..b2c505d 100644
--- a/VMBuilder/plugins/cli/__init__.py
+++ b/VMBuilder/plugins/cli/__init__.py
@@ -1,13 +1,12 @@
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
# Copyright (C) 2009 Bernd Zeimetz <bzed at debian.org>
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ec2/__init__.py b/VMBuilder/plugins/ec2/__init__.py
index 64f0ba8..02f2053 100644
--- a/VMBuilder/plugins/ec2/__init__.py
+++ b/VMBuilder/plugins/ec2/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,8 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from VMBuilder import register_plugin, Plugin, VMBuilderUserError
-from VMBuilder.util import run_cmd
+import VMBuilder
+from VMBuilder import register_plugin, Plugin, VMBuilderUserError, VMBuilderException
+from VMBuilder.util import run_cmd
import logging
import os
@@ -26,6 +26,9 @@ class EC2(Plugin):
name = 'EC2 integration'
def register_options(self):
+ # Don't pretend like we can do EC2
+ if not isinstance(self.vm.hypervisor, VMBuilder.plugins.xen.Xen):
+ return
group = self.vm.setting_group('EC2 integation')
group.add_option('--ec2', action='store_true', help='Build for EC2')
group.add_option('--ec2-name','--ec2-prefix', metavar='EC2_NAME', help='Name for the EC2 image.')
@@ -37,96 +40,121 @@ class EC2(Plugin):
group.add_option('--ec2-secret-key', metavar='SECRET_ID', help='AWS secret access key.')
group.add_option('--ec2-kernel','--ec2-aki', metavar='AKI', help='EC2 AKI (kernel) to use.')
group.add_option('--ec2-ramdisk','--ec2-ari', metavar='ARI', help='EC2 ARI (ramdisk) to use.')
+ group.add_option('--ec2-version', metavar='EC2_VER', help='Specify the EC2 image version.')
+ group.add_option('--ec2-landscape', action='store_true', help='Install landscape client support')
+ group.add_option('--ec2-bundle', action='store_true', help='Bundle the instance')
+ group.add_option('--ec2-upload', action='store_true', help='Upload the instance')
+ group.add_option('--ec2-register', action='store_true', help='Register the instance')
self.vm.register_setting_group(group)
def preflight_check(self):
- if not self.vm.ec2:
+ if not getattr(self.vm, 'ec2', False):
return True
+ try:
+ run_cmd('ec2-ami-tools-version')
+ except VMBuilderException, e:
+ raise VMBuilderUserError('You need to have the Amazon EC2 AMI tools installed')
+
if not self.vm.hypervisor.name == 'Xen':
raise VMBuilderUserError('When building for EC2 you must use the xen hypervisor.')
- if not self.vm.ec2_name:
- raise VMBuilderUserError('When building for EC2 you must supply the name for the image.')
+ if self.vm.ec2_bundle:
+ if not self.vm.ec2_name:
+ raise VMBuilderUserError('When building for EC2 you must supply the name for the image.')
- if not self.vm.ec2_cert:
- if "EC2_CERT" in os.environ:
- self.vm.ec2_cert = os.environ["EC2_CERT"]
- else:
- raise VMBuilderUserError('When building for EC2 you must provide your PEM encoded public key certificate')
+ if not self.vm.ec2_cert:
+ if "EC2_CERT" in os.environ:
+ self.vm.ec2_cert = os.environ["EC2_CERT"]
+ else:
+ raise VMBuilderUserError('When building for EC2 you must provide your PEM encoded public key certificate')
- if not self.vm.ec2_key:
- if "EC2_PRIVATE_KEY" in os.environ:
- self.vm.ec2_key = os.environ["EC2_PRIVATE_KEY"]
- else:
- raise VMBuilderUserError('When building for EC2 you must provide your PEM encoded private key file')
+ if not self.vm.ec2_key:
+ if "EC2_PRIVATE_KEY" in os.environ:
+ self.vm.ec2_key = os.environ["EC2_PRIVATE_KEY"]
+ else:
+ raise VMBuilderUserError('When building for EC2 you must provide your PEM encoded private key file')
- if not self.vm.ec2_user:
- raise VMBuilderUserError('When building for EC2 you must provide your EC2 user ID (your AWS account number, not your AWS access key ID)')
+ if not self.vm.ec2_user:
+ raise VMBuilderUserError('When building for EC2 you must provide your EC2 user ID (your AWS account number, not your AWS access key ID)')
- 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 not self.vm.ec2_kernel:
+ self.vm.ec2_kernel = self.vm.distro.get_ec2_kernel()
+ logging.debug('%s - to be used for AKI.' %(self.vm.ec2_kernel))
- if not self.vm.ec2_ramdisk:
- logging.debug('No ec2-ari choosen setting to default. Use --ec2-ramdisk to change this.')
- if self.vm.arch == 'amd64':
- self.vm.ec2_ramdisk = 'ari-d014f0b9'
- else:
- self.vm.ec2_ramdisk = 'ari-ac14f0c5'
+ if not self.vm.ec2_ramdisk:
+ self.vm.ec2_ramdisk = self.vm.distro.ec2_ramdisk_id()
+ logging.debug('%s - to be use for the ARI.' %(self.vm.ec2_ramdisk))
- if not self.vm.ec2_bucket:
- raise VMBuilderUserError('When building for EC2 you must provide an S3 bucket to hold the AMI')
+ if self.vm.ec2_upload:
+ if not self.vm.ec2_bucket:
+ raise VMBuilderUserError('When building for EC2 you must provide an S3 bucket to hold the AMI')
- if not self.vm.ec2_access_key:
- raise VMBuilderUserError('When building for EC2 you must provide your AWS access key ID.')
+ if not self.vm.ec2_access_key:
+ raise VMBuilderUserError('When building for EC2 you must provide your AWS access key ID.')
- if not self.vm.ec2_secret_key:
- raise VMBuilderUserError('When building for EC2 you must provide your AWS secret access key.')
+ if not self.vm.ec2_secret_key:
+ raise VMBuilderUserError('When building for EC2 you must provide your AWS secret access key.')
+ if not self.vm.ec2_version:
+ raise VMBuilderUserError('When building for EC2 you must provide version info.')
if not self.vm.addpkg:
self.vm.addpkg = []
- self.vm.addpkg += ['openssh-server']
- self.vm.addpkg += ['ec2-init']
- self.vm.addpkg += ['openssh-server']
- self.vm.addpkg += ['ec2-modules']
- self.vm.addpkg += ['server^']
- self.vm.addpkg += ['standard^']
+ self.vm.addpkg += ['ec2-init',
+ 'openssh-server',
+ 'ec2-modules',
+ 'standard^',
+ 'ec2-ami-tools',
+ 'update-motd']
+
+ if self.vm.ec2_landscape:
+ logging.info('Installing landscape support')
+ self.vm.addpkg += ['landscape-client']
if not self.vm.ppa:
self.vm.ppa = []
- self.vm.ppa += ['ubuntu-ec2']
+ self.vm.ppa += ['ubuntu-on-ec2/ppa']
def post_install(self):
- if not self.vm.ec2:
+ if not getattr(self.vm, 'ec2', False):
return
logging.info("Running ec2 postinstall")
- self.install_from_template('/etc/event.d/xvc0', 'upstart')
- self.run_in_target('passwd', '-l', self.vm.user)
+ self.install_from_template('/etc/ec2_version', 'ec2_version', { 'version' : self.vm.ec2_version } )
+ self.install_from_template('/etc/ssh/sshd_config', 'sshd_config')
+ self.install_from_template('/etc/sudoers', 'sudoers')
- def deploy(self):
- if not self.vm.ec2:
- return False
-
- logging.info("Building EC2 bundle")
- bundle_cmdline = ['ec2-bundle-image', '--image', self.vm.filesystems[0].filename, '--cert', self.vm.ec2_cert, '--privatekey', self.vm.ec2_key, '--user', self.vm.ec2_user, '--prefix', self.vm.ec2_name, '-r', ['i386', 'x86_64'][self.vm.arch == 'amd64'], '-d', self.vm.workdir, '--kernel', self.vm.ec2_kernel, '--ramdisk', self.vm.ec2_ramdisk]
+ if self.vm.ec2_landscape:
+ self.install_from_template('/etc/default/landscape-client', 'landscape_client')
- run_cmd(*bundle_cmdline)
+ self.vm.distro.disable_hwclock_access()
- logging.info("Uploading EC2 bundle")
- upload_cmdline = ['ec2-upload-bundle', '--retry', '--manifest', '%s/%s.manifest.xml' % (self.vm.workdir, self.vm.ec2_name), '--bucket', self.vm.ec2_bucket, '--access-key', self.vm.ec2_access_key, '--secret-key', self.vm.ec2_secret_key]
- run_cmd(*upload_cmdline)
+ def deploy(self):
+ if not getattr(self.vm, 'ec2', False):
+ return False
- from boto.ec2.connection import EC2Connection
- conn = EC2Connection(self.vm.ec2_access_key, self.vm.ec2_secret_key)
- print conn.register_image('%s/%s.manifest.xml' % (self.vm.ec2_bucket, self.vm.ec2_name))
+ if self.vm.ec2_bundle:
+ logging.info("Building EC2 bundle")
+ bundle_cmdline = ['ec2-bundle-image', '--image', self.vm.filesystems[0].filename, '--cert', self.vm.ec2_cert, '--privatekey', self.vm.ec2_key, '--user', self.vm.ec2_user, '--prefix', self.vm.ec2_name, '-r', ['i386', 'x86_64'][self.vm.arch == 'amd64'], '-d', self.vm.workdir, '--kernel', self.vm.ec2_kernel, '--ramdisk', self.vm.ec2_ramdisk]
+ run_cmd(*bundle_cmdline)
+
+ manifest = '%s/%s.manifest.xml' % (self.vm.workdir, self.vm.ec2_name)
+ if self.vm.ec2_upload:
+ logging.info("Uploading EC2 bundle")
+ upload_cmdline = ['ec2-upload-bundle', '--retry', '--manifest', manifest, '--bucket', self.vm.ec2_bucket, '--access-key', self.vm.ec2_access_key, '--secret-key', self.vm.ec2_secret_key]
+ run_cmd(*upload_cmdline)
+
+ if self.vm.ec2_register:
+ from boto.ec2.connection import EC2Connection
+ conn = EC2Connection(self.vm.ec2_access_key, self.vm.ec2_secret_key)
+ conn.register_image('%s/%s.manifest.xml' % (self.vm.ec2_bucket, self.vm.ec2_name))
+ else:
+ self.vm.result_files.append(manifest)
+ else:
+ self.vm.result_files.append(self.vm.filesystems[0].filename)
return True
diff --git a/VMBuilder/plugins/ec2/templates/ec2_version.tmpl b/VMBuilder/plugins/ec2/templates/ec2_version.tmpl
new file mode 100644
index 0000000..f43b9c6
--- /dev/null
+++ b/VMBuilder/plugins/ec2/templates/ec2_version.tmpl
@@ -0,0 +1 @@
+$version
diff --git a/VMBuilder/plugins/ec2/templates/landscape_client.tmpl b/VMBuilder/plugins/ec2/templates/landscape_client.tmpl
new file mode 100644
index 0000000..4ea1407
--- /dev/null
+++ b/VMBuilder/plugins/ec2/templates/landscape_client.tmpl
@@ -0,0 +1 @@
+CLOUD=1
diff --git a/VMBuilder/plugins/ec2/templates/sshd_config.tmpl b/VMBuilder/plugins/ec2/templates/sshd_config.tmpl
new file mode 100644
index 0000000..3691b82
--- /dev/null
+++ b/VMBuilder/plugins/ec2/templates/sshd_config.tmpl
@@ -0,0 +1,77 @@
+# Package generated configuration file
+# See the sshd(8) manpage for details
+
+# What ports, IPs and protocols we listen for
+Port 22
+# Use these options to restrict which interfaces/protocols sshd will bind to
+#ListenAddress ::
+#ListenAddress 0.0.0.0
+Protocol 2
+# HostKeys for protocol version 2
+HostKey /etc/ssh/ssh_host_rsa_key
+HostKey /etc/ssh/ssh_host_dsa_key
+#Privilege Separation is turned on for security
+UsePrivilegeSeparation yes
+
+# Lifetime and size of ephemeral version 1 server key
+KeyRegenerationInterval 3600
+ServerKeyBits 768
+
+# Logging
+SyslogFacility AUTH
+LogLevel INFO
+
+# Authentication:
+LoginGraceTime 120
+PermitRootLogin yes
+StrictModes yes
+
+RSAAuthentication yes
+PubkeyAuthentication yes
+#AuthorizedKeysFile %h/.ssh/authorized_keys
+
+# Don't read the user's ~/.rhosts and ~/.shosts files
+IgnoreRhosts yes
+# For this to work you will also need host keys in /etc/ssh_known_hosts
+RhostsRSAAuthentication no
+# similar for protocol version 2
+HostbasedAuthentication no
+# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
+#IgnoreUserKnownHosts yes
+
+# To enable empty passwords, change to yes (NOT RECOMMENDED)
+PermitEmptyPasswords no
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication no
+
+# Change to no to disable tunnelled clear text passwords
+PasswordAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosGetAFSToken no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+X11Forwarding yes
+X11DisplayOffset 10
+PrintMotd no
+PrintLastLog yes
+TCPKeepAlive yes
+#UseLogin no
+
+#MaxStartups 10:30:60
+#Banner /etc/issue.net
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+Subsystem sftp /usr/lib/openssh/sftp-server
+
+UsePAM yes
diff --git a/VMBuilder/plugins/ubuntu/templates/sudoers.tmpl b/VMBuilder/plugins/ec2/templates/sudoers.tmpl
similarity index 75%
copy from VMBuilder/plugins/ubuntu/templates/sudoers.tmpl
copy to VMBuilder/plugins/ec2/templates/sudoers.tmpl
index f25be9b..46bfcf9 100644
--- a/VMBuilder/plugins/ubuntu/templates/sudoers.tmpl
+++ b/VMBuilder/plugins/ec2/templates/sudoers.tmpl
@@ -3,9 +3,9 @@
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
-# Defaults
+#
-Defaults !lecture,tty_tickets,!fqdn
+Defaults env_reset
# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL
@@ -18,6 +18,4 @@ Defaults !lecture,tty_tickets,!fqdn
# User privilege specification
root ALL=(ALL) ALL
-
-# Members of the admin group may gain root privileges
-%admin ALL=(ALL) ALL
+ubuntu ALL=(ALL) NOPASSWD:ALL
diff --git a/VMBuilder/plugins/firstscripts/__init__.py b/VMBuilder/plugins/firstscripts/__init__.py
index cfcb18f..d7d18b8 100644
--- a/VMBuilder/plugins/firstscripts/__init__.py
+++ b/VMBuilder/plugins/firstscripts/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/kvm/__init__.py b/VMBuilder/plugins/kvm/__init__.py
index e711f7a..04d4665 100644
--- a/VMBuilder/plugins/kvm/__init__.py
+++ b/VMBuilder/plugins/kvm/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/kvm/vm.py b/VMBuilder/plugins/kvm/vm.py
index 83cddc3..78c87b0 100644
--- a/VMBuilder/plugins/kvm/vm.py
+++ b/VMBuilder/plugins/kvm/vm.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/libvirt/__init__.py b/VMBuilder/plugins/libvirt/__init__.py
index c0c7df5..b1b56ca 100644
--- a/VMBuilder/plugins/libvirt/__init__.py
+++ b/VMBuilder/plugins/libvirt/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/postinst/__init__.py b/VMBuilder/plugins/postinst/__init__.py
index 1b05e36..099da48 100644
--- a/VMBuilder/plugins/postinst/__init__.py
+++ b/VMBuilder/plugins/postinst/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ubuntu/__init__.py b/VMBuilder/plugins/ubuntu/__init__.py
index 77e89ea..7bbf6ca 100644
--- a/VMBuilder/plugins/ubuntu/__init__.py
+++ b/VMBuilder/plugins/ubuntu/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ubuntu/dapper.py b/VMBuilder/plugins/ubuntu/dapper.py
index 60b0b6a..575c3cc 100644
--- a/VMBuilder/plugins/ubuntu/dapper.py
+++ b/VMBuilder/plugins/ubuntu/dapper.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -94,6 +93,9 @@ class Dapper(suite.Suite):
logging.debug("Copy host settings")
self.copy_settings()
+ logging.debug("Setting timezone")
+ self.set_timezone()
+
logging.debug("Making sure system is up-to-date")
self.update()
@@ -103,6 +105,10 @@ class Dapper(suite.Suite):
logging.debug("Unmounting volatile lrm filesystems")
self.unmount_volatile()
+ if hasattr(self.vm, 'ec2') and self.vm.ec2:
+ logging.debug("Configuring for ec2")
+ self.install_ec2()
+
logging.debug("Unpreventing daemons from starting")
self.unprevent_daemons_starting()
@@ -136,8 +142,15 @@ class Dapper(suite.Suite):
else:
self.run_in_target('chpasswd', '-e', stdin='root:!\n')
+ if self.vm.lock_user:
+ logging.info('Locking %s' %(self.vm.user))
+ self.run_in_target('chpasswd', '-e', stdin=('%s:!\n' %(self.vm.user)))
+
def create_initial_user(self):
- self.run_in_target('adduser', '--disabled-password', '--gecos', self.vm.name, self.vm.user)
+ if self.vm.uid:
+ self.run_in_target('adduser', '--disabled-password', '--uid', self.vm.uid, '--gecos', self.vm.name, self.vm.user)
+ else:
+ self.run_in_target('adduser', '--disabled-password', '--gecos', self.vm.name, self.vm.user)
self.run_in_target('addgroup', '--system', 'admin')
self.run_in_target('adduser', self.vm.user, 'admin')
@@ -245,9 +258,7 @@ class Dapper(suite.Suite):
def install_mirrors(self):
- if self.vm.iso:
- mirror = "file:///isomnt"
- elif self.vm.install_mirror:
+ if self.vm.install_mirror:
mirror = self.vm.install_mirror
else:
mirror = self.vm.mirror
@@ -318,3 +329,18 @@ class Dapper(suite.Suite):
def install_vmbuilder_log(self, logfile, rootdir):
shutil.copy(logfile, '%s/var/log/vmbuilder-install.log' % (rootdir,))
+
+ def set_timezone(self):
+ if self.vm.timezone:
+ self.unlink('%s/etc/localtime' % self.destdir)
+ shutil.copy('%s/usr/share/zoneinfo/%s' % (self.destdir, self.vm.timezone), '%s/etc/localtime' % (self.destdir,))
+
+ def install_ec2(self):
+ if self.vm.ec2:
+ logging.debug('This suite does not support ec2')
+
+ def disable_hwclock_access(self):
+ fp = open('%s/etc/default/rcS' % self.destdir, 'a')
+ fp.write('HWCLOCKACCESS=no')
+ fp.close()
+
diff --git a/VMBuilder/plugins/ubuntu/distro.py b/VMBuilder/plugins/ubuntu/distro.py
index bb47ff3..6e7d9f1 100644
--- a/VMBuilder/plugins/ubuntu/distro.py
+++ b/VMBuilder/plugins/ubuntu/distro.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -63,6 +62,7 @@ class Ubuntu(Distro):
group.add_option('--components', metavar='COMPS', help='A comma seperated list of distro components to include (e.g. main,universe).')
group.add_option('--ppa', metavar='PPA', action='append', help='Add ppa belonging to PPA to the vm\'s sources.list.')
group.add_option('--lang', metavar='LANG', default=self.get_locale(), help='Set the locale to LANG [default: %default]')
+ group.add_option('--timezone', action='store_true', help='Set the timezone to the vm.')
self.vm.register_setting_group(group)
group = self.vm.setting_group('Settings for the initial user')
@@ -70,6 +70,9 @@ class Ubuntu(Distro):
group.add_option('--name', default='Ubuntu', help='Full name of initial user [default: %default]')
group.add_option('--pass', default='ubuntu', help='Password of initial user [default: %default]')
group.add_option('--rootpass', help='Initial root password (WARNING: this has strong security implications).')
+ group.add_option('--uid', help='Initial UID value.')
+ group.add_option('--gid', help='Initial GID value.')
+ group.add_option('--lock-user', action='store_true', help='Lock the initial user [default %default]')
self.vm.register_setting_group(group)
group = self.vm.setting_group('Other options')
@@ -133,6 +136,10 @@ class Ubuntu(Distro):
msg = "locale-gen does not recognize your locale '%s'" % self.vm.lang
raise VMBuilderUserError(msg)
+ if self.vm.ec2:
+ self.get_ec2_kernel()
+ self.get_ec2_ramdisk()
+
def install(self, destdir):
self.destdir = destdir
self.suite.install(destdir)
@@ -180,13 +187,29 @@ EOT''')
else:
raise VMBuilderUserError('There is no valid xen kernel for the suite selected.')
- def xen_kernel_path(self):
- path = '/boot/vmlinuz-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour)
+ def xen_kernel_initrd_path(self, which):
+ path = '/boot/%s-%s-%s' % (which, self.xen_kernel_version(), self.suite.xen_kernel_flavour)
return path
+ def xen_kernel_path(self):
+ return self.xen_kernel_initrd_path('kernel')
+
def xen_ramdisk_path(self):
- path = '/boot/initrd.img-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour)
- return path
+ return self.xen_kernel_initrd_path('ramdisk')
+
+ def get_ec2_kernel(self):
+ if self.suite.ec2_kernel_info:
+ return self.suite.ec2_kernel_info[self.vm.arch]
+ else:
+ raise VMBuilderUserError('EC2 is not supported for the suite selected')
+
+ def get_ec2_ramdisk(self):
+ if self.suite.ec2_ramdisk_info:
+ return self.suite.ec2_ramdisk_info[self.vm.arch]
+ else:
+ raise VMBuilderUserError('EC2 is not supported for the suite selected')
+ def disable_hwclock_access(self):
+ return self.suite.disable_hwclock_access()
register_distro(Ubuntu)
diff --git a/VMBuilder/plugins/ubuntu/edgy.py b/VMBuilder/plugins/ubuntu/edgy.py
index 3e3fba9..4c9742e 100644
--- a/VMBuilder/plugins/ubuntu/edgy.py
+++ b/VMBuilder/plugins/ubuntu/edgy.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ubuntu/feisty.py b/VMBuilder/plugins/ubuntu/feisty.py
index c89ab5b..5c9e19f 100644
--- a/VMBuilder/plugins/ubuntu/feisty.py
+++ b/VMBuilder/plugins/ubuntu/feisty.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ubuntu/gutsy.py b/VMBuilder/plugins/ubuntu/gutsy.py
index 5cefcd1..58df14d 100644
--- a/VMBuilder/plugins/ubuntu/gutsy.py
+++ b/VMBuilder/plugins/ubuntu/gutsy.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/ubuntu/hardy.py b/VMBuilder/plugins/ubuntu/hardy.py
index 76b2f97..fce3063 100644
--- a/VMBuilder/plugins/ubuntu/hardy.py
+++ b/VMBuilder/plugins/ubuntu/hardy.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,6 +21,17 @@ from VMBuilder.plugins.ubuntu.gutsy import Gutsy
class Hardy(Gutsy):
virtio_net = True
+ ec2_kernel_info = { 'i386' : 'aki-6e709707', 'amd64' : 'aki-6f709706' }
+ ec2_ramdisk_info = { 'i386' : 'ari-6c709705', 'amd64' : 'ari-61709708' }
+
+ def install_ec2(self):
+ self.run_in_target('apt-get' ,'--force-yes', '-y', 'install', 'libc6-xen')
+ self.run_in_target('apt-get','--purge','--force-yes', '-y', 'remove', 'libc6-i686')
+ self.install_from_template('/etc/event.d/xvc0', 'upstart', { 'console' : 'xvc0' })
+ self.install_from_template('/etc/ld.so.conf.d/libc6-xen.conf', 'xen-ld-so-conf')
+ self.run_in_target('update-rc.d', '-f', 'hwclockfirst.sh', 'remove')
+ self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd-hardy')
+ self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
def xen_kernel_path(self):
return '/boot/vmlinuz-2.6.24-19-xen'
diff --git a/VMBuilder/plugins/ubuntu/intrepid.py b/VMBuilder/plugins/ubuntu/intrepid.py
index ee27598..6f2703e 100644
--- a/VMBuilder/plugins/ubuntu/intrepid.py
+++ b/VMBuilder/plugins/ubuntu/intrepid.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,6 +28,15 @@ class Intrepid(Hardy):
'lpia' : ['lpia', 'lpiacompat'] }
default_flavour = { 'i386' : 'virtual', 'amd64' : 'virtual', 'lpia' : 'lpia' }
xen_kernel_flavour = 'virtual'
+ ec2_kernel_info = { 'i386' : 'aki-714daa18', 'amd64' : 'aki-4f4daa26' }
+ ec2_ramdisk_info = { 'i386': 'ari-7e4daa17', 'amd64' : 'ari-4c4daa25' }
+
+ def install_ec2(self):
+# workaround for policy bug on ubuntu-server. (see bug #275432)
+ self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'policykit')
+ self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^')
+ self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd')
+ self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
def mangle_grub_menu_lst(self):
bootdev = disk.bootpart(self.vm.disks)
diff --git a/VMBuilder/plugins/ubuntu/jaunty.py b/VMBuilder/plugins/ubuntu/jaunty.py
index 50f9041..6514716 100644
--- a/VMBuilder/plugins/ubuntu/jaunty.py
+++ b/VMBuilder/plugins/ubuntu/jaunty.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -25,6 +24,13 @@ from VMBuilder.plugins.ubuntu.intrepid import Intrepid
class Jaunty(Intrepid):
xen_kernel_flavour = 'server'
+ ec2_kernel_info = { 'i386' : 'aki-c553b4ac', 'amd64' : 'aki-d653b4bf' }
+ ec2_ramdisk_info = { 'i386' : 'ari-c253b4ab', 'amd64' : 'ari-d753b4be' }
+
+ def install_ec2(self):
+ self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^')
+ self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd')
+ self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
def mangle_grub_menu_lst(self):
bootdev = disk.bootpart(self.vm.disks)
diff --git a/VMBuilder/plugins/ubuntu/templates/51_update-motd-hardy.tmpl b/VMBuilder/plugins/ubuntu/templates/51_update-motd-hardy.tmpl
new file mode 100644
index 0000000..f51c547
--- /dev/null
+++ b/VMBuilder/plugins/ubuntu/templates/51_update-motd-hardy.tmpl
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+echo "---------------------------------------------------------------------"
+echo "At the moment, only the core of the system is installed. To tune the "
+echo "system to your needs, you can choose to install one or more "
+echo "predefined collections of software by running the following "
+echo "command: "
+echo " "
+echo " sudo tasksel "
+echo "---------------------------------------------------------------------"
diff --git a/VMBuilder/plugins/ubuntu/templates/51_update-motd.tmpl b/VMBuilder/plugins/ubuntu/templates/51_update-motd.tmpl
new file mode 100644
index 0000000..2a98f7d
--- /dev/null
+++ b/VMBuilder/plugins/ubuntu/templates/51_update-motd.tmpl
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+echo "---------------------------------------------------------------------"
+echo "At the moment, only the core of the system is installed. To tune the "
+echo "system to your needs, you can choose to install one or more "
+echo "predefined collections of software by running the following "
+echo "command: "
+echo " "
+echo " sudo tasksel --section server "
+echo "---------------------------------------------------------------------"
diff --git a/VMBuilder/plugins/ec2/templates/upstart.tmpl b/VMBuilder/plugins/ubuntu/templates/upstart.tmpl
similarity index 60%
rename from VMBuilder/plugins/ec2/templates/upstart.tmpl
rename to VMBuilder/plugins/ubuntu/templates/upstart.tmpl
index 245efa1..b372c17 100644
--- a/VMBuilder/plugins/ec2/templates/upstart.tmpl
+++ b/VMBuilder/plugins/ubuntu/templates/upstart.tmpl
@@ -1,6 +1,6 @@
-# tty1 - getty
+# $console - getty
#
-# This service maintains a getty on tty1 from the point the system is
+# This service maintains a getty on $console from the point the system is
# started until it is shut down again.
start on stopped rc2
@@ -13,4 +13,4 @@ stop on runlevel 1
stop on runlevel 6
respawn
-exec /sbin/getty 38400 xvc0
+exec /sbin/getty 38400 $console
diff --git a/VMBuilder/plugins/ubuntu/templates/xen-ld-so-conf.tmpl b/VMBuilder/plugins/ubuntu/templates/xen-ld-so-conf.tmpl
new file mode 100644
index 0000000..e5ce344
--- /dev/null
+++ b/VMBuilder/plugins/ubuntu/templates/xen-ld-so-conf.tmpl
@@ -0,0 +1 @@
+hwcap 0 nosegneg
diff --git a/VMBuilder/plugins/virtualbox/__init__.py b/VMBuilder/plugins/virtualbox/__init__.py
index e711f7a..04d4665 100644
--- a/VMBuilder/plugins/virtualbox/__init__.py
+++ b/VMBuilder/plugins/virtualbox/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl b/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
index baad6f8..ed1536d 100644
--- a/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
+++ b/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
@@ -1,5 +1,5 @@
#raw
-#! /usr/bin/env sh
+#! /usr/bin/env bash
###############################################################################
#
# This script is used to create und register a new VM
@@ -14,7 +14,6 @@ os_type="Linux"
disk_path="#echo os.path.abspath(os.path.dirname($vm_disks[0]))#/"
-
VBoxManage createvm -name $vm_name -ostype \$os_type -register
VBoxManage openmedium #slurp
@@ -55,3 +54,6 @@ VBoxManage modifyvm $vm_name -nic1 nat
VBoxManage modifyvm $vm_name -nic1 intnet
#end if
#end if
+
+#activating PAE support for the CPU because some OS (e.g. ubuntu server ) won't boot in a virtual machine without it
+VBoxManage modifyvm $vm_name -pae on
diff --git a/VMBuilder/plugins/virtualbox/vm.py b/VMBuilder/plugins/virtualbox/vm.py
index ad16490..04a13c0 100644
--- a/VMBuilder/plugins/virtualbox/vm.py
+++ b/VMBuilder/plugins/virtualbox/vm.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -42,7 +41,7 @@ class VirtualBox(VMBuilder.hypervisor.Hypervisor):
self.vm.result_files.append(img_path)
def deploy(self):
- vm_deploy_script = VMBuilder.util.render_template('virtualbox', self.vm, 'vm_deploy_script', { 'os_type' : self.vm.distro ,'vm_name' : self.vm.hostname, 'vm_disks' : self.imgs, 'memory' : self.vm.mem })
+ vm_deploy_script = VMBuilder.util.render_template('virtualbox', self.vm, 'vm_deploy_script', { 'os_type' : self.vm.distro.__class__.__name__, 'vm_name' : self.vm.hostname, 'vm_disks' : self.imgs, 'memory' : self.vm.mem })
script_file = '%s/deploy_%s.sh' % (self.vm.destdir, self.vm.hostname)
fp = open(script_file, 'w')
diff --git a/VMBuilder/plugins/vmware/__init__.py b/VMBuilder/plugins/vmware/__init__.py
index e711f7a..04d4665 100644
--- a/VMBuilder/plugins/vmware/__init__.py
+++ b/VMBuilder/plugins/vmware/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/vmware/vm.py b/VMBuilder/plugins/vmware/vm.py
index 1112222..6f63995 100644
--- a/VMBuilder/plugins/vmware/vm.py
+++ b/VMBuilder/plugins/vmware/vm.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/xen/__init__.py b/VMBuilder/plugins/xen/__init__.py
index d18ead9..ec7acde 100644
--- a/VMBuilder/plugins/xen/__init__.py
+++ b/VMBuilder/plugins/xen/__init__.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/plugins/xen/vm.py b/VMBuilder/plugins/xen/vm.py
index 7fc545b..61a2695 100644
--- a/VMBuilder/plugins/xen/vm.py
+++ b/VMBuilder/plugins/xen/vm.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/suite.py b/VMBuilder/suite.py
index 1dd0d95..51c8aaf 100644
--- a/VMBuilder/suite.py
+++ b/VMBuilder/suite.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/util.py b/VMBuilder/util.py
index 2ebaf35..6ebc2d5 100644
--- a/VMBuilder/util.py
+++ b/VMBuilder/util.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/VMBuilder/vm.py b/VMBuilder/vm.py
index ab116f5..8782917 100644
--- a/VMBuilder/vm.py
+++ b/VMBuilder/vm.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -76,7 +75,7 @@ class VM(object):
self.fsmounted = False
- self.optparser = _MyOptParser(epilog="ubuntu-vm-builder is Copyright (C) 2007-2008 Canonical Ltd. and written by Soren Hansen <soren at canonical.com>.", usage='%prog hypervisor distro [options]')
+ self.optparser = _MyOptParser(epilog="ubuntu-vm-builder is Copyright (C) 2007-2009 Canonical Ltd. and written by Soren Hansen <soren at canonical.com>.", usage='%prog hypervisor distro [options]')
self.optparser.arg_help = (('hypervisor', self.hypervisor_help), ('distro', self.distro_help))
self.confparser = ConfigParser.SafeConfigParser()
diff --git a/setup.py b/setup.py
index b488597..44eb2e2 100755
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ if os.path.exists('.bzr'):
print repr(e)
setup(name='VMBuilder',
- version='0.9',
+ version='0.11',
description='Uncomplicated VM Builder',
author='Soren Hansen',
author_email='soren at canonical.com',
diff --git a/tests.py b/tests.py
index 41bcc68..7ae46f0 100644
--- a/tests.py
+++ b/tests.py
@@ -1,13 +1,12 @@
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ubuntu-vm-builder b/ubuntu-vm-builder
index e06f3e4..2d5ea0b 100755
--- a/ubuntu-vm-builder
+++ b/ubuntu-vm-builder
@@ -1,14 +1,13 @@
#!/usr/bin/python
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/vmbuilder b/vmbuilder
index 4d962d5..58a1adc 100755
--- a/vmbuilder
+++ b/vmbuilder
@@ -1,13 +1,13 @@
#!/usr/bin/python
#
# Uncomplicated VM Builder
-# Copyright (C) 2007-2008 Canonical Ltd.
+# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
+# it under the terms of the GNU General Public License version 3, as
+# published by the Free Software Foundation.
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
--
Tool for creating VM images.
More information about the Pkg-escience-soc2009
mailing list