--boot-disk-size parameter check is wrong
"gcloud compute instance-templates create" fails when '--boot-disk-size' is less than 10 while creation of the template using web interface succeeds. Steps to reproduce:
1) create custom image that requires a boot disk of 1GB.
2) Using web interface start to create an instance template using that image not changing the size of the requested boot image.
3) Obtain the CLI command to create the image from the web interface.
4) try to execute it.
creating a template using web interface or issuing the same command with --boot-disk-size option omitted successfully creates an instance template with boot disk size equal to the image size, 1GB in my case.
We’re investigating this further, it appears there are circumstances where a small image can create small disks.
Thanks, Sergey, it does look like you have 1GB disks, and I think we've found out a reason why. We're investigating further, thanks for the additional info.
Sergey Mende commented
Paul, look please:
$ ./gcloud compute disks list
NAME ZONE SIZE_GB TYPE STATUS
asia-east1-8psx asia-east1-c 1 pd-standard READY
asia-east1-cjwr asia-east1-c 1 pd-standard READY
asia-east1-fmej asia-east1-c 1 pd-standard READY
us-central1-lhgd us-central1-f 1 pd-standard READY
us-central1-xult us-central1-f 1 pd-standard READY
europe-west1-b4et europe-west1-d 1 pd-standard READY
europe-west1-vac5 europe-west1-d 1 pd-standard READY
europe-west1-xvh2 europe-west1-d 1 pd-standard READY
europe-west1-z86o europe-west1-d 1 pd-standard READY
asia-east1-dqwn asia-east1-a 1 pd-standard READY
asia-east1-po75 asia-east1-a 1 pd-standard READY
asia-east1-qhzj asia-east1-a 1 pd-standard READY
asia-east1-xoti asia-east1-a 1 pd-standard READY
asia-east1-sbzm asia-east1-b 1 pd-standard READY
asia-east1-ufd2 asia-east1-b 1 pd-standard READY
asia-east1-xx4n asia-east1-b 1 pd-standard READY
us-east1-m44d us-east1-c 1 pd-standard READY
us-east1-zq6a us-east1-c 1 pd-standard READY
us-west1-b-ceva us-west1-b 1 pd-standard READY
us-west1-b-dglr us-west1-b 1 pd-standard READY
us-west1-b-nwi0 us-west1-b 1 pd-standard READY
us-west1-b-pwb1 us-west1-b 1 pd-standard READY
us-west1-b-py13 us-west1-b 1 pd-standard READY
We believe that this is confusing, but not a bug. DISKS are required to be 10GB minimum. However, the archive size of an IMAGE can be smaller. Creating a Disk from an Image that is smaller than 10GB will still result in a disk of at least 10GB.
When you imported your tar file of an image needing 1GB, the Image that was created would end up getting set to create 10GB disks. You can confirm that this is likely true by running 'glcoud compute images describe' on your Image. It likely has a property called diskSizeGb that is likely set to '10'. For example, if you run this command on a recent CentOS 6 image, you'll see that the "archive size" is about 4 billion bytes, but diskSizeGb is '10'.
gcloud compute images describe --project=centos-cloud centos-6-v20161027
Because images have such a setting for how big the disk will be, in your example the instances create from the Instance Template should end up with disks that are 10GB, which is not an error. However specifying --boot-disk-size less than 10GB *is* an error, and that's what the parameter you mention is verifying.