gcloud beta compute instance-templates create-with-container
NAME
[--accelerator
=[count
=COUNT
],[type
=TYPE
]] [--no-boot-disk-auto-delete
] [--boot-disk-device-name
=BOOT_DISK_DEVICE_NAME
] [--boot-disk-interface
=BOOT_DISK_INTERFACE
] [--boot-disk-provisioned-iops
=BOOT_DISK_PROVISIONED_IOPS
] [--boot-disk-provisioned-throughput
=BOOT_DISK_PROVISIONED_THROUGHPUT
] [--boot-disk-size
=BOOT_DISK_SIZE
] [--boot-disk-type
=BOOT_DISK_TYPE
] [--can-ip-forward
] [--confidential-compute
] [--container-arg
=CONTAINER_ARG
] [--container-command
=CONTAINER_COMMAND
] [--container-env
=[KEY
=VALUE
, …,…]] [--container-env-file
=CONTAINER_ENV_FILE
] [--container-image
=CONTAINER_IMAGE
] [--container-mount-disk
=[mode
=MODE
],[mount-path
=MOUNT-PATH
],[name
=NAME
],[partition
=PARTITION
]] [--container-mount-host-path
=[host-path
=HOSTPATH
,mount-path
=MOUNTPATH
[,mode
=MODE
],…]] [--container-mount-tmpfs
=[mount-path
=MOUNTPATH
,…]] [--container-privileged
] [--container-restart-policy
=POLICY
; default="always"] [--container-stdin
] [--container-tty
] [--create-disk
=[PROPERTY
=VALUE
,…]] [--description
=DESCRIPTION
] [--disk
=[auto-delete
=AUTO-DELETE
],[boot
=BOOT
],[device-name
=DEVICE-NAME
],[interface
=INTERFACE
],[mode
=MODE
],[name
=NAME
]] [--external-ipv6-address
=EXTERNAL_IPV6_ADDRESS
] [--external-ipv6-prefix-length
=EXTERNAL_IPV6_PREFIX_LENGTH
] [--internal-ipv6-address
=INTERNAL_IPV6_ADDRESS
] [--internal-ipv6-prefix-length
=INTERNAL_IPV6_PREFIX_LENGTH
] [--ipv6-network-tier
=IPV6_NETWORK_TIER
] [--labels
=[KEY
=VALUE
,…]] [--local-ssd
=[device-name
=DEVICE-NAME
],[interface
=INTERFACE
]] [--machine-type
=MACHINE_TYPE
] [--maintenance-policy
=MAINTENANCE_POLICY
] [--metadata
=KEY
=VALUE
,[KEY
=VALUE
,…]] [--metadata-from-file
=KEY
=LOCAL_FILE_PATH
,[…]] [--min-cpu-platform
=PLATFORM
] [--network
=NETWORK
] [--network-interface
=[PROPERTY
=VALUE
,…]] [--network-tier
=NETWORK_TIER
] [--preemptible
] [--private-ipv6-google-access-type
=PRIVATE_IPV6_GOOGLE_ACCESS_TYPE
] [--private-network-ip
=PRIVATE_NETWORK_IP
] [--provisioning-model
=PROVISIONING_MODEL
] [--region
=REGION
] [--resource-policies
=[RESOURCE_POLICY
,…]] [--no-restart-on-failure
] [--shielded-integrity-monitoring
] [--shielded-secure-boot
] [--shielded-vtpm
] [--[no-]skip-guest-os-shutdown
] [--stack-type
=STACK_TYPE
] [--subnet
=SUBNET
] [--tags
=TAG
,[TAG
,…]] [--address
=ADDRESS
| --no-address
] [--custom-cpu
=CUSTOM_CPU
--custom-memory
=CUSTOM_MEMORY
: --custom-extensions
--custom-vm-type
=CUSTOM_VM_TYPE
] [--image-project
=IMAGE_PROJECT
--image
=IMAGE
| --image-family
=IMAGE_FAMILY
] [--reservation
=RESERVATION
--reservation-affinity
=RESERVATION_AFFINITY
; default="any"] [--scopes
=[SCOPE
,…] | --no-scopes
] [--service-account
=SERVICE_ACCOUNT
| --no-service-account
] [GCLOUD_WIDE_FLAG …
]
(BETA)
gcloud beta compute instance-templates create-with-container
creates a Compute Engine virtual machine instance template that runs a container image. To create an instance template named 'instance-template-1' that runs the 'busybox' image, run:
gcloud beta compute instance-templates create-with-container instance-template-1 --container-image=gcr.io/google-containers/busybox
For more examples, refer to the EXAMPLES
section below.
gcloud beta compute instance-templates create-with-container instance-template-1 --container-image=gcr.io/google-containers/busybox --container-command='echo "Hello world"'
To create a template running gcr.io/google-containers/busybox in privileged mode, run:
gcloud beta compute instance-templates create-with-container instance-template-1 --container-image=gcr.io/google-containers/busybox --container-privileged
NAME
--accelerator
=[count
=COUNT
],[type
=TYPE
]
type
count
--boot-disk-auto-delete
--no-boot-disk-auto-delete
to disable.
--boot-disk-device-name
=BOOT_DISK_DEVICE_NAME
--boot-disk-interface
=BOOT_DISK_INTERFACE
--boot-disk-provisioned-iops
=BOOT_DISK_PROVISIONED_IOPS
--boot-disk-provisioned-throughput
=BOOT_DISK_PROVISIONED_THROUGHPUT
--boot-disk-size
=BOOT_DISK_SIZE
KB
for kilobyte, MB
for megabyte, GB
for gigabyte, or TB
for terabyte. For example, 10GB
will produce a 10 gigabyte disk. Disk size must be a multiple of 1 GB. Default size unit is GB
.
--boot-disk-type
=BOOT_DISK_TYPE
$ gcloud compute disk-types list
.
--can-ip-forward
--confidential-compute
--container-arg
=CONTAINER_ARG
Assuming the default entry point of the container (or an entry point overridden with --container-command flag) is a Bourne shell-compatible executable, in order to execute 'ls -l' command in the container, the user could use:
--container-arg="-c" --container-arg="ls -l"
Caveat: due to the nature of the argument parsing, it's impossible to provide the flag value that starts with a dash (-
) without the =
sign (that is, --container-arg "-c"
will not work correctly).
Default: None. (no arguments appended)
--container-command
=CONTAINER_COMMAND
nc
.
Default: None (default container entrypoint is used)
--container-env
=[KEY
=VALUE
, …,…]
Values, declared with --container-env flag override those with the same KEY from file, provided in --container-env-file.
--container-env-file
=CONTAINER_ENV_FILE
File with environment variables in format used by docker (almost). This means:
#
is first non-whitespace character in a line the line is ignored as a comment.--container-image
=CONTAINER_IMAGE
docker.io/tomcat
.
--container-mount-disk
=[mode
=MODE
],[mount-path
=MOUNT-PATH
],[name
=NAME
],[partition
=PARTITION
]
--disk
or --create-disk
.
name
--disk
or --create-disk
, specifying disk name here is optional. The name of the single additional disk will be used by default.
mount-path
partition
mode
rw
(read/write) or ro
(read-only). Defaults to rw
. Fails if the disk mode is ro
and volume mount mode is rw
.
--container-mount-host-path
=[host-path
=HOSTPATH
,mount-path
=MOUNTPATH
[,mode
=MODE
],…]
host-path
mount-path
mode
Default: rw.
--container-mount-tmpfs
=[mount-path
=MOUNTPATH
,…]
mount-path
--container-privileged
Default: --no-container-privileged
.
--container-restart-policy
=POLICY
; default="always"
POLICY
must be one of: never
, on-failure
, always
.
--container-stdin
Default: --no-container-stdin
.
--container-tty
Default: --no-container-tty
.
--create-disk
=[PROPERTY
=VALUE
,…]
name
--container-mount-disk
.
description
mode
ro
for read-only and rw
for read-write. If omitted, rw
is used as a default. It is an error to create a disk in ro
mode if attaching it to a container with --container-mount-disk
.
image
$ gcloud compute images list
. It is best practice to use image when a specific version of an image is needed. If both image and image-family flags are omitted a blank disk will be created.
image-family
image-project
gcloud compute images list
.
size
KB
for kilobyte, MB
for megabyte, GB
for gigabyte, or TB
for terabyte. For example, 10GB
will produce a 10 gigabyte disk. Disk size must be a multiple of 1 GB. If not specified, the default image size will be used for the new disk.
type
pd-standard
.
device-name
name
if used with --container-mount-disk
. If omitted, a device name of the form persistent-disk-N
is used. If omitted and used with --container-mount-disk
(where the name
of the container mount disk is the same as in this flag), a device name equal to disk name
is used.
provisioned-iops
provisioned-throughput
disk-resource-policy
https://www.googleapis.com/compute/v1/projects/my-project/regions/us-central1/resourcePolicies/my-resource-policy
projects/my-project/regions/us-central1/resourcePolicies/my-resource-policy
For more information, see the following docs:
auto-delete
yes
, this persistent disk will be automatically deleted when the instance is deleted. However, if the disk is later detached from the instance, this option won't apply. The default value for this is yes
.
architecture
storage-pool
interface
multi-writer
yes
, the disk is created in multi-writer mode so that it can be attached with read-write access to two VMs. The default value is no
. The multi-writer feature requires specialized filesystems, among other restrictions. For more information, see https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms.
replica-zones
labels
:
character to add to the disk.
Example: Key1=Value1:Key2=Value2:Key3=Value3
. Keys must start with a lowercase character and contain only hyphens (-
), underscores (_
), lowercase characters, and numbers. Values must contain only hyphens (-
), underscores (_
), lowercase characters, and numbers.
--description
=DESCRIPTION
--disk
=[auto-delete
=AUTO-DELETE
],[boot
=BOOT
],[device-name
=DEVICE-NAME
],[interface
=INTERFACE
],[mode
=MODE
],[name
=NAME
]
name
projects/myproject/regions/us-central1/disks/my-regional-disk
.
mode
ro
for read-only mode and rw
for read-write mode. If omitted, rw
is used as a default value. If you use rw
when creating more than one instance, you encounter errors.
boot
yes
, you attach a boot disk. The virtual machine then uses the first partition of the disk for the root file systems. The default value for this is no
.
device-name
name
if used with --container-mount-disk
. If omitted, a device name of the form persistent-disk-N
is used. If omitted and used with --container-mount-disk
(where the name
of the container mount disk is the same as in this flag), a device name equal to disk name
is used.
auto-delete
yes
, the persistent disk is automatically deleted when the instance is deleted. However, if you detach the disk from the instance, deleting the instance doesn't delete the disk. The default value is yes
.
interface
--external-ipv6-address
=EXTERNAL_IPV6_ADDRESS
--external-ipv6-prefix-length
=EXTERNAL_IPV6_PREFIX_LENGTH
--external-ipv6-address
. Only the /96 IP address range is supported, and the default value is 96.
--internal-ipv6-address
=INTERNAL_IPV6_ADDRESS
--internal-ipv6-prefix-length
=INTERNAL_IPV6_PREFIX_LENGTH
--ipv6-network-tier
=IPV6_NETWORK_TIER
IPV6_NETWORK_TIER
must be (only one value is supported):
PREMIUM
--labels
=[KEY
=VALUE
,…]
Keys must start with a lowercase character and contain only hyphens (-
), underscores (_
), lowercase characters, and numbers. Values must contain only hyphens (-
), underscores (_
), lowercase characters, and numbers.
--local-ssd
=[device-name
=DEVICE-NAME
],[interface
=INTERFACE
]
device-name
interface
is SCSI
. If omitted, a device name of the form local-ssd-N
will be used.
interface
SCSI
and NVME
. SCSI is the default and is supported by more guest operating systems. NVME might provide higher performance.
--machine-type
=MACHINE_TYPE
--maintenance-policy
=MAINTENANCE_POLICY
MAINTENANCE_POLICY
must be one of:
MIGRATE
TERMINATE
--metadata
=KEY
=VALUE
,[KEY
=VALUE
,…]
--metadata key-1=value-1,key-2=value-2,key-3=value-3
. The combined total size for all metadata entries is 512 KB.
In images that have Compute Engine tools installed on them, such as the official images, the following metadata keys have special meanings:
startup-script
--metadata-from-file
can be used to pull the value from a file.
startup-script-url
startup-script
except that the script contents are pulled from a publicly-accessible location on the web. For startup scripts on Windows instances, the following metadata keys have special meanings: windows-startup-script-url
, windows-startup-script-cmd
, windows-startup-script-bat
, windows-startup-script-ps1
, sysprep-specialize-script-url
, sysprep-specialize-script-cmd
, sysprep-specialize-script-bat
, and sysprep-specialize-script-ps1
. For more information, see Running startup scripts.
--metadata-from-file
=KEY
=LOCAL_FILE_PATH
,[…]
--metadata
except that the value for the entry will be read from a local file. This is useful for values that are too large such as startup-script
contents.
--min-cpu-platform
=PLATFORM
gcloud beta compute zones describe ZONE --format="value(availableCpuPlatforms)"
Default setting is "AUTOMATIC".
CPU platform selection is available only in selected zones.
You can find more information on-line: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform
--network
=NETWORK
--subnet
is also specified, subnet must be a subnetwork of the network specified by this --network
flag. If neither is specified, the default network is used.
--network-interface
=[PROPERTY
=VALUE
,…]
--address
, --network
, --network-tier
, --subnet
, --private-network-ip
, --stack-type
, --ipv6-network-tier
, --internal-ipv6-address
, --internal-ipv6-prefix-length
, --ipv6-address
, --ipv6-prefix-length
, --external-ipv6-address
, --external-ipv6-prefix-length
. This flag can be repeated to specify multiple network interfaces.
The following keys are allowed:
address
network
no-address
network-tier
NETWORK_TIER
must be one of: PREMIUM
, STANDARD
. The default value is PREMIUM
.
private-network-ip
subnet
nic-type
NIC_TYPE
must be one of: GVNIC
, VIRTIO_NET
.
stack-type
STACK_TYPE
must be one of: IPV4_ONLY
, IPV4_IPV6
, IPV6_ONLY
. The default value is IPV4_ONLY
.
ipv6-network-tier
IPV6_NETWORK_TIER
must be PREMIUM
(currently only one value is supported).
internal-ipv6-address
internal-ipv6-prefix-length
external-ipv6-address
external-ipv6-prefix-length
aliases
For example:
--aliases="10.128.1.0/24;range1:/32"Each IP alias range consists of a range name and a CIDR netmask (e.g.
/24
) separated by a colon or just the netmask. The range name is the name of the range within the network interface's subnet from which to allocate an IP alias range. If unspecified, it defaults to the primary IP range of the subnet. The IP allocator will pick an available range with the specified netmask and allocate it to this network interface.
network-attachment
--network
and --subnet
flags.
--network-tier
=NETWORK_TIER
NETWORK_TIER
must be one of: PREMIUM
, STANDARD
. The default value is PREMIUM
.
--preemptible
--private-ipv6-google-access-type
=PRIVATE_IPV6_GOOGLE_ACCESS_TYPE
PRIVATE_IPV6_GOOGLE_ACCESS_TYPE
must be one of: enable-bidirectional-access
, enable-outbound-vm-access
, inherit-subnetwork
.
--private-network-ip
=PRIVATE_NETWORK_IP
--provisioning-model
=PROVISIONING_MODEL
PROVISIONING_MODEL
must be one of:
FLEX_START
RESERVATION_BOUND
SPOT
STANDARD
--region
=REGION
To avoid prompting when this flag is omitted, you can set the
property:compute/region
gcloud config set compute/region REGION
A list of regions can be fetched by running:
gcloud compute regions list
To unset the property, run:
gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION
--resource-policies
=[RESOURCE_POLICY
,…]
--restart-on-failure
--no-restart-on-failure
to disable.
--shielded-integrity-monitoring
gcloud compute instances update --shielded-learn-integrity-policy
. On Shielded VM instances, integrity monitoring is enabled by default. For information about how to modify Shielded VM options, see https://cloud.google.com/compute/docs/instances/modifying-shielded-vm. For information about monitoring integrity on Shielded VM instances, see https://cloud.google.com/compute/docs/instances/integrity-monitoring."
--shielded-secure-boot
--shielded-vtpm
--[no-]skip-guest-os-shutdown
--skip-guest-os-shutdown
to enable and --no-skip-guest-os-shutdown
to disable.
--stack-type
=STACK_TYPE
STACK_TYPE
must be one of:
IPV4_IPV6
IPV4_ONLY
IPV6_ONLY
--subnet
=SUBNET
--network
is also specified, subnet must be a subnetwork of the network specified by the --network
flag.
--tags
=TAG
,[TAG
,…]
gcloud compute firewall-rules create
(1) for more details.
To read more about configuring network tags, read this guide: https://cloud.google.com/vpc/docs/add-remove-network-tags
To list instances with their respective status and tags, run:
gcloud compute instances list --format='table(name,status,tags.list())'
To list instances tagged with a specific tag, tag1
, run:
gcloud compute instances list --filter='tags:tag1'
--address
=ADDRESS
--no-address
--custom-cpu
=CUSTOM_CPU
For some machine types, shared-core values can also be used. For example, for E2 machine types, you can specify micro
, small
, or medium
.
This flag argument must be specified if any of the other arguments in this group are specified.
--custom-memory
=CUSTOM_MEMORY
This flag argument must be specified if any of the other arguments in this group are specified.
--custom-extensions
--custom-vm-type
=CUSTOM_VM_TYPE
n1
. For more information about custom machine types, see: https://cloud.google.com/compute/docs/general-purpose-machines#custom_machine_types
--image-project
=IMAGE_PROJECT
gcloud projects list
.
--image
=IMAGE
$ gcloud compute images list
. It is best practice to use --image
when a specific version of an image is needed.
When using this option,
and --boot-disk-device-name
can be used to override the boot disk's device name and size, respectively.--boot-disk-size
--image-family
=IMAGE_FAMILY
--image-family
when the latest version of an image is needed.
By default,
is assumed for this flag.debian-12
--reservation
=RESERVATION
--reservation-affinity
is one of: specific
, specific-then-any-reservation
or specific-then-no-reservation
.
--reservation-affinity
=RESERVATION_AFFINITY
; default="any"
RESERVATION_AFFINITY
must be one of:
any
none
specific
specific-then-any-reservation
specific-then-no-reservation
--scopes
=[SCOPE
,…]
SCOPE can be either the full URI of the scope or an alias. Default
scopes are assigned to all instances. Available aliases are:
Alias URI bigquery https://www.googleapis.com/auth/bigquery cloud-platform https://www.googleapis.com/auth/cloud-platform cloud-source-repos https://www.googleapis.com/auth/source.full_control cloud-source-repos-ro https://www.googleapis.com/auth/source.read_only compute-ro https://www.googleapis.com/auth/compute.readonly compute-rw https://www.googleapis.com/auth/compute datastore https://www.googleapis.com/auth/datastore default https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/logging.write https://www.googleapis.com/auth/monitoring.write https://www.googleapis.com/auth/pubsub https://www.googleapis.com/auth/service.management.readonly https://www.googleapis.com/auth/servicecontrol https://www.googleapis.com/auth/trace.append gke-default https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/logging.write https://www.googleapis.com/auth/monitoring https://www.googleapis.com/auth/service.management.readonly https://www.googleapis.com/auth/servicecontrol https://www.googleapis.com/auth/trace.append logging-write https://www.googleapis.com/auth/logging.write monitoring https://www.googleapis.com/auth/monitoring monitoring-read https://www.googleapis.com/auth/monitoring.read monitoring-write https://www.googleapis.com/auth/monitoring.write pubsub https://www.googleapis.com/auth/pubsub service-control https://www.googleapis.com/auth/servicecontrol service-management https://www.googleapis.com/auth/service.management.readonly sql (deprecated) https://www.googleapis.com/auth/sqlservice sql-admin https://www.googleapis.com/auth/sqlservice.admin storage-full https://www.googleapis.com/auth/devstorage.full_control storage-ro https://www.googleapis.com/auth/devstorage.read_only storage-rw https://www.googleapis.com/auth/devstorage.read_write taskqueue https://www.googleapis.com/auth/taskqueue trace https://www.googleapis.com/auth/trace.append userinfo-email https://www.googleapis.com/auth/userinfo.emailDEPRECATION WARNING: https://www.googleapis.com/auth/sqlservice account scope and
sql
alias do not provide SQL instance management capabilities and have been deprecated. Please, use https://www.googleapis.com/auth/sqlservice.admin or sql-admin
to manage your Google SQL Service instances.
--no-scopes
--service-account
=SERVICE_ACCOUNT
If not provided, the instance will use the project's default service account.
--no-service-account
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud compute instance-templates create-with-container
gcloud alpha compute instance-templates create-with-container
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4