Skip to content

Commit 8b27ba1

Browse files
committed
CP-54441 No need to reboot in reset when use networkd to sort
In the legacy logic, interface-rename.service need to reboot host to complete its function. If use networkd to sort interfaces, it is no need to do so. Also, service is not supported in the XS 9, use systemctl to stop and start xapi. Signed-off-by: Changlei Li <changlei.li@cloud.com>
1 parent c2e2cb9 commit 8b27ba1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

python3/bin/xe-reset-networking

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Type 'no' to cancel.
219219

220220
# Ensure xapi is not running
221221
print("Stopping xapi...")
222-
os.system('service xapi stop >/dev/null 2>/dev/null')
222+
os.system('systemctl stop xapi >/dev/null 2>/dev/null')
223223

224224
# Reconfigure new management interface
225225
print("Reconfiguring " + device + "...")
@@ -289,5 +289,12 @@ Type 'no' to cancel.
289289
# hardware.
290290
os.system("/etc/sysconfig/network-scripts/interface-rename.py --reset-to-install")
291291

292-
# Reboot
293-
os.system("mount -o remount,rw / && reboot -f")
292+
# Reboot
293+
os.system("mount -o remount,rw / && reboot -f")
294+
else:
295+
# If use xcp-networkd to sort, reboot host is not needed
296+
# Start xcp-networkd and xapi derectly
297+
print("Starting xcp-networkd...")
298+
os.system('systemctl start xcp-networkd >/dev/null 2>/dev/null')
299+
print("Starting xapi...")
300+
os.system('systemctl start xapi >/dev/null 2>/dev/null')

0 commit comments

Comments
 (0)