Managed VM instance is created empty

122 views Asked by At

When I run

gcloud preview app deploy /yamls/app.yaml

it executes with no error messages or warnings, and I see a new managed VM instance in a developer console. The problem is that this instance has a size of 0 bytes, and, obviously, does not work.

It looks like I am not the first one to run into this issue, but there was no response to that question. Hopefully, this time someone knows how to answer it.

Here is the contents of app.yam, if it matters:

runtime: java7
vm: True
module: 'backend'
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 20
  cool_down_period_sec: 60
  cpu_utilization:
    target_utilization: 0.75
inbound_services:
- warmup
threadsafe: True
auto_id_policy: default
health_check:
  enable_health_check: True
resources:
  cpu: 0.5
  memory_gb: 1.3
  disk_size_gb: 10.0
api_version: '1.0'
handlers:
- url: /
  script: unused
  login: optional
  secure: optional
- url: /_ah/.*
  script: unused
  login: optional
  secure: optional
- url: /z
  script: unused
  login: optional
  secure: optional
- url: .*\.jsp
  script: unused
  login: optional
  secure: optional
- url: /.*/
  script: unused
  login: optional
  secure: optional
- url: /z/.*
  script: unused
  login: optional
  secure: optional
2

There are 2 answers

3
Doug Richardson On

From Configuring the VM Environment:

There are two kinds of configuration files. Which one you use depends on the language you are using and whether you are using standard or custom runtimes:

Use appengine-web.xml for:

  • Modules running the Java standard runtime
  • Modules using a custom runtime based on the Java standard runtime (gcr.io/google_appengine/java-compat base)

Use app.yaml for:

  • Modules running the Python and Go standard runtimes
  • Any module running in a custom runtime that is not based on the Java standard runtime

Since you're Java runtime, you need to be using appengine-web.xml, not app.yaml.

From Testing and deploying managed VMs:

These sample Java projects are available:

Java Hello World Quickstart

The instructions on the Hello World Quickstart github project use maven to deploy. From the README:

mvn gcloud:deploy
0
Andrei Volgin On

I opened a support ticket with Google, and the issue has been resolved in the new version of gcloud.