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

feat: [NODE-1469] Change monitoring strategy for GuestOS VM #1586

Open
wants to merge 2 commits into
base: master
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: 2 additions & 2 deletions ic-os/components/hostos-scripts/guestos/guestos.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Requires=generate-guestos-config.service
After=generate-guestos-config.service

[Service]
Type=forking
Type=oneshot
RemainAfterExit=true
ExecStartPre=/opt/ic/bin/detect-first-boot.sh
ExecStart=/opt/ic/bin/start-guestos.sh
ExecStartPost=/opt/ic/bin/manageboot.sh hostos confirm
ExecStop=/opt/ic/bin/stop-guestos.sh
Restart=on-failure
PIDFile=/var/run/libvirt/qemu/guestos.pid

[Install]
WantedBy=multi-user.target
18 changes: 0 additions & 18 deletions ic-os/components/hostos-scripts/guestos/start-guestos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,10 @@ function start_guestos() {
fi
}

function enable_guestos() {
if [ "$(virsh list --autostart | grep 'guestos')" ]; then
write_log "GuestOS virtual machine is already enabled."
write_metric "hostos_guestos_service_enable" \
"0" \
"GuestOS virtual machine enable state" \
"gauge"
else
virsh autostart guestos
write_log "Enabling GuestOS virtual machine."
write_metric "hostos_guestos_service_enable" \
"1" \
"GuestOS virtual machine enable state" \
"gauge"
fi
}

function main() {
# Establish run order
define_guestos
start_guestos
enable_guestos
}

main
18 changes: 0 additions & 18 deletions ic-os/components/hostos-scripts/guestos/stop-guestos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,9 @@ function stop_guestos() {
fi
}

function disable_guestos() {
if [ "$(virsh list --autostart | grep 'guestos')" ]; then
virsh autostart --disable guestos
write_log "Disabling GuestOS virtual machine."
write_metric "hostos_guestos_service_disable" \
"1" \
"GuestOS virtual machine disable state" \
"gauge"
else
write_log "GuestOS virtual machine is already disabled."
write_metric "hostos_guestos_service_disable" \
"0" \
"GuestOS virtual machine disable state" \
"gauge"
fi
}

function main() {
# Establish run order
stop_guestos
disable_guestos
}

main
Loading