Documentation
¶
Index ¶
- Constants
- Variables
- func InitTPMConfig(ctx context.Context, svcCfg *ServiceConfig) error
- type Config
- type ConfigSwitchType
- type Iperf3Report
- type Iperf3ReportEnd
- type Iperf3ReportInterval
- type Iperf3ReportSum
- type LinkConfig
- type Server
- type ServerConnectivityTestConfig
- type Service
- func (svc *Service) List() error
- func (svc *Service) SSH(name string, args []string) error
- func (svc *Service) Serial(name string) error
- func (svc *Service) SetupPeerings(ctx context.Context, cfg SetupPeeringsConfig) error
- func (svc *Service) SetupVPCs(ctx context.Context, cfg SetupVPCsConfig) error
- func (svc *Service) StartServer(killStaleVMs bool, charNBDDev string, installComplete bool, runComplete string, ...) error
- func (svc *Service) TestConnectivity(ctx context.Context, cfg ServerConnectivityTestConfig) error
- func (svc *Service) VFIOPCIBindAll() error
- type ServiceConfig
- type SetupPeeringsConfig
- type SetupVPCsConfig
- type SwitchConfig
- type VM
- func (vm *VM) OnieEepromConfig() (string, error)
- func (vm *VM) Prepare(ctx context.Context, svcCfg *ServiceConfig) error
- func (vm *VM) Run(ctx context.Context, eg *errgroup.Group, svc *Service)
- func (vm *VM) RunInstall(ctx context.Context, svc *Service) func() error
- func (vm *VM) RunTPM(ctx context.Context, svcCfg *ServiceConfig) func() error
- func (vm *VM) RunVM(ctx context.Context, svcCfg *ServiceConfig) func() error
- func (vm *VM) UUID() string
- type VMConfig
- type VMInterface
- type VMManager
- type VMType
- type VMsConfig
Constants ¶
View Source
const ( HHFAB_CFG_PREFIX = ".hhfab.fabric.githedgehog.com" HHFAB_CFG_TYPE = "type" + HHFAB_CFG_PREFIX HHFAB_CFG_SERIAL = "serial" + HHFAB_CFG_PREFIX HHFAB_CFG_LINK_PREFIX = "link" + HHFAB_CFG_PREFIX + "/" HHFAB_CFG_PCI_PREFIX = "pci@" HHFAB_CFG_SERIAL_SCHEME_SSH = "ssh://" HHFAB_CFG_SERIAL_SCHEME_TELNET = "telnet://" )
View Source
const ( VPCSetupTypeVPCPerServer = "vpc-per-server" VPCSetupTypeSingleVPC = "single-vpc" VPCSetupTypeVPCSubnetPerServer = "subnet-per-server" )
View Source
const ( MAC_ADDR_TMPL = "0c:20:12:fe:%02d:%02d" // if changing update onie-qcow2-eeprom-edit config too KUBE_PORT = 6443 REGISTRY_PORT = 31000 SSH_PORT_BASE = 22000 IF_PORT_BASE = 30000 IF_PORT_NULL = IF_PORT_BASE + 9000 IF_PORT_VM_ID_MULT = 100 IF_PORT_PORT_ID_MULT = 1 )
View Source
const ( VM_SELECTOR_SSH = "ssh" VM_SELECTOR_ALL = "all" )
View Source
const ( VM_SIZE_DEFAULT = "default" // meaningful VM sizes for dev & testing VM_SIZE_COMPACT = "compact" // minimal working setup, applied on top of default VM_SIZE_FULL = "full" // full setup as specified in requirements and more real switch resources, applied on top of default VM_SIZE_HUGE = "huge" // full setup with more resources for servers, applied on top of default VIRTUAL_EDGE_ANNOTATION = "external.hhfab.fabric.githedgehog.com/dest" // HHFAB annotation to specify destination for external connection )
View Source
const (
IFACES_PER_PCI_BRIDGE = 32
)
Variables ¶
View Source
var CompactControlVM = VMConfig{
CPU: 4,
RAM: 4096,
Disk: 50,
}
View Source
var CompactServerVM = VMConfig{
CPU: 1,
}
View Source
var CompactSwitchVM = VMConfig{
CPU: 3,
RAM: 3584,
Disk: 30,
}
View Source
var DefaultControlVM = VMConfig{
CPU: 6,
RAM: 6144,
Disk: 100,
}
View Source
var DefaultServerVM = VMConfig{
CPU: 2,
RAM: 768,
Disk: 10,
}
View Source
var DefaultSwitchVM = VMConfig{
CPU: 4,
RAM: 5120,
Disk: 50,
}
View Source
var FullControlVM = VMConfig{
CPU: 8,
RAM: 16384,
Disk: 250,
}
View Source
var FullServerVM = VMConfig{
RAM: 2048,
}
View Source
var FullSwitchVM = VMConfig{
RAM: 8192,
}
View Source
var HugeControlVM = VMConfig{
CPU: 8,
RAM: 16384,
Disk: 250,
}
View Source
var HugeServerVM = VMConfig{
CPU: 4,
RAM: 8192,
}
View Source
var HugeSwitchVM = VMConfig{
RAM: 8192,
}
View Source
var RequiredCommands = []string{
"qemu-system-x86_64",
"qemu-img",
"tpm2",
"swtpm_setup",
"ssh",
"scp",
"sudo",
}
View Source
var SSH_QUIET_FLAGS = []string{
"-o", "GlobalKnownHostsFile=/dev/null",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no",
"-o", "LogLevel=ERROR",
}
View Source
var VM_SIZES = []string{VM_SIZE_DEFAULT, VM_SIZE_COMPACT, VM_SIZE_FULL, VM_SIZE_HUGE}
View Source
var VPCSetupTypes = []string{ VPCSetupTypeVPCPerServer, }
Functions ¶
func InitTPMConfig ¶
func InitTPMConfig(ctx context.Context, svcCfg *ServiceConfig) error
Makes sure that swtpm config is initialized before we start VMs
Types ¶
type Config ¶
type Config struct { VMs VMsConfig `json:"vms,omitempty"` Switches map[string]SwitchConfig `json:"switches,omitempty"` Links map[string]LinkConfig `json:"links,omitempty"` }
type ConfigSwitchType ¶ added in v0.6.0
type ConfigSwitchType string
const ( ConfigSwitchTypeVS ConfigSwitchType = "vs" ConfigSwitchTypeHW ConfigSwitchType = "hw" )
type Iperf3Report ¶ added in v0.6.18
type Iperf3Report struct { Intervals []Iperf3ReportInterval `json:"intervals"` End Iperf3ReportEnd `json:"end"` }
type Iperf3ReportEnd ¶ added in v0.6.18
type Iperf3ReportEnd struct { SumSent Iperf3ReportSum `json:"sum_sent"` SumReceived Iperf3ReportSum `json:"sum_received"` }
type Iperf3ReportInterval ¶ added in v0.6.18
type Iperf3ReportInterval struct {
Sum Iperf3ReportSum `json:"sum"`
}
type Iperf3ReportSum ¶ added in v0.6.18
type LinkConfig ¶ added in v0.6.0
type LinkConfig struct {
PCIAddress string `json:"pci,omitempty"`
}
type Server ¶ added in v0.6.18
type Server struct { Name string VM *VM ConnectedTo []string ConnectionType string Server *wiringapi.Server Connection *wiringapi.Connection VPCAttachment *vpcapi.VPCAttachment VPC *vpcapi.VPC Subnet string ExternalPeering *vpcapi.ExternalPeering InVPCPeers []string VPCPeers []string Externals []string IP string }
type ServerConnectivityTestConfig ¶ added in v0.6.18
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func Load ¶
func Load(cfg *ServiceConfig) (*Service, error)
func (*Service) SetupPeerings ¶ added in v0.7.1
func (svc *Service) SetupPeerings(ctx context.Context, cfg SetupPeeringsConfig) error
TODO move vpc creation to here, just have flag --vpc-per-server
func (*Service) SetupVPCs ¶ added in v0.7.1
func (svc *Service) SetupVPCs(ctx context.Context, cfg SetupVPCsConfig) error
func (*Service) StartServer ¶
func (*Service) TestConnectivity ¶ added in v0.7.1
func (svc *Service) TestConnectivity(ctx context.Context, cfg ServerConnectivityTestConfig) error
func (*Service) VFIOPCIBindAll ¶ added in v0.6.0
type ServiceConfig ¶ added in v0.6.0
type ServiceConfig struct { DryRun bool Size string SudoSwtpm bool CharNBDDev string InstallComplete bool RunComplete string OnReady []string RestrictServers bool Basedir string Wiring *wiring.Data ControlIgnition string ServerIgnitionDir string ControlInstaller string ServerInstaller string FilesDir string SshKey string }
type SetupPeeringsConfig ¶ added in v0.7.1
type SetupVPCsConfig ¶ added in v0.7.1
type SetupVPCsConfig struct {
Type string
}
type SwitchConfig ¶ added in v0.6.0
type SwitchConfig struct { Type ConfigSwitchType `json:"type,omitempty"` Serial string `json:"serial,omitempty"` }
type VM ¶
type VM struct { ID int Name string Type VMType Basedir string Config VMConfig Interfaces map[int]VMInterface Ready fileMarker Installed fileMarker }
func (*VM) OnieEepromConfig ¶ added in v0.6.0
type VMConfig ¶ added in v0.6.0
type VMConfig struct { CPU int `json:"cpu,omitempty"` // in cores RAM int `json:"ram,omitempty"` // in MB Disk int `json:"disk,omitempty"` // in GB }
func (VMConfig) DefaultsFrom ¶ added in v0.6.0
func (VMConfig) OverrideBy ¶ added in v0.6.0
type VMInterface ¶ added in v0.6.0
type VMManager ¶ added in v0.6.0
type VMManager struct {
// contains filtered or unexported fields
}
func NewVMManager ¶ added in v0.6.0
func (*VMManager) LogOverview ¶ added in v0.6.0
func (mngr *VMManager) LogOverview()
Click to show internal directories.
Click to hide internal directories.