### Check Server Setup Status using sdc-server list Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This command lists all servers and their setup status. The 'SETUP' column indicates whether a server has been configured. 'false' means it requires setup, while 'true' means it is ready. ```bash [root@headnode (coal) ~]# sdc-server list HOSTNAME UUID VERSION SETUP STATUS RAM ADMIN_IP 00-0c-29-e9-7b-8f 564dd681-2326-3f07-82ba-e010ebe97b8f 7.0 false running 1047 10.192.0.43 headnode 564dfd57-1dd4-6fc0-d973-4f137ee12afe 7.0 true running 6143 10.192.0.7 [root@headnode (coal) ~]# ``` -------------------------------- ### Initiate Server Setup using sdc-server Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This command initiates the server setup process for a given server UUID. It calls the CNAPI endpoint and waits for the setup job to complete successfully. The output shows the job ID, duration, and completion status. ```bash [root@headnode (coal) ~]# sdc-server setup -s 564dd681-2326-3f07-82ba-e010ebe97b8f Job(14896857-1cd1-404f-8fd0-ba34d3da30a6) - 322.1s - completed successfully [root@headnode (coal) ~]# ``` -------------------------------- ### Check Server Setup Status using CNAPI Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This command retrieves the 'setup' field for a specific server from CNAPI. It provides a direct boolean value indicating the server's setup status, useful for scripting and automation. ```bash [root@headnode (coal) ~]# sdc-cnapi /servers/564dd681-2326-3f07-82ba-e010ebe97b8f | json -H setup false [root@headnode (coal) ~]# ``` -------------------------------- ### Set up CloudAPI for Development Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/coal-setup.md This command installs CloudAPI, providing self-serve API access to Triton. It creates a zone for CloudAPI and is a prerequisite for development and testing against the CloudAPI. ```bash root@headnode (coal-1) ~]# sdcadm post-setup cloudapi cloudapi0 zone created ``` -------------------------------- ### Setup headnode with a boot-time networking file Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/coal-post-setup-fabrics.md This process involves mounting the USB key, generating a networking configuration file for the headnode's boot process, and then unmounting the USB key. ```APIDOC ## POST /sdc-usbkey/mount, POST /sdc-login, POST /sdc-usbkey/unmount ### Description Configures the headnode's boot-time networking by creating a `networking.json` file on the USB key. ### Method POST ### Endpoint - `/sdc-usbkey/mount` - `/sdc-login` (with specific arguments for `dhcpd` and the networking file path) - `/sdc-usbkey/unmount` ### Parameters #### Request Body (for `/sdc-login`) - **service** (string) - Required - The service to log into, typically 'dhcpd'. - **file_path** (string) - Required - The path to the networking configuration file, e.g., `/opt/smartdc/booter/bin/hn-netfile`. - **output_destination** (string) - Required - The destination path for the output, e.g., `/mnt/usbkey/boot/networking.json`. ### Response #### Success Response (200) Indicates successful mounting, login/file creation, and unmounting operations. #### Response Example ``` /mnt/usbkey ``` ``` -------------------------------- ### Install SmartOS via Virtual Media and USB Image Source: https://github.com/tritondatacenter/triton/wiki/FAQ This process outlines installing SmartOS on a server remotely using KVM over IP. It involves downloading the SmartOS ISO, booting from virtual media, using the 'noimport' option, and then using `curl` and `dd` to write a SmartOS USB image to the server's OS disk. ```shell cd /tmp && curl -k -C - -O https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos-latest.iso # ... (boot from virtual media, select 'noimport') ... # login as root/root cd /tmp && curl -k -C - -O https://us-east.manta.joyent.com/Joyent_Dev/public/SmartDataCenter/usb-latest.tgz && tar xzvf usb-latest.tgz # display disks using 'format /mnt/usbkey/boot/networking.json sdc-usbkey unmount ``` -------------------------------- ### Manage CloudAPI with sdcadm Source: https://context7.com/tritondatacenter/triton/llms.txt Commands to set up and manage the CloudAPI service. This includes initial setup and enabling specific features for development environments. CloudAPI is the customer-facing API for provisioning and managing instances. ```bash # Set up CloudAPI in a CoaL or production environment sdcadm post-setup cloudapi # Enable head node provisioning for development/testing sdcadm post-setup dev-headnode-prov ``` -------------------------------- ### Create Underlay NIC for Headnode Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/coal-post-setup-fabrics.md Creates an underlay network interface for the headnode. This command uses 'sdc-napi' to find the UUID of the 'sdc_underlay' network and 'sysinfo' to get the headnode's UUID, then passes these to 'sdcadm post-setup underlay-nics'. ```bash sdcadm post-setup underlay-nics \ $(sdc-napi /networks?name=sdc_underlay | json -H 0.uuid) \ $(sysinfo | json UUID) ``` -------------------------------- ### PXE Boot Menu Configuration (menu.lst) Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This snippet shows the configuration for a PXE boot menu, defining boot options, kernel parameters, and modules required for booting a live 64-bit system. It includes settings for console, network interfaces, and optional debugging modes. ```boot default 0 timeout 5 min_mem64 1024 variable os_console ttyb serial --unit=1 --speed=115200 --word=8 --parity=no --stop=1 terminal composite color cyan/blue white/blue title Live 64-bit kernel$ /os/20160517T105654Z/platform/i86pc/kernel/amd64/unix -B rabbitmq=guest:guest:10.192.0.20:5672,rabbitmq_dns=guest:guest:rabbitmq.coal.joyent.us:5672,admin_nic=00:0c:29:e9:7b:8f,console=${os_console},${os_console}-mode="115200,8,n,1,-" module$ /os/20160517T105654Z/platform/i86pc/amd64/boot_archive type=rootfs name=ramdisk module$ /os/20160517T105654Z/platform/i86pc/amd64/boot_archive.hash type=hash name=ramdisk module$ /bootfs/000c29e97b8f/networking.json type=file name=networking.json module$ /bootfs/000c29e97b8f/networking.json.hash type=file name=networking.json.hash title Live 64-bit +kmdb kernel$ /os/20160517T105654Z/platform/i86pc/kernel/amd64/unix -d -k -B rabbitmq=guest:guest:10.192.0.20:5672,rabbitmq_dns=guest:guest:rabbitmq.coal.joyent.us:5672,admin_nic=00:0c:29:e9:7b:8f,console=${os_console},${os_console}-mode="115200,8,n,1,-" module$ /os/20160517T105654Z/platform/i86pc/amd64/boot_archive type=rootfs name=ramdisk module$ /os/20160517T105654Z/platform/i86pc/amd64/boot_archive.hash type=hash name=ramdisk module$ /bootfs/000c29e97b8f/networking.json type=file name=networking.json module$ /bootfs/000c29e97b8f/networking.json.hash type=file name=networking.json.hash title Live 64-bit Rescue (no importing zpool) kernel$ /os/20160517T105654Z/platform/i86pc/kernel/amd64/unix -B rabbitmq=guest:guest:10.192.0.20:5672,rabbitmq_dns=guest:guest:rabbitmq.coal.joyent.us:5672,admin_nic=00:0c:29:e9:7b:8f,noimport=true,console=${os_console},${os_console}-mode="115200,8,n,1,-" module$ /os/20160517T105654Z/platform/i86pc/amd64/boot_archive type=rootfs name=ramdisk ``` -------------------------------- ### Download Triton Production Installation Images Source: https://context7.com/tritondatacenter/triton/llms.txt These commands download the latest production installation images for Triton DataCenter. It includes options for downloading a USB image (tar.gz), an ISO image, and an iPXE installer. The -C - option in curl allows for resuming interrupted downloads. ```bash curl -C - -O https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/usb-latest.tgz ``` ```bash curl -C - -O https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/iso-latest.iso ``` ```bash curl -C - -O https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/ipxe-latest.tgz ``` -------------------------------- ### Retrieving Default Boot Parameters (Shell) Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This command fetches the default boot parameters for a CN when specific parameters for the server are not found. It includes information such as the platform image, kernel arguments for services like RabbitMQ, kernel flags, boot modules, and console settings. These defaults are essential for a successful boot process. ```shell [root@headnode (coal) ~]# sdc-cnapi /boot/default | json -H { "platform": "20160517T105654Z", "kernel_args": { "rabbitmq": "guest:guest:10.192.0.20:5672", "rabbitmq_dns": "guest:guest:rabbitmq.coal.joyent.us:5672" }, "kernel_flags": {}, "boot_modules": [], "default_console": "serial", "serial": "ttyb" } [root@headnode (coal) ~]# ``` -------------------------------- ### Update sdcadm to Latest Version Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/coal-setup.md This command updates the sdcadm utility to the latest available version. It downloads the update and runs the installer, providing a log of the installation process. ```bash [root@headnode (coal-1) ~]# sdcadm --version sdcadm 1.4.4 (release-20150205-20150205T060457Z-g7d76790) [root@headnode (coal-1) ~]# sdcadm self-update --latest Update to sdcadm 1.5.0 (master-20150211T134112Z-gef31015) Download update from https://updates.tritondatacenter.com Run sdcadm installer (log at /var/sdcadm/self-updates/20150217T234531Z/install.log) Updated to sdcadm 1.5.0 (master-20150211T134112Z-gef31015, elapsed 7s) ``` -------------------------------- ### Download Latest Triton iPXE Release TGZ Source: https://github.com/tritondatacenter/triton/blob/master/README.md This command downloads the latest Triton iPXE release image in TGZ format. This is used for network-based installations via iPXE. Ensure curl is installed. ```bash https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/ipxe-latest.tgz ``` -------------------------------- ### Makefile Package Naming Example Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/release-engineering.md This example demonstrates how to define a `RELEASE_TARBALL` variable in a Makefile using a `STAMP` variable, likely defined in an included Makefile.defs file. This promotes consistent package naming according to the Triton versioning guidelines. ```makefile ENGBLD_REQUIRE := $(shell git submodule update --init deps/eng) include ./deps/eng/tools/Makefile.defs # provides "STAMP" ... RELEASE_TARBALL = $(NAME)-pkg-$(STAMP).tar.gz ``` -------------------------------- ### iPXE Boot Configuration for Triton Compute Nodes Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This snippet shows the necessary files to configure an iPXE server for booting Triton Compute Nodes. It includes an initial .ipxe instruction file, the Triton-specific iPXE binary, and a Triton-specific iPXE instruction file designed to bypass certain network interfaces. ```ipxe #!ipxe set base-url https://example.com/triton-cn-ipxe kernel ${base-url}/ipxe.lkrn module ${base-url}/default-no0.ipxe boot ``` ```ipxe # Skip BMaaS configuration NICs and instead locate the Triton ADMIN network. ifstat # Skip net0 and net2 dhcp net1 && autoboot net1 || dhcp net3 && autoboot net3 || dhcp net4 && autoboot net4 || dhcp net5 && autoboot net5 || dhcp net6 && autoboot net6 || dhcp net7 && autoboot net7 ``` -------------------------------- ### Get and Set SAPI Instance Configuration Source: https://context7.com/tritondatacenter/triton/llms.txt Demonstrates retrieving and modifying the configuration metadata for a specific SAPI instance. This includes getting combined config metadata and updating application-level variables. Changes are managed by config-agent. ```bash # Get combined config metadata for a specific instance (e.g., napi0) sdc-sapi /configs/$(vmadm lookup -1 alias=napi0) | json -H metadata # Set an application configuration variable sdc-sapi /applications/$(sdc-sapi /applications?name=sdc | json -H 0.uuid) \ -X PUT -d '{"metadata": {"account_allowed_dcs": true}}' # Verify the setting sdc-sapi /applications/$(sdc-sapi /applications?name=sdc | json -H 0.uuid) \ | json -Ha metadata.account_allowed_dcs # Delete a configuration variable sdc-sapi /applications/$(sdc-sapi /applications?name=sdc | json -H 0.uuid) \ -X PUT -d '{"action": "delete", "metadata": {"account_allowed_dcs": null}}' ``` -------------------------------- ### Create Zone via Web Interface Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/build-zone-setup-triton.md Instructions for creating a virtual machine zone using the Triton DataCenter web administration UI. This method involves navigating through the UI, selecting options for the zone's configuration, and provisioning the machine. -------------------------------- ### Configure VMware Networking for CoaL (Linux) Source: https://context7.com/tritondatacenter/triton/llms.txt This script configures VMware networking for CoaL on Linux systems. It downloads and executes a setup script from a remote URL using curl and pipes the output to sudo bash for execution. This is suitable for Linux-based environments requiring VMware network setup. ```bash curl -s https://raw.githubusercontent.com/joyent/sdc/master/tools/coal-linux-vmware-setup | sudo bash ``` -------------------------------- ### iPXE Boot Script Configuration (iPXE) Source: https://github.com/tritondatacenter/triton/blob/master/docs/operator-guide/server-setup.md This iPXE script configures the network boot process for the CN. It specifies the kernel to load, along with kernel arguments derived from the boot parameters and network configuration. It also defines the boot archive (ramdisk) and the networking JSON file to be loaded as modules, enabling the CN to boot into its operating system. ```ipxe #!ipxe kernel tftp://${next-server}/os/20160517T105654Z/platform/i86pc/kernel/amd64/unix -B rabbitmq=guest:guest:10.192.0.20:5672,rabbitmq_dns=guest:guest:rabbitmq.coal.joyent.us:5672,admin_nic=00:0c:29:e9:7b:8f,console=ttyb,ttyb-mode="115200,8,n,1,-" module tftp://${next-server}/os/20160517T105654Z/platform/i86pc/amd64/boot_archive type=rootfs name=ramdisk module tftp://${next-server}/os/20160517T105654Z/platform/i86pc/amd64/boot_archive.hash type=hash name=ramdisk module tftp://${next-server}/bootfs/000c29e97b8f/networking.json type=file name=networking.json ``` -------------------------------- ### List VMs and IPs using sdc-vmapi CLI Source: https://context7.com/tritondatacenter/triton/llms.txt Demonstrates how to list all running VMs and their associated IP addresses using the sdc-vmapi CLI. This is useful for network troubleshooting and inventory management. It leverages the VMAPI to retrieve instance details. ```bash # List all VMs with their IPs using the VMAPI through sdc-vmapi CLI sdc-vmapi /vms?state=running | json -H -ga alias nics.0.ip nics.1.ip ``` -------------------------------- ### Download Latest Triton ISO Release Image Source: https://github.com/tritondatacenter/triton/blob/master/README.md This command downloads the latest Triton ISO release image. It is intended for use with the ISO installer method. Ensure you have enough disk space for the download. ```bash https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/iso-latest.iso ``` -------------------------------- ### Build and Deploy Pull Request Changes Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/building.md Shows the process of building and preparing an image from a checked-out pull request. This involves running the 'make all release publish buildimage' command, which compiles the project and generates an image. The output details the build process, including dependency cloning and image building steps, and indicates the location of the built image. ```bash -bash-4.3$ make all release publish buildimage Cloning into 'deps/eng'... remote: Enumerating objects: 177, done. remote: Counting objects: 100% (177/177), done. . . /usr/bin/pfexec /tmp/sdc-manta.git/deps/eng/tools/buildimage/bin/buildimage \ -i 04a48d7d-6bb5-4e83-8c3b-e60a99e0f48f \ -d /tmp/buildimage-manta-deployment-prr-MANTA-4744-20191126T165949Z-gb4cc60e/root \ -m '{"name": "manta-deployment", "description": "Manta deployment tools", "version": "prr-MANTA-4744-20191126T165949Z-gb4cc60e", "tags": {"smartdc_service": true} }' \ \ -p $(echo openldap-client-2.4.44nb2 | sed -e 's/ /,/g') \ -M -S "$(git -C /tmp/sdc-manta.git remote get-url origin)" \ -a \ -P manta-deployment-zfs [ 0.04019809] Starting build for manta-deployment (prr-MANTA-4744-20191126T165949Z-gb4cc60e) . . . cp /tmp/manta-deployment-zfs-prr-MANTA-4744-20191126T165949Z-gb4cc60e.pkgaudit /tmp/sdc-manta.git/bits/manta-deployment /usr/bin/pfexec rm /tmp/manta-deployment-zfs-prr-MANTA-4744-20191126T165949Z-gb4cc60e.zfs.gz /usr/bin/pfexec rm /tmp/manta-deployment-zfs-prr-MANTA-4744-20191126T165949Z-gb4cc60e.imgmanifest /usr/bin/pfexec rm /tmp/manta-deployment-zfs-prr-MANTA-4744-20191126T165949Z-gb4cc60e.pkgaudit /usr/bin/pfexec rm -rf /tmp/buildimage-manta-deployment-prr-MANTA-4744-20191126T165949Z-gb4cc60e -bash-4.3$ ``` -------------------------------- ### Download Latest Triton USB Release Image Source: https://github.com/tritondatacenter/triton/blob/master/README.md This command downloads the latest Triton USB release image using curl. Ensure curl is installed and you have sufficient disk space. The download is resumable. ```bash curl -C - -O https://us-central.manta.mnx.io/Joyent_Dev/public/SmartDataCenter/usb-latest.tgz ``` -------------------------------- ### Create VM using sdc-vmadm Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/build-zone-setup-triton.md Command to create a virtual machine using the `sdc-vmadm` tool with a specified JSON configuration file. This initiates the provisioning process on the Triton headnode. ```bash [root@headnode (uk-1) ~]# sdc-vmadm create -f json Creating VM 60802c6d-e458-612b-bcc5-b472fffad1a2 (job "db55fe3e-a631-4df5-a5e7-18ab9ed11afa") [root@headnode (uk-1) ~]# ``` -------------------------------- ### CNAPI - Compute Node API Source: https://context7.com/tritondatacenter/triton/llms.txt CNAPI manages communication with and management of compute nodes. It handles server registration, setup, boot parameters, and task execution on CNs through the Ur agent. ```APIDOC ## CNAPI - Compute Node API ### Description CNAPI manages communication with and management of compute nodes. It handles server registration, setup, boot parameters, and task execution on CNs through the Ur agent. ### Usage Examples **List all servers in the datacenter:** ```bash sdc-server list ``` **Output:** ``` HOSTNAME UUID VERSION SETUP STATUS RAM ADMIN_IP headnode 564dfd57-1dd4-6fc0-d973-4f137ee12afe 7.0 true running 6143 10.192.0.7 ``` **Get boot parameters for a specific server:** ```bash sdc-cnapi /boot/930896af-bf8c-48d4-885c-6573a94b1853 | json -H ``` **Get default boot parameters:** ```bash sdc-cnapi /boot/default | json -H ``` **Output:** ```json { "platform": "20160517T105654Z", "kernel_args": { "rabbitmq": "guest:guest:10.192.0.20:5672", "rabbitmq_dns": "guest:guest:rabbitmq.coal.joyent.us:5672" }, "kernel_flags": {}, "boot_modules": [], "default_console": "serial", "serial": "ttyb" } ``` **Check if a server is setup:** ```bash sdc-cnapi /servers/564dd681-2326-3f07-82ba-e010ebe97b8f | json -H setup ``` **Setup a new compute node:** ```bash sdc-server setup -s 564dd681-2326-3f07-82ba-e010ebe97b8f ``` **Output:** ``` Job(14896857-1cd1-404f-8fd0-ba34d3da30a6) - 322.1s - completed successfully ``` ``` -------------------------------- ### Build Triton Component using Makefile Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/building.md This snippet demonstrates the typical commands to build a Triton component. It involves setting an environment variable to skip platform validation and then executing common Makefile targets for building and releasing the component. The output includes a component image and manifest in the `./bits` directory. ```bash $ export ENGBLD_SKIP_VALIDATE_BUILD_PLATFORM=true $ make all release publish buildimage ``` -------------------------------- ### Enable Headnode Provisioning on Triton Source: https://github.com/tritondatacenter/triton/blob/master/docs/developer-guide/build-zone-setup-triton.md This command configures the Triton instance to allow the creation of zones directly on the headnode. This is useful for development environments where a dedicated compute node might not be available, but it's not recommended for production. ```bash [root@headnode (coal-1) ~]# sdcadm post-setup dev-headnode-prov Configuring CNAPI to allow headnode provisioning and over-provisioning Refreshing instance cnapi0 config-agent [root@headnode (coal-1) ~]# ```