mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: ihost add cpu_architecture interface
This commit is contained in:
@@ -301,6 +301,8 @@ type ICloudHost interface {
|
||||
GetCpuDesc() string
|
||||
GetCpuMhz() int
|
||||
GetCpuCmtbound() float32
|
||||
GetCpuArchitecture() string
|
||||
|
||||
GetMemSizeMB() int
|
||||
GetMemCmtbound() float32
|
||||
GetReservedMemoryMb() int
|
||||
|
||||
@@ -1867,6 +1867,10 @@ func (self *SHost) syncWithCloudHost(ctx context.Context, userCred mcclient.Toke
|
||||
self.MemCmtbound = memCmt
|
||||
}
|
||||
|
||||
if arch := extHost.GetCpuArchitecture(); len(arch) > 0 {
|
||||
self.CpuArchitecture = arch
|
||||
}
|
||||
|
||||
if reservedMem := extHost.GetReservedMemoryMb(); reservedMem > 0 {
|
||||
self.MemReserved = reservedMem
|
||||
}
|
||||
@@ -2107,6 +2111,9 @@ func (manager *SHostManager) NewFromCloudHost(ctx context.Context, userCred mccl
|
||||
if memCmt := extHost.GetMemCmtbound(); memCmt > 0 {
|
||||
host.MemCmtbound = memCmt
|
||||
}
|
||||
if arch := extHost.GetCpuArchitecture(); len(arch) > 0 {
|
||||
host.CpuArchitecture = arch
|
||||
}
|
||||
|
||||
if reservedMem := extHost.GetReservedMemoryMb(); reservedMem > 0 {
|
||||
host.MemReserved = reservedMem
|
||||
|
||||
@@ -19,22 +19,26 @@ type SHostBase struct {
|
||||
STagBase
|
||||
}
|
||||
|
||||
func (self *SHostBase) GetCpuCmtbound() float32 {
|
||||
func (host *SHostBase) GetCpuCmtbound() float32 {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (self *SHostBase) GetMemCmtbound() float32 {
|
||||
func (host *SHostBase) GetMemCmtbound() float32 {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (self *SHostBase) GetReservedMemoryMb() int {
|
||||
func (host *SHostBase) GetReservedMemoryMb() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (self *SHostBase) GetSchedtags() ([]string, error) {
|
||||
func (host *SHostBase) GetSchedtags() ([]string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (self *SHostBase) GetOvnVersion() string {
|
||||
func (host *SHostBase) GetOvnVersion() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (host *SHostBase) GetCpuArchitecture() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user