A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/instances/create-vm-with-additional-non-boot-disks below:

Create an instance with additional non-boot disks | Compute Engine Documentation

When you create a compute instance, you can create and attach additional non-boot disks to the instance at the same time. You can also

.

If you want to create a disk in multi-writer mode, you can't create the disk at the same time that you create the instance. You must create the disk first, then you can attach the disk to the instance.

This predefined role contains the permissions required to create an instance with added non-boot disks. To see the exact permissions that are required, expand the Required permissions section:

To create an instance that has additional non-boot disks created and attached, follow these steps:

Console
  1. In the Google Cloud console, go to the Create an instance page.

    Go to Create an instance

    If prompted, select your project and click Continue.

    The Create an instance page appears and displays the Machine configuration pane.

  2. In the Machine configuration pane, do the following:

    1. In the Name field, specify a name for your instance. For more information, see Resource naming convention.
    2. Optional: In the Zone field, select a zone for this instance.

      The default selection is Any. If you don't change this default selection, then Google automatically chooses a zone for you based on machine type and availability.

    3. Select the machine family for your instance. The Google Cloud console then displays the machine series that are available for your selected machine family. The following machine family options are available:

      • General purpose
      • Compute optimized
      • Memory optimized
      • Storage optimized
      • GPUs
    4. In the Series column, select the machine series for your instance.

      If you selected GPUs as the machine family in the previous step, then select the GPU type that you want. The machine series is then automatically selected for the selected GPU type.

    5. In the Machine type section, select the machine type for your instance.

  3. In the navigation menu, click OS and storage. In the Operating system and storage pane that appears, complete the following steps.

    To learn more about the parameters that you can configure while adding new disks, see About Persistent Disk and About Google Cloud Hyperdisk.

    1. To configure your boot disk, click Change. The Boot disk pane appears and displays the Public images tab.

    2. Configure the data source for the boot disk in one of the following ways:

      Note: Unless you explicitly choose a different boot disk, if the name of the new instance matches the name of an existing disk, then the existing disk automatically attaches to the new instance as the boot disk.
      • To choose a public image as the data source for your boot disk, in the Public images tab, specify the following:

        1. In the Operating system list, select the OS type.
        2. In the Version list, select the OS version.
        3. In the Boot disk type list, select the type of the boot disk.
        4. In the Size (GB) field, specify the size of the boot disk.
      • To choose a custom image as the data source for your boot disk, click Custom images and then, in the Custom images tab that appears, specify the following:

        1. To select the image project, click Change, and then select the project that contains the image.
        2. In the Image list, select the image that you want to import.
        3. In the Boot disk type list, select the type of the boot disk.
        4. In the Size (GB) field, specify the size of the boot disk.
      • To choose a standard snapshot as the data source for your boot disk, click Snapshots and then, in the Snapshots tab that appears, specify the following:

        1. In the Snapshot list, select the snapshot.
        2. In the Boot disk type list, select the type of the boot disk.
        3. In the Size (GB) field, specify the size of the boot disk.
      • To choose an archive snapshot as the data source for your boot disk, click Archive snapshots and then, in the Archive snapshots tab that appears, specify the following:

        1. In the Archive snapshot list, select the archive snapshot.
        2. In the Boot disk type list, select the type of the boot disk.
        3. In the Size (GB) field, specify the size of the boot disk.
      • To choose an existing disk as your boot disk, click Existing disks. Then, in the Existing disks tab that appears, select an existing regional Persistent Disk or Hyperdisk Balanced High Availability volume in the Disk list.

    3. Optional: For advanced configuration options, expand the expand_more Show advanced configurations section.

    4. To confirm your boot disk options and return to the Operating system and storage pane, click Select.

    5. To create a new non-boot disk and attach it to your instance, in the Additional storage and VM backups section, click Add new disk.

      In the Add new disk pane that appears, do the following:

      1. In the Name field, specify a name for the non-boot disk.
      2. In the Disk source type list, select the source type for the non-boot disk.
      3. In the Disk type list, select a type for the non-boot disk.
      4. In the Size field, specify the size of the non-boot disk.
      5. In the Attachment settings section, do the following:
      6. In the Mode field, select the disk attachment mode.
      7. In the Deletion rule filed, select an option to specify what happens to the disk when the instance is deleted.

      Repeat this step for each non-boot disk that you want to create and attach to your instance.

  4. In the navigation menu, click Data protection. In the Data protection pane that appears, specify how you want to back up and replicate the data for your instance by doing the following.

    Caution: The data backup and replication settings that you specify while creating an instance using the Google Cloud console are applied only when your selected instance and disk configurations support those options. You must verify that your configuration for the instance and each disk meets the requirements for each data protection option that you specify. For more information, see Data protection options.
    1. To specify how you want to back up data, select an option for Back up your data.
    2. To specify how you want to replicate data, do the following:

      1. If you want new disks for the instance to be synchronously replicated in a second zone by using regional disks types, select the Regional disks checkbox.
      Important: The Regional disks checkbox doesn't affect existing disks. If you want to change an existing zonal disk to a regional disk, see Change a zonal disk to a regional disk instead.
      1. If you want disks for the instance to be replicated in a second region using Persistent Disk Asynchronous Replication, select the Asynchronous replication checkbox.
    3. If you only want to use the specified data protection options on non-boot disks, select the Exclude boot disks checkbox.

      Important: This option doesn't affect backup plans, which can't exclude boot disks.
  5. In the navigation menu, click Networking. In the Networking pane that appears, do the following:

    1. Go to the Firewall section.
    2. To permit HTTP or HTTPS traffic to the instance, select Allow HTTP traffic or Allow HTTPS traffic.

      The Compute Engine adds a network tag to your instance and creates the corresponding ingress firewall rule that allows all incoming traffic on tcp:80 (HTTP) or tcp:443 (HTTPS). The network tag associates the firewall rule with the instance. For more information, see Firewall rules overview in the Cloud Next Generation Firewall documentation.

  6. Optional: Specify other configuration options. For more information, see Configuration options during instance creation.

  7. To create and start the instance, click Create.

gcloud
  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. Run the gcloud compute instances create command to create an instance with additional non-boot disks.

    You can add up to 127 non-boot disks while you're creating your instance. Specify the --create-disk flag for each non-boot disk you create.

    To create non-boot disks from a public or stock image, specify the image or image-family and image-project properties with the --create-disk flag. To create a blank disk, don't include these properties.

    You can optionally include properties for:

    gcloud compute instances create INSTANCE_NAME \
        --zone=ZONE \
        --image-project=IMAGE_PROJECT \
        IMAGE_FLAG \
        --create-disk DISK_IMAGE,image-project=DISK_IMAGE_PROJECT,size=SIZE_GB,type=DISK_TYPE \
        --create-disk device-name=DISK_NAME,replica-zones=^:^ZONE:REMOTE-ZONE,boot=false
    

    Replace the following:

Terraform To generate the Terraform code, you can use the Equivalent code component in the Google Cloud console.
  1. In the Google Cloud console, go to the VM instances page.

    Go to VM Instances

  2. Click Create instance.
  3. Specify the parameters you want.
  4. At the top or bottom of the page, click Equivalent code, and then click the Terraform tab to view the Terraform code.
Go

Before trying this sample, follow the Go setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Go API reference documentation.

To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Java

Before trying this sample, follow the Java setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Java API reference documentation.

To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Node.js

Before trying this sample, follow the Node.js setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Node.js API reference documentation.

To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Python

Before trying this sample, follow the Python setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Python API reference documentation.

To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

REST

You can create up to 127 non-boot disks at the time you create an instance by using the initializeParams property for each additional disk. Create additional disks with a public or private image. To add a blank disk, define the initializeParams entry with no sourceImage value. Include the disk property replicaZones to create regional disks instead of zonal disks.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances

{
   "machineType":"zones/MACHINE_TYPE_ZONE/machineTypes/MACHINE_TYPE",
   "name":"VM_NAME",
   
   "disks":[
      {
         "initializeParams":{
            "sourceImage":"projects/IMAGE_PROJECT/global/images/IMAGE"
         },
         "boot":true
      },
      {
         "initializeParams":{
            "diskSizeGb":"SIZE_GB",
            "sourceImage":"projects/DISK_IMAGE_PROJECT/global/images/DISK_IMAGE",
            "diskType":"DISK_TYPE"
         }
      },
      {
         "initializeParams":{
            "diskSizeGb":"SIZE_GB",
            "diskType":"DISK_TYPE"
         },
      },
      {
         "boot": false,
         "deviceName":"DISK_NAME",
         "initializeParams": {
            "diskType": "DISK_TYPE",
            "replicaZones": [
               "projects/PROJECT_ID/zones/ZONE",
               "projects/PROJECT_ID/zones/REMOTE_ZONE"
            ]
         }
      }
   ],
   
   
   "networkInterfaces":[
      {
         "network":"global/networks/NETWORK_NAME"
      }
   ],
   
  
   "shieldedInstanceConfig":{
      "enableSecureBoot":"ENABLE_SECURE_BOOT"
   }
}

Replace the following:


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