cloudyr/googleComputeEngineR

Create VM with bootdisk and additional disk via gce_vm_create

assanstreamline opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
@muschellij2 and I would like to launch a GCP VM with boot disk and additional disks. The end goal is to mount these additional disks for saving data from RStudio.

Describe the solution you'd like

we would like to have the possibility to add multiple disks at VM creation

So, when creating the VM with 1 source disk + 1 additional disk I would call the function like below:

gce_vm_create <- function(name,
                          predefined_type = "f1-micro",
                          image_project = "debian-cloud",
                          image_family = "debian-10",
                          image = "debian-10-buster",
                          disk_attached_name="attached-disk-name",
                          network = gce_make_network("default", project = project), 
                          project = gce_get_global_project(), 
                          zone = gce_get_global_zone(),
                          dry_run = FALSE,
                          disk_size_gb = 20,
                          disk_attached_size_gb=10,
                          use_beta = TRUE)

Alternative
We can always create the instance with the current gce_vm_create with 1 disk_source and add + attach supplementary disks after creation (via gce_make_disk and gce_attach_disk)

Do you think this feature would make sense ?

Sure, but is this not possible now with the attach disk functions? Or is that only working for the boot disk?

Currently you have to attach disks after VM creation via gce_attach_disk.
I managed to 1 create the VM, 2. create the disks 3. attach the disks.
What we would like is to have the additional disks attached to the VM at directly at creation, so that these disks can be easily mounted at startup.