Documentation ¶
Index ¶
- Constants
- Variables
- func FetchGuestByHostIDs(ids []string) ([]models.SGuest, error)
- func FetchHostsByIds(ids []string) ([]computemodels.SHost, error)
- func FetchModelIds(q *sqlchemy.SQuery) ([]string, error)
- func HostResidentTenantCount(id string) (map[string]int64, error)
- func HostsResidentTenantStats(hostIDs []string) (map[string]map[string]interface{}, error)
- func IsGuestCreating(g models.SGuest) bool
- func IsGuestPendingDelete(g models.SGuest) bool
- func IsGuestRunning(g models.SGuest) bool
- func IsStorageBackendMediumMatch(s *api.CandidateStorage, backend string, mediumType string) bool
- func NewCandidateManager(stopCh <-chan struct{}) *cache.GroupManager
- type BaremetalBuilder
- type BaremetalDesc
- func (bd *BaremetalDesc) FreeCPUCount() int64
- func (bd *BaremetalDesc) FreeMemSize() int64
- func (bd *BaremetalDesc) FreeStorageSize() int64
- func (bd *BaremetalDesc) GetGuestCount() int64
- func (bd *BaremetalDesc) Getter() core.CandidatePropertyGetter
- func (bd *BaremetalDesc) IndexKey() string
- func (bd *BaremetalDesc) String() string
- func (bd *BaremetalDesc) Type() int
- type BaseHostDesc
- func (h *BaseHostDesc) GetEnableStatus() string
- func (b *BaseHostDesc) GetFreePort(netId string) int
- func (h *BaseHostDesc) GetHostType() string
- func (h *BaseHostDesc) GetIsolatedDevice(devID string) *core.IsolatedDeviceDesc
- func (h *BaseHostDesc) GetIsolatedDevices() []*core.IsolatedDeviceDesc
- func (b *BaseHostDesc) GetPendingUsage() *schedmodels.SPendingUsage
- func (b BaseHostDesc) GetResourceType() string
- func (b BaseHostDesc) GetSchedDesc() *jsonutils.JSONDict
- func (h *BaseHostDesc) UnusedGpuDevices() []*core.IsolatedDeviceDesc
- func (h *BaseHostDesc) UnusedIsolatedDevices() []*core.IsolatedDeviceDesc
- func (h *BaseHostDesc) UnusedIsolatedDevicesByModel(model string) []*core.IsolatedDeviceDesc
- func (h *BaseHostDesc) UnusedIsolatedDevicesByModelAndWire(model, wire string) []*core.IsolatedDeviceDesc
- func (h *BaseHostDesc) UnusedIsolatedDevicesByType(devType string) []*core.IsolatedDeviceDesc
- func (h *BaseHostDesc) UnusedIsolatedDevicesByVendorModel(vendorModel string) []*core.IsolatedDeviceDesc
- type BuildActor
- type DBGroupCacher
- type DescBuilder
- type HostBuilder
- type HostDesc
- func (h *HostDesc) GetFreeCPUCount(useRsvd bool) int64
- func (h *HostDesc) GetFreeLocalStorageSize(useRsvd bool) int64
- func (h *HostDesc) GetFreeMemSize(useRsvd bool) int64
- func (h *HostDesc) GetFreePort(netId string) int
- func (h *HostDesc) GetFreeStorageSizeOfType(sType string, mediumType string, useRsvd bool, reqMaxSize int64) (int64, int64, error)
- func (h *HostDesc) GetGuestCount() int64
- func (h *HostDesc) GetReservedCPUCount() int64
- func (h *HostDesc) GetReservedMemSize() int64
- func (h *HostDesc) GetReservedStorageSize() int64
- func (h *HostDesc) GetTotalCPUCount(useRsvd bool) int64
- func (h *HostDesc) GetTotalLocalStorageSize(useRsvd bool) int64
- func (h *HostDesc) GetTotalMemSize(useRsvd bool) int64
- func (h *HostDesc) Getter() core.CandidatePropertyGetter
- func (h *HostDesc) GuestReservedCPUCountFree() int64
- func (h *HostDesc) GuestReservedMemSizeFree() int64
- func (h *HostDesc) GuestReservedStorageSizeFree() int64
- func (h *HostDesc) IndexKey() string
- func (h *HostDesc) String() string
- func (h *HostDesc) Type() int
- type ReservedResource
- func NewGuestReservedResourceByBuilder(b *HostBuilder, host *computemodels.SHost) (ret *ReservedResource)
- func NewGuestReservedResourceUsedByBuilder(b *HostBuilder, host *computemodels.SHost, free *ReservedResource) (ret *ReservedResource, err error)
- func NewReservedResource(cpu, mem, storage int64) *ReservedResource
- type ResidentTenant
- type SyncGroupCacher
- type UpdateStatus
- type WaitGroupWrapper
Constants ¶
View Source
const ( CacheKind = "CandidateCache" HostCandidateCache = "Hosts" BaremetalCandidateCache = "Baremetals" HostDescBuilder = HostCandidateCache BaremetalDescBuilder = BaremetalCandidateCache )
Variables ¶
View Source
var ( VMRunningStatus = sets.NewString( computeapi.VM_START_START, computeapi.VM_STARTING, computeapi.VM_RUNNING, computeapi.VM_STOP_FAILED, computeapi.VM_BLOCK_STREAM, computeapi.VM_UNKNOWN, computeapi.VM_BACKUP_STARTING, ) VMCreatingStatus = sets.NewString( computeapi.VM_SCHEDULE, computeapi.VM_CREATE_NETWORK, computeapi.VM_CREATE_DISK, computeapi.VM_START_DEPLOY, computeapi.VM_DEPLOYING, computeapi.VM_BACKUP_CREATING, computeapi.VM_DEPLOYING_BACKUP, ) )
Functions ¶
func FetchHostsByIds ¶
func FetchHostsByIds(ids []string) ([]computemodels.SHost, error)
func IsGuestCreating ¶
func IsGuestPendingDelete ¶
func IsGuestRunning ¶
func IsStorageBackendMediumMatch ¶
func IsStorageBackendMediumMatch(s *api.CandidateStorage, backend string, mediumType string) bool
func NewCandidateManager ¶
func NewCandidateManager(stopCh <-chan struct{}) *cache.GroupManager
Types ¶
type BaremetalBuilder ¶
type BaremetalBuilder struct {
// contains filtered or unexported fields
}
func (*BaremetalBuilder) AllIDs ¶
func (bb *BaremetalBuilder) AllIDs() ([]string, error)
func (*BaremetalBuilder) Clone ¶
func (bb *BaremetalBuilder) Clone() BuildActor
func (*BaremetalBuilder) Do ¶
func (bb *BaremetalBuilder) Do(ids []string) ([]interface{}, error)
type BaremetalDesc ¶
type BaremetalDesc struct { *BaseHostDesc StorageInfo []*baremetal.BaremetalStorage `json:"storage_info"` StorageType string `json:"storage_type"` StorageSize int64 `json:"storage_size"` ServerID string `json:"server_id"` }
func (*BaremetalDesc) FreeCPUCount ¶
func (bd *BaremetalDesc) FreeCPUCount() int64
func (*BaremetalDesc) FreeMemSize ¶
func (bd *BaremetalDesc) FreeMemSize() int64
func (*BaremetalDesc) FreeStorageSize ¶
func (bd *BaremetalDesc) FreeStorageSize() int64
func (*BaremetalDesc) GetGuestCount ¶
func (bd *BaremetalDesc) GetGuestCount() int64
func (*BaremetalDesc) Getter ¶
func (bd *BaremetalDesc) Getter() core.CandidatePropertyGetter
func (*BaremetalDesc) IndexKey ¶
func (bd *BaremetalDesc) IndexKey() string
func (*BaremetalDesc) String ¶
func (bd *BaremetalDesc) String() string
func (*BaremetalDesc) Type ¶
func (bd *BaremetalDesc) Type() int
type BaseHostDesc ¶
type BaseHostDesc struct { *computemodels.SHost Region *computemodels.SCloudregion `json:"region"` Zone *computemodels.SZone `json:"zone"` Cloudprovider *computemodels.SCloudprovider `json:"cloudprovider"` Cloudaccount *computemodels.SCloudaccount `json:"cloudaccount"` Networks []*api.CandidateNetwork `json:"networks"` NetInterfaces map[string][]computemodels.SNetInterface `json:"net_interfaces"` Storages []*api.CandidateStorage `json:"storages"` IsolatedDevices []*core.IsolatedDeviceDesc `json:"isolated_devices"` Tenants map[string]int64 `json:"tenants"` InstanceGroups map[string]*api.CandidateGroup `json:"instance_groups"` IpmiInfo types.SIPMIInfo `json:"ipmi_info"` Nics []*types.SNic `json:"nics"` PendingUsage map[string]interface{} `json:"pending_usage"` ClassMetadata map[string]string `json:"class_metadata"` }
func (*BaseHostDesc) GetEnableStatus ¶
func (h *BaseHostDesc) GetEnableStatus() string
func (*BaseHostDesc) GetFreePort ¶
func (b *BaseHostDesc) GetFreePort(netId string) int
func (*BaseHostDesc) GetHostType ¶
func (h *BaseHostDesc) GetHostType() string
func (*BaseHostDesc) GetIsolatedDevice ¶
func (h *BaseHostDesc) GetIsolatedDevice(devID string) *core.IsolatedDeviceDesc
func (*BaseHostDesc) GetIsolatedDevices ¶
func (h *BaseHostDesc) GetIsolatedDevices() []*core.IsolatedDeviceDesc
func (*BaseHostDesc) GetPendingUsage ¶
func (b *BaseHostDesc) GetPendingUsage() *schedmodels.SPendingUsage
func (BaseHostDesc) GetResourceType ¶
func (b BaseHostDesc) GetResourceType() string
func (BaseHostDesc) GetSchedDesc ¶
func (b BaseHostDesc) GetSchedDesc() *jsonutils.JSONDict
func (*BaseHostDesc) UnusedGpuDevices ¶
func (h *BaseHostDesc) UnusedGpuDevices() []*core.IsolatedDeviceDesc
func (*BaseHostDesc) UnusedIsolatedDevices ¶
func (h *BaseHostDesc) UnusedIsolatedDevices() []*core.IsolatedDeviceDesc
func (*BaseHostDesc) UnusedIsolatedDevicesByModel ¶
func (h *BaseHostDesc) UnusedIsolatedDevicesByModel(model string) []*core.IsolatedDeviceDesc
func (*BaseHostDesc) UnusedIsolatedDevicesByModelAndWire ¶
func (h *BaseHostDesc) UnusedIsolatedDevicesByModelAndWire(model, wire string) []*core.IsolatedDeviceDesc
func (*BaseHostDesc) UnusedIsolatedDevicesByType ¶
func (h *BaseHostDesc) UnusedIsolatedDevicesByType(devType string) []*core.IsolatedDeviceDesc
func (*BaseHostDesc) UnusedIsolatedDevicesByVendorModel ¶
func (h *BaseHostDesc) UnusedIsolatedDevicesByVendorModel(vendorModel string) []*core.IsolatedDeviceDesc
type BuildActor ¶
type DBGroupCacher ¶
type DBGroupCacher interface {
// contains filtered or unexported methods
}
type DescBuilder ¶
type DescBuilder struct {
// contains filtered or unexported fields
}
func NewDescBuilder ¶
func NewDescBuilder(act BuildActor) *DescBuilder
func (*DescBuilder) Build ¶
func (d *DescBuilder) Build(ids []string) ([]interface{}, error)
type HostBuilder ¶
type HostBuilder struct {
// contains filtered or unexported fields
}
func (*HostBuilder) AllIDs ¶
func (b *HostBuilder) AllIDs() ([]string, error)
func (*HostBuilder) Clone ¶
func (b *HostBuilder) Clone() BuildActor
func (*HostBuilder) Do ¶
func (b *HostBuilder) Do(ids []string) ([]interface{}, error)
type HostDesc ¶
type HostDesc struct { *BaseHostDesc // cpu CPUCmtbound float32 `json:"cpu_cmtbound"` CPUBoundCount int64 `json:"cpu_bound_count"` CPULoad *float64 `json:"cpu_load"` TotalCPUCount int64 `json:"total_cpu_count"` RunningCPUCount int64 `json:"running_cpu_count"` CreatingCPUCount int64 `json:"creating_cpu_count"` RequiredCPUCount int64 `json:"required_cpu_count"` FakeDeletedCPUCount int64 `json:"fake_deleted_cpu_count"` FreeCPUCount int64 `json:"free_cpu_count"` // memory MemCmtbound float32 `json:"mem_cmtbound"` TotalMemSize int64 `json:"total_mem_size"` FreeMemSize int64 `json:"free_mem_size"` RunningMemSize int64 `json:"running_mem_size"` CreatingMemSize int64 `json:"creating_mem_size"` RequiredMemSize int64 `json:"required_mem_size"` FakeDeletedMemSize int64 `json:"fake_deleted_mem_size"` // storage StorageTypes []string `json:"storage_types"` // IO IOBoundCount int64 `json:"io_bound_count"` IOLoad *float64 `json:"io_load"` // server GuestCount int64 `json:"guest_count"` CreatingGuestCount int64 `json:"creating_guest_count"` RunningGuestCount int64 `json:"running_guest_count"` //Groups *GroupCounts `json:"groups"` Metadata map[string]string `json:"metadata"` IsMaintenance bool `json:"is_maintenance"` GuestReservedResource *ReservedResource `json:"guest_reserved_resource"` GuestReservedResourceUsed *ReservedResource `json:"guest_reserved_used"` }
func (*HostDesc) GetFreeCPUCount ¶
func (*HostDesc) GetFreeLocalStorageSize ¶
func (*HostDesc) GetFreeMemSize ¶
func (*HostDesc) GetFreePort ¶
func (*HostDesc) GetFreeStorageSizeOfType ¶
func (*HostDesc) GetGuestCount ¶
func (*HostDesc) GetReservedCPUCount ¶
func (*HostDesc) GetReservedMemSize ¶
func (*HostDesc) GetReservedStorageSize ¶
func (*HostDesc) GetTotalCPUCount ¶
func (*HostDesc) GetTotalLocalStorageSize ¶
func (*HostDesc) GetTotalMemSize ¶
func (*HostDesc) Getter ¶
func (h *HostDesc) Getter() core.CandidatePropertyGetter
func (*HostDesc) GuestReservedCPUCountFree ¶
func (*HostDesc) GuestReservedMemSizeFree ¶
func (*HostDesc) GuestReservedStorageSizeFree ¶
type ReservedResource ¶
type ReservedResource struct { CPUCount int64 `json:"cpu_count"` MemorySize int64 `json:"memory_size"` StorageSize int64 `json:"storage_size"` }
func NewGuestReservedResourceByBuilder ¶
func NewGuestReservedResourceByBuilder(b *HostBuilder, host *computemodels.SHost) (ret *ReservedResource)
func NewGuestReservedResourceUsedByBuilder ¶
func NewGuestReservedResourceUsedByBuilder(b *HostBuilder, host *computemodels.SHost, free *ReservedResource) (ret *ReservedResource, err error)
func NewReservedResource ¶
func NewReservedResource(cpu, mem, storage int64) *ReservedResource
type ResidentTenant ¶
type ResidentTenant struct { HostId string `json:"host_id"` TenantId string `json:"tenant_id"` TenantCount int64 `json:"tenant_count"` }
func FetchHostsResidentTenants ¶
func FetchHostsResidentTenants(hostIds []string) ([]ResidentTenant, error)
func (ResidentTenant) First ¶
func (t ResidentTenant) First() string
func (ResidentTenant) Second ¶
func (t ResidentTenant) Second() string
func (ResidentTenant) Third ¶
func (t ResidentTenant) Third() interface{}
type SyncGroupCacher ¶
type SyncGroupCacher interface {
// contains filtered or unexported methods
}
type UpdateStatus ¶
func FetchHostsUpdateStatus ¶
func FetchHostsUpdateStatus(isBaremetal bool) ([]UpdateStatus, error)
func FetchModelUpdateStatus ¶
func FetchModelUpdateStatus(man db.IStandaloneModelManager, cond sqlchemy.ICondition) ([]UpdateStatus, error)
type WaitGroupWrapper ¶
func (*WaitGroupWrapper) Wrap ¶
func (w *WaitGroupWrapper) Wrap(cb func())
Click to show internal directories.
Click to hide internal directories.