2nd nic for TIA-VM (--bridge Option in vm-start)
This commit is contained in:
parent
fb4041b6f2
commit
a410f4528c
1 changed files with 10 additions and 7 deletions
|
@ -16,6 +16,7 @@ options:
|
||||||
--cpu num number of CPUs
|
--cpu num number of CPUs
|
||||||
--os OS operating system (win10|linux|..)
|
--os OS operating system (win10|linux|..)
|
||||||
--data-disk size additional data-disk
|
--data-disk size additional data-disk
|
||||||
|
--bridge virbrX additional network interface on bridge virbrX
|
||||||
--options options additional options for virt-install command
|
--options options additional options for virt-install command
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
@ -109,7 +110,7 @@ LIBVIRTOPTS=""
|
||||||
|
|
||||||
source /etc/lmn/vm.conf
|
source /etc/lmn/vm.conf
|
||||||
|
|
||||||
TEMP=$(getopt -o no:ps --long new,options:,persistent:,system,memory:,data-disk:,cpu:,os:,help -n $0 -- "$@")
|
TEMP=$(getopt -o no:ps --long new,options:,persistent:,system,memory:,data-disk:,cpu:,bridge:,os:,help -n $0 -- "$@")
|
||||||
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
||||||
|
|
||||||
eval set -- "$TEMP"
|
eval set -- "$TEMP"
|
||||||
|
@ -145,6 +146,12 @@ while true; do
|
||||||
LIBVIRTOPTS="${LIBVIRTOPTS} --vcpu $2"
|
LIBVIRTOPTS="${LIBVIRTOPTS} --vcpu $2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
--bridge )
|
||||||
|
if ip link | grep $2; then
|
||||||
|
LIBVIRTOPTS="${LIBVIRTOPTS} --network=bridge=$2,model.type=virtio"
|
||||||
|
fi
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--os )
|
--os )
|
||||||
LIBVIRTOSINFO=$2
|
LIBVIRTOSINFO=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
@ -191,11 +198,6 @@ if ! virsh --connect="${QEMU}" list | grep "${VM_NAME}-clone"; then
|
||||||
|
|
||||||
# finally, create the new vm
|
# finally, create the new vm
|
||||||
|
|
||||||
if ip link | grep virbr1; then
|
|
||||||
LIBVIRTOPTS="${LIBVIRTOPTS} --network=bridge=virbr1,model.type=virtio"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# # find macvtap interface MAC address:
|
# # find macvtap interface MAC address:
|
||||||
# MAC="$(ip link | grep -A1 "vm-macvtap" |
|
# MAC="$(ip link | grep -A1 "vm-macvtap" |
|
||||||
|
@ -209,9 +211,10 @@ if ! virsh --connect="${QEMU}" list | grep "${VM_NAME}-clone"; then
|
||||||
--clock hpet_present=yes \
|
--clock hpet_present=yes \
|
||||||
--features hyperv.synic.state=on,xpath1.set=./hyperv/vpindex/@state=on \
|
--features hyperv.synic.state=on,xpath1.set=./hyperv/vpindex/@state=on \
|
||||||
--memorybacking source.type=memfd,access.mode=shared \
|
--memorybacking source.type=memfd,access.mode=shared \
|
||||||
--disk "${VM_DIR}/${VM_NAME}-clone.qcow2" \
|
--disk "${VM_DIR}/${VM_NAME}-clone.qcow2",driver.discard=unmap,target.bus=scsi,cache=writeback \
|
||||||
--network=bridge=virbr0,model.type=virtio \
|
--network=bridge=virbr0,model.type=virtio \
|
||||||
--filesystem driver.type=virtiofs,accessmode=passthrough,target.dir=virtiofs,xpath1.set=./source/@socket="/run/user/${UID}/virtiofs-${VM_NAME}.sock" \
|
--filesystem driver.type=virtiofs,accessmode=passthrough,target.dir=virtiofs,xpath1.set=./source/@socket="/run/user/${UID}/virtiofs-${VM_NAME}.sock" \
|
||||||
|
--controller type=scsi,model=virtio-scsi \
|
||||||
--check path_in_use=off \
|
--check path_in_use=off \
|
||||||
--connect="${QEMU}" \
|
--connect="${QEMU}" \
|
||||||
--noautoconsole \
|
--noautoconsole \
|
||||||
|
|
Loading…
Add table
Reference in a new issue