Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateSize(conf string, storages []*api.BaremetalStorage) int64
- func CheckDisksAllocable(layouts []Layout, disks []*api.Disk) bool
- func GetMinDiskRequirement(diskConfig string) int
- func GetSplitSizes(size int64, splitConf string) []int64
- func GetStoragesMinSize(ss []*api.BaremetalStorage) int64
- func MeetConfig(conf *api.BaremetalDiskConfig, storages []*api.BaremetalStorage) error
- func NewBaremetalDiskConfigs(dss ...string) ([]*api.BaremetalDiskConfig, error)
- func ParseDiskConfig(desc string) (bdc api.BaremetalDiskConfig, err error)
- func ParseRange(rangeStr string) (ret []int64, err error)
- func RequireEvenDisks(diskConfig string) bool
- func RetrieveStorageDrivers(storages []*api.BaremetalStorage) sets.String
- func RetrieveStorages(diskConfig *api.BaremetalDiskConfig, storages []*api.BaremetalStorage) (selected, rest []*api.BaremetalStorage)
- type DiskSpec
- type Layout
- type SpecSizeCount
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 ¶
View Source
var ( DISK_CONFS = sets.NewString( DISK_CONF_RAID0, DISK_CONF_RAID1, DISK_CONF_RAID5, DISK_CONF_RAID10, DISK_CONF_NONE, ) DISK_TYPES = sets.NewString( DISK_TYPE_ROTATE, DISK_TYPE_SSD, DISK_TYPE_HYBRID, ) DISK_DRIVERS_RAID = sets.NewString( DISK_DRIVER_MEGARAID, DISK_DRIVER_HPSARAID, DISK_DRIVER_MPT2SAS, DISK_DRIVER_MARVELRAID, ) DISK_DRIVERS = sets.NewString( DISK_DRIVER_LINUX, DISK_DRIVER_PCIE).Union(DISK_DRIVERS_RAID) )
Functions ¶
func CalculateSize ¶
func CalculateSize(conf string, storages []*api.BaremetalStorage) int64
func GetMinDiskRequirement ¶
func GetSplitSizes ¶
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 RequireEvenDisks ¶
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 ¶
type SpecSizeCount ¶
Click to show internal directories.
Click to hide internal directories.