provider

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	RULEOFFSET                 = 10000
	MINSIZE                    = 1
	MAXSIZE                    = 10
	MON                        = "MON"
	OSD                        = "OSD"
	JOURNALSIZE                = 5120
	MAX_JOURNALS_ON_SSD        = 4
	MIN_MON_IN_CLUSTER         = 3
	BYTE_TO_TB                 = 1099511627776
	CRUSH_DEFAULT_ROOT_NODE_ID = -1
	CRUSH_DEFAULT_RULE_ID      = 0
)
View Source
const (
	DEFAULT_PG_NUM       = 128
	TARGET_PGS_PER_OSD   = 200
	MAX_UTILIZATION_PCNT = 80
)

Variables

View Source
var (
	EventTypes map[string]string
	DbManager  dbprovider.DbInterface
)

Functions

func ComputeClusterObjectCount added in v0.0.34

func ComputeClusterObjectCount(cluster models.Cluster) map[string]interface{}

func ComputeClusterPGNum added in v0.0.34

func ComputeClusterPGNum(cluster models.Cluster, ctxt string) (map[string]uint64, error)

func ComputeMonCount added in v0.0.34

func ComputeMonCount(selectCriteria bson.M) (map[string]int, error)

func ComputeObjectCount added in v0.0.34

func ComputeObjectCount(selectCriteria bson.M) (map[string]int64, error)

func ComputeSystemPGNum added in v0.0.34

func ComputeSystemPGNum() (map[string]uint64, error)

func CreateClusterUsingInstaller

func CreateClusterUsingInstaller(cluster_uuid *uuid.UUID, request models.AddClusterRequest,
	nodes map[uuid.UUID]models.Node, node_ips map[uuid.UUID]map[string]string,
	t *task.Task, min_mon_in_cluster int, ctxt string) error

func CreateClusterUsingSalt

func CreateClusterUsingSalt(cluster_uuid *uuid.UUID, request models.AddClusterRequest,
	nodes map[uuid.UUID]models.Node, node_ips map[uuid.UUID]map[string]string,
	t *task.Task, ctxt string) error

func CreateDefaultECProfiles

func CreateDefaultECProfiles(ctxt string, mon string, clusterId uuid.UUID) (bool, error)

func DerivePgNum

func DerivePgNum(clusterId uuid.UUID, size string, replicaCount int, profile string) uint

RULES FOR DERIVING THE PG NUM if no of osds <= 5 then

no of PGs = 128

if no of osds > 5 and <= 10 then

no of PGs = 512

if no of osds > 10 and <= 50 then

no of PGs = 4096

if no of osds > 50 then

 no of PGs = (Avg Target PGs per OSD * No of OSDs * Data Percentage) / Replica Count
 -- where
    Data Percentage = Target Allocation Size / Max Allocation Size
    -- where
       Target Allocation Size - provided in request
       Max Allocation Size = ((Average OSD Size * No of OSDs) / Replica Count) * Max Utilization Factor
       -- where Max Utilization Factor is set as 0.8
Finally round this value of next 2's power

func EmitRbdEvents added in v0.0.27

func EmitRbdEvents(params map[string]interface{})

func ExpandClusterUsingInstaller

func ExpandClusterUsingInstaller(cluster_uuid *uuid.UUID, request models.AddClusterRequest,
	nodes map[uuid.UUID]models.Node, node_ips map[uuid.UUID]map[string]string,
	t *task.Task, ctxt string) error

func ExpandClusterUsingSalt

func ExpandClusterUsingSalt(cluster_uuid *uuid.UUID, request models.AddClusterRequest,
	nodes map[uuid.UUID]models.Node, node_ips map[uuid.UUID]map[string]string,
	t *task.Task, ctxt string) error

func FetchClusterStats

func FetchClusterStats(ctxt string, cluster models.Cluster, monName string) (map[string]map[string]string, error)

func FetchOSDStats

func FetchOSDStats(ctxt string, cluster models.Cluster, monName string) (map[string]map[string]string, error)

func FetchObjectCount

func FetchObjectCount(ctxt string, cluster models.Cluster, monName string) (map[string]map[string]string, error)

func FetchPGSummary

func FetchPGSummary(ctxt string, cluster models.Cluster, monName string) (map[string]map[string]string, error)

func FetchRBDStats

func FetchRBDStats(ctxt string, cluster models.Cluster, monName string) (map[string]map[string]string, error)

func FetchStorageProfileUtilizations

func FetchStorageProfileUtilizations(ctxt string, osdDetails OSDStats, cluster models.Cluster) (statsToPush map[string]map[string]string, err error, storageProfileEvents []models.Event)

func GetCalamariMonNode

func GetCalamariMonNode(clusterId uuid.UUID, ctxt string) (*models.Node, error)

func GetDbProvider

func GetDbProvider() dbprovider.DbInterface

func GetMons

func GetMons(param bson.M) (models.Nodes, error)

func GetRandomMon

func GetRandomMon(clusterId uuid.UUID) (*models.Node, error)

func GetStatInBytes added in v0.0.38

func GetStatInBytes(stat string) (int64, error)

func HandleCalamariEvent

func HandleCalamariEvent(e models.AppEvent, ctxt string) (err error, statusCode int)

func HandleEvent

func HandleEvent(e models.Event, ctxt string) (err error, statusCode int)

func InitInstaller

func InitInstaller() error

func InitMonitoringManager

func InitMonitoringManager() error

func InitializeDb

func InitializeDb() error

func PopulateBlockDevices

func PopulateBlockDevices(bootstrapNode string, clusterId uuid.UUID, ctxt string) error

func PopulateClusterDetails

func PopulateClusterDetails(bootstrapNode string, ctxt string) (*uuid.UUID, string, error)

func PopulateClusterNetworkDetails

func PopulateClusterNetworkDetails(bootstrapNode string, clusterId uuid.UUID, ctxt string) error

func PopulateClusterNodes

func PopulateClusterNodes(bootstrapNode string, clusterId uuid.UUID, nodes []string, ctxt string) ([]string, error)

func PopulateClusterOSDs

func PopulateClusterOSDs(bootstrapNode string, clusterId uuid.UUID, ctxt string) error

func PopulateClusterStatus

func PopulateClusterStatus(bootstrapNode string, clusterId uuid.UUID, ctxt string) error

func PopulateNodeNetworkDetails

func PopulateNodeNetworkDetails(clusterId uuid.UUID, nodes []string, ctxt string) ([]string, error)

func PopulateStoragePools

func PopulateStoragePools(bootstrapNode string, clusterId uuid.UUID, ctxt string) error

func RecalculatePgnum

func RecalculatePgnum(ctxt string, clusterId uuid.UUID, t *task.Task) bool

func ScheduleRbdEventEmitter added in v0.0.27

func ScheduleRbdEventEmitter() error

func SortDisksOnSize

func SortDisksOnSize(disks []models.Disk) []models.Disk

func SyncOsdStatus

func SyncOsdStatus(clusterId uuid.UUID, ctxt string) error

func UpdateCrushNodeItems

func UpdateCrushNodeItems(ctxt string, clusterId uuid.UUID, sluList map[string]models.StorageLogicalUnit) error

func UpdateMonCountToSummaries added in v0.0.34

func UpdateMonCountToSummaries(ctxt string, cluster models.Cluster)

func UpdateObjectCountToSummaries added in v0.0.34

func UpdateObjectCountToSummaries(ctxt string, cluster models.Cluster)

func UpdatePgNumToSummaries added in v0.0.34

func UpdatePgNumToSummaries(cluster models.Cluster, ctxt string)

Types

type CephProvider

type CephProvider struct{}

func (*CephProvider) CreateBlockDevice

func (s *CephProvider) CreateBlockDevice(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) CreateCluster

func (s *CephProvider) CreateCluster(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) CreateStorage

func (s *CephProvider) CreateStorage(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) DeleteBlockDevice

func (s *CephProvider) DeleteBlockDevice(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) ExpandCluster

func (s *CephProvider) ExpandCluster(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetClusterConfig

func (s *CephProvider) GetClusterConfig(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetClusterNodesForImport

func (s *CephProvider) GetClusterNodesForImport(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetClusterStatus

func (s *CephProvider) GetClusterStatus(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetClusterSummary

func (s *CephProvider) GetClusterSummary(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetDiskHierarchy added in v0.0.21

func (s *CephProvider) GetDiskHierarchy(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetServiceCount

func (s *CephProvider) GetServiceCount(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetStorages

func (s *CephProvider) GetStorages(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) GetSummary

func (s *CephProvider) GetSummary(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) ImportCluster

func (s *CephProvider) ImportCluster(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) MonitorCluster

func (s *CephProvider) MonitorCluster(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) ProcessEvent

func (s *CephProvider) ProcessEvent(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) RemoveStorage

func (s *CephProvider) RemoveStorage(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) ResizeBlockDevice

func (s *CephProvider) ResizeBlockDevice(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) StopTask

func (s *CephProvider) StopTask(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) SyncBlockDevices

func (s *CephProvider) SyncBlockDevices(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) SyncStorageLogicalUnitParams

func (s *CephProvider) SyncStorageLogicalUnitParams(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) SyncStorageLogicalUnits

func (s *CephProvider) SyncStorageLogicalUnits(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) SyncStorageNodes

func (s *CephProvider) SyncStorageNodes(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) SyncStorages

func (s *CephProvider) SyncStorages(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) UpdateStorage

func (s *CephProvider) UpdateStorage(req models.RpcRequest, resp *models.RpcResponse) error

func (*CephProvider) UpdateStorageLogicalUnitParams

func (s *CephProvider) UpdateStorageLogicalUnitParams(req models.RpcRequest, resp *models.RpcResponse) error

type ClusterStats added in v0.0.24

type ClusterStats struct {
	Stats struct {
		Total       int64   `json:"total_bytes"`
		Used        int64   `json:"total_used_bytes"`
		Available   int64   `json:"total_avail_bytes"`
		PercentUsed float64 `json:"percent_used"`
	} `json:"stats"`
	Pools []PoolStats `json:"pools"`
}

type ExistingJournal added in v0.0.24

type ExistingJournal struct {
	Journal  JournalDetail `json:"journal"`
	OsdCount int           `json:"osdcount"`
}

type JournalDetail

type JournalDetail struct {
	JournalDisk string  `json:"journaldisk"`
	SSD         bool    `json:"type"`
	Size        float64 `json:"size"`
	Reweight    float64 `json:"reweight"`
	OsdJournal  string  `json:"osd_journal"`
	Available   float64 `json:"available"`
}

type OSDStats added in v0.0.24

type OSDStats struct {
	OSDs []struct {
		Name         string  `json:"name"`
		Id           int     `json:"id"`
		Available    int64   `json:"kb_avail"`
		Used         int64   `json:"kb_used"`
		UsagePercent float64 `json:"utilization"`
		Total        int64   `json:"kb"`
	} `json:"nodes"`
}

type PoolStats added in v0.0.38

type PoolStats struct {
	Name            string `json:"name"`
	Id              int    `json:"id"`
	PoolUtilization struct {
		Used        int64   `json:"bytes_used"`
		Available   int64   `json:"max_avail"`
		PercentUsed float64 `json:"percent_used"`
	} `json:"stats"`
}

type RBDStats added in v0.0.24

type RBDStats struct {
	RBDs []struct {
		Name  string `json:"name"`
		Used  int64  `json:"used_size"`
		Total int64  `json:"provisioned_size"`
	} `json:"images"`
}

Jump to

Keyboard shortcuts

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