summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorPete Fotheringham <pete.fotheringham@codethink.co.uk>2014-12-02 13:58:13 +0000
committerPete Fotheringham <pete.fotheringham@codethink.co.uk>2014-12-05 15:48:48 +0000
commitef2b60ae1bc4214ef695e4afdcf326a740153b46 (patch)
tree90d8e099b183ec702045d5627f229a2a418a2f34 /morphlib
parent6ac1bf8642fede685546dff599fe6cbf2e6e0fc0 (diff)
downloadmorph-ef2b60ae1bc4214ef695e4afdcf326a740153b46.tar.gz
OpenStack write extension documentation
Diffstat (limited to 'morphlib')
-rwxr-xr-xmorphlib/exts/openstack.write34
-rw-r--r--morphlib/exts/openstack.write.help37
2 files changed, 39 insertions, 32 deletions
diff --git a/morphlib/exts/openstack.write b/morphlib/exts/openstack.write
index b1941d3c..faf47f54 100755
--- a/morphlib/exts/openstack.write
+++ b/morphlib/exts/openstack.write
@@ -28,40 +28,11 @@ import morphlib.writeexts
class OpenStackWriteExtension(morphlib.writeexts.WriteExtension):
- '''Configure a raw disk image into an OpenStack host.
-
- The raw disk image is created during Morph's deployment and the
- image is deployed in OpenStack using python-glanceclient.
-
- The location command line argument is the authentification url
- of the OpenStack server using the following syntax:
-
- http://HOST:PORT/VERSION
-
- where
-
- * HOST is the host running OpenStack
- * PORT is the port which is using OpenStack for authentifications.
- * VERSION is the authentification version of OpenStack (Only v2.0
- supported)
-
- This extension needs in the environment the following variables:
-
- * OPENSTACK_USER is the username to use in the deployment.
- * OPENSTACK_TENANT is the project name to use in the deployment.
- * OPENSTACK_IMAGENAME is the name of the image to create.
- * OPENSTACK_PASSWORD is the password of the user.
-
-
- The extension will connect to OpenStack using python-glanceclient
- to configure a raw image.
-
- '''
def process_args(self, args):
if len(args) != 2:
raise cliapp.AppException('Wrong number of command line args')
-
+
temp_root, location = args
os_params = self.get_openstack_parameters()
@@ -69,7 +40,7 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension):
fd, raw_disk = tempfile.mkstemp()
os.close(fd)
self.create_local_system(temp_root, raw_disk)
- self.status(msg='Temporary disk image has been created at %s'
+ self.status(msg='Temporary disk image has been created at %s'
% raw_disk)
self.set_extlinux_root_to_virtio(raw_disk)
@@ -120,4 +91,3 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension):
self.status(msg='Image configured.')
OpenStackWriteExtension().run()
-
diff --git a/morphlib/exts/openstack.write.help b/morphlib/exts/openstack.write.help
new file mode 100644
index 00000000..579512f5
--- /dev/null
+++ b/morphlib/exts/openstack.write.help
@@ -0,0 +1,37 @@
+help: |
+
+ Deploy a Baserock system as a *new* OpenStack virtual machine.
+ (Use the `ssh-rsync` write extension to deploy upgrades to an *existing*
+ VM)
+
+ Deploys the system to the OpenStack host using python-glanceclient.
+
+ Parameters:
+
+ * location: the authentication url of the OpenStack server using the
+ following syntax:
+
+ http://HOST:PORT/VERSION
+
+ where
+
+ * HOST is the host running OpenStack
+ * PORT is the port which is using OpenStack for authentifications.
+ * VERSION is the authentification version of OpenStack (Only v2.0
+ supported)
+
+ * OPENSTACK_USER=username: the username to use in the `--os-username`
+ argument to `glance`.
+
+ * OPENSTACK_TENANT=tenant: the project name to use in the `--os-tenant-name`
+ argument to `glance`.
+
+ * OPENSTACK_IMAGENAME=imagename: the name of the image to use in the
+ `--name` argument to `glance`.
+
+ * OPENSTACK_PASSWORD=password: the password of the OpenStack user. (We
+ recommend passing this on the command-line, rather than setting an
+ environment variable or storing it in a cluster cluster definition file.)
+
+ (See `morph help deploy` for details of how to pass parameters to write
+ extensions)