Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Configuring a Managed VM

Applications that run in the Managed VM environment use the same configuration files and syntax as applications that run in the sandbox. Python and Go apps use an app.yaml file, and Java apps use an appengine-web.xml file.

When designing your app, you can factor work into one or more modules. Each module can be independently configured to run within the App Engine hosting environment or the Managed VM hosting environment. All the instances of a module will use the same environment. You can mix and match your modules' environments according to the needs of each module in your app.

You must configure the VM hosting environment separately for each module that uses managed VMs. Two new configuration sections exist specifically for VMs: VM settings and health checking.

Hosting Environment and Runtime

Python

The vm and runtime keys are required:
vm: true
runtime: python27

Go

The vm and runtime keys are required:
vm: true
runtime: go

Java

The <vm> element is required (no runtime is needed since the xml config file implies Java):
<vm>true</vm>

Scaling

Python


You must specify manual scaling and the initial number of instances in the configuration file. Auto-scaling is currently not available within the Managed VM hosting environment (but will be supported in a future release).
manual_scaling:
  instances: 1  

Go


You must specify manual scaling and the initial number of instances in the configuration file. Auto-scaling is currently not available within the Managed VM hosting environment (but will be supported in a future release).
manual_scaling:
  instances: 1  

Java


You must specify manual scaling and the initial number of instances in the configuration file. Auto-scaling is currently not available within the Managed VM hosting environment (but will be supported in a future release).
<manual-scaling>
  <instances>1</instances>
</manual-scaling>

VM Settings

The VM Settings section of the config file applies to the underlying VM.

Python

You can specify any of the standard GCE machine types . (However, the shared-core f1-micro and g1-small types are not allowed).

You can add additional third party software packages by using the apt_get_install key. The value is a space-delimited list of packages that you want to install on the VM.

vm_settings:
  machine_type: n1-standard
  apt_get_install: redis-server vim

Go

You can specify any of the standard GCE machine types . (However, the shared-core f1-micro and g1-small types are not allowed).

You can add additional third party software packages by using the apt_get_install key. The value is a space-delimited list of packages that you want to install on the VM.

vm_settings:
  machine_type: n1-standard
  apt_get_install: redis-server vim

Java

Note that VM settings are specified using name and value attributes in the setting tag. You can specify any of the standard GCE machine types . (However, the shared-core f1-micro and g1-small types are not allowed).

You can add additional third party software packages by using the apt_get_install setting. The value is a space-delimited list of packages that you want to install on the VM.

<vm_settings>
  <setting name="machine_type" value="n1-standard-1"/>
  <setting name="apt_get_install" value="redis-server vim"/>
</vm_settings>

Health Checking

Periodic health check requests are used to confirm that a VM instance has been successfully deployed, and to check that a running instance maintains a healthy status. Each health check must be answered within a specified time interval. An instance is unhealthy when it fails to respond to a specified number of consecutive health check requests. An unhealthy instance will not receive any client requests, but health checks will still be sent. If an unhealthy instance continues to fail to respond to a predetermined number of consecutive health checks, it will be restarted.

Health check requests are enabled by default, with default threshold values. You can customize VM health checking by adding an optional health check section to your configuration file:

Python

vm_health_check:
  enable_health_check: True
  check_interval: 8
  timeout: 8
  unhealthy_threshold: 8
  healthy_threshold: 8
  restart_threshold: 8

Option Description Default
enable_health_check Enable/disable health checks. Health checks are enabled by default.
To disable health checking, set to False .
True
check_interval Time interval between checks 5 seconds
timeout Health check timeout interval 4 seconds
unhealthy_threshold An instance is unhealthy after failing this number of consecutive checks 2 checks
healthy_threshold An unhealthy instance becomes healthy again after successfully
responding to this number of consecutive checks
2 checks
restart_threshold The number of consecutive check failures that will trigger a VM restart 120 checks

Go

vm_health_check:
  enable_health_check: True
  check_interval: 8
  timeout: 8
  unhealthy_threshold: 8
  healthy_threshold: 8
  restart_threshold: 8
Option Description Default
enable_health_check Enable/disable health checks. Health checks are enabled by default.
To disable health checking, set to False .
True
check_interval Time interval between checks 5 seconds
timeout Health check timeout interval 4 seconds
unhealthy_threshold An instance is unhealthy after failing this number of consecutive checks 2 checks
healthy_threshold An unhealthy instance becomes healthy again after successfully
responding to this number of consecutive checks
2 checks
restart_threshold The number of consecutive check failures that will trigger a VM restart 120 checks

Java

<vm-health-check>
      <enable-health-check>true</enable-health-check>
      <check-interval-sec>5</check-interval-sec>
      <timeout-sec>4</timeout-sec>
      <unhealthy-threshold>2</unhealthy-threshold>
      <healthy-threshold>2</healthy-threshold>
      <restart-threshold>120</restart-threshold>
</vm-health-check>
Option Description Default
<enable-health-check> Enable/disable health checks. Health checks are enabled by default.
To disable health checking, set to false .
True
<check-interval-sec> Time interval between checks 5 seconds
<timeout-sec> Health check timeout interval 4 seconds
<unhealthy-threshold> An instance is unhealthy after failing this number of consecutive checks 2 checks
<healthy-threshold> An unhealthy instance becomes healthy again after successfully
responding to this number of consecutive checks
2 checks
<restart-threshold> The number of consecutive check failures that will trigger a VM restart 120 checks

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.