Managing packages

Modified: 28 Apr 2022 01:26 UTC

In Triton, a package specifies the resources allocated to an instance. These resources include:

Unlike in SDC 6.5, in Triton networks are optional components of packages.

Package details

Traits

Traits can be used to associate packages with Server types. For more information, including details on how to set traits for packages, images, and compute nodes, please see the compute node, image, and package traits document.

Disk considerations

SmartOS and LX Branded containers are allocated a quota based on the disk values chosen for the package. This disk is allocated as needed up to the quota. Due to the way they are virtualized, HVM containers are allocated their entire disk at once.

HVMs will have multiple disks associated with them. Infrastructure containers running SmartOS have only one. The reason for the difference is that the OS is allocated as Disk0 and the data storage is allocated as Disk1. All HVMs provisioned from the same image (ie, CentOS 2.6.1) will have the same size for Disk0. The data disk, Disk1, will be sized according to the disk size provided in the package.

Processes considerations

The Processes field is used only for infrastructure containers running SmartOS. Instances based on HVMs run only one process at the SmartOS level, the qemu emulator for kvm instances, and bhyve for bhyve instances.

CPU considerations

The value defined for vCPU is passed along to the qemu or bhyve process and is used to allocate the maximum number of CPUs that the hypervisor can use. The value defined for CPU_CAP is enforced on all processes in a SmartOS instance, and for the qemu process in an HVM.

Swap considerations

The amount of swap space allocated to an infrastructure container running SmartOS will be taken out of real memory, and will amount to half of the value provided. For example, a container running SmartOS that provides 1GB of RAM and 2GB of swap will create an instance that has access to 2GB of real memory, of which 1GB will appear as swap.

In all Triton packages, the max_swap must be at least two times the size of max_physical_memory. For example, if max_physical_memory is set to 4GB, the max_swap must be at least 8GB. This allows for overhead memory to be allocated during startup.

Sizing considerations

Please see sizing Triton packages to learn more about how to size packages for your application.

Resizing considerations

Resizing has been an option for SmartOS and Docker, but the Triton CLI version 7.1.1 enables resizing disks with Bhyve HVMs. Please see configuring Triton packages to learn how to configure packages that support flexible disk space.

Brand

You have the option to set the brand attribute to specify the brand to use for a provisioning request. If the image does not have a brand requirement specified, the package brand will be used. If the image has a different brand requirement from that of the package, it will result in a brand mismatch error.

Container images typically have a brand defined in the image ("lx", "docker", "joyent"). It is therefore unnecessary to have brand-specific packages for containers. For HVMs, it is possible to have "hybrid" images that support both "bhyve" and "kvm" brands. Such images do not have a predefined brand.

To provision bhyve VMs with hybrid images, it will be necessary to use a package that has the brand attribute set to "bhyve". When neither the package nor the image has a brand defined, the HVM image will be provisioned as a KVM instance by default.

PAPI - The Package API

You interact with the package API (PAPI) through the API endpoint, which is based off the IP address assigned to the PAPI instance, or via the sdc-papi command.

For example, to get details on the package with the UUID of 9fcd9ab7-bd07-cb3c-9f9a-ac7ec3aa934e, you simply need to:

headnode# sdc-papi --no-headers /packages/9fcd9ab7-bd07-cb3c-9f9a-ac7ec3aa934e
{
  "name": "g3-devtier-0.25-smartos",
  "version": "1.0.3",
  "active": true,
  "cpu_cap": 25,
  "description": "DevTier - Micro 0.25 GB RAM 0.125 vCPU and bursting 16 GB Disk",
  "max_lwps": 4000,
  "max_physical_memory": 256,
  "max_swap": 512,
  "common_name": "DevTier 0.25",
  "quota": 16384,
  "networks": [
    "42325ea0-eb62-44c1-8eb6-0af3e2f83abc",
    "c8cde927-6277-49ca-82a3-741e8b23b02f"
  ],
  "zfs_io_priority": 100,
  "fss": 25,
  "cpu_burst_ratio": 0.5,
  "ram_ratio": 1.995012469,
  "overprovision_cpu": 2,
  "overprovision_memory": 1,
  "billing_tag": "g3-devtier-0.25-smartos",
  "uuid": "9fcd9ab7-bd07-cb3c-9f9a-ac7ec3aa934e",
  "created_at": "2014-03-26T00:11:19.192Z",
  "updated_at": "2014-03-31T16:38:00.420Z",
  "default": false,
  "group": "Standard",
  "v": 1
}

Configuring packages

Please see configuring Triton packages to learn how to create, delete, and modify packages through both PAPI and the Operations Portal.

Sizing packages