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
name: The name of the resource, provided by the client when initially creating the resource
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
predefined_type: A predefined machine type from gce_list_machinetype
cpus: If not defining predefined_type, the number of CPUs
memory: If not defining predefined_type, amount of memory
project: Project ID for this request
zone: The name of the zone for this request
open_webports: If TRUE, will open firewall ports 80 and 443 if not open already
Returns
A gce_instance object
Details
Will get or create the instance as specified. Will wait for instance to be created if necessary.
Make sure the instance is big enough to handle what you need, for instance the default f1-micro will hang the instance when trying to install large R libraries.
Creation logic
You need these parameters defined to call the right function for creation. Check the function definitions for more details.
If the VM name exists but is not running, it start the VM and return the VM object
If the VM is running, it will return the VM object
If you specify the argument template it will call gce_vm_template
If you specify one of file or cloud_init it will call gce_vm_container
Otherwise it will call gce_vm_create
Examples
## Not run:library(googleComputeEngineR)## auto auth, project and zone pre-set## list your VMs in the project/zonethe_list <- gce_list_instances()## start an existing instancevm <- gce_vm("markdev")## for rstudio, you also need to specify a username and password to loginvm <- gce_vm(template ="rstudio", name ="rstudio-server", username ="mark", password ="mark1234")## specify your own cloud-init file and pass it into gce_vm_container()vm <- gce_vm(cloud_init ="example.yml", name ="test-container", predefined_type ="f1-micro")## specify disk size at creationvm <- gce_vm('my-image3', disk_size_gb =20)## End(Not run)