Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove problematic DHCP interface configuration #983

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions devsetup/scripts/interfaces-setup-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ fi
MAC_ADDRESS=$(virsh --connect=qemu:///system dumpxml $INSTANCE_NAME | xmllint --xpath "string(/domain/devices/interface/source[@network=\"$NETWORK_NAME\"]/../mac/@address)" -)
if [ -n "${MAC_ADDRESS}" ]; then
virsh --connect=qemu:///system detach-interface $INSTANCE_NAME network --mac $MAC_ADDRESS
# First try to remove the DHCP static IP entry by MAC, if it fails try by hostname
if ! virsh --connect=qemu:///system net-update $NETWORK_NAME delete ip-dhcp-host "<host mac='$MAC_ADDRESS'/>" --config --live; then
virsh --connect=qemu:///system net-update $NETWORK_NAME delete ip-dhcp-host "<host name='$INSTANCE_NAME'/>" --config --live
fi
sleep 5
fi

Expand Down
1 change: 0 additions & 1 deletion devsetup/scripts/interfaces-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ if [[ -z "${MAC_ADDRESS}" ]]; then
else
VM_ID_SECTION="mac='$MAC_ADDRESS'"
fi
virsh --connect=qemu:///system net-update $NETWORK_NAME add-last ip-dhcp-host --xml "<host $VM_ID_SECTION ip='$IP_ADDRESS'/>" --config --live
virsh --connect=qemu:///system attach-interface $INSTANCE_NAME --source $NETWORK_NAME --type network --model virtio --mac $MAC_ADDRESS --config --persistent

sleep 5
Expand Down