summaryrefslogtreecommitdiff
path: root/morphlib/exts/virtualbox-ssh.write
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2013-07-02 07:24:30 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2013-07-02 07:24:30 +0000
commit429f08e8cbddd4f108ab125b44c5eb7b7bba3e09 (patch)
treedcf3b898c3acfcfaeefbd87fa0c7a61901bc7c7a /morphlib/exts/virtualbox-ssh.write
parent7efdaa1487bf39867d21fa19634c35e830940ca7 (diff)
downloadmorph-429f08e8cbddd4f108ab125b44c5eb7b7bba3e09.tar.gz
Allow to set the number of cpus for virtualbox and kvm deployments.
Diffstat (limited to 'morphlib/exts/virtualbox-ssh.write')
-rwxr-xr-xmorphlib/exts/virtualbox-ssh.write5
1 files changed, 4 insertions, 1 deletions
diff --git a/morphlib/exts/virtualbox-ssh.write b/morphlib/exts/virtualbox-ssh.write
index 3ee2eae0..1abe233e 100755
--- a/morphlib/exts/virtualbox-ssh.write
+++ b/morphlib/exts/virtualbox-ssh.write
@@ -113,12 +113,15 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
ram_mebibytes = str(self.get_ram_size() / (1024**2))
+ vcpu_count = str(self.get_vcpu_count())
+
hostonly_iface = self.get_host_interface(ssh_host)
commands = [
['createvm', '--name', vm_name, '--ostype', 'Linux26_64',
'--register'],
- ['modifyvm', vm_name, '--ioapic', 'on', '--memory', ram_mebibytes,
+ ['modifyvm', vm_name, '--ioapic', 'on',
+ '--memory', ram_mebibytes, '--cpus', vcpu_count,
'--nic1', 'hostonly', '--hostonlyadapter1', hostonly_iface,
'--nic2', 'nat', '--natnet2', 'default'],
['storagectl', vm_name, '--name', '"SATA Controller"',