Learn R Programming

googleComputeEngineR (version 0.1.0)

gce_vm_create: Creates an instance resource in the specified project using the data included in the request.

Description

Creates an instance resource in the specified project using the data included in the request.

Usage

gce_vm_create(name, predefined_type = "f1-micro", image_project = "debian-cloud", image_family = "debian-8", cpus = NULL, memory = NULL, image = "", disk_source = NULL, network = "default", externalIP = NULL, canIpForward = NULL, description = NULL, metadata = NULL, scheduling = NULL, serviceAccounts = NULL, tags = NULL, auth_email = "GCE_AUTH_FILE", project = gce_get_global_project(), zone = gce_get_global_zone(), dry_run = FALSE)

Arguments

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 predefined_type, the number of CPUs
memory
If not defining predefined_type, amount of memory
image
Name of the image resource to return
disk_source
Specifies a valid URL to an existing Persistent Disk resource.
network
The name of the network interface
externalIP
An external IP you have previously reserved, leave NULL to have one assigned or "none" for no external access.
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
serviceAccounts
A list of service accounts, with their specified scopes, authorized for this instance
tags
A list of tags to apply to this instance
auth_email
If it includes '@' then assume the email, otherwise an environment file var that includes the email
project
Project ID for this request
zone
The name of the zone for this request
dry_run
whether to just create the request JSON

Value

A zone operation, or if the name already exists the VM object from gce_get_instance

Details

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

See Also

Google Documentation