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
commit2b35eb5ebef0de0ad78466f41ccfd7792fbf2e40 (patch)
tree00a722a696bfd8f905c56d3407df905daf147d50
parenta69b342f542f4895ef2bfd9f18a0e56d38b4bc7d (diff)
downloaddefinitions-2b35eb5ebef0de0ad78466f41ccfd7792fbf2e40.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-xkvm.check9
1 files changed, 9 insertions, 0 deletions
diff --git a/kvm.check b/kvm.check
index 83562e44..67cb3d38 100755
--- a/kvm.check
+++ b/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()