diff --git a/pkg/cloudprovider/resources.go b/pkg/cloudprovider/resources.go index fb59e5b38..4616516e5 100644 --- a/pkg/cloudprovider/resources.go +++ b/pkg/cloudprovider/resources.go @@ -318,6 +318,18 @@ type ICloudHost interface { GetSchedtags() ([]string, error) GetOvnVersion() string // just for cloudpods host + + GetIsolateDevices() ([]IsolateDevice, error) +} + +type IsolateDevice interface { + GetName() string + GetGlobalId() string + GetModel() string + GetAddr() string + GetDevType() string + GetNumaNode() int8 + GetVendorDeviceId() string } type ICloudVM interface { @@ -400,6 +412,7 @@ type ICloudVM interface { AllocatePublicIpAddress() (string, error) GetPowerStates() string + GetIsolateDeviceIds() ([]string, error) } type ICloudNic interface { diff --git a/pkg/multicloud/host_base.go b/pkg/multicloud/host_base.go index c13c6fdf7..ceef8cb81 100644 --- a/pkg/multicloud/host_base.go +++ b/pkg/multicloud/host_base.go @@ -16,7 +16,9 @@ package multicloud import ( "yunion.io/x/cloudmux/pkg/apis" + "yunion.io/x/cloudmux/pkg/cloudprovider" "yunion.io/x/jsonutils" + "yunion.io/x/pkg/errors" ) type SHostBase struct { @@ -55,3 +57,7 @@ func (host *SHostBase) GetStorageDriver() string { func (host *SHostBase) GetStorageInfo() jsonutils.JSONObject { return nil } + +func (host *SHostBase) GetIsolateDevices() ([]cloudprovider.IsolateDevice, error) { + return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDevices") +} diff --git a/pkg/multicloud/instance_base.go b/pkg/multicloud/instance_base.go index 570cedd29..412edee17 100644 --- a/pkg/multicloud/instance_base.go +++ b/pkg/multicloud/instance_base.go @@ -94,3 +94,7 @@ func (ins *SInstanceBase) GetPowerStates() string { func (instance *SInstanceBase) GetError() error { return nil } + +func (instance *SInstanceBase) GetIsolateDeviceIds() ([]string, error) { + return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDeviceIds") +} diff --git a/pkg/multicloud/remotefile/instance.go b/pkg/multicloud/remotefile/instance.go index 3998de4bc..253c5710b 100644 --- a/pkg/multicloud/remotefile/instance.go +++ b/pkg/multicloud/remotefile/instance.go @@ -284,3 +284,7 @@ func (self *SInstance) GetPowerStates() string { } return api.VM_POWER_STATES_OFF } + +func (self *SInstance) GetIsolateDeviceIds() ([]string, error) { + return nil, cloudprovider.ErrNotSupported +}