diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-25 16:42:06 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-12-25 16:42:06 +0200 |
commit | d353a3e1fb10bc214ff7b8b6e6b410193ce029c0 (patch) | |
tree | 02507fdba06c2e906dd97f1e8ee242eb34769b9a /create-vm | |
parent | a536d9b2872321c5d272f244e29c9b76cd9648de (diff) | |
download | ansibleness-d353a3e1fb10bc214ff7b8b6e6b410193ce029c0.tar.gz |
Change: allow user to pass in arbitrary virt-install options
Diffstat (limited to 'create-vm')
-rwxr-xr-x | create-vm | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |