I'm supposing it is an pulumi issue and not a terr...
# general
w
I'm supposing it is an pulumi issue and not a terraform one
b
Hi, please can you share your code that you are creating the Virtual Machine with?
@stocky-spoon-28903 ☝️
@witty-alarm-17249 ping
t
Sounds similar to https://github.com/terraform-providers/terraform-provider-azurerm/issues/362 So you might need to specify the size?
w
does not look like the same issue
b
The terraform provider also specifies this
w
but with the correct size it is working
b
Copy code
disk_size_gb - (Required) Specifies the size of the data disk in gigabytes.
it's a required field to add a size
we will have the same validation
So I don't believe this is an issue
s
However, that is why we are projecting it as an optional input of number.
w
I have looked the same code
but seems consistent with the snippet I pasted
disk_size_gb is missing too from the storage_os_disk
and terraform does not complain
s
b
@stocky-spoon-28903 you are correct
the actual validation for this is follows:
Copy code
func validateDiskSizeGB(v interface{}, _ string) (warnings []string, errors []error) {
	value := v.(int)
	if value < 0 || value > 32767 {
		errors = append(errors, fmt.Errorf(
			"The `disk_size_gb` can only be between 0 and 32767"))
	}
	return warnings, errors
}
so I am not sure why the error message is between 1 and 32767
s
Does the error come back at preview or update, @witty-alarm-17249?
w
update
Copy code
error: Plan apply failed: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The value '0' of parameter 'dataDisk.diskSizeGB' is out of range. Value '0' must be between '1' and '32767' inclusive." Target="dataDisk.diskSizeGB"
s
Ohhh that’s from the azure API itself
b
ah! I am looking at the API docs now
s
That is interesting.
@witty-alarm-17249 I wonder if this is a bug in our terraform bridge. I’m going to try creating a minimal repro.
w
thanks, let me know if I can help you
s
What image are you creating the disk from?
w
unfortunately a private one
s
Did you omit the image field from the code you posted?
w
Copy code
storageImageReference: {
                id: "/subscriptions/......"
            },
I can create you a temporary access to my subscription if it can help you
s
It should be fine without that, I just need to make sure we have the object shape correct
b
@witty-alarm-17249 FYI, AFAICT, if you want to use an Image with the DataDisk then you need to use the Image inside the StorageDataDisk block
It's effectively a URI
the ImageReference seems more about the image to use with the VM itself, not the disk
unless, you are using an Image that already has provision for a second disk
s
The latency on my internet connection (in a plane) is too high for using Azure at the moment - @witty-alarm-17249 could you open an issue on
pulumi-azure
with the summary so far and I’ll investigate when I land?
w
@broad-dog-22463,
Copy code
unless, you are using an Image
that's it
b
👍
w
@stocky-spoon-28903, ok I will open an issue