Skip to content

Commit

Permalink
add params auto_migrate_on_host_down
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyaoqi committed Jul 16, 2020
1 parent 0bfba15 commit b806e53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/apis/compute/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ type HostDetails struct {
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 允许开启宿主机健康检查
AllowHealthCheck bool `json:"allow_health_check"`
AllowHealthCheck bool `json:"allow_health_check"`
AutoMigrateOnHostDown bool `json:"auto_migrate_on_host_down"`

// reserved resource for isolated device
ReservedResourceForGpu IsolatedDeviceReservedResourceInput `json:"reserved_resource_for_gpu"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/compute/models/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,9 @@ func (self *SHost) getMoreDetails(ctx context.Context, out api.HostDetails, show
if self.EnableHealthCheck && hostHealthChecker != nil {
out.AllowHealthCheck = true
}
if self.GetMetadata("__auto_migrate_on_host_down", nil) == "enable" {
out.AutoMigrateOnHostDown = true
}

if count, rs := self.GetReservedResourceForIsolatedDevice(); rs != nil {
out.ReservedResourceForGpu = *rs
Expand Down

0 comments on commit b806e53

Please sign in to comment.