-
Notifications
You must be signed in to change notification settings - Fork 6
Basic Commands
A placeholder is a notation starting with dollar sign like $name
or $date
similar to how you declare variables in PHP or Bash. Placeholders are mostly used in bulk operations. For example you would like to create instance snapshots based on instance name:
my-instance-1 -> my-instance1_image
my-instance-2 -> my-instance2_image
In that case you can do bulk operation like that:
perspective> add images --name $name_image --instances my-instance-[12]
This works because in $name_image
expression $name
will be replaced by real instance name for each processed instance.
Shows a list of available projects. Can optionally filter projects by name.
perspective> show projects
perspective> show projects --name one,two,three
Shows available flavors optionally filtering by name, project name or cloud.
perspective> show flavors
perspective> show flavors --project test
Shows available keypairs optionally filtering by name, project name or cloud.
perspective> show keypairs
perspective> show flavors --name my-keypair
Shows available networks optionally filtering by name, project name or cloud.
perspective> show networks
perspective> show networks --name my-keypair
Adds one or more instances. Without arguments launches a step-by-step wizard:
perspective> add instances
This wizard will ask you some questions about instance name, flavor, network configuration or image and then generate respective arguments. You can also specify arguments manually:
perspective> add instances --project test-project --name my-vm-$number --flavor m1.small --image ^ubuntu-14.04$ --network ^my-network$ --range 1,3-5,7
This command will create 5 instances by replacing $number
with 1, 3, 4, 5 and 7 respectively.
Lists instances optionally filtering by name, state, flavor, image or project.
perspective> show instances
perspective> show instances --state error
perspective> show instances --name one,two --project test
perspective> show instances --image my-img --flavor m1.test
Shows instance console if such information is available.
perspective> show console vm-one,vm-two,test.*
An example console is shown below:
Reboots instance.
perspective> reboot test-instance,one-more-instance
Hard-reboots (resets) instance.
perspective> hard-reboot test-instance,one-more-instance
perspective> reboot my-vm --hard
Shuts instance down. The same as doing ACPI shutdown. In some clouds tries normal shutdown and after timeout does power off.
perspective> shutdown test-instance,one-more-instance
Starts previously shutdown instance.
perspective> start test-instance,one-more-instance
Pauses instance. Instance memory is still stored in hypervisor RAM.
perspective> pause test-instance,one-more-instance
Suspends (hibernates) instance. Instance memory is copied to disk.
perspective> suspend test-instance,one-more-instance
Activates previously suspended or paused instance.
perspective> resume test-instance,one-more-instance
Rebuilds instance, i.e. changes its image without recreating VM. Without arguments launches respective wizard:
perspective> rebuild
Manually typed command is like the following:
perspective> rebuild --project test-project --instances test-instance,one-more-instance --image new-image
Resize instance, i.e. modifies its flavor: number of VCPUS, memory and disk size. Without arguments launches respective wizard:
perspective> resize
Manually typed command is like the following:
perspective> resize --project test-project --instances test-instance,one-more-instance --flavor new-flavor
Change instance name. For some clouds this can lead to automatic hostname change. You may want to use $name
or $date
placeholders to consider current instance name or date in new name.
perspective> rename --instances test-instance,one-more-instance --name $name-new
Completely deletes one or more instances.
perspective> delete instances my-vm-[123]
Adds one or more images. Without arguments launches a step-by-step wizard similar to add instances
command:
perspective> add images
You can also specify arguments manually:
perspective> add images --name $name-$date --instances test-.*
In this command $name
placeholder will be replaced by instance name and $date
by current date formatted using date_format
setting.
Lists images optionally filtering by name, state or cloud.
perspective> show images --name my-image,one-more-image
perspective> show images --state saving
Deletes one or more images.
perspective> delete images my-cool-image-.*,test-img-2
Shows a list of available settings.
perspective> show settings
perspective> show settings --all
Shows a list of available filters.
perspective> show filters
perspective> show filters --all
Shows a list of incoming letters.
perspective> show mail
Sets value for filter or setting. Value can optionally contain multiple comma separated strings.
perspective> set some_name = value1,value2,value3
Unsets previously set value for filter or setting.
perspective> unset some_name
Shows help information for specified command or a list of available commands.
perspective> help
perspective> help show projects
Shows shell version.
perspective> version