summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2012-10-10 15:55:07 +0200
committervarac <varacanero@zeromail.org>2012-10-10 15:55:07 +0200
commit738cebb625cb225439f2ff21570ce8c147842aac (patch)
tree9e9bd2cb2590456edff2566027b2ead15733b181
parentb98293f06f5c2b399cabe0c20fbeb8d0f189fd1c (diff)
use KVM_URI='qemu:///system' as default
-rwxr-xr-xcreate-guest-with-cloudinit6
1 files changed, 4 insertions, 2 deletions
diff --git a/create-guest-with-cloudinit b/create-guest-with-cloudinit
index 5b543ac..feecdcc 100755
--- a/create-guest-with-cloudinit
+++ b/create-guest-with-cloudinit
@@ -10,8 +10,10 @@ ETC='/etc/cloudinit'
CONFIG="$ETC/cloudinit.cfg"
VARDIR='/var/lib/libvirt/cloudinit'
SCRIPTDIR='/usr/local/bin/leap_cloudadmin'
+KVM_URI='qemu:///system'
-. $CONFIG
+# overwrite defaults
+[ -e $CONFIG] && . $CONFIG
fail() { [ $# -eq 0 ] || echo "$@"; exit 1; }
@@ -70,7 +72,7 @@ echo
echo "Creating guest VM $vmname with size: $size GB, using $userdata for clound-init"
echo
-
+# is a VM with the same name defined ?
virsh dominfo $vmname > /dev/null 2>&1
if [ $? -eq 0 ]; then fail "Domain $vmname is defined in libvirt. Please undefine first."; fi