diff options
author | Pete Fotheringham <pete.fotheringham@codethink.co.uk> | 2014-11-28 10:14:53 +0000 |
---|---|---|
committer | Pete Fotheringham <pete.fotheringham@codethink.co.uk> | 2014-11-28 10:21:06 +0000 |
commit | a2ac64a4baa72bb805d0aee2b9862c25a0fff89f (patch) | |
tree | 2063ad783ee8c278254f163ea13d274c8991ac87 | |
parent | d9069e2434fd152b0e3039839b6596c84376c4c3 (diff) | |
download | definitions-a2ac64a4baa72bb805d0aee2b9862c25a0fff89f.tar.gz |
Refere to .write.help file for documentation
-rwxr-xr-x | kvm.write | 6 | ||||
-rwxr-xr-x | virtualbox-ssh.write | 31 |
2 files changed, 11 insertions, 26 deletions
@@ -15,7 +15,11 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -'''A Morph deployment write extension for deploying to KVM+libvirt.''' +'''A Morph deployment write extension for deploying to KVM+libvirt. + +See file kvm.write.help for documentation + +''' import cliapp diff --git a/virtualbox-ssh.write b/virtualbox-ssh.write index 39ea8f86..1b4de89c 100755 --- a/virtualbox-ssh.write +++ b/virtualbox-ssh.write @@ -20,6 +20,8 @@ VirtualBox is assumed to be running on a remote machine, which is accessed over ssh. The machine gets created, but not started. +See file virtualbox-ssh.write.help for documentation + ''' @@ -36,30 +38,10 @@ import morphlib.writeexts class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): - '''Create a VirtualBox virtual machine during Morph's deployment. - - The location command line argument is the pathname of the disk image - to be created. The user is expected to provide the location argument - using the following syntax: - - vbox+ssh://HOST/GUEST/PATH - - where: - - * HOST is the host on which VirtualBox is running - * GUEST is the name of the guest virtual machine on that host - * PATH is the path to the disk image that should be created, - on that host - - The extension will connect to HOST via ssh to run VirtualBox's - command line management tools. - - ''' - def process_args(self, args): if len(args) != 2: raise cliapp.AppException('Wrong number of command line args') - + temp_root, location = args ssh_host, vm_name, vdi_path = self.parse_location(location) autostart = self.get_environment_boolean('AUTOSTART') @@ -88,7 +70,7 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): def parse_location(self, location): '''Parse the location argument to get relevant data.''' - + x = urlparse.urlparse(location) if x.scheme != 'vbox+ssh': raise cliapp.AppException( @@ -169,11 +151,11 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): attach_disks = self.parse_attach_disks() for device_no, disk in enumerate(attach_disks, 1): - cmd = ['storageattach', vm_name, + cmd = ['storageattach', vm_name, '--storagectl', 'SATA Controller', '--port', str(device_no), '--device', '0', - '--type', 'hdd', + '--type', 'hdd', '--medium', disk] commands.append(cmd) @@ -242,4 +224,3 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): return iface VirtualBoxPlusSshWriteExtension().run() - |