ganymede

package
v0.0.0-...-f1b23c0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 6 Imported by: 0

README

Ganymede

Ganymede is component of virtual machine.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	UUID      uuid.UUID `db:"uuid"`
	VLANID    uint32    `db:"vlan_id"`
	Name      string    `db:"name"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Bridge is bridge.

func (*Bridge) ToPb

func (b *Bridge) ToPb() *pb.Bridge

ToPb is

type CPUCorePinned

type CPUCorePinned struct {
	UUID              uuid.UUID `db:"uuid"`
	CPUPinningGroupID uuid.UUID `db:"pinning_group_id"`
	CorePairID        uuid.UUID `db:"hypervisor_cpu_pair_id"`
	CreatedAt         time.Time `db:"created_at"`
	UpdatedAt         time.Time `db:"updated_at"`
}

CPUCorePinned is pinned cpu

type CPUPinningGroup

type CPUPinningGroup struct {
	UUID         uuid.UUID `db:"uuid"`
	Name         string    `db:"name"`
	HypervisorID int       `db:"hypervisor_id"`
	CountCore    int       `db:"count_of_core"`
	CreatedAt    time.Time `db:"created_at"`
	UpdatedAt    time.Time `db:"updated_at"`
}

CPUPinningGroup is group of cpu cores. use a same group's cpu core if joined a same group.

func (*CPUPinningGroup) ToPb

func (cpg *CPUPinningGroup) ToPb() *pb.CPUPinningGroup

ToPb convert to type for proto

type CorePair

type CorePair struct {
	UUID         uuid.UUID     `db:"uuid"`
	PhysicalCore uint32        `db:"physical_core_number"`
	LogicalCore  sql.NullInt32 `db:"logical_core_number"`
	NUMANodeID   uuid.UUID     `db:"numa_node_id"`
	CreatedAt    time.Time     `db:"created_at"`
	UpdatedAt    time.Time     `db:"updated_at"`
}

CorePair is pair of cpu core

func (*CorePair) ToPb

func (cp *CorePair) ToPb() *dspb.CorePair

ToPb convert to type for proto

type Ganymede

type Ganymede interface {
	CreateVirtualMachine(ctx context.Context, name string, vcpus uint32, memoryKiB uint64, bootDeviceName, hypervisorName, rootVolumeID string, readBytesSec, writeBytesSec, readIOPSSec, writeIOPSSec uint32, cpuPinningGroupName string) (*VirtualMachine, error)
	StartVirtualMachine(ctx context.Context, vmID uuid.UUID) error
	DeleteVirtualMachine(ctx context.Context, vmID uuid.UUID) error

	CreateBridge(ctx context.Context, name string, vlanID uint32) (*Bridge, error)
	CreateInternalBridge(ctx context.Context, name string) (*Bridge, error)
	GetBridge(ctx context.Context, bridgeID uuid.UUID) (*Bridge, error)
	ListBridge(ctx context.Context) ([]Bridge, error)
	DeleteBridge(ctx context.Context, bridgeID uuid.UUID) error

	AttachInterface(ctx context.Context, vmID, bridgeID, leaseID uuid.UUID, average int, name string) (*InterfaceAttachment, error)
	DetachInterface(ctx context.Context, attachmentID uuid.UUID) error
	GetAttachment(ctx context.Context, attachmentID uuid.UUID) (*InterfaceAttachment, error)
	ListAttachment(ctx context.Context) ([]InterfaceAttachment, error)
}

A Ganymede is type definition of Virtual Machine.

type HyperVisor

type HyperVisor struct {
	ID        int       `db:"id"`
	IQN       string    `db:"iqn"`
	Hostname  string    `db:"hostname"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

HyperVisor is host of virtual machines

type InterfaceAttachment

type InterfaceAttachment struct {
	UUID             uuid.UUID `db:"uuid"`
	VirtualMachineID uuid.UUID `db:"virtual_machine_id"`
	BridgeID         uuid.UUID `db:"bridge_id"`
	Average          int       `db:"average"`
	Name             string    `db:"name"`
	LeaseID          uuid.UUID `db:"lease_id"`
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
}

InterfaceAttachment is

func (*InterfaceAttachment) ToPb

ToPb is

type NUMANode

type NUMANode struct {
	UUID            uuid.UUID `db:"uuid"`
	CorePairs       []CorePair
	PhysicalCoreMin uint32        `db:"physical_core_min"`
	PhysicalCoreMax uint32        `db:"physical_core_max"`
	LogicalCoreMin  sql.NullInt32 `db:"logical_core_min"`
	LogicalCoreMax  sql.NullInt32 `db:"logical_core_max"`
	HypervisorID    int           `db:"hypervisor_id"`
	CreatedAt       time.Time     `db:"created_at"`
	UpdatedAt       time.Time     `db:"updated_at"`
}

NUMANode is Non-uniform memory access in hypervisor

func (*NUMANode) ToPb

func (node *NUMANode) ToPb() *dspb.NumaNode

ToPb convert to type for proto

type VirtualMachine

type VirtualMachine struct {
	UUID              uuid.UUID     `db:"uuid"`
	Name              string        `db:"name"`
	Vcpus             uint32        `db:"vcpus"`
	MemoryKiB         uint64        `db:"memory_kib"`
	HypervisorName    string        `db:"hypervisor_name"`
	RootVolumeID      string        `db:"root_volume_id"`
	RootVolumeGB      uint32        `db:"capacity_gb"`
	ReadBytesSec      uint32        `db:"read_bytes_sec"`
	WriteBytesSec     uint32        `db:"write_bytes_sec"`
	ReadIOPSSec       uint32        `db:"read_iops_sec"`
	WriteIOPSSec      uint32        `db:"write_iops_sec"`
	SourceImageID     uuid.UUID     `db:"base_image_id"`
	CPUPinningGroupID uuid.NullUUID `db:"cpu_pinning_group_id"`
	CreatedAt         time.Time     `db:"created_at"`
	UpdatedAt         time.Time     `db:"updated_at"`
}

VirtualMachine is virtual machine.

func (*VirtualMachine) ToPb

func (vm *VirtualMachine) ToPb(cpuPinningGroupName, europaBackendName string) *pb.VirtualMachine

ToPb convert to type for proto

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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