fix stop vm
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
a49a918a16
commit
b108d836ff
2 changed files with 2 additions and 3 deletions
|
|
@ -74,8 +74,7 @@ function qemu_stop_vm {
|
||||||
local unix_path="/tmp/${vm_name}.qmp-sock"
|
local unix_path="/tmp/${vm_name}.qmp-sock"
|
||||||
|
|
||||||
print_in_color "${COLOR_RED}" "Stop ${vm_name}"
|
print_in_color "${COLOR_RED}" "Stop ${vm_name}"
|
||||||
echo '{ "execute": "qmp_capabilities" }' | socat - UNIX-CONNECT:"${unix_path}"
|
echo -e '{ "execute": "qmp_capabilities" }\n{ "execute": "system_powerdown" }' | socat - UNIX-CONNECT:"${unix_path}" > /dev/null
|
||||||
echo '{ "execute": "system_powerdown" }' | socat - UNIX-CONNECT:"${unix_path}"
|
|
||||||
|
|
||||||
|
|
||||||
print_in_color "${COLOR_RED}" "Delete tap${tap_id}"
|
print_in_color "${COLOR_RED}" "Delete tap${tap_id}"
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ function delete_subnet {
|
||||||
delete_in_db "subnet" "${subnet_name}"
|
delete_in_db "subnet" "${subnet_name}"
|
||||||
ip -n "${vpc_name}" route del "${subnet}" dev "br-${subnet_id}"
|
ip -n "${vpc_name}" route del "${subnet}" dev "br-${subnet_id}"
|
||||||
ip link del dev "vxlan-${vxlan_id}"
|
ip link del dev "vxlan-${vxlan_id}"
|
||||||
systemctl stop "dnsmasq@${vpc_name_br}-br-${subnet_id}.service"
|
systemctl stop "dnsmasq@${vpc_name}_br-${subnet_id}.service"
|
||||||
rm /etc/dnsmasq.d/${vpc_name}_br-${subnet_id}.conf
|
rm /etc/dnsmasq.d/${vpc_name}_br-${subnet_id}.conf
|
||||||
ebtables -D FORWARD -p arp --arp-op Request --arp-ip-dst "${gateway_ip}" --out-interface "br-${subnet_id}" -j DROP
|
ebtables -D FORWARD -p arp --arp-op Request --arp-ip-dst "${gateway_ip}" --out-interface "br-${subnet_id}" -j DROP
|
||||||
ebtables -D FORWARD --out-interface "br-${subnet_id}" -p IPv4 --ip-protocol udp --ip-source-port 67:68 --ip-destination-port 67:68 -j DROP
|
ebtables -D FORWARD --out-interface "br-${subnet_id}" -p IPv4 --ip-protocol udp --ip-source-port 67:68 --ip-destination-port 67:68 -j DROP
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue