scaleio

package
v0.0.0-...-0391a7e Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMC

type BMC struct {
	// contains filtered or unexported fields
}

BMC credentials

type Cluster

type Cluster struct {
	MDMs      []*MDMNode
	TBs       []*TBNode
	SDSs      []*SDSNode
	ScaleIO   *ScaleIO
	IsCluster bool
	Options   *clusterOptions
}

Cluster describes the properties clusttered MDM/TB group.

func (*Cluster) AddMDMStandby

func (cluster *Cluster) AddMDMStandby(mdm MDMNode) error

AddMDMStandby adds the other MDM node

func (*Cluster) Defaults

func (cluster *Cluster) Defaults()

Defaults sets certain usual options

func (*Cluster) SetPassword

func (cluster *Cluster) SetPassword(password string) error

SetPassword sets the ScaleIO password

type Config

type Config struct {
	Vblock         string
	VCSAManagement ConfigVM `json:"vcsa_management"`
	VCSACustomer   ConfigVM `json:"vcsa_customer"`
	Switches       []Credentials
	Hosts          []Host `json:"hosts"`
	OS             string `json:"os_name"`
	Vlans          struct {
		Trunk  []string
		Native string
	}
	DVSPortgroups map[string]string `json:"dvs_portgroups"`
	OVA           string            `json:"ova"`
	DNSSuffixes   []string          `json:"dns_suffixes"`
	DNSServers    []string          `json:"dns_servers"`
	Domain        string
	Datacenter    string
	VibURL        string `json:"vib_url"`
	PackageURL    string `json:"package_url"`
}

Config is thre top-level item

func Import

func Import(path string) *Config

Import takes the config file

type ConfigVCSA

type ConfigVCSA struct {
	OVA  string `json:"ova"`
	FQDN string `json:"fqdn"`
	IP   string `json:"ip"`

	DNS string `json:"dns"`

	DeploymentOption string
	DiskMode         string
	// contains filtered or unexported fields
}

ConfigVCSA carries VCSA-specific parameters for building the VM.

type ConfigVM

type ConfigVM struct {
	Target Target
	Config struct {
		VCSA ConfigVCSA `json:"vcsa"`
	}
}

ConfigVM carrries the location where an OVA is installed plus it's config parameters

type Credentials

type Credentials struct {
	IP   string
	User string
	Pass string
}

Credentials is the minimum login info for equipment using username/password auth

type GatewayNode

type GatewayNode struct {
	*Node
	ScaleIO *ScaleIO
}

GatewayNode describes the properties of the VM to be built

func NewGatewayNode

func NewGatewayNode(Username string, Password string, Hostname string, DataCIDR []string, ManagementCIDR string, UseSudo bool, ScaleIO *ScaleIO) *GatewayNode

NewGatewayNode passes a new node object

type Host

type Host struct {
	Hostname  string   `json:"hostname"`
	Location  []string `json:"location"`
	Mac       string   `json:",omitempty"`
	BMCIP     string   `json:"bmc_ip"`
	BMCUser   string   `json:"bmc_user"`
	BMCPass   string   `json:"bmc_pass"`
	Datastore string
	Network   NetworkMap
	SDS       SDSConfig `json:"sds"`
}

Host describes an (ESXi) host to be built

type Installation

type Installation struct {
	PrereqCommands  []string
	InstallCommands []string
	EraseCommands   []string
	SioPackageURL   string
}

Installation describes commands for install

type InstallationManager

type InstallationManager interface {
	Install() error
}

InstallationManager is intended to be an opportunity for DI of installation methods

type MDMNode

type MDMNode struct {
	*Node
	ScaleIO *ScaleIO
}

MDMNode describes the properties of the VM to be built

func NewMDMNode

func NewMDMNode(Username string, Password string, Hostname string, DataCIDR []string, ManagementCIDR string, UseSudo bool, ScaleIO *ScaleIO) *MDMNode

NewMDMNode passes a new node object

type Network

type Network struct {
	Role     string
	Nics     []string `json:",omitempty"`
	Vswitch  string   `json:",omitempty"`
	Dvs      string   `json:",omitempty"`
	Teaming  string   `json:",omitempty"`
	IP       string   `json:"ip"`
	Netmask  string
	Gateway  string `json:",omitempty"`
	Vlan     int32  `json:",omitempty"`
	VnicName string `json:"vnic_name,omitempty"`
}

Network is a ScaleIO network object as used on ESXi hosts and SDS Vms

type NetworkMap

type NetworkMap struct {
	SIODATA1 Network `json:"SIO-DATA1"`
	SIODATA2 Network `json:"SIO-DATA2"`
	SIOMGMT  Network `json:"SIO-MGMT,omniempty"`
}

NetworkMap is a list of ScaleIO-specific networks

type Node

type Node struct {
	SSH               sshclient.ShellConnection
	Installation      Installation
	DataNetworks      []string
	ManagementNetwork string
	Hostname          string
	Become            string
}

Node describes the properties of the VM to be built

func NewNode

func NewNode(Username string, Password string, Hostname string, DataCIDR []string, ManagementCIDR string, UseSudo bool) *Node

NewNode passes a new node object

func (*Node) Command

func (node *Node) Command(cmd string) (*sshclient.CommandOutput, error)

Command executes an SSH command

func (*Node) Commands

func (node *Node) Commands(cmds []string) ([]*sshclient.CommandOutput, error)

Commands executes a list of commands

func (*Node) DataIPString

func (node *Node) DataIPString() string

DataIPString is a commaseparated list of IPs for this node

func (*Node) Install

func (node *Node) Install() error

Install sets up the VM

func (*Node) MgmtIP

func (node *Node) MgmtIP() net.IP

MgmtIP produces the IP needed to connect.

func (*Node) MgmtIPString

func (node *Node) MgmtIPString() string

MgmtIPString provides the CSV IP string the ScaleIO uses

type SDCESXi

type SDCESXi struct {
	HostSystem  *object.HostSystem
	Network     NetworkMap
	MdmIPString string
	IniGUIDStr  string
	Hostname    string
	SSH         sshclient.ShellConnection
	Vcenter     *vsphere.Vcenter
}

SDCESXi describes the ESXi host being used as ScaleIO init or SDC.

func (*SDCESXi) Command

func (sdc *SDCESXi) Command(cmd string) (*sshclient.CommandOutput, error)

Command allows for SSH commands to be sent to the ESXI server

func (*SDCESXi) DeploySVM

func (sdc *SDCESXi) DeploySVM(template *object.VirtualMachine, sds *SDSNode) (*object.VirtualMachine, error)

DeploySVM creates a new VM on this host based on the supplied template VM.

func (*SDCESXi) DeployTemplate

func (sdc *SDCESXi) DeployTemplate(fpath string) (*object.VirtualMachine, error)

DeployTemplate creates a VM with the specified SDS information

func (*SDCESXi) EnablePassthrough

func (sdc *SDCESXi) EnablePassthrough(devname string) error

EnablePassthrough makes a hardware device available to VMs if it matches a name pattern

func (*SDCESXi) RemoveSDS

func (sdc *SDCESXi) RemoveSDS() error

RemoveSDS will power off and delete the SDS VM

func (*SDCESXi) SDS

func (sdc *SDCESXi) SDS() (*object.VirtualMachine, error)

SDS finds a VM providingg the SDS if it exists.

func (*SDCESXi) UpdateScini

func (sdc *SDCESXi) UpdateScini(mdmIP string, guid string) error

UpdateScini writes values to the scini module configuration in ESXi

type SDSConfig

type SDSConfig struct {
	VMName          string `json:"vm_name"`
	NetworkMappings struct {
		Nat string
	} `json:"network_mappings"`
	Network NetworkMap
}

SDSConfig describes an SDS VM

type SDSNode

type SDSNode struct {
	*Node
}

SDSNode describes the properties of the VM to be built

func NewSDSNode

func NewSDSNode(Username string, Password string, Hostname string, DataCIDR []string, ManagementCIDR string, UseSudo bool) *SDSNode

NewSDSNode passes a new node object

func (*SDSNode) Install

func (node *SDSNode) Install() error

Install sets up the VM

type ScaleIO

type ScaleIO struct {
	Password   string //defaults to 'admin' on initial install
	MaxRetries int
}

ScaleIO describes the properties of the overall ScaleIO environment

func (*ScaleIO) NewCluster

func (sio *ScaleIO) NewCluster(mdm *MDMNode) (*Cluster, error)

NewCluster passes back the new struct and adds the first MDM

type SecureShellClient

type SecureShellClient struct {
	// contains filtered or unexported fields
}

SecureShellClient describes the basic connection parameters

type TBNode

type TBNode struct {
	*Node
	ScaleIO *ScaleIO
}

TBNode describes the properties of the VM to be built

func NewTBNode

func NewTBNode(Username string, Password string, Hostname string, DataCIDR []string, ManagementCIDR string, UseSudo bool, ScaleIO *ScaleIO) *TBNode

NewTBNode passes a new node object

type Target

type Target struct {
	ESXi           Credentials `json:"esxi"`
	Portgroup      string
	PortgroupScope string `json:"portgroup_scope"`
	PortgroupVLAN  string `json:"portgroup_vlan"`
	Datastore      string
	Vcenter        Credentials `json:",omitempty"`
}

Target descibes the destination where an OVA is deployed.

Jump to

Keyboard shortcuts

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