### Bootstrap Triton Instance with Startup Script Source: https://docs.tritondatacenter.com/public-cloud/api/triton-cli This example demonstrates how to create a Triton instance and execute a script upon startup. It first downloads a Couchbase installation script, then creates a CentOS instance, runs the script to install Couchbase, and finally retrieves the Couchbase dashboard address. Dependencies include `curl` for downloading the script and `triton` CLI for instance management. ```bash curl -sL -o couchbase-install-triton-centos.bash https://raw.githubusercontent.com/misterbisson/couchbase-benchmark/master/bin/install-triton-centos.bash triton instance create \ --name=couch-bench-1 \ $(triton images name=~centos-6 type=lx-dataset -Ho id | tail -1) \ 'Large 16GB' \ --wait \ --script=./couchbase-install-triton-centos.bash triton ssh couch-bench-1 'cat /root/couchbase.txt' ``` -------------------------------- ### Triton Log Archiver Service Setup Help Source: https://docs.tritondatacenter.com/private-cloud/log-management/setup This command displays the help information for the `sdcadm post-setup logarchiver` command. It details the usage, available options for controlling the installation process, and image selection criteria. ```bash [root@headnode (coal) ~]# sdcadm post-setup logarchiver --help Create the "logarchiver" service and a first instance. Usage: sdcadm post-setup logarchiver Options: -h, --help Show this help. -y, --yes Answer yes to all confirmations. -n, --dry-run Do a dry-run. -s SERVER, --server=SERVER Either hostname or uuid of the server on which to create the instance. (By default the headnode will be used.). Image selection (by default latest image on default channel): -i ARG, --image=ARG Specifies which image to use for the first instance. Use "latest" (the default) for the latest available on updates.tritondatacenter.com, "current" for the latest image already in the datacenter (if any), or an image UUID or version. -C ARG, --channel=ARG The updates.tritondatacenter.com channel from which to fetch the image. See `sdcadm channel get` for the default channel. The "logarchiver" service uploads specific Triton log files to a configured Manta object store. ``` -------------------------------- ### Example Automatic Instance Migration Output Source: https://docs.tritondatacenter.com/private-cloud/instances/migrating This is an example output demonstrating the successful execution of an automatic instance migration using `sdc-migrate migrate`. It shows the different stages from reserving the instance to starting the migrated instance. ```text [root@headnode (triton0) ~]# sdc-migrate migrate d167bf4f-a98d-c278-b121-e5b28b6eb8ad # Migration begin running in job 32afebae-de1e-4f25-8002-99286062f91b - reserving instance - syncing data - running: 100% 5.6MB/s - syncing data - running: 100% 1.1kB/s (ETA 4s) - stopping the instance - syncing data - running: 100% 211.3kB/s - switching instances - filesytem sync finished, switching instances - reserving the IP addresses for the instance - setting up the target filesystem - hiding the original instance - promoting the migrated instance - removing sync snapshots - starting the migrated instance OK - switch was successful ``` -------------------------------- ### Create Triton Log Archiver Service Source: https://docs.tritondatacenter.com/private-cloud/log-management/setup This command initiates the setup of the Triton Log Archiver service. It creates the service in SAPI, downloads the necessary image, and deploys the first agent instance to a specified server. Confirmation is required before proceeding with the installation. ```bash [root@headnode (coal) ~]# sdcadm post-setup logarchiver This will make the following changes: create "logarchiver" service in SAPI download image a1b75ba0-336b-46f0-a9fb-3260947b2114 (logarchiver@master-20190507T165334Z-gb5754db) from updates server using channel "dev" create "logarchiver" service instance on server "564d2b36-7e25-7d79-e3c2-7ceb79d8abd6" Would you like to continue? [y/N] y Importing image a1b75ba0-336b-46f0-a9fb-3260947b2114 (logarchiver@master-20190507T165334Z-gb5754db) Downloading image a1b75ba0-336b-46f0-a9fb-3260947b2114 (logarchiver@master-20190507T165334Z-gb5754db) Imported image a1b75ba0-336b-46f0-a9fb-3260947b2114 (logarchiver@master-20190507T165334Z-gb5754db) Creating "logarchiver" service Creating "logarchiver" instance on server 564d2b36-7e25-7d79-e3c2-7ceb79d8abd6 Created VM eb394c52-916e-4b95-aa53-3a7b6452824d (logarchiver0) Completed successfully (elapsed 109s). ``` -------------------------------- ### Start an Instance Source: https://docs.tritondatacenter.com/private-cloud/instances This endpoint allows you to start a virtual machine instance. It requires the instance's UUID and uses a POST request. ```APIDOC ## POST /vms/:uuid?action=start ### Description Starts a virtual machine instance identified by its UUID. ### Method POST ### Endpoint `/vms/:uuid?action=start` ### Parameters #### Path Parameters - **uuid** (string) - Required - The unique identifier of the virtual machine to start. ### Request Example ```bash headnode# sdc sdc-vmapi /vms/4985f9fb-e674-e472-ac02-86e15242d6f7?action=start -X POST ``` ### Response #### Success Response (202 Accepted) - **vm_uuid** (string) - The UUID of the virtual machine. - **job_uuid** (string) - The UUID of the job created to perform the start action. #### Response Example ```json { "vm_uuid": "4985f9fb-e674-e472-ac02-86e15242d6f7", "job_uuid": "82acee52-2b5b-41d9-a4e3-02a626554870" } ``` ``` -------------------------------- ### Start Triton Instance using sdc-vmapi Source: https://docs.tritondatacenter.com/private-cloud/instances This command starts a specified Triton Datacenter instance using the sdc-vmapi tool. It requires the instance's UUID and sends a POST request to the VMAPI. The output confirms the accepted request and provides a job UUID for tracking the start operation. ```bash headnode# sdc sdc-vmapi /vms/:uuid?action=start -X POST ``` ```bash # sdc sdc-vmapi /vms/4985f9fb-e674-e472-ac02-86e15242d6f7?action=start -X POST HTTP/1.1 202 Accepted Content-Type: application/json Content-Length: 100 Content-MD5: G0SIUMSwiu6vv9rZJQ6iuw== Date: Fri, 14 Mar 2014 04:48:08 GMT Server: VMAPI x-request-id: d6e72080-ab33-11e3-80c0-d1d28a191fe5 x-response-time: 29 x-server-name: 069caca7-94dc-4ebb-9579-cc223e44d3ab Connection: keep-alive { "vm_uuid": "4985f9fb-e674-e472-ac02-86e15242d6f7", "job_uuid": "82acee52-2b5b-41d9-a4e3-02a626554870" } ``` -------------------------------- ### Install Triton Sample Docker Packages Source: https://docs.tritondatacenter.com/private-cloud/install/advanced-configuration Installs the default sample packages for Docker functionality in Triton. This command should be run on the head node. If packages are already installed, a warning will be displayed and can be safely ignored. ```bash sdcadm post-setup dev-sample-data ``` -------------------------------- ### Example Bootloader Configuration (boot.ipxe.01ECF4BBD295B0) Source: https://docs.tritondatacenter.com/private-cloud/instances/pass-through-config This snippet shows an example of a generated bootloader configuration file (`boot.ipxe.01ECF4BBD295B0`) after the CNAPI updates have been processed. It includes kernel parameters for hostname, RabbitMQ connection, admin NIC, external NIC, and console settings. ```shell #!ipxe kernel http://${next-server}/os/20200520T174734Z/platform/i86pc/kernel/amd64/unix -B hostname=5F0P842,rabbitmq=guest:guest:172.20.5.23:5672,rabbitmq_dns=guest:guest:rabbitmq.commercial-QA.example.com:5672,admin_nic=ec:f4:bb:d2:95:b0,external_nic=ec:f4:bb:d2:95:b2,console=text,text-mode="115200,8,n,1,-" ``` -------------------------------- ### Extract Primary IP from Triton Instance Get JSON Output Source: https://docs.tritondatacenter.com/public-cloud/network/faq This snippet demonstrates how to use the 'json' CLI tool (installed via npm) to parse the JSON output of 'triton instance get' and extract only the primary IP address. ```bash triton instance get -j | json primaryIp ``` -------------------------------- ### cloud-init with Shell Script for Ubuntu Instance Source: https://docs.tritondatacenter.com/images/linux/ubuntu-certified This snippet demonstrates how to use cloud-init with a shell script to execute commands on the first boot of an Ubuntu instance. The script writes the current date and time to '/root/output.txt'. It requires the 'ubuntu.cloud.sh' script to be in the same directory as the 'sdc-createmachine' command. ```bash #! /usr/bin/env bash echo "Hello World. The time is now $(date -R)!" | tee /root/output.txt ``` ```bash $ sdc-createmachine --dataset 46407334-9096-40ef-bb72-6f9a094f0507 \ --package g3-standard-1-kvm \ --metadata-file cloud-init:user-data=./ubuntu.cloud.sh ``` ```bash $ sudo cat /root/output.txt Hello World. The time is now Fri, 14 Feb 2014 23:15:13 +0000! ``` -------------------------------- ### Creating Instance with New Permissions Source: https://docs.tritondatacenter.com/public-cloud/rbac/cloudapi This command successfully creates a new instance using the `sdc-createmachine` command for the 'bob' user. With the 'basicmachine' role applied to the resource, the user now has the necessary permissions. The output details the newly provisioned machine, including its ID, name, state, and configuration. ```bash $ sdc-createmachine --user=bob \ --keyId=10:d0:59:ef:4f:71:3b:8b:4b:6a:05:d2:57:24:28:27 \ --image=bae9b95e-10c0-11e4-89d4-9fb9155d8bda \ --package=2eac03a7-ea7f-4215-fb66-e2ef510f2cde { "id": "e571f3ab-2f2b-6b9d-8098-be5d2c39c1ee", "name": "e306e5e", "type": "smartmachine", "state": "provisioning", "image": "bae9b95e-10c0-11e4-89d4-9fb9155d8bda", "ips": [], "memory": 128, "disk": 1280, "metadata": { "root_authorized_keys": "ssh-rsa AAAAB3NzaC1yc2...M384hFfS4PQ== \n" }, "tags": {}, "created": "2014-08-05T03:20:37.319Z", "updated": "2014-08-05T03:20:37.319Z", "networks": [], "dataset": "sdc:sdc:base:14.2.0", "firewall_enabled": false, "compute_node": null, "package": "test_128" } ``` -------------------------------- ### Example Aperture Policy Rules Source: https://docs.tritondatacenter.com/private-cloud/users Illustrates valid Aperture policy rule definitions for common actions like listing, viewing, starting, stopping, rebooting, and creating machines. The '*' wildcard is used to signify all resources. ```aperture CAN listmachines and getmachines * CAN stopmachine, startmachine, and rebootmachine * CAN createmachine * ``` -------------------------------- ### Attempt Manta Access Without Permissions (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This command demonstrates a user attempting to access Manta contents without the necessary role permissions, resulting in a `NoMatchingRoleTagError`. ```bash $ mls --user=maria --keyId=61:62:35:66:e6:e0:91:6a:fc:dc:d2:1b:90:52:51:04 ~~/stor mls: NoMatchingRoleTagError: None of your active roles are present on the resource. ``` -------------------------------- ### Boot Instance with VM Tools ISO Source: https://docs.tritondatacenter.com/private-cloud/images/kvm/linux Shows how to boot an instance with a specific ISO image attached, typically used for installing VM tools or an OS. Requires the instance UUID and the ISO path. ```shell headnode# vmadm boot 34f6d7d1-55ae-4775-a77d-b60ffc5ebff6 cdrom=/vmtools.iso,ide ``` -------------------------------- ### cloud-init with Cloud-Config for Ubuntu Instance Source: https://docs.tritondatacenter.com/images/linux/ubuntu-certified This snippet shows how to use cloud-init with a YAML file ('cloud.init') to configure an Ubuntu instance. The configuration updates the package list, upgrades installed packages, and installs the 'apache2' package. It requires the 'cloud.init' file to be present when running the 'sdc-createmachine' command. ```yaml #cloud-config apt_update: true apt_upgrade: true packages: - apache2 ``` ```bash sdc-createmachine --dataset 46407334-9096-40ef-bb72-6f9a094f0507 \ --package g3-standard-1-kvm \ --metadata-file cloud-init:user-data=./cloud.init ``` ```bash $ dpkg -l | grep apache ii apache2 2.4.6-2ubuntu2.1 amd64 Apache HTTP Server ii apache2-bin 2.4.6-2ubuntu2.1 amd64 Apache HTTP Server (binary files and modules) ii apache2-data 2.4.6-2ubuntu2.1 all Apache HTTP Server (common files) ``` -------------------------------- ### List Manta Objects and View File Content (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This snippet shows how to list objects in a Manta directory and view the content of a specific file using the `mls` and `mget` commands. ```bash $ mls ~~/stor access.log readme.txt $ mget -q ~~/stor/access.log | head 127.0.0.1 - - [11/Feb/2014:13:31:11 -0500] "GET / HTTP/1.1" 200 2158 127.0.0.1 - - [11/Feb/2014:13:31:18 -0500] "GET /search?q=linux HTTP/1.1" 200 2580 127.0.0.1 - - [11/Feb/2014:13:31:56 -0500] "GET /template HTTP/1.1" 200 7023 127.0.0.1 - - [11/Feb/2014:13:32:02 -0500] "GET /assets/images/upgrading HTTP/1.1" 200 5992 127.0.0.1 - - [11/Feb/2014:13:32:10 -0500] "GET /assets/images/search?q=linux HTTP/1.1" 404 1760 127.0.0.1 - - [11/Feb/2014:13:32:11 -0500] "GET /assets/images/search?q=linux HTTP/1.1" 404 1760 127.0.0.1 - - [11/Feb/2014:13:32:11 -0500] "GET /assets/styles/styles.css HTTP/1.1" 304 - 127.0.0.1 - - [11/Feb/2014:13:32:11 -0500] "GET /assets/styles/php.css HTTP/1.1" 304 - 127.0.0.1 - - [11/Feb/2014:13:32:11 -0500] "GET /assets/styles/html.css HTTP/1.1" 304 - 127.0.0.1 - - [11/Feb/2014:13:32:11 -0500] "GET /assets/styles/js.css HTTP/1.1" 304 - ``` -------------------------------- ### Enable Autostart on Destination Server Source: https://docs.tritondatacenter.com/private-cloud/instances/compute-nodes Enables the autostart functionality for a virtual machine on the destination server. This ensures the instance will automatically start upon system boot or service restart. ```shell Enabling Autostart on the dest-server... [ DONE ] ``` -------------------------------- ### Create a Manta User (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This command creates a new user in Manta, requiring a login name, password, and email address. The output includes the user's ID, login, email, and timestamps. ```bash $ sdc-user create --login=maria --password=123secret --email=maria@example.com { "id": "8e9fcc58-3240-4e33-d145-fad9d92c6822", "login": "maria", "email": "maria@example.com", "updated": "2014-07-17T15:32:48.029Z", "created": "2014-07-17T15:32:48.029Z" } ``` -------------------------------- ### Get Instance Details with Triton CLI Source: https://docs.tritondatacenter.com/public-cloud/containers/infrastructure/managing Retrieves detailed information for a specific instance using its UUID. The output includes various infrastructure details, such as the primary IP address, which is listed next to `primaryIp`. ```bash triton instance get 91e8aad0 ``` -------------------------------- ### Install CloudAPI Core Service Zone in Triton Source: https://docs.tritondatacenter.com/private-cloud/install/headnode-installation This command installs the cloudapi zone, which is a prerequisite for using smartdc or triton, and for running the user portal. It is executed using the sdcadm post-setup command. ```shell headnode# sdcadm post-setup cloudapi ``` -------------------------------- ### Successful Hermes Agent Deployment Log Source: https://docs.tritondatacenter.com/private-cloud/log-management/setup This log excerpt demonstrates a successful deployment of the logarchiver agent to multiple servers. It shows the 'deploying actor' and 'actor deployed' messages, confirming the agent's successful installation and operation. ```log [2019-06-27T07:47:15.859Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: starting periodic worker [2019-06-27T07:47:15.974Z] INFO: hermes/HttpServer/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: http server listening address: { "address": "10.99.99.71", "family": "IPv4", "port": 9999 } [2019-06-27T07:47:20.860Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: deploying actor (server=564d7de2-18d1-3c68-f893-44008b349c7d) [2019-06-27T07:47:20.862Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: deploying actor (server=564d2b36-7e25-7d79-e3c2-7ceb79d8abd6) [2019-06-27T07:47:20.863Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: deploying actor (server=564df69b-8c03-e569-0fe9-6a830b3f1084) [2019-06-27T07:47:20.864Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: deploying actor (server=564d7861-5038-e426-d052-cbc059bf6083) [2019-06-27T07:47:21.369Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: actor deployed (server=564df69b-8c03-e569-0fe9-6a830b3f1084) [2019-06-27T07:47:21.408Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: actor deployed (server=564d7de2-18d1-3c68-f893-44008b349c7d) [2019-06-27T07:47:21.408Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: actor deployed (server=564d7861-5038-e426-d052-cbc059bf6083) [2019-06-27T07:47:21.556Z] INFO: hermes/29734 on eb394c52-916e-4b95-aa53-3a7b6452824d: actor deployed (server=564d2b36-7e25-7d79-e3c2-7ceb79d8abd6) ``` -------------------------------- ### Posting Configuration to CNAPI via CLI Source: https://docs.tritondatacenter.com/private-cloud/instances/pass-through-config This command-line example illustrates how to use `sdc-cnapi` to send PUT requests to the CNAPI. It includes the necessary parameters for specifying the boot module path and the base64 encoded content of `ppt_matches` and `ppt_aliases`. ```shell sdc-cnapi /boot/44454c4c-4600-1030-8050-b5c04f383432 -X PUT -d '{ "boot_modules": [ { "path": "etc/ppt_matches","content": "cGNpMTBkZSwxNWYwCnBjaTgwODYsN2IxMQo=" }, { "path": "etc/ppt_aliases", "content": "cHB0ICIvcGNpQDc1LDAvcGNpODA4NiwyZjBhQDMsMi9wY2k4MDg2LDdiMTFAMCIK" } ] }' ``` -------------------------------- ### Create a Manta Policy for Object Read Access (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This command creates a policy named 'read' with a single rule that allows users to 'getobject' from Manta. The output displays the policy's name, ID, and the defined rule. ```bash $ sdc-policy create --name=read --rules='CAN getobject' { "name": "read", "id": "3072e003-34f7-c4a5-9f73-a8808de40e26", "rules": [ "CAN getobject" ] } ``` -------------------------------- ### Base64 Encoding and Posting Configuration to CNAPI (Node.js) Source: https://docs.tritondatacenter.com/private-cloud/instances/pass-through-config This Node.js example shows how to read configuration files (`ppt_matches`, `ppt_aliases`), base64 encode their content, and then post this encoded data to the CNAPI using a PUT request. This is a crucial step for updating bootloader configurations. ```javascript var fs = require('fs'); var d = fs.readFileSync('/tmp/ppt_matches'); d.toString('base64'); var dd = fs.readFileSync('/tmp/ppt_aliases'); dd.toString('base64'); ``` -------------------------------- ### Troubleshoot Hermes Agent Deployment Failure (Log Analysis) Source: https://docs.tritondatacenter.com/private-cloud/log-management/setup This log snippet shows an error during the deployment of an actor to a server, indicating that the operation failed because the target server was not running. This helps in identifying the root cause of agent installation failures. ```log [2019-06-26T11:00:00.003Z] INFO: hermes/27456 on eb394c52-916e-4b95-aa53-3a7b6452824d: deploying actor (server=564d7de2-18d1-3c68-f893-44008b349c7d) [2019-06-26T11:00:00.017Z] ERROR: hermes/27456 on eb394c52-916e-4b95-aa53-3a7b6452824d: error deploying actor to server (server=564d7de2-18d1-3c68-f893-44008b349c7d) VError: could not execute command on server 564d7de2-18d1-3c68-f893-44008b349c7d: Operation attempted on server which is not running at /opt/smartdc/hermes/lib/servers.js:233:13 at /opt/smartdc/hermes/node_modules/sdc-clients/lib/restifyclient.js:174:20 at parseResponse (/opt/smartdc/hermes/node_modules/restify-clients/lib/JsonClient.js:93:9) at IncomingMessage.done (/opt/smartdc/hermes/node_modules/restify-clients/lib/StringClient.js:207:13) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:978:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9) ``` -------------------------------- ### Create a Manta Role with Members (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This command creates a new role named 'contractor' and assigns 'maria' as both a regular member and a default member. The output shows the role's name, ID, members, and an empty policies list. ```bash $ sdc-role create --name=contractor --members=maria --default-members=maria { "name": "contractor", "id": "559d4252-d75c-4189-bf08-f30c73a703a6", "members": [ "maria" ], "default_members": [ "maria" ], "policies": [] } ``` -------------------------------- ### ContainerPilot Configuration Example with Template Rendering Source: https://docs.tritondatacenter.com/public-cloud/instances/docker/containerpilot/configuration/configuration-file This snippet demonstrates how to use Go's text/template syntax within a ContainerPilot configuration file to substitute environment variables into job execution commands. It shows basic variable interpolation and highlights the availability of ContainerPilot-specific environment variables. ```json { "consul": "consul:8500", "job": { "exec": "/bin/setup.sh {{.URL_TO_SERVICE}} {{.API_KEY}}" } } ``` -------------------------------- ### Add SSH Key to Manta User (CLI) Source: https://docs.tritondatacenter.com/public-cloud/rbac/jpc/rbac/quickstart This command uploads an SSH public key for a specified user, identified by their user ID. It requires the key name and the path to the public key file. The output confirms the key's name, fingerprint, and content. ```bash $ sdc-user upload-key 8e9fcc58-3240-4e33-d145-fad9d92c6822 --name=mariakey ~/.ssh/maria.pub { "name": "mariakey", "fingerprint": "61:62:35:66:e6:e0:91:6a:fc:dc:d2:1b:90:52:51:04", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLnrt...fMp maria@example.com\n" } ``` -------------------------------- ### Create Triton Support Bundle with sdc-sbcreate Source: https://docs.tritondatacenter.com/private-cloud/troubleshooting/support-bundles The `sdc-sbcreate` command initiates the process of gathering system information to create a Triton support bundle. The bundle is saved in `/var/tmp/sdcsb.` and later packed into a compressed tar file. The process can be aborted by pressing CTRL-C. ```bash # sdc-oneachnode -n 78-2b-cb-0a-75-23 sdc-sbcreate === Output from 44454c4c-3700-1039-8034-c2c04f445131 (78-2b-cb-0a-75-23): This tool will create a Triton support bundle in /var/tmp/sdcsb.78896. This may take some time... If you wish to abort press CTRL-C now! Starting in 0 seconds... ==> Gathering System Information > sysinfo > hardware configuration > datalink info > network interface info > routing table > auditlog info > services (all services) (global service archive) (service archive for d8f99863-b45a-c1a4-df12-ca98347c2bd4) (service archive for 8d44d9e9-fa70-462e-b355-02b077e8556c) (service archive for 15161bd5-a5c4-40f7-967e-d3b9f6ec64fd) (service archive for fd44546b-154d-6098-e96d-88805c802270) (service archive for f12ecbd6-b615-eb7d-c0b8-94df68378932) (service archive for 4985f9fb-e674-e472-ac02-86e15242d6f7) > process information > zfs info (zpool status) (zfs list) (iostat -e) > disk utilization > module information > zone list > zone kernel state > zone configs > zone logs > kernel crash dumps > fmdump > logs > app zone config > fmd > disk list > zpool history > agents ==> packing data to /var/tmp/sdc-support.78-2b-cb-0a-75-23.20140314T125306Z.tar.bz2 ==> cleaning up ==> done ``` -------------------------------- ### Boot KVM Instance with OS and VMTools ISOs (Shell) Source: https://docs.tritondatacenter.com/private-cloud/images/kvm This command boots a KVM instance, specifying the order of boot devices and attaching ISO files for the operating system and VMTools. The `order=cd,once=d` ensures booting from CD-ROM once. ```shell headnode# vmadm boot e9d0f9b7-e76e-474a-8951-e12e227f24d6 \ order=cd,once=d \ cdrom=/operating-system.iso,ide \ cdrom=/vmtools.iso,ide ``` -------------------------------- ### Create Triton Headnode using Shell Source: https://docs.tritondatacenter.com/private-cloud/install-hosted This command initiates the creation of the Triton headnode server. It requires the project ID, a facility code, and an optional supplemental JSON file for advanced configuration. The script handles VLAN creation, IP provisioning, server setup, and network configuration. ```shell triton-eqm-create.sh headnode -p bec6b78a-a91f-11eb-b5ef-cfcd9128c9eb \ -f sv15 -a supplemental.json ``` -------------------------------- ### Create Policy for Machine Operations (sdc-policy) Source: https://docs.tritondatacenter.com/public-cloud/rbac/cloudapi Creates a new policy named 'startstop' that allows users to reboot, stop, and start any machine. This policy is a prerequisite for creating roles that grant these permissions. ```bash $ sdc-policy create --name=startstop \ --rules='CAN rebootmachine, stopmachine, and startmachine *' ``` ```json { "name": "startstop", "id": "6544f677-58b1-4c8d-e701-f7b6a61ab4b0", "rules": [ "CAN rebootmachine, stopmachine, and startmachine *" ] } ``` -------------------------------- ### Manually Mount NFS Volume in Triton Instance (Bash) Source: https://docs.tritondatacenter.com/public-cloud/volumes This example demonstrates how to manually mount an NFS volume in a Triton instance using bash commands. It requires the 'nfs-common' package to be installed. The output shows the mount command and verification using 'mount | grep tank'. This method does not create a persistent mount. ```bash root@hopper:~# mkdir /tank root@hopper:~# apt-get install nfs-common ... root@hopper:~# mount 192.168.128.69:/zones/3024606f-fedb-4b61-9c0f-3fe7085c3eb2/data /tank root@hopper:~# mount | grep tank 192.168.128.69:/zones/3024606f-fedb-4b61-9c0f-3fe7085c3eb2/data on /tank type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.128.71,local_lock=none,addr=192.168.128.69) ``` -------------------------------- ### Listing Instances with Default Permissions Source: https://docs.tritondatacenter.com/public-cloud/rbac/cloudapi This command demonstrates listing instances owned by the 'bob' user using default permissions. It utilizes the `sdc-listmachines` command with user and key ID, piping the output to `json -a id` to extract only the instance IDs. The output shows a list of instance IDs. ```bash $ sdc-listmachines --user=bob --keyId=10:d0:59:ef:4f:71:3b:8b:4b:6a:05:d2:57:24:28:27 | json -a id db1186a7-e908-632e-d609-ed960ed8bac1 dbdd81f1-43a7-4adb-a5cd-d18655c4b682 ad4c95dc-c813-6b63-b3b4-fc4515d36951 ``` -------------------------------- ### Add Triton Group to Sample Packages using sdc-papi CLI Source: https://docs.tritondatacenter.com/private-cloud/install/user-portal This command adds the 'triton' group to all packages whose names start with 'samp*'. It utilizes the `sdc-papi` CLI to query for package UUIDs and then updates each package with the specified group. This is useful for controlling which packages are available through the Triton DataCenter portal. ```bash headnode# for PACKAGE in `sdc-papi /packages?name=samp* | json -Hag uuid` ; do sdc-papi /packages/$PACKAGE -d '{ "group" : "triton"}' -X PUT; done ``` -------------------------------- ### Collect RSS Memory Information (Machine Readable) Source: https://docs.tritondatacenter.com/public-cloud/instances/infrastructure/images/smartos/managing-smartos/smtools-usage The sm-meminfo script collects information about Resident Set Size (RSS) memory usage. This example shows how to invoke it to get machine-readable output, which is useful for scripting and automated analysis. It requires specifying 'rss' as the memory type and the '-p' flag for machine-readable format. ```bash # sm-meminfo -p rss * Gathering rss memory infomation for 9272333a-80dc-4a2d-a0b6-321e9e4f5a93.. mem_cap:2147483648 mem_used:212860928 mem_free:1934622720 ``` -------------------------------- ### Configure Consul Agent and Application Dependencies (JSON) Source: https://docs.tritondatacenter.com/public-cloud/instances/docker/containerpilot/configuration/examples/consul-agent.json5 This JSON configuration defines a 'consul-agent' job that starts and performs health checks. It then configures a 'preStart' job to wait for the 'consul-agent' to be healthy before executing a Consul-template command. Finally, it sets up the 'app' job to wait for 'preStart' to succeed and includes a health check for the application. ```json { "consul": "localhost:8500", "jobs": [ { "name": "consul-agent", "exec": [ "consul", "agent", "-rejoin", "-retry-join", "{{ .CONSUL }}", "-retry-max", "10", "-retry-interval", "10s" ], "restarts": "unlimited", "health": { "exec": "consul info | grep leader" } }, { "name": "preStart", "exec": [ "consul-template", "-once", "-consul-addr", "localhost:8500", "-template", "/etc/template.ctmpl:/etc/app.conf" ], "restarts": "never", "when": { "source": "consul-agent", "once": "healthy", "timeout": "120s" } }, { "name": "app", "exec": [ "/usr/local/bin/node", "/usr/local/bin/http-server", "/srv", "-p", "8000" ], "port": 8000, "restarts": "unlimited", "when": { "source": "preStart", "once": "exitSuccess", "timeout": "120s" }, "health": { "exec": "/usr/bin/curl --fail -s -o /dev/null http://localhost:8000", "interval": 5, "ttl": 10, "timeout": "10s" } } ] } ```