File tree 2 files changed +0
-5
lines changed 2 files changed +0
-5
lines changed Original file line number Diff line number Diff line change 9
9
MAC_ADDRESS=$( virsh --connect=qemu:///system dumpxml $INSTANCE_NAME | xmllint --xpath " string(/domain/devices/interface/source[@network=\" $NETWORK_NAME \" ]/../mac/@address)" -)
10
10
if [ -n " ${MAC_ADDRESS} " ]; then
11
11
virsh --connect=qemu:///system detach-interface $INSTANCE_NAME network --mac $MAC_ADDRESS
12
- # First try to remove the DHCP static IP entry by MAC, if it fails try by hostname
13
- if ! virsh --connect=qemu:///system net-update $NETWORK_NAME delete ip-dhcp-host " <host mac='$MAC_ADDRESS '/>" --config --live; then
14
- virsh --connect=qemu:///system net-update $NETWORK_NAME delete ip-dhcp-host " <host name='$INSTANCE_NAME '/>" --config --live
15
- fi
16
12
sleep 5
17
13
fi
18
14
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ if [[ -z "${MAC_ADDRESS}" ]]; then
50
50
else
51
51
VM_ID_SECTION=" mac='$MAC_ADDRESS '"
52
52
fi
53
- virsh --connect=qemu:///system net-update $NETWORK_NAME add-last ip-dhcp-host --xml " <host $VM_ID_SECTION ip='$IP_ADDRESS '/>" --config --live
54
53
virsh --connect=qemu:///system attach-interface $INSTANCE_NAME --source $NETWORK_NAME --type network --model virtio --mac $MAC_ADDRESS --config --persistent
55
54
56
55
sleep 5
You can’t perform that action at this time.
0 commit comments