6

TLDR in brief

gcloud compute instance to have hard disk size under 200Gb get warning but when set to 200Gb will get another warning.

in details

When we create instance template, as command 01 below, we have this warning if setting hard disk size 10Gb

WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#performance

Though when we do set it to 200Gb, we get this warning when creating instance from that template

WARNING: Some requests generated warnings: Disk size: '200 GB' is larger than image size: '10 GB'. You might need to resize the root repartition manually if the operating system does not support automatic resizing. See https://cloud.google.com/compute/docs/disks/persistent-disks#repartitionrootpd for details.

So why you gcloud warn us from the start about the 200Gb? And what should we do to get things set up correctly with no warning?

commands used

*command 01 - create instance template

gcloud compute instance-templates create TEMPLATE-NAME
          --image='projects/ubuntu-os-cloud/global/images/ubuntu-1604-xenial-v20190212' \
          --custom-cpu=1 --custom-memory=2  \
          --boot-disk-size=200 --boot-disk-type=pd-standard 

command 02 - create compute instance from instance template

gcloud compute instances create INSTANCE_NAME \
          --source-instance-template TEMPLATE_NAME \
          --project=$GC_PROJECT --zone=$zone 
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • It's a warning and you may ignore it at your discretion. To avoid the warning, revise your template to use disk size >= 200GB. Then, VMs created from the template will inherit the larger disk size too. – DazWilkin Feb 28 '19 at 05:34
  • Ignore is of course what we did. The issue is the two warnings conflicts each other. – Nam G VU Feb 28 '19 at 05:51
  • The messages don't conflict. I think you're not (as you think) setting the template boot disk size to 200GB *or* you're overriding this when you create the instance. Are you using Cloud Console or the command-line to do this? – DazWilkin Feb 28 '19 at 18:34
  • 1
    `gcloud compute instance-templates create instance-template-1 --image=debian-9-drawfork-v20181101 --image-project=eip-images --boot-disk-size=200GB` then `gcloud compute instances create instance-1 --source-instance-template=instance-template-1 --zone=us-west1-c` then `gcloud compute disks describe instance-1 --zone=us-west1-c --format="value(sizeGb)"` returns `200` for me. – DazWilkin Feb 28 '19 at 18:43
  • 1
    If you're using the Console and your template defines a container deployment, you may be experiencing an issue that I observed in which creating a VM from the template incorrectly overrides the template's boot disk size and defaults to 10GB. I've reported the bug. – DazWilkin Feb 28 '19 at 19:05
  • It tells you exactly why it warns you. Decide whether it's relevant and then move on :) – hobbs Mar 01 '19 at 01:10
  • @DazWilkin My question is taged by `command-line` and `gcloud` so yes, I'm using command-line gcloud – Nam G VU Mar 01 '19 at 06:02
  • I'll add full command 01 create instance template, 02 create instance – Nam G VU Mar 01 '19 at 06:03
  • Your commands similar to mine and I'm getting the conflicted warnings as described. No idea how you would get thru - maybe the image name differs. – Nam G VU Mar 01 '19 at 06:11
  • Please remember that I'm trying to help you. Your sarcasm is unwarranted. I'll let you work this out for yourself. Good luck! – DazWilkin Mar 01 '19 at 06:13
  • Thanks for the help @DazWilkin. No idea why you say it in the way of such favor and not the stackoverflow manner dude. Thanks again. – Nam G VU Mar 01 '19 at 06:31
  • @DazWilkin I just got this warning as well; I'm running a Docker container in my VM. You mentioned you submitted a bug report last year; did anything come of that? – GaryO Jul 04 '20 at 21:42
  • @GaryO I was unable to find the issue. I've a feeling that I submitted the bug before I retired from Google; unfortunately, I now don't have access to those issues. – DazWilkin Jul 06 '20 at 15:53

0 Answers0