summaryrefslogtreecommitdiff
path: root/create-vm
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-12-25 16:42:06 +0200
committerLars Wirzenius <liw@liw.fi>2019-12-25 16:42:06 +0200
commitd353a3e1fb10bc214ff7b8b6e6b410193ce029c0 (patch)
tree02507fdba06c2e906dd97f1e8ee242eb34769b9a /create-vm
parenta536d9b2872321c5d272f244e29c9b76cd9648de (diff)
downloadansibleness-d353a3e1fb10bc214ff7b8b6e6b410193ce029c0.tar.gz
Change: allow user to pass in arbitrary virt-install options
Diffstat (limited to 'create-vm')
-rwxr-xr-xcreate-vm9
1 files changed, 6 insertions, 3 deletions
diff --git a/create-vm b/create-vm
index b4d1cdd..52ea196 100755
--- a/create-vm
+++ b/create-vm
@@ -44,9 +44,9 @@ raw_uncompressed_size()
# Check parameters.
-if [ "$#" != 2 ]
+if [ "$#" -lt 2 ]
then
- die "Usage: $0 NAME BASE"
+ die "Usage: $0 NAME BASE [virt-install-options]"
fi
verbose "Command line args OK"
@@ -63,6 +63,8 @@ case "$2" in
esac
verbose "basepath=$basepath"
+shift 2
+
# Does the base image exist?
if [ ! -e "$basepath" ]
then
@@ -134,7 +136,8 @@ virt-install --connect qemu:///system \
--disk="path=$lvpath,cache=none" \
--network="$vmnetwork" \
--graphics=spice \
- --noautoconsole
+ --noautoconsole \
+ "$@"
# If we're using the virtual network "default", wait for the VM to get
# a DHCP response and add it to /etc/hosts. We don't do it for other