payloads

package
v0.0.0-...-194264a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: Apache-2.0 Imports: 1 Imported by: 13

Documentation

Index

Constants

View Source
const (
	// PublicIPNoInstance indicates that a public IP assignment/release failed
	// because the corresponding instance does not exist
	PublicIPNoInstance PublicIPFailureReason = "no_instance"

	// PublicIPInvalidPayload constant is used to denote when YAML payload
	//  is corrupt.
	PublicIPInvalidPayload = "invalid_payload"

	// PublicIPInvalidData constant is used to denote when command section
	// of YAML payload is corrupt or missing required information.
	PublicIPInvalidData = "invalid_data"

	// PublicIPAssignFailure constant is used to denote when Public IP assignment
	// operation failed.
	PublicIPAssignFailure = "assign_failure"

	// PublicIPReleaseFailure constant is used to denote when Public IP release
	// operation failed.
	PublicIPReleaseFailure = "release_failure"
)
View Source
const (
	// AttachVolumeNoInstance indicates that a volume could not be attached
	// to an instance as the instance does not exist on the node to
	// which the AttachVolume command was sent.
	AttachVolumeNoInstance AttachVolumeFailureReason = "no_instance"

	// AttachVolumeInvalidPayload indicates that the payload of the SSNTP
	// AttachVolume command was corrupt and could not be unmarshalled.
	AttachVolumeInvalidPayload = "invalid_payload"

	// AttachVolumeInvalidData is returned by ciao-launcher if the contents
	// of the AttachVolume payload are incorrect, e.g., the instance_uuid
	// is missing.
	AttachVolumeInvalidData = "invalid_data"

	// AttachVolumeAttachFailure indicates that the attempt to attach a
	// volume to an instance failed.
	AttachVolumeAttachFailure = "attach_failure"

	// AttachVolumeAlreadyAttached indicates that the volume is already
	// attached to the instance.
	AttachVolumeAlreadyAttached = "already_attached"

	// AttachVolumeStateFailure indicates that launcher was unable to
	// update its internal state to register the new volume.
	AttachVolumeStateFailure = "state_failure"

	// AttachVolumeInstanceFailure indicates that the volume could not
	// be attached as the instance has failed to start and is being
	// deleted
	AttachVolumeInstanceFailure = "instance_failure"

	// AttachVolumeNotSupported indicates that the attach volume command
	// is not supported for the given workload type, e.g., a container.
	AttachVolumeNotSupported = "not_supported"
)
View Source
const (
	// DeleteNoInstance indicates that an instance could not be deleted
	// as it does not exist on the node to which the DELETE command was
	// sent.
	DeleteNoInstance DeleteFailureReason = "no_instance"

	// DeleteInvalidPayload indicates that the payload of the SSNTP
	// DELETE command was corrupt and could not be unmarshalled.
	DeleteInvalidPayload = "invalid_payload"

	// DeleteInvalidData is returned by ciao-launcher if the contents
	// of the DELETE payload are incorrect, e.g., the instance_uuid
	// is missing.
	DeleteInvalidData = "invalid_data"
)
View Source
const (
	// All used to indicate all persistent scenario, in this case it
	// indicates to act in all instances.
	All Persistence = "all"

	// VM used to indicate in a instance persistent scenario, in this case it
	// indicates to act in only one instance.
	VM = "vm"

	// Host used to indicate in a Host persistent scenario, in this case it
	// indicates to act in only in the instances of a host.
	Host = "host"
)
View Source
const (
	// VCPUs indicates that a particular resource struct contains a count
	// of VCPUs
	VCPUs Resource = "vcpus"

	// MemMB indicates that a resource struct specifies a quantity of memory
	// in MBs
	MemMB = "mem_mb"

	// NetworkNode indicates that a resource struct specifies whether the
	// command in which it is embedded applies to a network node.
	NetworkNode = "network_node"

	// ComputeNode indicates that a resource struct specifies whether the
	// command in which it is embedded applies to a compute node.
	ComputeNode = "compute_node"

	// Instance is used to indicate that this requested resource is an instance.
	Instance = "instance"

	// Volume is used to indicate that the requested resource is a volume.
	Volume = "volume"

	// Image is used to indicate that the requested resource is an image.
	Image = "image"

	// ExternalIP is used to indicate the the requested resource is an
	// externally accessible IP address.
	ExternalIP = "external_ip"

	// SharedDiskGiB is used for shared storage across the cluster used for
	// storing volume and images. (Measured in GiB)
	SharedDiskGiB = "shared_disk_gib"
)
View Source
const (
	// FullCloud is returned by the scheduler when all nodes in the cluster
	// are FULL and it is unable to satisfy a START request.
	FullCloud StartFailureReason = "full_cloud"

	// FullComputeNode indicates that the node to which the START command
	// was sent had insufficient resources to start the requested instance.
	FullComputeNode = "full_cn"

	// NodeInMaintenance indicates that the node to which the START command
	// was sent cannot host the instance as it is currently in maintenance
	// mode.
	NodeInMaintenance = "node_maintenance"

	// NoComputeNodes is returned by the scheduler if no compute nodes are
	// running in the cluster upon which the instance can be started.
	NoComputeNodes = "no_cn"

	// NoNetworkNodes is returned by the scheduler if no network nodes are
	// running in the cluster upon which the instance can be started.
	NoNetworkNodes = "no_net_cn"

	// InvalidPayload indicates that the contents of the START payload are
	// corrupt
	InvalidPayload = "invalid_payload"

	// InvalidData indicates that the start section of the payload is
	// corrupt or missing information
	InvalidData = "invalid_data"

	// AlreadyRunning is returned when an attempt is made to start an
	// instance on a node upon which that very same instance is already
	// running.
	AlreadyRunning = "already_running"

	// InstanceExists is returned when an attempt is made to start an
	// instance on a node upon which that very same instance already
	// exists but is not currently running.
	InstanceExists = "instance_exists"

	// ImageFailure indicates that ciao-launcher is unable to locate
	// the rootfs for the instance, e.g., a VM instance is started
	// with no bootable volumes or a containers image cannot be
	// downloaded.
	ImageFailure = "image_failure"

	// LaunchFailure indicates that the instance has been successfully
	// created but could not be launched.  Actually, this is sort of an
	// odd situation as the START command partially succeeded.
	// ciao-launcher returns an error code, but the instance has been
	// created and could be booted a later stage via the RESTART command.
	LaunchFailure = "launch_failure"

	// NetworkFailure indicates that it was not possible to initialise
	// networking for the instance.
	NetworkFailure = "network_failure"
)
View Source
const (
	// ComputeStatusPending is a filter that used to select pending
	// instances in requests to the controller.
	ComputeStatusPending = "pending"

	// ComputeStatusRunning is a filter that used to select running
	// instances in requests to the controller.
	ComputeStatusRunning = "active"

	// ComputeStatusStopped is a filter that used to select exited
	// instances in requests to the controller.
	ComputeStatusStopped = "exited"
)
View Source
const (
	// Pending indicates that ciao-launcher has not yet ascertained the
	// state of a given instance.  This can happen, either because the
	// instance is in the process of being created, or ciao-launcher itself
	// has just started and is still gathering information about the
	// existing instances.
	Pending = ComputeStatusPending

	// Running indicates an instance is running
	Running = ComputeStatusRunning

	// Stopping indicates that an instance has been issued a delete
	// command, however, we are unalbe to ascertain whether the
	// instance has been deleted yet.
	Stopping = "stopping"

	// Exited indicates that an instance has been successfully created but
	// is not currently running, either because it failed to start or was
	// explicitly stopped by a STOP command or perhaps by a CN reboot.
	Exited = ComputeStatusStopped
	// ExitFailed is not currently used
	ExitFailed = "exit_failed"
	// ExitPaused is not currently used
	ExitPaused = "exit_paused"

	// Deleted indicates that an instance has been successfully deleted.
	Deleted = "deleted"

	// Hung indicates that an instance is not responding to commands.
	Hung = "hung"

	// Missing indicates that the node this instance is running on is not
	// active
	Missing = "missing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachVolume

type AttachVolume struct {
	Attach VolumeCmd `yaml:"attach_volume"`
}

AttachVolume represents the unmarshalled version of the contents of a SSNTP AttachVolume payload. The structure contains enough information to attach a volume to an existing instance.

type AttachVolumeFailureReason

type AttachVolumeFailureReason string

AttachVolumeFailureReason denotes the underlying error that prevented an SSNTP AttachVolume command from attaching a volume to an instance.

func (AttachVolumeFailureReason) String

func (r AttachVolumeFailureReason) String() string

type CNCINet

type CNCINet struct {
	PhysicalIP string `yaml:"physical_ip"`
	Subnet     string `yaml:"subnet"`
	TunnelIP   string `yaml:"tunnel_ip"`
	TunnelID   uint32 `yaml:"tunnel_id"`
}

CNCINet contains information about CNCI network interfaces.

type CNCIRefreshCommand

type CNCIRefreshCommand struct {
	CNCIUUID string    `yaml:"cnci_uuid"`
	CNCIList []CNCINet `yaml:"cncis"`
}

CNCIRefreshCommand contains information on where to send the updated concentrator instance list.

type CommandAssignPublicIP

type CommandAssignPublicIP struct {
	AssignIP PublicIPCommand `yaml:"assign_public_ip"`
}

CommandAssignPublicIP is a wrapper around PublicIPCommand. It is the AssignPublicIP command payload.

type CommandCNCIRefresh

type CommandCNCIRefresh struct {
	Command CNCIRefreshCommand `yaml:"cnci_refresh"`
}

CommandCNCIRefresh represents the unmarshalled version of the contents of an SSNTP ssntp.ConcentratorInstanceRefresh command. This command is sent by the controller to the cnci-agent when new cncis are added or an existing cnci is modified.

type CommandReleasePublicIP

type CommandReleasePublicIP struct {
	ReleaseIP PublicIPCommand `yaml:"release_public_ip"`
}

CommandReleasePublicIP is a wrapper around PublicIPCommand. It is the ReleasePublicIP command payload.

type ConcentratorInstanceAddedEvent

type ConcentratorInstanceAddedEvent struct {
	InstanceUUID    string `yaml:"instance_uuid"`
	TenantUUID      string `yaml:"tenant_uuid"`
	ConcentratorIP  string `yaml:"concentrator_ip"`
	ConcentratorMAC string `yaml:"concentrator_mac"`
}

ConcentratorInstanceAddedEvent contains information about a newly added CNCI instance.

type Configure

type Configure struct {
	Configure ConfigurePayload `yaml:"configure"`
}

Configure represents the SSNTP CONFIGURE command payload.

func (*Configure) InitDefaults

func (conf *Configure) InitDefaults()

InitDefaults initializes default vaulues for Configure structure.

type ConfigureController

type ConfigureController struct {
	CiaoPort             int    `yaml:"ciao_port"`
	HTTPSCACert          string `yaml:"compute_ca"`
	HTTPSKey             string `yaml:"compute_cert"`
	CNCIVcpus            int    `yaml:"cnci_vcpus"`
	CNCIMem              int    `yaml:"cnci_mem"`
	CNCIDisk             int    `yaml:"cnci_disk"`
	AdminSSHKey          string `yaml:"admin_ssh_key"`
	ClientAuthCACertPath string `yaml:"client_auth_ca_cert_path"`
	CNCINet              string `yaml:"cnci_net"`
}

ConfigureController contains the unmarshalled configurations for the controller service.

type ConfigureLauncher

type ConfigureLauncher struct {
	ComputeNetwork    []string `yaml:"compute_net"`
	ManagementNetwork []string `yaml:"mgmt_net"`
	DiskLimit         bool     `yaml:"disk_limit"`
	MemoryLimit       bool     `yaml:"mem_limit"`
	ChildUser         string   `yaml:"child_user"`
}

ConfigureLauncher contains the unmarshalled configurations for the launcher service.

type ConfigurePayload

type ConfigurePayload struct {
	Scheduler  ConfigureScheduler  `yaml:"scheduler"`
	Storage    ConfigureStorage    `yaml:"storage"`
	Controller ConfigureController `yaml:"controller"`
	Launcher   ConfigureLauncher   `yaml:"launcher"`
}

ConfigurePayload is a wrapper to read and unmarshall all posible configurations for the following services: scheduler, controller, launcher,

imaging and identity.

type ConfigureScheduler

type ConfigureScheduler struct {
	ConfigStorageURI string `yaml:"storage_uri"`
}

ConfigureScheduler contains the unmarshalled configurations for the scheduler service.

type ConfigureStorage

type ConfigureStorage struct {
	CephID string `yaml:"ceph_id"`
}

ConfigureStorage contains the unmarshalled configurations for the Ceph storage driver.

type Delete

type Delete struct {
	// Delete contains information about the instance to delete.
	Delete StopCmd `yaml:"delete"`
}

Delete represents the unmarshalled version of the contents of a SSNTP DELETE payload. The structure contains enough information to delete a CN or NN instance.

type DeleteFailureReason

type DeleteFailureReason string

DeleteFailureReason denotes the underlying error that prevented an SSNTP DELETE command from deleting a running instance.

func (DeleteFailureReason) String

func (r DeleteFailureReason) String() string

type ErrorAttachVolumeFailure

type ErrorAttachVolumeFailure struct {
	// NodeUUID is the UUID of the node that generated this error.
	NodeUUID string `yaml:"node_uuid"`

	// InstanceUUID is the UUID of the instance to which a volume could not be
	// attached.
	InstanceUUID string `yaml:"instance_uuid"`

	// VolumeUUID is the UUID of the volume that could not be attached.
	VolumeUUID string `yaml:"volume_uuid"`

	// Reason provides the reason for the attach failure, e.g.,
	// AttachVolumehNoInstance.
	Reason AttachVolumeFailureReason `yaml:"reason"`
}

ErrorAttachVolumeFailure represents the unmarshalled version of the contents of a SSNTP ERROR frame whose type is set to ssntp.AttachVolumeFailure.

type ErrorDeleteFailure

type ErrorDeleteFailure struct {
	// NodeUUID is the UUID of the node that generated this error.
	NodeUUID string `yaml:"node_uuid"`

	// InstanceUUID is the UUID of the instance that could not be deleted.
	InstanceUUID string `yaml:"instance_uuid"`

	// Reason provides the reason for the delete failure, e.g.,
	// DeleteNoInstance.
	Reason DeleteFailureReason `yaml:"reason"`
}

ErrorDeleteFailure represents the unmarshalled version of the contents of a SSNTP ERROR frame whose type is set to ssntp.DeleteFailure.

type ErrorPublicIPFailure

type ErrorPublicIPFailure struct {
	ConcentratorUUID string                `yaml:"concentrator_uuid"`
	TenantUUID       string                `yaml:"tenant_uuid"`
	InstanceUUID     string                `yaml:"instance_uuid"`
	PublicIP         string                `yaml:"public_ip"`
	PrivateIP        string                `yaml:"private_ip"`
	VnicMAC          string                `yaml:"vnic_mac"`
	Reason           PublicIPFailureReason `yaml:"reason"`
}

ErrorPublicIPFailure represents the PublicIPFailure SSNTP error payload. It includes information about the IP itself and the actual reason for failure.

type ErrorStartFailure

type ErrorStartFailure struct {
	// NodeUUID is the UUID of the node that generated this error.
	NodeUUID string `yaml:"node_uuid"`

	// InstanceUUID is the UUID of the instance that could not be started.
	InstanceUUID string `yaml:"instance_uuid"`

	// Reason provides the reason for the start failure, e.g.,
	// LaunchFailure.
	Reason StartFailureReason `yaml:"reason"`

	// Restart is true if the failed start command was attempting to
	// restart an existing instance.
	Restart bool
}

ErrorStartFailure represents the unmarshalled version of the contents of a SSNTP ERROR frame whose type is set to ssntp.StartFailure.

type Evacuate

type Evacuate struct {
	Evacuate EvacuateCmd `yaml:"evacuate"`
}

Evacuate represents the SSNTP EVACUATE command payload.

type EvacuateCmd

type EvacuateCmd struct {
	WorkloadAgentUUID string `yaml:"workload_agent_uuid"`
}

EvacuateCmd contains the nodeID of a SSNTP Agent.

type EventConcentratorInstanceAdded

type EventConcentratorInstanceAdded struct {
	CNCIAdded ConcentratorInstanceAddedEvent `yaml:"concentrator_instance_added"`
}

EventConcentratorInstanceAdded represents the unmarshalled version of the contents of an SSNTP ssntp.ConcentratorInstanceAdded event. This event is sent by the cnci-agent to the controller when it connects to the scheduler.

type EventInstanceDeleted

type EventInstanceDeleted struct {
	InstanceDeleted InstanceDeletedEvent `yaml:"instance_deleted"`
}

EventInstanceDeleted represents the unmarshalled version of the contents of an SSNTP ssntp.InstanceDeleted event. This event is sent by ciao-launcher when it successfully deletes an instance.

type EventInstanceStopped

type EventInstanceStopped struct {
	InstanceStopped InstanceStoppedEvent `yaml:"instance_stopped"`
}

EventInstanceStopped represents the unmarshalled version of the contents of an SSNTP ssntp.InstanceStopped event. This event is sent by ciao-launcher when it successfully deletes an instance that is being migrated.

type EventPublicIPAssigned

type EventPublicIPAssigned struct {
	AssignedIP PublicIPEvent `yaml:"public_ip_assigned"`
}

EventPublicIPAssigned represents the SSNTP PublicIPAssigned event payload.

type EventPublicIPUnassigned

type EventPublicIPUnassigned struct {
	UnassignedIP PublicIPEvent `yaml:"public_ip_unassigned"`
}

EventPublicIPUnassigned represents the SSNTP PublicIPUnassigned event payload.

type EventTenantAdded

type EventTenantAdded struct {
	TenantAdded TenantAddedEvent `yaml:"tenant_added"`
}

EventTenantAdded represents the unmarshalled version of the contents of an SSNTP ssntp.TenantAdded event payload. The structure contains all the information needed by an CNCI instance to add a remote tunnel for a CN

type EventTenantRemoved

type EventTenantRemoved struct {
	TenantRemoved TenantAddedEvent `yaml:"tenant_removed"`
}

EventTenantRemoved represents the unmarshalled version of the contents of an SSNTP ssntp.TenantRemoved event payload. The structure contains all the information needed by an CNCI instance to remove a remote tunnel for a CN

type Firmware

type Firmware string

Firmware represents the type of firmware used to boot a VM

const (
	// EFI indicates that EFI firmware, e.g., OVMF.fd, should be used to
	// boot a VM
	EFI Firmware = "efi"

	// Legacy indicates that legacy firmware, e.g., BIOS should be used
	// to boot a VM
	Legacy = "legacy"
)

type FrameTrace

type FrameTrace struct {
	Label          string `yaml:"label"`
	Type           string `yaml:"type"`
	Operand        string `yaml:"operand"`
	StartTimestamp string `yaml:"start_timestamp"`
	EndTimestamp   string `yaml:"end_timestamp"`
	Nodes          []SSNTPNode
}

FrameTrace captures trace information for an SSNTP frame as it makes its way through a SSNTP cluster.

type Hypervisor

type Hypervisor string

Hypervisor indicates the type of hypervisor used to run a given instance

const (
	// QEMU specifies that an instance is to be booted on QEMU KVM VM.
	QEMU Hypervisor = "qemu"

	// Docker specifies that an instance is to be launched inside a Docker
	// container.
	Docker = "docker"
)

type InstanceDeletedEvent

type InstanceDeletedEvent struct {
	InstanceUUID string `yaml:"instance_uuid"`
}

InstanceDeletedEvent contains the UUID of an instance that has just been deleted.

type InstanceStat

type InstanceStat struct {

	// UUID of the instance to which this stats structure pertains
	InstanceUUID string `yaml:"instance_uuid"`

	// State of the instance, e.g., running, pending, exited
	State string `yaml:"state"`

	// IP address to use to connect to instance via SSH.  This
	// is actually the IP address of the CNCI VM.
	// Will be "" if the instance is itself a CNCI VM.
	SSHIP string `yaml:"ssh_ip"`

	// Port number used to access the SSH service running on the
	// VM.  This number is computed from the VM's IP address.
	// Will be 0 if the instance is itself a CNCI VM.
	SSHPort int `yaml:"ssh_port"`

	// Memory usage in MB.  May be -1 if State != Running.
	MemoryUsageMB int `yaml:"memory_usage_mb"`

	// Disk usage in MB.  May be -1 if State = Pending.
	DiskUsageMB int `yaml:"disk_usage_mb"`

	// Percentage of CPU Usage for VM, normalized for VCPUs.
	// May be -1 if State != Running or if launcher has not
	// acquired enough samples to compute the CPU usage.
	// Assuming CPU usage can be computed it will be a value
	// between 0 and 100% regardless of the number of VPCUs.
	// 100% means all your VCPUs are maxed out.
	CPUUsage int `yaml:"cpu_usage"`

	// List of volumes attached to the instance.
	Volumes []string `yaml:"volumes"`
}

InstanceStat contains information about the state of an indiviual instance in a ciao cluster.

type InstanceStoppedEvent

type InstanceStoppedEvent struct {
	InstanceUUID string `yaml:"instance_uuid"`
}

InstanceStoppedEvent contains the UUID of an instance that has just been deleted from a node for the purposes of migration.

type NetworkResources

type NetworkResources struct {

	// VnicMAC contains the MAC address of an instance's VNIC.
	VnicMAC string `yaml:"vnic_mac"`

	// VnicUUID is a cluster unique UUID assigned to an instance's VNIC.
	VnicUUID string `yaml:"vnic_uuid"`

	// ConcentratorUUID is the UUID of the CNCI instance.  Only specified
	// when creating CN instances.
	ConcentratorUUID string `yaml:"concentrator_uuid"`

	// ConcentratorIP is the IP address of the CNCI.  Only specified
	// when creating CN instances.
	ConcentratorIP string `yaml:"concentrator_ip"`

	// Subnet is the subnet to which the instance is assigned.  Only
	// specified when creating CN instances.
	Subnet string `yaml:"subnet"`

	// SubnetKey is the subnet identifier to which the instance
	// is assigned.
	SubnetKey string `yaml:"subnet_key"`

	// SubnetUUID is the subnet ID of the subnet to which the instance is
	//  assinged.
	SubnetUUID string `yaml:"subnet_uuid"`

	// PrivateIP represents the private IP address of an instance.  Only
	// specified when creating CN instances.
	PrivateIP string `yaml:"private_ip"`

	// PublicIP represents the current statu of the assignation of a Public
	// IP.
	PublicIP bool `yaml:"public_ip"`
}

NetworkResources contains all the networking information for an instance.

type NetworkStat

type NetworkStat struct {
	NodeIP  string `yaml:"ip"`
	NodeMAC string `yaml:"mac"`
}

NetworkStat contains information about a single network interface present on a ciao compute or network node.

type NodeConnected

type NodeConnected struct {
	Connected NodeConnectedEvent `yaml:"node_connected"`
}

NodeConnected represents the unmarshalled version of the contents of an SSNTP ssntp.NodeConnected event payload. This event is sent by the scheduler to the controller to inform it that a node has just connected.

type NodeConnectedEvent

type NodeConnectedEvent struct {
	// SSNTP UUID of the agent running on that node.
	NodeUUID string `yaml:"node_uuid"`

	// The type of the node, e.g., NetworkNode or ComputeNode.
	NodeType Resource `yaml:"node_type"`
}

NodeConnectedEvent contains information about a node that has either just connected or disconnected.

type NodeDisconnected

type NodeDisconnected struct {
	Disconnected NodeConnectedEvent `yaml:"node_disconnected"`
}

NodeDisconnected represents the unmarshalled version of the contents of an SSNTP ssntp.NodeDisconnected event payload. This event is sent by the scheduler to the controller to inform it that a node has just disconnected.

type Persistence

type Persistence string

Persistence represents the persistency of an instance, i.e., whether that instance should be restarted after certain events have occurred, e.g., the node on which the instance runs is rebooted. It's not currently implemented in ciao-launcher.

type PublicIPCommand

type PublicIPCommand struct {
	ConcentratorUUID string `yaml:"concentrator_uuid"`
	TenantUUID       string `yaml:"tenant_uuid"`
	InstanceUUID     string `yaml:"instance_uuid"`
	PublicIP         string `yaml:"public_ip"`
	PrivateIP        string `yaml:"private_ip"`
	VnicMAC          string `yaml:"vnic_mac"`
}

PublicIPCommand contains information about a IP and its associated data.

type PublicIPEvent

type PublicIPEvent struct {
	ConcentratorUUID string `yaml:"concentrator_uuid"`
	InstanceUUID     string `yaml:"instance_uuid"`
	PublicIP         string `yaml:"public_ip"`
	PrivateIP        string `yaml:"private_ip"`
}

PublicIPEvent contains the basic information of Public IP event.

type PublicIPFailureReason

type PublicIPFailureReason string

PublicIPFailureReason represents the potential AssignPublicIP/ReleasePublicIP commands failure reasons.

func (PublicIPFailureReason) String

func (r PublicIPFailureReason) String() string

type Ready

type Ready struct {
	// NodeUUID is the SSNTP UUID assigned to the ciao-launcher instance
	// that transmitted the READY frame.
	NodeUUID string `yaml:"node_uuid"`

	// Total amount of RAM available on a CN or NN
	MemTotalMB int `yaml:"mem_total_mb"`

	// Memory currently available on a CN or NN, computed from
	// proc/meminfo:MemFree + Active(file) + Inactive(file)
	MemAvailableMB int `yaml:"mem_available_mb"`

	// Size of the CN/NN RootFS in MB
	DiskTotalMB int `yaml:"disk_total_mb"`

	// MBs available in the RootFS of the CN/NN
	DiskAvailableMB int `yaml:"disk_available_mb"`

	// Load of CN/NN, taken from /proc/loadavg (Average over last minute
	// reported).
	Load int `yaml:"load"`

	// Number of CPUs present in the CN/NN.  Derived from the number of
	// cpu[0-9]+ entries in /proc/stat.
	CpusOnline int `yaml:"cpus_online"`

	// Array containing one entry for each network interface present on the
	// CN/NN
	Networks []NetworkStat

	// Hostname of the CN/NN
	NodeHostName string `yaml:"hostname"`
}

Ready represents the unmarshalled version of the contents of an SSNTP READY payload. The structure contains information about the state of an NN or a CN on which ciao-launcher is running.

func (*Ready) Init

func (s *Ready) Init()

Init initialises the Ready structure.

type RequestedResource

type RequestedResource struct {
	// Type specifies the type of the resource, e.g., VCPUs.
	Type Resource `yaml:"type"`

	// Value specifies the integer value associated with that resource.
	Value int `yaml:"value"`

	// ValueString is an optional string format value instead of integer
	ValueString string `yaml:"value_string,omitempty"`

	// Mandatory indicates whether a resource is mandatory or not.
	Mandatory bool `yaml:"mandatory"`
}

RequestedResource is used to specify an individual resource contained within a Start or Restart command. Example of resources include number of VCPUs or MBs of RAM to assign to an instance

type Resource

type Resource string

Resource represents the name of a resource in a StartCmd structure

type Restore

type Restore struct {
	Restore RestoreCmd `yaml:"restore"`
}

Restore represents the SSNTP Restore command payload.

type RestoreCmd

type RestoreCmd struct {
	WorkloadAgentUUID string `yaml:"workload_agent_uuid"`
}

RestoreCmd contains the nodeID of a SSNTP Agent.

type SSNTPNode

type SSNTPNode struct {
	SSNTPUUID   string `yaml:"ssntp_node_uuid"`
	SSNTPRole   string `yaml:"ssntp_role"`
	TxTimestamp string `yaml:"tx_timestamp"`
	RxTimestamp string `yaml:"rx_timestamp"`
}

SSNTPNode contains information about a node through which a SSNTP frame has passed.

type Start

type Start struct {
	// Start contains information about the instance to create.
	Start StartCmd `yaml:"start"`
}

Start represents the unmarshalled version of the contents of a SSNTP START payload. The structure contains enough information to create and launch a new CN or NN instance.

type StartCmd

type StartCmd struct {
	// TenantUUID is the UUID of the tenant to which the new instance will
	// belong.
	TenantUUID string `yaml:"tenant_uuid"`

	// InstanceUUID is the UUID of the instance itself.
	InstanceUUID string `yaml:"instance_uuid"`

	// DockerImage is the name of the docker base image from which the
	// container will be created.  It should match the name of an
	// existing image in the docker registry.  Only used for docker
	// instances.
	DockerImage string `yaml:"docker_image"`

	// FWType indicates the type of firmware needed to boot the instance.
	// Only used for qemu instances.
	FWType Firmware `yaml:"fw_type"`

	// InstancePersistence is the persistence type for the instance.
	InstancePersistence Persistence `yaml:"persistence"`

	// VMType indicates whether we are creating a qemu or docker instance.
	VMType Hypervisor `yaml:"vm_type"`

	// Networking contains all the information required to set up networking
	// for the new instance.
	Networking NetworkResources `yaml:"networking"`

	// Storage contains all the information required to attach or boot
	// from storage for the new instance.
	Storage []StorageResource `yaml:"storage,omitempty"`

	// Requirements indicates what resources are needed for this workload
	Requirements WorkloadRequirements `yaml:"requirements"`

	// Restart is set to true if the payload represents a request to
	// restart an existing instance on a new node.
	Restart bool
}

StartCmd contains the information needed to start a new instance.

type StartFailureReason

type StartFailureReason string

StartFailureReason denotes the underlying error that prevented an SSNTP START command from launching a new instance on a CN or a NN. Most, but not all, of these errors are returned by ciao-launcher

func (StartFailureReason) IsFatal

func (r StartFailureReason) IsFatal() bool

IsFatal indicates that the failure should be treated as a fatal failure indicating the instance did not start.

func (StartFailureReason) String

func (r StartFailureReason) String() string

type Stat

type Stat struct {
	// The UUID of the launcher instance from which the Stats structure
	// originated
	NodeUUID string `yaml:"node_uuid"`

	// The Status of the node, e.g., READY or FULL
	Status string `yaml:"status"`

	// Total amount of RAM available on a CN or NN
	MemTotalMB int `yaml:"mem_total_mb"`

	// Memory currently available on a CN or NN, computed from
	// proc/meminfo:MemFree + Active(file) + Inactive(file)
	MemAvailableMB int `yaml:"mem_available_mb"`

	// Size of the CN/NN RootFS in MB
	DiskTotalMB int `yaml:"disk_total_mb"`

	// MBs available in the RootFS of the CN/NN
	DiskAvailableMB int `yaml:"disk_available_mb"`

	// Load of CN/NN, taken from /proc/loadavg (Average over last minute
	// reported
	Load int `yaml:"load"`

	// Number of CPUs present in the CN/NN.  Derived from the number of
	// cpu[0-9]+ entries in /proc/stat
	CpusOnline int `yaml:"cpus_online"`

	// Hostname of the CN/NN
	NodeHostName string `yaml:"hostname"`

	// Array containing one entry for each network interface present on the
	// CN/NN
	Networks []NetworkStat

	// Array containing statistics information for each instance hosted by
	// the CN/NN
	Instances []InstanceStat
}

Stat represents a snapshot of the state of a compute or a network node. This information is sent periodically by ciao-launcher to the scheduler.

func (*Stat) Init

func (s *Stat) Init()

Init initialises instances of the Stat structure.

type Stop

type Stop struct {
	// Stop contains information about the instance to stop.
	Stop StopCmd `yaml:"stop"`
}

Stop represents the unmarshalled version of the contents of a SSNTP STOP payload. The structure contains enough information to stop a CN or NN instance.

type StopCmd

type StopCmd struct {
	// InstanceUUID is the UUID of the instance to stop
	InstanceUUID string `yaml:"instance_uuid"`

	// WorkloadAgentUUID identifies the node on which the instance is
	// running.  This information is needed by the scheduler to route
	// the command to the correct CN/NN.
	WorkloadAgentUUID string `yaml:"workload_agent_uuid"`

	// Stop is true if the instance is being stopped rather than deleted.
	// In this case the delete command should only delete the instance from
	// the node to which it is sent and not the entire cluster.
	Stop bool
}

StopCmd contains the information needed to stop a running instance.

type StorageResource

type StorageResource struct {
	// ID is passed to the Block Driver to operate on the resource
	ID string `yaml:"id,omitempty"`

	// Bootable indicates that this is a bootable storage device.
	Bootable bool `yaml:"boot,omitempty"`

	// BootIndex hints to the hypervisor a bootable disk order among
	// multple storage resources
	BootIndex int `yaml:"boot_index,omitempty"`

	// Ephemeral indicates whether this storage should only last as long as
	// the instance
	Ephemeral bool `yaml:"ephemeral,omitempty"`

	// Local indicates if the storage resource is local (ephemeral,
	// auto-created by launcher implied) or backed by the volume service
	Local bool `yaml:"local,omitempty"`

	// Swap optionally indicates the storage resource is intended for
	// use as a linux swap device (attempt swapon via cloud-init
	Swap bool `yaml:"swap,omitempty"`

	// Tag is an arbitrary text identifier
	Tag string `yaml:"tag,omitempty"`

	// Size is the requested size for an auto-created storage resource
	Size int `yaml:"size,omitempty"`
}

StorageResource represents a requested storage resource for a workload.

type StorageType

type StorageType string

StorageType is used to define the configuration backend storage type.

const (
	// Filesystem defines the local filesystem backend storage type for the
	// configuration data.
	Filesystem StorageType = "file"
)

func (StorageType) String

func (s StorageType) String() string

type TenantAddedEvent

type TenantAddedEvent struct {
	// The UUID of the ciao-launcher that generated the event.
	AgentUUID string `yaml:"agent_uuid"`

	// The IP address of the CN on which the originating agent runs.
	AgentIP string `yaml:"agent_ip"`

	// The UUID of the tenant.
	TenantUUID string `yaml:"tenant_uuid"`

	// The subnet of the Tenant.
	TenantSubnet string `yaml:"tenant_subnet"`

	// The UUID of the concentrator.
	ConcentratorUUID string `yaml:"concentrator_uuid"`

	// The IP address of the concentrator.
	ConcentratorIP string `yaml:"concentrator_ip"`

	// The UUID of the subnet.
	SubnetKey int `yaml:"subnet_key"`
}

TenantAddedEvent is populated by ciao-launcher whenever it creates or removes a local tunnel for a tenant on a CN. This information is sent to a CNCI instance, via the scheduler. The cnci-agent then does its magic.

type Trace

type Trace struct {
	Frames []FrameTrace
}

Trace represents the unmarshalled version of the contents of an SSNTP ssntp.TraceReport event. The structure contains tracing information for an SSNTP frame.

type VolumeCmd

type VolumeCmd struct {
	// InstanceUUID is the UUID of the instance to which the volume is to be
	// attached.
	InstanceUUID string `yaml:"instance_uuid"`

	// VolumeUUID is the UUID of the volume to attach.
	VolumeUUID string `yaml:"volume_uuid"`

	// WorkloadAgentUUID identifies the node on which the instance is
	// running.  This information is needed by the scheduler to route
	// the command to the correct CN/NN.
	WorkloadAgentUUID string `yaml:"workload_agent_uuid"`
}

VolumeCmd contains all the information needed to attach a volume to or detach a volume from an existing instance.

type WorkloadRequirements

type WorkloadRequirements struct {
	// MemMB species the required memory for this workload in MiB
	MemMB int `yaml:"mem_mb"`

	// VCPUs specifies the required number of CPUs for the workload
	VCPUs int `yaml:"vcpus"`

	// NodeID specifies the node that the instance must be scheduled on
	NodeID string `yaml:"node_id,omitempty"`

	// Hostname specifies the node that the instance must be scheduled on
	Hostname string `yaml:"hostname,omitempty"`

	// NetworkNode specifies that this workload must be scheduled on a network node
	NetworkNode bool `yaml:"network_node,omitempty"`

	// Privileged indicates that this container workload should be run with increased
	// permissions
	Privileged bool `yaml:"privileged,omitempty"`
}

WorkloadRequirements contains the requirements to execute the workload

Jump to

Keyboard shortcuts

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