Documentation
¶
Index ¶
- Constants
- type BlockDevice
- type CPUTemplate
- type Config
- type Firecracker
- type FirecrackerClient
- func (f *FirecrackerClient) CreateSyncAction(ctx context.Context, info *models.InstanceActionInfo) (*ops.CreateSyncActionNoContent, error)
- func (f *FirecrackerClient) GetMachineConfig() (*ops.GetMachineConfigOK, error)
- func (f *FirecrackerClient) PutGuestBootSource(ctx context.Context, source *models.BootSource) (*ops.PutGuestBootSourceNoContent, error)
- func (f *FirecrackerClient) PutGuestDriveByID(ctx context.Context, driveID string, drive *models.Drive) (*ops.PutGuestDriveByIDNoContent, error)
- func (f *FirecrackerClient) PutGuestNetworkInterfaceByID(ctx context.Context, ifaceID string, ifaceCfg *models.NetworkInterface) (*ops.PutGuestNetworkInterfaceByIDNoContent, error)
- func (f *FirecrackerClient) PutGuestVsockByID(ctx context.Context, vsockID string, vsock *models.Vsock) (*ops.PutGuestVsockByIDCreated, *ops.PutGuestVsockByIDNoContent, error)
- func (f *FirecrackerClient) PutLogger(ctx context.Context, logger *models.Logger) (*ops.PutLoggerNoContent, error)
- func (f *FirecrackerClient) PutMachineConfiguration(ctx context.Context, cfg *models.MachineConfiguration) (*ops.PutMachineConfigurationNoContent, error)
- type Machine
- type NetworkInterface
- type VsockDevice
Constants ¶
View Source
const ( // ConsoleXterm indicates that the machine's console should be presented in an xterm ConsoleXterm = "xterm" // ConsoleStdio indicates that the machine's console should re-use the parent's stdio streams ConsoleStdio = "stdio" // ConsoleNone indicates that the machine's console IO should be discarded ConsoleNone = "none" )
View Source
const ( CPUTemplateT2 = models.CPUTemplateT2 CPUTemplateC3 = models.CPUTemplateC3 )
CPUTemplates known by Firecracker. These are passed through directly from the model.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDevice ¶
BlockDevice represents a host block device mapped to the firecracker VM. mode is either "ro" or "rw"
type CPUTemplate ¶
type CPUTemplate models.CPUTemplate
CPUTemplate defines a set of CPU features that are exposed by Firecracker
type Config ¶
type Config struct { BinPath string SocketPath string LogFifo string LogLevel string MetricsFifo string KernelImagePath string KernelArgs string CPUCount int64 HtEnabled bool CPUTemplate CPUTemplate MemInMiB int64 RootDrive BlockDevice RootPartitionUUID string AdditionalDrives []BlockDevice NetworkInterfaces []NetworkInterface VsockDevices []VsockDevice Console string // contains filtered or unexported fields }
Config is a collection of user-configurable VMM settings
type Firecracker ¶
type Firecracker interface { PutLogger(ctx context.Context, logger *models.Logger) (*ops.PutLoggerNoContent, error) PutMachineConfiguration(ctx context.Context, cfg *models.MachineConfiguration) (*ops.PutMachineConfigurationNoContent, error) PutGuestBootSource(ctx context.Context, source *models.BootSource) (*ops.PutGuestBootSourceNoContent, error) PutGuestNetworkInterfaceByID(ctx context.Context, ifaceID string, ifaceCfg *models.NetworkInterface) (*ops.PutGuestNetworkInterfaceByIDNoContent, error) PutGuestDriveByID(ctx context.Context, driveID string, drive *models.Drive) (*ops.PutGuestDriveByIDNoContent, error) PutGuestVsockByID(ctx context.Context, vsockID string, vsock *models.Vsock) (*ops.PutGuestVsockByIDCreated, *ops.PutGuestVsockByIDNoContent, error) CreateSyncAction(ctx context.Context, info *models.InstanceActionInfo) (*ops.CreateSyncActionNoContent, error) GetMachineConfig() (*ops.GetMachineConfigOK, error) }
type FirecrackerClient ¶
type FirecrackerClient struct {
// contains filtered or unexported fields
}
func NewFirecrackerClient ¶
func NewFirecrackerClient(socketPath string) *FirecrackerClient
func (*FirecrackerClient) CreateSyncAction ¶
func (f *FirecrackerClient) CreateSyncAction(ctx context.Context, info *models.InstanceActionInfo) (*ops.CreateSyncActionNoContent, error)
func (*FirecrackerClient) GetMachineConfig ¶
func (f *FirecrackerClient) GetMachineConfig() (*ops.GetMachineConfigOK, error)
func (*FirecrackerClient) PutGuestBootSource ¶
func (f *FirecrackerClient) PutGuestBootSource(ctx context.Context, source *models.BootSource) (*ops.PutGuestBootSourceNoContent, error)
func (*FirecrackerClient) PutGuestDriveByID ¶
func (f *FirecrackerClient) PutGuestDriveByID(ctx context.Context, driveID string, drive *models.Drive) (*ops.PutGuestDriveByIDNoContent, error)
func (*FirecrackerClient) PutGuestNetworkInterfaceByID ¶
func (f *FirecrackerClient) PutGuestNetworkInterfaceByID(ctx context.Context, ifaceID string, ifaceCfg *models.NetworkInterface) (*ops.PutGuestNetworkInterfaceByIDNoContent, error)
func (*FirecrackerClient) PutGuestVsockByID ¶
func (f *FirecrackerClient) PutGuestVsockByID(ctx context.Context, vsockID string, vsock *models.Vsock) (*ops.PutGuestVsockByIDCreated, *ops.PutGuestVsockByIDNoContent, error)
func (*FirecrackerClient) PutLogger ¶
func (f *FirecrackerClient) PutLogger(ctx context.Context, logger *models.Logger) (*ops.PutLoggerNoContent, error)
func (*FirecrackerClient) PutMachineConfiguration ¶
func (f *FirecrackerClient) PutMachineConfiguration(ctx context.Context, cfg *models.MachineConfiguration) (*ops.PutMachineConfigurationNoContent, error)
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine is the main object for manipulating firecracker VMs
func NewMachine ¶
func NewMachine(cfg Config, firecracker Firecracker, l *log.Logger) *Machine
NewMachine initializes a new Machine instance
func (*Machine) StartInstance ¶
StartInstance starts the firecracker VM
type NetworkInterface ¶
NetworkInterface represents a Firecracker VMs network interface.
type VsockDevice ¶
VsockDevice represents a vsock connection between the host and the guest VM.
Click to show internal directories.
Click to hide internal directories.