Allow multiple VMs.
This commit is contained in:
parent
749b8e1e17
commit
edf92566cf
1 changed files with 6 additions and 2 deletions
|
@ -48,20 +48,24 @@ case "$img" in
|
|||
esac
|
||||
|
||||
type="ethernet,mac=${mac},target.dev=vm-macvtap,xpath1.set=./target/@managed=no"
|
||||
n=0
|
||||
for vm in $(virsh --connect qemu:///session list --all --name) ; do
|
||||
if virsh domiflist "$vm" | grep -q "$mac" ; then
|
||||
type="user"
|
||||
virt-manager &
|
||||
break
|
||||
fi
|
||||
if [[ "${img}$n" = "$vm" ]] ; then
|
||||
n=$((n+1))
|
||||
fi
|
||||
done
|
||||
kargs+=(hostname="${img}$n")
|
||||
|
||||
## FIXME: use passt, needs more settings for correct DNS/gateway
|
||||
# type=user,xpath1.create=./backend,xpath2.set=./backend/@type=passt,xpath3.create=./ip,xpath4.set=./ip/@family=ipv4,xpath5.set=./ip/@address=172.16.1.1,xpath6.set=./ip/@prefix=24,xpath7.create=./portForward,xpath8.set=./portForward/@proto=tcp,xpath9.set=./portForward/range/@start=2001,xpath10.set=./portForward/range/@end=2500,xpath11.set=./portForward/range/@to=1
|
||||
|
||||
http_proxy='' \
|
||||
exec virt-install \
|
||||
--name "$img" \
|
||||
--name "${img}$n" \
|
||||
--osinfo debiantesting \
|
||||
--nodisks --import --noreboot --transient \
|
||||
--controller type=scsi,model=virtio-scsi \
|
||||
|
|
Loading…
Add table
Reference in a new issue