Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Compute VM Instance (n4-standard-16) with attached disks.

Hi. I'm working on a usecase to provision a compute VM instance with an additional attached disks with a machine_type = n4-standard-16 (for intel processer) through terraform. I have received this error while provisioning a compute VM Instance with attached disks. Any thoughts on this error?

Error: googleapi: Error 400: [pd-standard, pd-ssd, n4-standard-16] features are not compatible for creating instance., badRequest..

2 6 2,312
6 REPLIES 6

This is because N4 instance types only support Hyperdisk Balanced written as:

hyperdisk-balanced

See:

https://cloud.google.com/compute/docs/general-purpose-machines#supported_disk_types_for_n4

(correct at the time of writing, check the link for the latest supported disks)

@alexmoore Appreciate your prompt reply. I want to create VM instance with additional disks with a '16 vCPUs', and the required machine processor is 'intel'. I have tried to create a VM with machine type 'n2-standard-16' and 'n2d-standard-16', but I'm unable to create additional disks with these specifications. Which machine type is available to create a VM instance with additional disk with 16vCPU?

when you say you're unable to create them, what errors are you encountering?

You can attach up to 128 PD volumes to most VMs (16 for shared core VMs), see: 

@alexmoore Here is my terraform config to create a VM instance, create additional disk and attach disk to the instance, with machine type n4-standard-16.

resource "google_compute_instance" "VM {
name = "attached-disk-instance"
machine_type = "n4-standard-16"
zone = "us-central1-a

boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
}
}

network_interface {
network = "default"
}

lifecycle {
ignore_changes = [attached_disk]
}
}


resource "google_compute_disk" "testdisk"
name = "disk1"
image = "debian-cloud/debian-11"
size = 100
type = "pd-ssd"
zone = "us-central1-a"
}

resource "google_compute_attached_disk" "attach_disk"
disk = google_compute_disk.testdisk.id
instance = google_compute_instance.vm.id
}

Error:- Error: googleapi: Error 400: [pd-standard, pd-ssd, n4-standard-16] features are not compatible for creating instance., badRequest.

This is confusing me slightly, at the top of your last reply you say "n2-standard-16", in the terrafrom code you shared it has "n2d-standard-16" and in the error at the bottom it lists "n4-standard-16" - can you confirm which you are using?  because the error is saying n4-standard-16 and you can't use pd-<anything> with N4.

@alexmoore Sure. Initially I tried to create a VM machine with additional disk with a machine type n4-standard-16, which is not supported to create an additional disk with 'pd-ssd'. Then I'm able to create a VM instance with a machine type 'n2-standard-16', then create a additional disk with 'pd-ssd' type and able to attach it. Now this issue is resolved. Thank you!!