summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2015-04-03 20:05:09 +0100
committerBaserock Gerrit <gerrit@baserock.org>2015-04-07 15:52:28 +0000
commit1eb4aded65367880fe9b859d35b1a3c30ed846d6 (patch)
treecc2be78b8b99a7c2bbd00b8ddce56b991f24b229
parentcd3b1b243e5c43245edb068d9fc328d0815a324d (diff)
downloadmorph-1eb4aded65367880fe9b859d35b1a3c30ed846d6.tar.gz
Make kvm deploy check that host has virt-install
This allows us to catch a case where virt-install hasn't been installed on the host we're deploying to much earlier in the deployment process. Change-Id: I413ad804a7e8bef4fc2d1231411e01d30d0cb9e8
-rwxr-xr-xmorphlib/exts/kvm.check9
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/exts/kvm.check b/morphlib/exts/kvm.check
index 83562e44..67cb3d38 100755
--- a/morphlib/exts/kvm.check
+++ b/morphlib/exts/kvm.check
@@ -47,6 +47,7 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension):
self.check_no_existing_libvirt_vm(ssh_host, vm_name)
self.check_extra_disks_exist(ssh_host, self.parse_attach_disks())
self.check_virtual_networks_are_started(ssh_host)
+ self.check_host_has_virtinstall(ssh_host)
def check_and_parse_location(self, location):
'''Check and parse the location argument to get relevant data.'''
@@ -156,5 +157,13 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension):
for network in networks:
check_virtual_network_is_started(network)
+ def check_host_has_virtinstall(self, ssh_host):
+ try:
+ cliapp.ssh_runcmd(ssh_host, ['which', 'virt-install'])
+ except cliapp.AppException:
+ raise cliapp.AppException(
+ 'virt-install does not seem to be installed on host %s'
+ % ssh_host)
+
KvmPlusSshCheckExtension().run()