baremetal

package
v2.0.36+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DISK_CONF_RAID0  = api.DISK_CONF_RAID0
	DISK_CONF_RAID1  = api.DISK_CONF_RAID1
	DISK_CONF_RAID5  = api.DISK_CONF_RAID5
	DISK_CONF_RAID10 = api.DISK_CONF_RAID10
	DISK_CONF_NONE   = api.DISK_CONF_NONE

	DEFAULT_DISK_CONF = DISK_CONF_NONE

	DISK_TYPE_ROTATE = api.DISK_TYPE_ROTATE
	DISK_TYPE_SSD    = api.DISK_TYPE_SSD
	DISK_TYPE_HYBRID = api.DISK_TYPE_HYBRID

	DEFAULT_DISK_TYPE = DISK_TYPE_ROTATE

	DISK_DRIVER_MEGARAID   = api.DISK_DRIVER_MEGARAID
	DISK_DRIVER_LINUX      = api.DISK_DRIVER_LINUX
	DISK_DRIVER_HPSARAID   = api.DISK_DRIVER_HPSARAID
	DISK_DRIVER_MPT2SAS    = api.DISK_DRIVER_MPT2SAS
	DISK_DRIVER_MARVELRAID = api.DISK_DRIVER_MARVELRAID
	DISK_DRIVER_PCIE       = api.DISK_DRIVER_PCIE

	HDD_DISK_SPEC_TYPE = api.HDD_DISK_SPEC_TYPE
	SSD_DISK_SPEC_TYPE = api.SSD_DISK_SPEC_TYPE

	ErrMoreThanOneSizeUnspecificSplit = `more than 1 size unspecific split`
	ErrNoMoreSpaceForUnspecificSplit  = `no more space for an unspecific split`
	ErrSubtotalOfSplitExceedsDiskSize = `subtotal of split exceeds disk size`
)

Variables

Functions

func CalculateSize

func CalculateSize(conf string, storages []*api.BaremetalStorage) int64

func CheckDisksAllocable

func CheckDisksAllocable(layouts []Layout, disks []*api.Disk) bool

func GetMinDiskRequirement

func GetMinDiskRequirement(diskConfig string) int

func GetSplitSizes

func GetSplitSizes(size int64, splitConf string) []int64

func GetStoragesMinSize

func GetStoragesMinSize(ss []*api.BaremetalStorage) int64

func MeetConfig

func MeetConfig(
	conf *api.BaremetalDiskConfig,
	storages []*api.BaremetalStorage,
) error

func NewBaremetalDiskConfigs

func NewBaremetalDiskConfigs(dss ...string) ([]*api.BaremetalDiskConfig, error)

func ParseDiskConfig

func ParseDiskConfig(desc string) (bdc api.BaremetalDiskConfig, err error)

func ParseRange

func ParseRange(rangeStr string) (ret []int64, err error)

func RequireEvenDisks

func RequireEvenDisks(diskConfig string) bool

func RetrieveStorageDrivers

func RetrieveStorageDrivers(storages []*api.BaremetalStorage) sets.String

func RetrieveStorages

func RetrieveStorages(diskConfig *api.BaremetalDiskConfig, storages []*api.BaremetalStorage) (selected, rest []*api.BaremetalStorage)

Types

type DiskSpec

type DiskSpec map[string]SpecSizeCount

func GetDiskSpec

func GetDiskSpec(storages []*api.BaremetalStorage) DiskSpec

type Layout

type Layout struct {
	Disks []*api.BaremetalStorage  `json:"disks"`
	Conf  *api.BaremetalDiskConfig `json:"conf"`
	Size  int64                    `json:"size"`
}

func CalculateLayout

func CalculateLayout(
	confs []*api.BaremetalDiskConfig,
	storages []*api.BaremetalStorage,
) (layouts []Layout, err error)

func ExpandNoneConf

func ExpandNoneConf(layouts []Layout) (ret []Layout)

func (Layout) String

func (l Layout) String() string

type SpecSizeCount

type SpecSizeCount map[string]int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL