Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Instance Commands

Contents

addinstance

addinstance                  Create new virtual machine instances.

                             Specify multiple instances as multiple arguments.
                             Each instance will be created in parallel.

                             Usage: gcutil [--global_flags] addinstance
                             [--command_flags] <instance-name-1> ...
                             <instance-name-n>

                             Flags for addinstance:

gcutil_lib.image_cmds:
  --[no]old_images: List all versions of images
    (default: 'false')
  --[no]standard_images: Include images in all well-known image projects.
    (default: 'true')

gcutil_lib.instance_cmds:
  --[no]add_compute_key_to_project: Adds the default Google Compute Engine ssh
    key as one of the authorized ssh keys for the project.If the default key has
    already been added to the project, then this will have no effect. The
    default behavior is to add the key to the project if no instance-specific
    keys are defined.
  --authorized_ssh_keys: Updates the list of user/key-file pairs to the
    specified entries, disabling project-wide key management for this instance.
    These are specified as a comma separated list of colon separated entries:
    user1:keyfile1,user2:keyfile2,...
    (default: '')
    (a comma separated list)
  --[no]auto_delete_boot_disk: Whether to auto-delete the boot disk when the
    instance is deleted.
    (default: 'false')
  --[no]automatic_restart: Whether the instance should be automatically
    restarted whenever it is terminated by Compute Engine (not terminated by
    user).
  --boot_disk_size_gb: Size of the persistent boot disk in GiB.
    (an integer)
  --[no]can_ip_forward: Specifies that the newly-created instance is allowed to
    send packets with a source IP address that does not match its own and
    receive packets whose destination IP address does not match its own.
    (default: 'false')
  --description: An optional description for this instance.
    (default: '')
  --disk: Attaches a persistent disk to this instance. You can also provide a
    list of comma-separated name=value pairs options. Legal option names are
    'deviceName', to specify the disk's device name, and 'mode', to indicate
    whether the disk should be attached READ_WRITE (the default) or READ_ONLY.
    You may also use the 'boot' flag to designate the disk as a boot device. For
    example: '--disk=mydisk,deviceName=primarydisk,mode=rw,boot';
    repeat this option to specify a list of values
    (default: '[]')
  --external_ip_address: Specifies the external NAT IP of this new instance. The
    default value is 'ephemeral' and indicates that the service should use any
    available ephemeral IP. You can also specify "none" (or an empty string) to
    indicate that no external IP should be assigned to the instance. If you want
    to explicitly use a certain IP, the IP must be reserved by the project and
    not in use by another resource.
    (default: 'ephemeral')
  --image: Specifies the image to use for this instance. For example,
    '--image=debian-7' or '--image=debian-7-wheezy-v20130723'. To get a list of
    images built by Google, run 'gcutil listimages --project=projects/google'.
    To get a list of images you have built, run 'gcutil --project=<project-id>
    listimages'.
  --machine_type: [Required] Specifies the machine type used for the instance.
    For example, '--machine_type=machinetype-name'. To get a list of available
    machine types, run 'gcutil listmachinetypes'.
  --network: Specifies the network to use for this instance. If not specified,
    the 'default' network is used.
    (default: 'default')
  --on_host_maintenance: <terminate|migrate>: How the instance should behave
    when the host machine undergoes maintenance that may temporarily impact
    instance performance. Must be unspecified or 'terminate' for instances with
    scratch disk. If unspecified, a default of 'terminate' will be used for
    instances with scratch disk, or 'migrate' for instances without scratch
    disk.
  --service_account: Specifies the service accounts for this instance. Once set,
    the service account's credentials can be used by the instance to make
    requests to other services. The default account is 'default'. You can also
    set specific service account names. For example,
    '[email protected]'
    (default: 'default')
  --service_account_scopes: Specifies the scope of credentials for the service
    account(s) available to this instance. Specify multiple scopes as
    comma-separated entries. You can also use a set of supported scope aliases:
    bigquery, cloudsql, compute-ro, compute-rw, datastore, storage-full,
    storage-ro, storage-rw, storage-wo, taskqueue, userinfo-email
    (default: '')
    (a comma separated list)
  --tags: Applies a set of tags to this instance. Tags can be used for filtering
    and configuring network firewall rules.
    (default: '')
    (a comma separated list)
  --[no]use_compute_key: Specifies the Google Compute Engine ssh key as one of
    the authorized ssh keys for the created instance. This has the side effect
    of disabling project-wide ssh key management for the instance.
    (default: 'false')
  --[no]wait_until_running: Specifies that gcutil should wait until the new
    instance is running before returning.
    (default: 'false')
  --zone: [Required] The zone for this request.

gcutil_lib.metadata:
  --metadata: Metadata to be made available within the VM environment via the
    local metadata server. This should be in the form key:value. Metadata keys
    must be unique;
    repeat this option to specify a list of values
    (default: '[]')
  --metadata_from_file: Metadata to be made available within the VM environment
    via the local metadata server. The value is loaded from a file. This should
    be in the form key:filename. Metadata keys must be unique;
    repeat this option to specify a list of values
    (default: '[]')

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

addtargetinstance

addtargetinstance            Create a new target instance to handle network load
                             balancing.

                             Usage: gcutil [--global_flags] addtargetinstance
                             [--command_flags] <target-instance-name>

                             Flags for addtargetinstance:

gcutil_lib.gcutil_flags:
  --nat_policy: <NO_NAT>: NAT policy options controlling how the IP should be
    NAT'ed to the VM.
    (default: 'NO_NAT')

gcutil_lib.target_instance_cmds:
  --description: An optional Target Instance description
    (default: '')
  --instance: The name of the instance resource to serve this target. The
    instance does not have to be created already, but must be in the same zone
    as this TargetInstance resource.
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

addtargetpoolinstance

addtargetpoolinstance        Add VM instances to an existing target pool.

                             Usage: gcutil [--global_flags]
                             addtargetpoolinstance [--command_flags]
                             <target-pool-name>

                             Flags for addtargetpoolinstance:

gcutil_lib.target_pool_cmds:
  --instance: [Deprecated]. Please use --instances to add one or more instances
    to the target pool. Must match the pattern [<zone>/]<instance>".
  --instances: [Required] Specifies a list of instances add to this target pool.
    Each entry must be specified by the instance name (e.g.,
    '--instances=<instance>') or by a relative or fully-qualified path to the
    instance (e.g., '--instances=<zone>/instances/<instance>'). To specify
    multiple instances, provide them as comma-separated entries. All instances
    in one target pool must belong to the same region as the target pool.
    Instances do not need to exist at the time it is added to the target pool
    and can be created afterwards.
    (default: '')
    (a comma separated list)
  --region: [Required] The region for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

deleteinstance

deleteinstance               Delete one or more VM instances.

                             Specify multiple disks as multiple arguments.
                             Instances will be deleted in parallel.

                             Usage: gcutil [--global_flags] deleteinstance
                             [--command_flags] <instance-name-1> ...
                             <instance-name-n>

                             Flags for deleteinstance:

gcutil_lib.command_base:
  -f,--[no]force: Override the "Delete instance" prompt
    (default: 'false')

gcutil_lib.instance_cmds:
  --[no]delete_boot_pd: Delete the attached boot persistent disk.
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

deletetargetinstance

deletetargetinstance         Delete one or more target instances.

                             If multiple target instance names are specified,
                             the target instance will be deleted in parallel.

                             Usage: gcutil [--global_flags] deletetargetinstance
                             [--command_flags] <target-instance-name-1> ...
                             <target-instance-name-n>

                             Flags for deletetargetinstance:

gcutil_lib.command_base:
  -f,--[no]force: Override the "Delete target instance" prompt
    (default: 'false')

gcutil_lib.target_instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

getinstance

getinstance                  Get a VM instance.

                             Usage: gcutil [--global_flags] getinstance
                             [--command_flags] <instance-name>

                             Flags for getinstance:

gcutil_lib.instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

## gettargetinstance {: id='gettargetinstance'}

gettargetinstance            Get a target instance.

                             Usage: gcutil [--global_flags] gettargetinstance
                             [--command_flags] <target-instance-name>

                             Flags for gettargetinstance:

gcutil_lib.target_instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

listinstances

listinstances                List the VM instances for a project.

                             Usage: gcutil [--global_flags] listinstances
                             [--command_flags]

                             Flags for listinstances:

gcutil_lib.command_base:
  --columns: A comma-separated list of the desired columns to display. If 'all'
    is specified, then all possible columns will be included. Valid columns are
    <all|name|machine-type|image|kernel|network|network-ip|external-ip|disks|zon
    e|status|status-message>.
    (a comma separated list)
  --[no]fetch_all_pages: Deprecated flag.
    (default: 'true')
  --filter: Filter expression for filtering listed resources. See gcutil
    documentation for syntax of the filter expression here:
    http://developers.google.com/compute/docs/gcutil/tips#filtering
  --max_results: Maximum number of items to list [Default is to fetch all].
    (a positive integer)

gcutil_lib.gcutil_flags:
  --sort_by: <name|-name|zone|-zone|status|-status|network-ip|-network-ip|extern
    al-ip|-external-ip>: Sort output results by the given field name. Field
    names starting with a "-" will lead to a descending order.

gcutil_lib.instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

listtargetinstances

listtargetinstances          List the target instances for a project.

                             Usage: gcutil [--global_flags] listtargetinstances
                             [--command_flags]

                             Flags for listtargetinstances:

gcutil_lib.command_base:
  --columns: A comma-separated list of the desired columns to display. If 'all'
    is specified, then all possible columns will be included. Valid columns are
    <all|name|description|zone|nat-policy|instance>.
    (a comma separated list)
  --[no]fetch_all_pages: Deprecated flag.
    (default: 'true')
  --filter: Filter expression for filtering listed resources. See gcutil
    documentation for syntax of the filter expression here:
    http://developers.google.com/compute/docs/gcutil/tips#filtering
  --max_results: Maximum number of items to list [Default is to fetch all].
    (a positive integer)

gcutil_lib.gcutil_flags:
  --sort_by: <name|-name|instance|-instance>: Sort output results by the given
    field name. Field names starting with a "-" will lead to a descending order.

gcutil_lib.target_instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

moveinstances

moveinstances                Move VM instances from one zone to another zone.

                             This command also moves any persistent disks that
                             are attached to the instances.

                             During the move, do not modify your project, as
                             changes to the project may interfere with the move.

                             You can pick which instances to move by specifying
                             a series of regular expressions that will be used
                             to match instance names in the source zone. For
                             example, the following command will move all
                             instances in zone-a whose names match the regular
                             expressions i-[0-9] or b-.* to zone-b:

                             gcutil moveinstances --source_zone=zone-a
                             --destination_zone=zone-b "i-[0-9]" "b-.*"

                             WARNING: Instances that are moved will lose ALL of
                             their transient state (i.e., scratch disks,
                             ephemeral IP addresses, and memory).

                             WARNING: This command may fail. If failure happens
                             during validation, the state of your instances is
                             preserved. If failure happens during
                             the move, the 'resumemove' command may be used to
                             recover. In rare
                             circumstances, you may need to move your instances
                             by hand.

                             Usage: gcutil [--global_flags] moveinstances
                             [--command_flags] <name-regex-1> ... <name-regex-n>

                             Flags for moveinstances:

gcutil_lib.move_cmds:
  --destination_zone: [Required] The zone to which the instances should be
    moved.
  --[no]force: Override the confirmation prompt.
    (default: 'false')
  --[no]keep_snapshots: Do not delete snapshots that were created for the disks.
    (default: 'false')
  --[no]replace_deprecated: Replaces deprecated resource with their recommended
    replacement.
    (default: 'false')
  --source_zone: [Required] The source zone from which instances will be moved.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

removetargetpoolinstance

removetargetpoolinstance     Remove a VM instance from a target pool.

                             Usage: gcutil [--global_flags]
                             removetargetpoolinstance [--command_flags]
                             <target-pool-name>

                             Flags for removetargetpoolinstance:

gcutil_lib.target_pool_cmds:
  --instance: [Deprecated]. Please use --instances to remove one or more
    instances from the target pool.
  --instances: [Required] Specifies a list of instances to be removed this
    target pool. Each entry must be specified by the instance name (e.g.,
    '--instances=<instance>') or a relatively or fully qualified path (e.g.,
    '--instances=<zone>/instances/<instance>'). To specify multiple instances,
    provide them as comma-separated entries. All instances in one target pool
    must belong to the same region as the target pool. Instances do not need to
    exist at the time it is added to the target pool and can be created
    afterwards.
    (default: '')
    (a comma separated list)
  --region: [Required] The region for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

resetinstance

resetinstance                Reset a VM instance, resulting in a reboot.

                             Usage: gcutil [--global_flags] resetinstance
                             [--command_flags] <instance-name>

                             Flags for resetinstance:

gcutil_lib.instance_cmds:
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

setcommoninstancemetadata

setcommoninstancemetadata    Set the commonInstanceMetadata field for a Google
                             Compute Engine project.

                             This is a blanket overwrite of all of the project
                             wide metadata.

                             Usage: gcutil [--global_flags]
                             setcommoninstancemetadata [--command_flags]

                             Flags for setcommoninstancemetadata:

gcutil_lib.metadata:
  --metadata: Metadata to be made available within the VM environment via the
    local metadata server. This should be in the form key:value. Metadata keys
    must be unique;
    repeat this option to specify a list of values
    (default: '[]')
  --metadata_from_file: Metadata to be made available within the VM environment
    via the local metadata server. The value is loaded from a file. This should
    be in the form key:filename. Metadata keys must be unique;
    repeat this option to specify a list of values
    (default: '[]')

gcutil_lib.project_cmds:
  -f,--[no]force: Sets project metadata even if it erases existing metadata
    keys.
    (default: 'false')

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

setinstancemetadata

setinstancemetadata          Set the metadata for a VM instance.

                             This method overwrites existing instance metadata
                             with new metadata. Common metadata (project-wide)
                             is preserved.

                             For example, running:

                             gcutil --project=<project-name> setinstancemetadata
                             my-instance --metadata="key1:value1"
                             --fingerprint=<original-fingerprint>
                             ...
                             gcutil --project=<project-name> setinstancemetadata
                             my-instance --metadata="key2:value2"
                             --fingerprint=<new-fingerprint>

                             will result in 'my-instance' having 'key2:value2'
                             as its metadata.

                             Usage: gcutil [--global_flags] setinstancemetadata
                             [--command_flags] <instance-name>

                             Flags for setinstancemetadata:

gcutil_lib.instance_cmds:
  --fingerprint: [Required] Fingerprint of the data to be overwritten. This
    fingerprint provides optimistic locking. Data will only be set if the given
    fingerprint matches the state of the data prior to this request.
  -f,--[no]force: Set new metadata even if the key 'sshKeys' will no longer be
    present.
  --zone: [Required] The zone for this request.

gcutil_lib.metadata:
  --metadata: Metadata to be made available within the VM environment via the
    local metadata server. This should be in the form key:value. Metadata keys
    must be unique;
    repeat this option to specify a list of values
    (default: '[]')
  --metadata_from_file: Metadata to be made available within the VM environment
    via the local metadata server. The value is loaded from a file. This should
    be in the form key:filename. Metadata keys must be unique;
    repeat this option to specify a list of values
    (default: '[]')

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

setinstancetags

setinstancetags              Set the tags for a VM instance.

                             This method overwrites existing instance tags.

                             For example, running:

                             gcutil --project=<project-name> setinstancetags
                             my-instance --tags="tag-1"
                             --fingerprint=<original-fingerprint>
                             ...
                             gcutil --project=<project-name> setinstancetags
                             my-instance --tags="tag-2,tag-3"
                             --fingerprint=<new-fingerprint>

                             will result in 'my-instance' having tags 'tag-2'
                             and 'tag-3'.

                             Usage: gcutil [--global_flags] setinstancetags
                             [--command_flags]

                             Flags for setinstancetags:

gcutil_lib.instance_cmds:
  --fingerprint: [Required] Fingerprint of the data to be overwritten. This
    fingerprint provides optimistic locking. Data will only be set if the given
    fingerprint matches the state of the data prior to this request.
  --tags: [Required] A set of tags applied to this instance. Used for filtering
    and to configure network firewall rules To specify multiple tags, provide
    them as comma-separated entries.
    (default: '')
    (a comma separated list)
  --zone: [Required] The zone for this request.

gflags:
  --flagfile: Insert flag definitions from the given file into the command line.
    (default: '')
  --undefok: comma-separated list of flag names that it is okay to specify on
    the command line even if the program does not define a flag with that name.
    IMPORTANT: flags in this list that have arguments MUST use the --flag=value
    format.
    (default: '')

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.