sdcadm [options] COMMAND [args...]
sdcadm help COMMAND
sdcadm
is a tool intended for managing SDC configuration, core services and
instances. I.e. it is responsible for setting up, upgrading, creating optional
instances (e.g. cloudapi), making services HA, etc.
The runtime sdcadm
configuration is loaded as follows:
- Load defaults from
/opt/smartdc/sdcadm/etc/defaults.json
. - Load and merge in values from
/var/sdcadm/sdcadm.conf
(JSON format), if that exists. - Load some SDC config data via
bash /lib/sdc/config.sh -json
.
-h, --help
Print help and exit.
--version
Print version and exit.
-v, --verbose
Verbose/debug output.
Help on a specific sub-command.
Show SDC datacenter and node information.
-h, --help
Show this help.
-j, --json
JSON Output.
Update "sdcadm" itself.
Find the given sdcadm
image in updates.tritondatacenter.com, download it, and
install. Latest version of sdcadm can be installed by providing the --latest
option instead of an image UUID.
It's recommended to run sdcadm self-update --latest
before performing any
sdcadm upgrade operation, especially because there could be critical bugfixes
published since the last time sdcadm
itself was updated.
You can get the exact version of sdcadm running in your SDC setup using:
sdcadm --version
The output of this command will include both the semver version, and the usual image version (referencing git branch, date and git SHA). For example:
[root@headnode (coal) ~]# sdcadm --version
sdcadm 1.3.9 (master-20141114T063621Z-g995ee7e)
# Update to the given image UUID:
sdcadm self-update IMAGE_UUID [<options>]
# Update to the latest available image:
sdcadm self-update --latest [<options>]
-h, --help
Show this help.
-n, --dry-run
Go through the motions without actually updating.
--allow-major-update
Allow a major version update to sdcadm. By default
major updates are skipped (to avoid accidental
backward compatibility breakage).
-C ARG, --channel=ARG
Use the given channel to fetch the image, even if it
is not the default one.
--latest
Get the latest available image.
List all SDC service instances. Note that "service" here includes SDC core vms and agents.
-h, --help
Show this help.
-j, --json
JSON output
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is
"-type,service,hostname,version,alias".
-I, --group-by-image
Group by unique (service, image).
List all SDC services.
-h, --help
Show this help.
-j, --json
JSON output
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is "-type,name".
Display images available for update of SDC services and instances.
sdcadm avail(able) [<options>] [<svc>] ...
-h, --help
Show this help.
-C ARG, --channel=ARG
Use the given channel to search for the image(s),
even if it is not the default one.
-a, --all-images
Display all the images available for updates, not
only the latest image for each service.
-j, --json
Show images list as raw JSON. Other options will not apply.
-J, --jsonstream
new-line separated JSON streaming output.
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is "-service,version,image".
-x ARG, --exclude=ARG
Exclude the given services (only when looking for
updates for all services, i.e. no arguments given).
Update SDC services and instances.
sdcadm update [<options>] <svc> ...
sdcadm update [<options>] <svc>@<image> ...
sdcadm update [<options>] <svc>@<version> ...
-h, --help
Show this help.
-n, --dry-run
Go through the motions without actually updating.
-a, --all
Update all instances.
-y, --yes
Answer yes to all confirmations.
-I, --just-images
Just import images. Commonly this is used to preload
images before the full upgrade run.
--force-data-path
Forcibly update compoents in the customer data path (which
are not updated by default). Applies to: portolan.
--force-rabbitmq
Forcibly update rabbitmq (which is not updated by default)
--force-same-image
Allow update of an instance(s) even if the target
image is the same as the current.
--force-bypass-min-image
Allow update of an instance(s) even if the target
image is unknown or it does not fulfil the
minimum image requirements for updates.
--ufds-backup-timeout=T
Timeout (in seconds) for the creation of the
backup of all the UFDS data during ufds updates.
Default: 600secs.
-C, --channel=ARG
Use the given channel to fetch the image(s), even if
it is not the default one.
-x ARG, --exclude=ARG
Exclude the given services (only when -a|--all is provided).
Rollback SDC services and instances.
In order to rollback one or more services to the version these services
were before a given update, it's necessary to pass the plan.json
file
generated for such update, (plan files are usually at
/var/sdcadm/updates/$buildstamp
). sdcadm
will figure out the previous
version for those services using this file, and generate a new plan for
the rollback process.
Right now there are no restrictions at all about what version a given service can be rolled back to -- if you can update a service to a given version, you can rollback a service to that same version.
Please take into consideration that we're not making any checks regarding
irreversible service migrations at the moment. This is the reason you
must specify the --force
flag, in order to confirm that you want to
rollback the services/instances listed into the provided plan file.
-h, --help
Show this help.
-n, --dry-run
Go through the motions without actually rolling back.
-y, --yes
Answer yes to all confirmations.
--force
Do the rollback despite of migrations and version dependencies
-f FILE_PATH, --file=FILE_PATH
Full path to file with update plan.json to rollback
Create one or more instances for an existing SDC service.
Note that in order to create an instance of some services the option --dev-allow-multiple-instances must be specified, given that those services are not supposed to have more than one instance. There are also some services whose instances should not be created using this tool, like manatee or binder. Finally, the first instance of some services should not be created using this tool when there is an alternate choice provided by post-setup subcommand.
-h, --help
Show this help.
-n, --dry-run
Go through the motions without actually creating.
-i ARG, --image=ARG
UUID of the Image to be used for the instance.
-s SERVERS, --servers=SERVERS
Comma separated list of servers (either hostnames or uuids)
on which to create the instance(s).
-y, --yes
Answer yes to all confirmations.
--dev-allow-multiple-instances
Allow additional instances to be created even if the service is not HA ready
(for development purposes).
Check sdc config in SAPI versus system reality.
-h, --help
Show this help.
Check that services or instances are up.
-h, --help
Show this help.
-j, --json
JSON output
-q, --quiet
Only print health errors, if any
-H
Omit table header row.
-s ARG, --servers=ARG
The UUID or hostname of the CNs to limit the check to. One argument
per server is required: -s UUID1 -s UUID2 ...
Instances to be checked can be filtered via by type: type=vm type=agent
and service or instance name: imgapi cnapi cn-agent
Initialize a default fabric for an account.
-h, --help
Display this help message.
Common post-setup procedures.
The default setup of a SmartDataCenter headnode is somewhat minimal. "Everything up to adminui." Practical usage of SDC -- whether for production, development or testing -- involves a number of common post-setup steps. This command attempts to capture many of those for convenience and consistency.
-h, --help
Show this help message and exit.
Help on a specific post-setup sub-command.
Create a first cloudapi instance.
Initial setup of SmartDataCenter does not create a cloudapi instance. This procedure will do that for you.
Add external NICs to the adminui and imgapi zones.
By default no SDC core zones are given external nics in initial setup. Typically it is most useful to have those for the adminui instance (to be able to access the operator portal in your browser) and for the imgapi instance (to enable it to reach out to updates.tritondatacenter.com and images.smartos.org for images). IMGAPI instances are always firewalled such that only outbound connections are allowed.
Provisions underlay NICs on the provided underlay network for the given Compute Node(s).
sdcadm post-setup underlay-nics NETWORK_UUID SERVER1 [ SERVER2 [SERVER3] ]
Note that this command can be re-run as many times as needed and it will automatically take care of do not provision two underlay nics into the same network for any CN.
-h, --help
Show this help and exit.
Setup the binder service for high availability (HA).
The binder service provides internal DNS to Triton core services. It also holds a zookeeper (ZK) cluster used by some Triton core services. To best support ZK availability we want an odd number of binder instances. One, three, or five instances are supported.
Usage: sdcadm post-setup ha-binder SERVER1 SERVER2 ...
Options:
-h, --help
Show this help.
--allow-delete
Allow replacement/deletion of existing binder instances.
--dev-allow-repeat-servers
For development, allow a binder cluster with
multiple instances on the same server.
-y, --yes
Answer yes to all confirmations.
"SERVER ..." should list one, three, or five setup servers (hostname or UUID) on which a binder instance is desired. Note that this includes existing binder instances, e.g. the "binder0" instance typically on the initial headnode.
For backward compatibility,
sdcadm post-setup ha-binder -s SERVER2 -s SERVER3
is accepted
(a) when there is only a single binder on the headnode and
(b) to mean that two binder instances should be added for a total of
three instances. The new calling form is preferred because it is
idempotent.
Examples: # Ensure a 3-instance binder cluster on the given 3 servers. sdcadm post-setup ha-binder headnode SERVER2 SERVER3
# Deprecated. Same result as preview example.
sdcadm post-setup ha-binder -s SERVER2 -s SERVER3
At least one of the existing binder instances must remain unchanged during the process. In case the desired configuration does not include any of the existing instances, the recommended procedure is to complete the removal or replacement of all the desired instances in two steps, keeping at least one of the instances during the first run of the command. For example, say we want to "move" our binder instances from servers "headnode", "SERVER1" and "SERVER2" to the new servers "SERVER4", "SERVER5" and "new-headnode". We can proceed as follows:
# Replace all but the first instance:
sdcadm post-setup ha-binder headnode SERVER4 SERVER5
# Replace the first one while keeping the new instances:
sdcadm post-setup ha-binder new-headnode SERVER4 SERVER5
Create 2nd and 3rd manatee instances as the 1st required step for HA.
When you have one manatee initially, you're in ONE_NODE_WRITE_MODE which is a special mode that exists just for bootstrapping. To go from this mode to a HA setup you'll need at least one more manatee. Switching modes however is not quite as simple as just provisioning a second one. This command attempts to move you from one instance to a HA setup.
After examining your setup and ensuring you're in the correct state it will:
- create a second manatee instance for you (with manatee-sitter disabled)
- disable the ONE_NODE_WRITE_MODE on the first instance
- reboot the first manatee into multi-node mode
- reenable the sitter and reboot the second instance
- wait for manatee to return that it's synchronized
After we've gone through this, it'll create a 3rd manatee instance on the second server you specified to complete manatee ha setup.
Remember that you need to specify the -s option as many times as different servers UUIDs you need to provide:
sdcadm post-setup ha-manatee -s SERVER_UUID1 -s SERVER_UUID2
-h, --help
Show this help and exit.
-y, --yes
Answer yes to all confirmations.
-s ARG, --servers=ARG
The UUID for the target servers. Two values are required, one for sync
manatee, another for async manatee.
Create portolan instance, nat service when needed and setup fabrics.
Initial setup of SmartDataCenter does not create a portolan instance. This procedure will do that for you and setup underlay-nics and fabrics and, if docker is setup, update docker config to use fabrics.
-h, --help
Display this help message.
-c FILE, --conf=FILE
Use the given configuration file (required).
-r, --reconfigure
Update fabrics configuration with the provided one.
Setup the Docker service.
This command will create the "docker" and "dockerlogger" services, create the initial docker instance on the headnode, and install dockerlogger on all setup servers (or a subset if "-s" is used).
-h, --help
Show this help.
-j N, --concurrency=N
Number of concurrent servers to which to install dockelogger simultaneously.
Default: 5.
-s ARG, --servers=ARG
Comma-separate list of servers (hostname or UUID) on which dockelogger will
be setup. If not specified, dockelogger will be setup on all setup
servers.
Setup the Container Monitor (CMON) system.
This command will setup the "cmon" and "cmon-agent" services and create an initial instance of "cmon" on the headnode and "cmon-agent" on the specify (or all setup) servers.
-h, --help
Show this help.
-C CHANNEL, --channel=CHANNEL
Update channel from which to get the "cmon" and "cmon-agent" images.
-j N, --concurrency=N
Number of concurrent servers to which to install cmon-agent simultaneously.
Default: 5.
-s ARG, --servers=ARG
Comma-separate list of servers (hostname or UUID) on which cmon-agent will
be setup. If not specified, then cmon-agent will be setup on all setup
servers.
Create the "cns" service and a first instance.
-h, --help
Show this help.
Make the headnode provisionable, for development and testing. This allows a Manta deployment to co-exist with standard Triton provisioning.
This is done via ALLOC_FILTER_CAPNESS
, ALLOC_FILTER_HEADNODE
,
and ALLOC_FILTER_MIN_RESOURCES
SAPI parameters of the CNAPI service. See
SAPI configuration
Platform related sdcadm commands.
These are commands to assist with the common set of tasks required to manage platforms on a typical SDC setup.
Note that SDC keeps a cache directory (/usbkey/os) of the platform images installed on the USB key (/mnt/usbkey/os). Please read help of sub-commands in order to know how this may or not affect each of them.
-h, --help
Show this help and exit.
Help on a specific platform sub-command.
Download and install platform image for later assignment.
sdcadm platform install IMAGE-UUID
sdcadm platform install PATH-TO-IMAGE
sdcadm platform install --latest
Please note that installing a new platform image will not assign this image to any server. Install will download the image, put it on the head node USB key (/mnt/usbkey/os) and copy it back to the platform cache directory (/usbkey/os). The image is made available through CNAPI for later assignment.
-h, --help
Show this help and exit.
--latest
Install the latest platform image from the update channel.
-C, --channel=ARG
Use the given channel to fetch the image(s), even if
it is not the default one.
Assign platform image to the given DC server(s).
sdcadm platform assign PLATFORM --all
sdcadm platform assign PLATFORM [SERVER ...]
-h, --help
Show this help and exit.
--latest
Assign latest Platform Image.
--all
Assign given platform image to all servers instead of
just the given one(s).
Where PLATFORM is one of "--latest" (the latest platform image installed on the USB key) or a "YYYYMMDDTHHMMDDZ" version of an installed platform (see "sdcadm platform list").
Use "--all" to assign to all servers or pass a specific set of SERVERs. A "SERVER" is a server UUID or hostname. In a larger datacenter, getting a list of the wanted servers can be a chore. The "sdc-server lookup ..." tool is useful for this.
Examples: # Assign the latest platform to all servers. sdcadm platform assign --latest --all
# Assign a specific platform on setup servers with the "pkg=aegean" trait.
sdcadm platform update-agents 20151021T183753Z \
$(sdc-server lookup setup=true traits.pkg=aegean)
# Assign a platform, excluding those with a "internal=PKGSRC" trait.
sdcadm platform update-agents 20151021T183753Z \
$(sdc-server lookup setup=true 'traits.internal!~PKGSRC')
Provides a list of platform images available to be used.
-h, --help
Show this help.
-j, --json
Show platforms list as raw JSON. Other options will not apply
-J, --jsonstream
new-line separated JSON streaming output
-a, --active
Do not display platform images where current and boot
platforms are zero.
-i, --inactive
Display only platform images where current and boot
platforms are zero.
-u, --usbkey
Display only platform images stored in USB Key (do not
display images stored only in cache directory).
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is
"-version,current_platform,boot_platform".
Provides a list of servers using the given platform.
-h, --help
Show this help.
-j, --json
Show platforms list as raw JSON. Other options will not apply
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is
"-uuid,hostname,current_platform,boot_platform".
Removes the given platform image(s).
sdcadm platform remove PLATFORM [PLATFORM2 [PLATFORM3]]
sdcadm platform remove --all
When a platform in use by any server is given, the --force
option
is mandatory.
When given, the --all
option will remove all the platforms not being
used by any server (neither currently, or configured to boot into).
Please note that unless the --cleanup-cache
option is given, the
platform image will remain available to be used at the /usbkey/os
directory and, therefore, will continue appearing into the listing
provided by both CNAPI and sdcadm platform list
.
On these cases, you can re-run this command with the desired platform
images and the --cleanup-cache
option, and sdcadm will remove them
from the cache directory.
-h, --help
Show this help.
--all
Removes all the platforms not in use.
--force
Remove the given platform despite of being in use.
--cleanup-cache
Also remove the given platform(s) from the on-disk cache.
-y, --yes
Answer yes to all confirmations.
-k NUM, --keep-latest=NUM
Keep the given number of the most recent platforms. (Requires --all
).
Return the list of remotely available platform images published after the latest image installed locally.
sdcadm platform avail [OPTIONS]
-h, --help
Show this help.
-j, --json
Show platforms list as raw JSON. Other options will not apply.
-J, --jsonstream
new-line separated JSON streaming output.
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is "-version,uuid,published_at".
-C, --channel=ARG
Use the given channel to fetch the image(s), even if
it is not the default one.
Set the default platform image for new servers.
-h, --help
Show this help.
--latest
Set default platform image to latest installed into USB key.
sdcadm commands for operations with update channels.
Provide a list of available update channels and set/update the preferred update channel.
-h, --help
Show this help and exit.
Help on a specific channel sub-command.
Provides a list of update channels available.
-h, --help
Show this help.
-j, --json
Show channels list as raw JSON. Other options will not apply
-H
Omit table header row.
Get the default update channel.
-h, --help
Show this help.
Set the default update channel.
-h, --help
Show this help.
History of sdcadm commands.
The historical collection of sdcadm commands ran into the current SDC setup, searchable by execution time (when SAPI is available).
We keep a history of updates in an 'sdcadm_history' moray bucket.
This command lists the history ala zpool history
(with tabular output).
In case moray happens to be down, history for an upgrade is cached locally
and pushed to Moray on later uses of sdcadm.
There is a two phase write to the history during an sdcadm update
: first at
the start of the update, before changes are made, and later upon completion.
We attempt to write that completion even when the update failed, but the
initial write at the start allows for detection of update crashes.
The same thing happens for other commands, like sdcadm self-update
or sdcadm post-setup cloudapi
. In general, any sdcadm subcommand causing a
modification of the system will call history and save such change into the
aforementioned 'sdcadm_history' bucket.
The -j|--json
option allows retrieving such changes in raw JSON format
(with the same structure than update plan.json). If the UUID of a given change
is given as an argument to sdcadm history
, only that change will be
retrieved.
It's also possible to just search for history items started after
(--since
) or before (--until
) a given date. Both command options take
a valid ISO 8610 Date String as their possible values. Of course, a combination
of both command options will allow searching within a given time interval.
-h, --help
Show this help message and exit.
-j, --json
Show history as JSON.
-H
Omit table header row.
-o field1,...
Specify fields (columns) to output.
-s field1,...
Sort on the given fields. Default is "-started,finished".
--since=ARG
Return only values since the given date. ISO 8601 Date String.
--until=ARG
Return only values until the given date. ISO 8601 Date String.
When HISTORY-ITEM-UUID is given, only that history item will be included using JSON format and all the other options will be ignored
Show and modify the DC maintenance mode.
"Maintenance mode" for an SDC means that Cloud API is in read-only mode. Modifying requests will return "503 Service Unavailable". Workflow API will be drained on entering maint mode. When Docker service is also installed, it'll behave the same way than Cloud API.
Limitation: This does not current wait for config changes to be made and cloudapi instances restarted. That means there is a window after starting that new jobs could come in.
-h, --help
Show this help message and exit.
Show DC maint status.
sdcadm dc-maint status [-j]
-h, --help
Show this help message and exit.
-j, --json
Show status as JSON.
Start DC Maintenance. Optionally, start maintenance only for CloudAPI or Docker services.
sdcadm dc-maint start
-h, --help
Show this help message and exit.
--docker-only
Start maintenance mode only for Docker service.
--cloudapi-only
Start maintenance mode only for CloudAPI service.
--message=ARG
Maintenance message to be used until the DC is restored to full operation.
--eta=DATE
Expected time to get the DC restored to full operation
(to be used in Retry-After HTTP headers).Epoch seconds,
e.g. 1396031701, or ISO 8601 format YYYY-MM-DD[THH:MM:SS[.sss][Z]], e.g.
"2014-03-28T18:35:01.489Z".
Stop DC Maintenance
sdcadm dc-maint stop
-h, --help
Show this help message and exit.
Experimental, unsupported, temporary sdcadm commands.
These are unsupported and temporary commands to assist with migration away from incr-upgrade scripts. The eventual general upgrade process will not include any commands under "sdcadm experimental".
-h, --help
Show this help message and exit.
Help on a specific experimental sub-command.
Update SDC agents
sdcadm experimental update-agents [OPTIONS] AGENTSSHAR --all
sdcadm experimental update-agents [OPTIONS] AGENTSSHAR [SERVER ...]
sdcadm experimental update-agents [OPTIONS] AGENTSSHAR --just-download
-h, --help
Show this help message and exit.
--latest
Update using the last published agents installer.
--just-download
Download the agents installer for later usage.
-a, --all
Update on all servers already setup.
-y, --yes
Answer yes to all confirmations.
-j N, --concurrency=N
Number of concurrent servers downloading agentsshar file or being updated
simultaneously. Default: 5.
Where AGENTSSHAR is one of "--latest" (the latest agentsshar package in the current channel of the update server), an agentsshar UUID in the updates server, or a path to a locally downloaded agentsshar package.
Agents may only be updated on servers that are setup. Use "--all" for all setup servers, or pass a specific set of SERVERs. A "SERVER" is a server UUID or hostname. In a larger datacenter, getting a list of the wanted servers can be a chore. The "sdc-server lookup ..." tool is useful for this.
Examples: # Update to the latest agentsshar on all setup servers. sdcadm experimental update-agents --latest --all
# Update a specific agentsshar on setup servers with the "pkg=aegean" trait.
sdcadm experimental update-agents 8198c6c0-778c-11e5-8416-13cb06970b44 \
$(sdc-server lookup setup=true traits.pkg=aegean)
# Update on setup servers, excluding those with a "internal=PKGSRC" trait.
sdcadm experimental update-agents 8198c6c0-778c-11e5-8416-13cb06970b44 \
$(sdc-server lookup setup=true 'traits.internal!~PKGSRC')
Temporary grabbag for small SDC update steps. The eventual goal is to integrate all of this into "sdcadm update".
-h, --help
Show this help message and exit.
Temporary grabbag for updating the SDC global zone tools. The eventual goal is to integrate all of this into "sdcadm update".
sdcadm experimental update-gz-tools IMAGE-UUID
sdcadm experimental update-gz-tools PATH-TO-INSTALLER
sdcadm experimental update-gz-tools --latest
-h, --help
Show this help message and exit.
--latest
Update using the last published gz-tools installer.
--just-download
Download the GZ Tools installer for later usage.
--force-reinstall
Force reinstall of the current gz-tools image in use.
-C NAME, --channel=NAME
Use the given channel to fetch the image, even if it is not the default one.
Temporary grabbag for installing the SDC global zone new agents. The eventual goal is to integrate all of this into "sdcadm update".
-h, --help
Show this help message and exit.
Installs a custom TLS certificate to be used by sdc-docker.
-h, --help
Show this help message and exit.
-k, --key
Path to private key.
-c, --cert
Path to certificate.
Enables/disables support for various NFS volumes features.
# Enable NFS volume support for sdc-docker
sdcadm experimental nfs-volumes docker
# Disable NFS volume support for sdc-docker
sdcadm experimental nfs-volumes docker -d
# Enable NFS volume support for CloudAPI
sdcadm experimental nfs-volumes cloudapi
# Disable NFS volume support for CloudAPI
sdcadm experimental nfs-volumes cloudapi -d
# Enable docker containers automatically mounting NFS volumes
sdcadm experimental nfs-volumes docker-automount
# Disable docker containers automatically mounting NFS volumes
sdcadm experimental nfs-volumes docker-automount -d
# Enable CloudAPI containers automatically mounting NFS volumes
sdcadm experimental nfs-volumes cloudapi-automount
# Disable CloudAPI containers automatically mounting NFS volumes
sdcadm experimental nfs-volumes cloudapi-automount -d
-h, --help
Show this help message and exit.
-d, --disable
Disable a given NFS volume feature instead of enabling it.
sdcadm Copyright 2024 MNX Cloud, Inc.