Skip to main content

ecs instance

Manage instance resources

Run ecctl ecs instance <action> -h for usage, or ecctl schema ecs.instance.<action> --full for the complete, agent-readable spec of every parameter and behavior.

create

ecctl ecs instance create [flags]

Create instance

  • Kind: mutation · Risk: medium
  • Synchronous: waits for Running (waiter running_after_create, timeout 300s); use --no-wait to skip.
  • Idempotent via ClientToken.
  • Dry run: supported via --dry-run.
APIWhen calledPurpose
DescribeImagesWhen --image is not empty and does not end with .vhd.Resolve the requested image name to an image ID before creating the instance.
RunInstancesEvery time the command runs.Perform the resource operation.
DescribeInstancesWhen --no-wait is not specified and --dry-run is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInstancesWhen --no-wait is not specified and --dry-run is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--imagestringECS image ID or name
--regionstringAlibaba Cloud region
--sgstringsecurity group ID
--typestringinstance type
--vswitchstringVSwitch ID
--affinitystringinstance affinity
--amountintegernumber of instances to create
--arnobjectRAM role ARNs for the instance.
--auto-paybooleanautomatically pay for prepaid instances
--auto-release-timestringautomatic release time
--auto-renewbooleanautomatically renew prepaid instances
--auto-renew-periodintegerautomatic renewal period
--clock-optionsobjectclock options
--cpu-optionsobjectCPU options
--credit-specificationstringburstable instance credit specification
--data-diskobjectData disks to attach when creating the instance.
--dedicated-hoststringdedicated host ID
--deletion-protectionbooleanenable deletion protection
--deployment-setstringdeployment set ID
--deployment-set-group-nointegerdeployment set group number
--descriptionstringinstance description
--hibernation-optionsobjecthibernation options
--host-namestringhost name
--host-namesarrayhost names
--hpc-clusterstringHPC cluster ID
--http-endpointstringmetadata service endpoint setting
--http-put-response-hop-limitintegermetadata service PUT response hop limit
--http-tokensstringmetadata service token requirement
--image-familystringimage family
--image-optionsobjectimage options
--instance-charge-typestringinstance charge type (default: PostPaid)
--internet-bandwidth-inintegerpublic inbound bandwidth
--internet-bandwidth-outintegerpublic outbound bandwidth
--internet-charge-typestringinternet charge type
--io-optimizedstringI/O optimized setting
--ipv6-address-countintegernumber of IPv6 addresses
--ipv6-addressesarrayIPv6 addresses
--ispstringline operator
--key-pairstringkey pair name
--launch-templatestringlaunch template ID
--launch-template-namestringlaunch template name
--launch-template-versionintegerlaunch template version
--min-amountintegerminimum number of instances to create
--namestringinstance name
--network-interfaceobjectElastic network interfaces.
--network-interface-queue-numberintegernetwork interface queue number
--network-optionsobjectnetwork options
--passwordstringinstance password
--password-inheritbooleaninherit image password
--periodintegerprepaid period
--period-unitstringprepaid period unit
--private-dns-name-optionsobjectprivate DNS name options
--private-ipstringprivate IPv4 address
--private-pool-optionsobjectprivate pool options
--ram-rolestringRAM role name
--resource-groupstringresource group ID
--scheduler-optionsobjectscheduler options
--security-enhancement-strategystringsecurity enhancement strategy
--security-group-idsarraysecurity group IDs
--security-optionsobjectsecurity options
--spot-durationintegerpreemptible instance duration
--spot-interruption-behaviorstringpreemptible interruption behavior
--spot-price-limitnumberpreemptible instance price limit
--spot-strategystringpreemptible instance strategy
--storage-setstringstorage set ID
--storage-set-partition-numberintegerstorage set partition number
--system-diskobjectSystem disk configuration.
--tagkey_valuetag assignment key=value
--tenancystringtenancy
--unique-suffixbooleanadd a unique suffix to generated names
--user-datastringuser data
--zonestringzone ID

update

ecctl ecs instance update <id> [flags]

Update instance

  • Kind: mutation · Risk: medium
APIWhen calledPurpose
ModifyInstanceAttributeWhen --name is specified or --description is specified or --host-name is specified.Perform the resource operation.
ModifyInstanceAutoReleaseTimeWhen --auto-release-time is specified.Perform the resource operation.
ModifyInstanceAutoRenewAttributeWhen --auto-renew is specified or --auto-renew-period is specified.Perform the resource operation.
ModifyInstanceChargeTypeWhen --instance-charge-type is specified and --type is not specified.Perform the resource operation.
ModifyInstanceClockOptionsWhen --clock-options is specified.Perform the resource operation.
ModifyInstanceMaintenanceAttributesWhen --maintenance-options is specified.Perform the resource operation.
ModifyInstanceMetadataOptionsWhen --http-endpoint is specified or --http-tokens is specified or --http-put-response-hop-limit is specified.Perform the resource operation.
ModifyInstanceNetworkOptionsWhen --network-options is specified.Perform the resource operation.
ModifyInstanceNetworkSpecWhen --internet-bandwidth-in is specified or --internet-bandwidth-out is specified or --internet-charge-type is specified.Perform the resource operation.
ModifyInstanceSpecWhen --type is specified and --instance-charge-type does not equal PrePaid.Perform the resource operation.
ModifyPrepayInstanceSpecWhen --type is specified and --instance-charge-type equals PrePaid.Perform the resource operation.
ModifyInstanceVncPasswdWhen --vnc-password is specified.Perform the resource operation.
ModifyInstanceVpcAttributeWhen --vswitch is specified or --private-ip is specified.Perform the resource operation.
AllocatePublicIpAddressWhen --allocate-public-ip is specified.Perform the resource operation.
ReplaceSystemDiskWhen --image is specified or --system-disk is specified.Perform the resource operation.
AttachInstanceRamRoleWhen --ram-role is explicitly set to a non-empty value.Perform the resource operation.
DetachInstanceRamRoleWhen --ram-role is explicitly set to an empty value.Perform the resource operation.
AttachKeyPairWhen --key-pair is explicitly set to a non-empty value.Perform the resource operation.
DetachKeyPairWhen --key-pair is explicitly set to an empty value.Perform the resource operation.
DescribeInstanceAttributeWhen --security-group-ids is specified.Read the resource view.
JoinSecurityGroupWhen --security-group-ids is specified.Perform the resource operation.
LeaveSecurityGroupWhen --security-group-ids is specified.Perform the resource operation.
JoinResourceGroupWhen --resource-group is specified.Perform the resource operation.
TagResourcesWhen --tag is specified.Perform the resource operation.
UntagResourcesWhen --remove-tag is specified.Perform the resource operation.
DescribeInstancesWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--auto-renewbooleanautomatically renew prepaid instances
--clock-optionsobjectclock options
--descriptionstringinstance description
--host-namestringhost name
--http-endpointstringmetadata service endpoint setting
--http-tokensstringmetadata service token requirement
--imagestringECS image ID or name
--instance-charge-typestringinstance charge type (default: ``)
--internet-bandwidth-outintegerpublic outbound bandwidth
--key-pairstringkey pair name
--maintenance-optionsobjectmaintenance attributes
--namestringinstance name
--network-optionsobjectnetwork options
--periodintegerprepaid period
--ram-rolestringRAM role name
--remove-tagstring_arraytag keys to remove
--resource-groupstringresource group ID
--security-group-idsarraysecurity group IDs
--tagkey_valuetag assignment key=value
--typestringinstance type
--vswitchstringVSwitch ID

delete

ecctl ecs instance delete [<ids>...] [flags]

Delete instance

  • Kind: mutation · Risk: high
  • Synchronous: waits for absent (waiter deleted_after_delete, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
DeleteInstanceWhen exactly one &lt;ids> value is provided.Perform the resource operation.
DescribeInstancesWhen exactly one &lt;ids> value is provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DeleteInstancesWhen multiple &lt;ids> values are provided.Perform the resource operation.
DescribeInstancesWhen multiple &lt;ids> values are provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--forcebooleanforce release running instance (must be set explicitly) (default: false)

get

ecctl ecs instance get <id> [flags]

Get instance

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeInstanceAttributeEvery time the command runs.Read the resource view.
DescribeInstanceAutoRenewAttributeWhen --with-auto-renew is specified.Read the resource view.
DescribeInstanceMaintenanceAttributesWhen --with-maintenance is specified.Read the resource view.
DescribeInstanceRamRoleWhen --with-ram-role is specified.Read the resource view.
DescribeUserDataWhen --with-user-data is specified.Read the resource view.
DescribeInstanceVncUrlWhen --with-vnc-url is specified.Read the resource view.
DescribeCloudAssistantStatusWhen --with-assistant is specified.Read the resource view.
ListPluginStatusWhen --with-plugin-status is specified.Read the resource view.
ListTagResourcesWhen --with-tags is specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--with-assistantbooleaninclude cloud assistant status
--with-auto-renewbooleaninclude automatic renewal settings
--with-maintenancebooleaninclude maintenance attributes
--with-plugin-statusbooleaninclude cloud assistant plugin status
--with-ram-rolebooleaninclude RAM role information
--with-tagsbooleaninclude resource tags
--with-user-databooleaninclude user data
--with-vnc-urlbooleaninclude VNC login URL

list

ecctl ecs instance list [<ids>...] [flags]

List instance resources

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeInstancesEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--filterkey_valuefilter expression key=value
--limitintegermaximum resources to return (default: 100)
--next-tokenstringtoken for the next result page

exec

ecctl ecs instance exec [<ids>...] [flags]

Run a temporary command on instances

  • Kind: mutation · Risk: high
  • Synchronous: waits for Success (waiter command_invocation_success, timeout 600s); use --no-wait to skip.
APIWhen calledPurpose
RunCommandEvery time the command runs.Perform the resource operation.
DescribeInvocationsWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInvocationResultsWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--commandstringcommand content to run on the instance
--regionstringAlibaba Cloud region
--command-timeoutintegercommand timeout in seconds
--command-typestringcloud assistant command type (default: RunShellScript)
--working-dirstringcommand working directory

monitor

ecctl ecs instance monitor <id> [flags]

Query instance monitor data

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeInstanceMonitorDataEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--end-timestringmonitor query end time
--regionstringAlibaba Cloud region
--start-timestringmonitor query start time
--monitor-periodintegermonitor data sampling period in seconds

reboot

ecctl ecs instance reboot [<ids>...] [flags]

Reboot instance

  • Kind: mutation · Risk: medium
  • Synchronous: waits for Running (waiter running_after_reboot, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
RebootInstanceWhen exactly one &lt;ids> value is provided.Perform the resource operation.
DescribeInstancesWhen exactly one &lt;ids> value is provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
RebootInstancesWhen multiple &lt;ids> values are provided.Perform the resource operation.
DescribeInstancesWhen multiple &lt;ids> values are provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInstancesWhen --no-wait is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region

renew

ecctl ecs instance renew <id> [flags]

Renew instance

  • Kind: mutation · Risk: medium
APIWhen calledPurpose
RenewInstanceEvery time the command runs.Perform the resource operation.
ParameterTypeRequiredDescription
--periodintegerprepaid period
--regionstringAlibaba Cloud region
--period-unitstringprepaid period unit

sendfile

ecctl ecs instance sendfile [<ids>...] [flags]

Send a file to instances

  • Kind: mutation · Risk: high
  • Synchronous: waits for Success (waiter sendfile_result_success, timeout 600s); use --no-wait to skip.
APIWhen calledPurpose
SendFileEvery time the command runs.Perform the resource operation.
DescribeSendFileResultsWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeSendFileResultsWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--contentstringfile content to send
--file-namestringfile name to create
--regionstringAlibaba Cloud region
--target-dirstringtarget directory for the file
--file-modestringfile permission mode
--groupstringfile group
--ownerstringfile owner

start

ecctl ecs instance start [<ids>...] [flags]

Start instance

  • Kind: mutation · Risk: medium
  • Synchronous: waits for Running (waiter running_after_start, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
StartInstanceWhen exactly one &lt;ids> value is provided.Perform the resource operation.
DescribeInstancesWhen exactly one &lt;ids> value is provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
StartInstancesWhen multiple &lt;ids> values are provided.Perform the resource operation.
DescribeInstancesWhen multiple &lt;ids> values are provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInstancesWhen --no-wait is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region

stop

ecctl ecs instance stop [<ids>...] [flags]

Stop instance

  • Kind: mutation · Risk: medium
  • Synchronous: waits for Stopped (waiter stopped_after_stop, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
StopInstanceWhen exactly one &lt;ids> value is provided.Perform the resource operation.
DescribeInstancesWhen exactly one &lt;ids> value is provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
StopInstancesWhen multiple &lt;ids> values are provided.Perform the resource operation.
DescribeInstancesWhen multiple &lt;ids> values are provided and --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInstancesWhen --no-wait is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region