smartos-live
repository·master·Indexed 23 days ago
https://github.com/tritondatacenter/smartos-liveThe central repository for building the SmartOS platform image. It orchestrates the assembly of the illumos-joyent core OS, third-party software via illumos-extra, and SmartOS-specific utilities such as vmadm and imgadm. The repository provides a gmake-based build system to produce platform tarballs, ISO, and USB images, including support for debug builds and release engineering targets for SmartOS and Triton platform images.
What's inside smartos-live
- fwadm is an administrative tool used for managing VM firewalls within the SmartOS ecosystem.
Manage SmartOS nic tags with nictagadm
masterThe
nictagadmtool is used to manage SmartOS nic tags. Nic tags allow you to refer to a physical network interface (NIC) using a logical name instead of its MAC address or interface name. These tags are used byvmadm(8)and the SmartOS configuration file as identifiers.Key Behaviors:
- MTU Management: The MTU of the physical device is set to the maximum MTU specified across all associated nic tags. Note that the MTU is not updated live; it requires a system start to apply.
- Persistence: On nodes with
/usbkeypresent,nictagadmupdates/usbkey/configand attempts to update the original USB key to ensure tags persist across reboots. On nodes without/usbkey, tags must be passed as boot parameters to persist. - Etherstubs: Using the
-lflag creates an etherstub, which is a virtual switch on the local host.
Manage SmartOS Platform Images with piadm
masterThe
piadm(8)command is used to manage SmartOS Platform Images (PIs) and boot images on ZFS pools. It allows for installing, activating, listing, and destroying platform images.Note on Verbosity:
- Use
-vbefore a command for verbose output. - Use
-vvbefore a command for verbose output plus the shell's-xflag (showing all commands run by the script).
- Use
Manage SmartOS firewall rules with fwadm
masterThe
fwadmtool is used to manage firewall data on a SmartOS system, specifically focusing on firewall rules and remote VMs.Core Concepts
- Firewall Rules: These are JSON objects containing a rule written in a Domain-Specific Language (DSL). Rules only apply to VMs where the
firewall_enabledproperty is set totrue. - Scoping:
- Rules with an
owner_uuidare scoped to VMs with a matching owner. - Global rules (ownerless) apply to all VMs described in their targets.
- Rules with an
- Remote VMs: JSON objects representing VMs on other SmartOS hosts. They allow rules to reference external entities.
- Automatic Reloading: Adding, updating, or deleting firewall rules or remote VMs will automatically reload the firewalls of any affected VMs.
- Firewall Rules: These are JSON objects containing a rule written in a Domain-Specific Language (DSL). Rules only apply to VMs where the
Manage SmartOS virtual machine images with imgadm
masterThe
imgadmtool is used to import and manage virtual machine images on a SmartOS system. These images (often called 'datasets') are snapshots of pre-installed virtual machines designed for repeated deployment.An image consists of two parts:
- A compressed ZFS snapshot (either a ZFS filesystem for OS-level zones or a ZFS zvol for KVM VMs).
- A JSON manifest containing metadata describing the contents.
Images are primarily identified by a unique UUID.
Use mdata-client to manage guest metadata
masterThe
mdata-clienttools allow guests (SmartOS Zones or KVM virtual machines) to retrieve and manipulate metadata provided by the SmartOS or SmartDataCenter (SDC) hypervisor. The hypervisor provides a set of base metadata keys, but guests can also interact with arbitrary user-provided metadata.Available Commands
mdata-list: Lists custom metadata keys currently in the metadata store.mdata-get: Retrieves the value associated with a specific metadata key.mdata-put: Sets the value for a specific metadata key.mdata-delete: Removes a metadata key from the store.
Use vminfo to check vminfod service health
masterThe
vminfo(8)tool is a client utility used to interface with thevminfodservice via its HTTP interface. It is primarily intended for administrators to check service health and status interactively.Note: This tool is not intended for stable programmatic use. For automation or programmatic access to
vminfod, use thevmadm(8)command or thevminfod/clientNode.js library instead.Use imgadm to manage VM images
masterimgadmis a tool used on local headnodes or compute nodes to manage VM images. It can import and destroy local images and provide information on image usage. To discover and install new images,imgadmcommunicates with a server implementing the IMGAPI. By default, it uses the SmartOS Images repository at https://images.smartos.org.Use vmadm to manage SmartOS virtual machines
masterThe
vmadmtool is the primary interface for interacting with virtual machines on a SmartOS system. You can use it to create, inspect, modify, and delete virtual machines on the local system. Most operations are performed using the VM's UUID as the primary reference. SmartOS includes bash tab-completion rules for UUIDs to simplify command entry.Note on LX VMs: Support for LX VMs is currently limited and experimental. Functionality may change significantly without notice, and documentation for LX-specific features is currently incomplete. However, most properties applicable to OS VMs also apply to LX VMs.
/usr/vm/sbin/vmadm <command> [-d] [-v] [command-specific arguments]Overview of SmartOS components
masterSmartOS is composed of several distinct parts managed within the
smartos-liverepository:- smartos-live: The root repository containing build logic and SmartOS-specific tools like
vmadmandimgadm. - illumos-joyent: The core operating system (kernel, libraries, and user commands). It is located in
projects/illumosand must be used instead of stockillumos-gate. - illumos-extra: Third-party software (e.g., GNU binutils, OpenSSL, bash, curl, Node.js) maintained via patches applied to stock releases. It is located in
projects/illumos-extra. - Local Projects: Extra projects located in
projects/local/(e.g.,illumos-kvm,mdata-client) that implement specific Makefile targets.
- smartos-live: The root repository containing build logic and SmartOS-specific tools like
What is vmadmd and how does it function?
masterThe
vmadmddaemon runs in a SmartOS global zone to support thevmadm(8)command. It manages long-running tasks and state changes that a single CLI execution cannot handle, such as maintaining connections or waiting for timeouts.Key responsibilities include:
- KVM Autobooting: Automatically starting KVM VMs based on zone properties.
- VNC Console Exposure: Redirecting internal VM VNC unix sockets to TCP sockets for external access.
- Stop/Reboot Management: Handling timeouts to ensure VMs eventually stop or reboot even if the guest kernel is unresponsive.
- QMP Command Proxying: Exposing QEMU Machine Protocol commands via an HTTP interface.
The daemon exposes these functions through an HTTP server listening on the unix socket
/tmp/vmadmd.http. This interface is private and intended for use byvmadm(8).Guidelines for changing public interfaces and mapfiles
masterPublic Interfaces
When modifying a standard command, library function, or mapfile section, evaluate backwards compatibility:
- Test old binaries against the new library.
- Test shell scripts that rely on specific command output formats.
- Check against relevant industry standards.
Mapfiles
- Public Mapfiles: Do not add public mapfile versions directly to
illumos-joyent. They should be contributed viaillumos-gate. - Private Mapfiles: If a library is specific to
illumos-joyent, it may be versioned privately before being moved to a public version upon upstreaming toillumos.