mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(host): start daemon guest on guest not running
Check guest status on Start daemon server. StartGuest on guest status running will restart guest. Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
@@ -607,7 +607,7 @@ func (s *SKVMGuestInstance) ImportServer(pendingDelete bool) {
|
||||
s.manager.SaveServer(s.Id, s)
|
||||
s.manager.RemoveCandidateServer(s)
|
||||
|
||||
if (s.IsDirtyShotdown() || s.IsDaemon()) && !pendingDelete {
|
||||
if s.IsDirtyShotdown() && !pendingDelete {
|
||||
log.Infof("Server dirty shutdown or a daemon %s", s.GetName())
|
||||
|
||||
if s.Desc.IsMaster || s.Desc.IsSlave ||
|
||||
@@ -623,6 +623,8 @@ func (s *SKVMGuestInstance) ImportServer(pendingDelete bool) {
|
||||
if !pendingDelete {
|
||||
s.StartMonitor(context.Background(), nil)
|
||||
}
|
||||
} else if s.IsDaemon() {
|
||||
s.StartGuest(context.Background(), nil, jsonutils.NewDict())
|
||||
} else {
|
||||
var action = "stopped"
|
||||
if s.IsSuspend() {
|
||||
|
||||
Reference in New Issue
Block a user