nifectl instance Command Reference
Manage VM instances (hosts).
Overview​
The instance commands manage the virtual machines registered with Nife on GCP, AWS and Azure. They match the Host VMs page of the nife.io dashboard: list and inspect hosts, start, stop and restart them, register new ones and remove them from Nife.
Subcommands​
| Subcommand | Description |
|---|---|
instance list | List VM instances |
instance show | Show a VM instance and its recent activity |
instance start | Start a VM instance |
instance stop | Stop a VM instance |
instance restart | Restart a VM instance |
instance delete | Delete a registered VM instance |
instance create | Create a VM instance |
nifectl instance <subcommand> [flags]
Options​
--org string Slug of the organization the instance belongs to
-h, --help Help for instance
Global Options​
-t, --access-token string Nife API Access Token
-j, --json JSON output format
-V, --verbose Verbose / debug output
instance list​
List VM instances.
List all virtual machine instances associated with your account.
nifectl instance list [flags]
Options:
--org string Slug of the organization the instance belongs to
--cloud string Show only one cloud: AWS, GCP or Azure
--status string Show only hosts with this status, for example running or stopped
instance show​
Show a VM instance and its recent activity.
Show the details of one registered VM instance and its activity log. Access keys and secrets are never shown.
nifectl instance show NAME [flags]
Options:
--org string Slug of the organization the instance belongs to
--activity int How many activity entries to show (default 10)
Examples:
nifectl instance show web-1
nifectl instance show web-1 --activity 25
instance start​
Start a VM instance.
Start a stopped virtual machine instance. Supports GCP, AWS and Azure.
nifectl instance start <name> [flags]
Options:
--org string Slug of the organization the instance belongs to
instance stop​
Stop a VM instance.
Stop a running virtual machine instance. Supports GCP, AWS and Azure.
nifectl instance stop <name> [flags]
Options:
--org string Slug of the organization the instance belongs to
instance restart​
Restart a VM instance.
Restart a registered virtual machine instance. Supports GCP, AWS and Azure.
nifectl instance restart NAME [flags]
Options:
--org string Slug of the organization the instance belongs to
Examples:
nifectl instance restart web-1
instance delete​
Delete a registered VM instance.
Remove a VM instance from Nife. You are asked to confirm unless you pass --yes.
nifectl instance delete NAME [flags]
Options:
--org string Slug of the organization the instance belongs to
-y, --yes Accept all confirmations
Examples:
nifectl instance delete web-1
nifectl instance delete web-1 --yes
instance create​
Create a VM instance.
Create a new virtual machine instance on Nife. Supports GCP, AWS and Azure. Requires cloud credentials appropriate to the selected provider.
nifectl instance create [NAME] [flags]
Options:
--org string Slug of the organization the instance belongs to
--name string Name of the instance (or give it as the first argument)
--cloud string Cloud of the instance: AWS, GCP or Azure
--zone string Zone (GCP) or region (AWS) of the instance
--instance-id string AWS: ID of the EC2 instance
--access-key string AWS: access key
--secret-key string AWS: secret key (env: NIFE_VM_SECRET_KEY)
--key-file string GCP: service account key file (JSON) (default "key.json")
--subscription-id string Azure: subscription ID
--resource-group string Azure: resource group name
--tenant-id string Azure: tenant ID
--client-id string Azure: client ID
--client-secret string Azure: client secret (env: NIFE_VM_CLIENT_SECRET)
Best Practices​
- Use
nifectl instance show NAME --activity 25to see more of a VM's activity log. Access keys and secrets are never shown. - Pass cloud credentials by environment variable (
NIFE_VM_SECRET_KEY,NIFE_VM_CLIENT_SECRET) rather than on the command line. - Pass
--yestoinstance deletein scripts to skip the confirmation.
See Also​
nifectl alerts– Alerts, including VM instance alert rulesnifectl status– Show application statusnifectl– The Nife CLI home command
Summary​
Nifectl Instance manages your registered virtual machines from the terminal without opening the dashboard.