Description Usage Arguments Details Value Preemptible VMS GPUs See Also
Creates an instance resource in the specified project using the data included in the request.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | gce_vm_create(
name,
predefined_type = "f1-micro",
image_project = "debian-cloud",
image_family = "debian-9",
cpus = NULL,
memory = NULL,
image = "",
disk_source = NULL,
network = gce_make_network("default", project = project),
externalIP = NULL,
canIpForward = NULL,
description = NULL,
metadata = NULL,
scheduling = NULL,
serviceAccounts = NULL,
tags = NULL,
minCpuPlatform = NULL,
project = gce_get_global_project(),
zone = gce_get_global_zone(),
dry_run = FALSE,
disk_size_gb = NULL,
use_beta = FALSE,
acceleratorCount = NULL,
acceleratorType = "nvidia-tesla-p4"
)
|
name |
The name of the resource, provided by the client when initially creating the resource |
predefined_type |
A predefined machine type from gce_list_machinetype |
image_project |
Project ID of where the image lies |
image_family |
Name of the image family to search for |
cpus |
If not defining |
memory |
If not defining |
image |
Name of the image resource to return |
disk_source |
Specifies a valid URL to an existing Persistent Disk resource. |
network |
A network object created by gce_make_network |
externalIP |
An external IP you have previously reserved, leave NULL to have one assigned or |
canIpForward |
Allows this instance to send and receive packets with non-matching destination or source IPs |
description |
An optional description of this resource |
metadata |
A named list of metadata key/value pairs assigned to this instance |
scheduling |
Scheduling options for this instance, such as preemptible instances |
serviceAccounts |
A list of service accounts, with their specified scopes, authorized for this instance |
tags |
A list of tags to apply to this instance |
minCpuPlatform |
Specify a minimum CPU platform as per https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform |
project |
Project ID for this request |
zone |
The name of the zone for this request |
dry_run |
whether to just create the request JSON |
disk_size_gb |
If not NULL, override default size of the boot disk (size in GB) |
use_beta |
If set to TRUE will use the beta version of the API. Should not be used for production purposes. |
acceleratorCount |
Number of GPUs to add to instance. If using this, you may want to instead use gce_vm_gpu which sets some defaults for GPU instances. |
acceleratorType |
Name of GPU to add, see gce_list_gpus |
Authentication scopes used by this function are:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/compute
cpus
must be in multiples of 2 up to 32
memory
must be in multiples of 256
One of image
or image_family
must be supplied
To create an instance you need to specify:
Name
Project [if not default]
Zone [if not default]
Machine type - either a predefined type or custom CPU and memory
Network - usually default, specifies open ports etc.
Image - a source image containing the operating system
You can add metadata to the server such as startup-script
and shutdown-script
. Details available here: https://cloud.google.com/compute/docs/storing-retrieving-metadata
If you want to not have an external IP then modify the instance afterwards
A zone operation, or if the name already exists the VM object from gce_get_instance
You can set preemptible VMs by passing this in the scheduling
arguments scheduling = list(preemptible = TRUE)
This creates a VM that may be shut down prematurely by Google - you will need to sort out how to save state if that happens in a shutdown script etc. However, these are much cheaper.
Some defaults for launching GPU enabled VMs are available at gce_vm_gpu
You can add GPUs to your instance, but they must be present in the zone you have specified - use gce_list_gpus to see which are available. Refer to this link for a list of current GPUs per zone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.