https://pulumi.com logo
#general
Title
# general
w

witty-alarm-17249

06/04/2019, 12:34 PM
I'm supposing it is an pulumi issue and not a terraform one
b

broad-dog-22463

06/04/2019, 12:35 PM
Hi, please can you share your code that you are creating the Virtual Machine with?
@stocky-spoon-28903 ☝️
@witty-alarm-17249 ping
t

tall-librarian-49374

06/04/2019, 12:38 PM
Sounds similar to https://github.com/terraform-providers/terraform-provider-azurerm/issues/362 So you might need to specify the size?
w

witty-alarm-17249

06/04/2019, 12:40 PM
does not look like the same issue
b

broad-dog-22463

06/04/2019, 12:40 PM
The terraform provider also specifies this
w

witty-alarm-17249

06/04/2019, 12:40 PM
but with the correct size it is working
b

broad-dog-22463

06/04/2019, 12:40 PM
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

stocky-spoon-28903

06/04/2019, 12:42 PM
However, that is why we are projecting it as an optional input of number.
w

witty-alarm-17249

06/04/2019, 12:42 PM
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

stocky-spoon-28903

06/04/2019, 12:43 PM
b

broad-dog-22463

06/04/2019, 12:44 PM
@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

stocky-spoon-28903

06/04/2019, 12:44 PM
Does the error come back at preview or update, @witty-alarm-17249?
w

witty-alarm-17249

06/04/2019, 12:44 PM
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

stocky-spoon-28903

06/04/2019, 12:45 PM
Ohhh that’s from the azure API itself
b

broad-dog-22463

06/04/2019, 12:45 PM
ah! I am looking at the API docs now
s

stocky-spoon-28903

06/04/2019, 12:45 PM
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

witty-alarm-17249

06/04/2019, 12:49 PM
thanks, let me know if I can help you
s

stocky-spoon-28903

06/04/2019, 12:54 PM
What image are you creating the disk from?
w

witty-alarm-17249

06/04/2019, 12:54 PM
unfortunately a private one
s

stocky-spoon-28903

06/04/2019, 12:55 PM
Did you omit the image field from the code you posted?
w

witty-alarm-17249

06/04/2019, 12:55 PM
Copy code
storageImageReference: {
                id: "/subscriptions/......"
            },
I can create you a temporary access to my subscription if it can help you
s

stocky-spoon-28903

06/04/2019, 1:00 PM
It should be fine without that, I just need to make sure we have the object shape correct
b

broad-dog-22463

06/04/2019, 1:01 PM
@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

stocky-spoon-28903

06/04/2019, 1:08 PM
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

witty-alarm-17249

06/04/2019, 1:14 PM
@broad-dog-22463,
Copy code
unless, you are using an Image
that's it
b

broad-dog-22463

06/04/2019, 1:14 PM
👍
w

witty-alarm-17249

06/04/2019, 1:15 PM
@stocky-spoon-28903, ok I will open an issue
2 Views