vmpooler/vmpooler.yaml.example
Glenn Sarti 2f37c1e9b5 (POOLER-52) Modify dummy provider to use a connection pool
Previously a connection pooler class was added.  This commit modifies the Dummy
VM Provider to use a connection pooler.  While the Dummy provider strictly
speaking does not use connections, this allows testing to see what happens when
connection pools are stressed or exhausted.  This commit:
- Modifies functions to use a connection pool object for the public API
  functions
- Modifies the VMPooler YAML with new settings for connection pool size and
  timeout
2017-05-17 13:52:28 -07:00

464 lines
13 KiB
Text

---
:providers:
# :providers:
#
# This section contains the VM providers for VMs and Pools
# The currently supported backing services are:
# - vsphere
# - dummy
# :vsphere:
#
# This section contains the server hostname and authentication credentials
# needed for vmpooler to connect to VMware vSphere.
#
# NOTE - To support older configuration files, a :vsphere: configuration section
# will be copied into :providers:/:vsphere: if one does not already exist.
#
# Available configuration parameters:
#
# - server
# The FQDN hostname of the VMware vSphere server.
# (required)
#
# - username
# The username used to authenticate VMware vSphere.
# (required)
#
# - password
# The password used to authenticate VMware vSphere.
# (required)
#
# - insecure
# Whether to ignore any HTTPS negotiation errors (e.g. untrusted self-signed certificates)
# (optional: default true)
# Example:
:vsphere:
server: 'vsphere.company.com'
username: 'vmpooler'
password: 'swimsw1msw!m'
# :dummy:
#
# The dummy backing service is a simple text file service that can be used
# to test vmpooler operations in a development or test environment
#
# Available configuration parameters:
#
# - filename (Optional)
# The filename used to store the backing text file. If this is not specified the VM state is only
# kept in memory, and is lost when the Provider is shutdown
#
# - connection_pool_size (Optional)
# The size of the dummy connection pool. This can be used to simulate constrained provider resources e.g. 200 pools sharing on connection
# (optional; default 1)
#
# - connection_pool_timeout (Optional)
# The number of seconds to wait for a connection object from the pool. If the timeout is exceeded an error is raised
# (optional; default 10 seconds)
#
# - migratevm_couldmove_percent
# Percent chance that a VM could be moved to another host
# (optional; default 0%)
#
# - migratevm_max_time
# Maximum amount of random time a VM migration action will take in seconds
# (optional; default 0 seconds)
#
# - migratevm_fail_percent
# Percent chance that a VM migration action will fail
# (optional; default 0%)
#
# - getvm_poweroff_percent
# Percent chance that when the VM information is gathered that the VM will be powered off
# (optional; default 0%)
#
# - getvm_rename_percent
# Percent chance that when the VM information is gathered that the VM will be renamed
# (optional; default 0%)
#
# - createvm_max_time
# Maximum amount of random time a VM creation action will take, in seconds
# (optional; default 0 seconds)
#
# - createvm_fail_percent
# Percent chance that a VM creation action will fail
# (optional; default 0%)
#
# - createdisk_max_time
# Maximum amount of random time a VM create disk action will take, in seconds
# (optional; default 0 seconds)
#
# - createdisk_fail_percent
# Percent chance that a VM create disk action will fail
# (optional; default 0%)
#
# - createsnapshot_max_time
# Maximum amount of random time a VM create snapshot action will take, in seconds
# (optional; default 0 seconds)
#
# - createsnapshot_fail_percent
# Percent chance that a VM create snapshot action will fail
# (optional; default 0%)
#
# - revertsnapshot_max_time
# Maximum amount of random time a VM revert snapshot action will take, in seconds
# (optional; default 0 seconds)
#
# - revertsnapshot_fail_percent
# Percent chance that a VM revert snapshot action will fail
# (optional; default 0%)
#
# - destroyvm_max_shutdown_time
# Maximum amount of random time a VM shutdown action will take during destroy, in seconds
# (optional; default 0 seconds)
#
# - destroyvm_max_time
# Maximum amount of random time a VM destroy action will take, in seconds
# (optional; default 0 seconds)
#
# - destroyvm_fail_percent
# Percent chance that a VM destroy action will fail
# (optional; default 0%)
#
# - vmready_fail_percent
# Percent chance that an error is raised when vm_ready? is called
# (optional; default 0%)
# Example:
:dummy:
filename: '/tmp/dummy-backing.yaml'
# :redis:
#
# This section contains the server hostname and authentication credentials
# needed for vmpooler to connect to Redis.
#
# Available configuration parameters:
#
# - server
# The FQDN hostname of the Redis server.
# (optional; default: 'localhost')
#
# - username
# The username used to authenticate Redis.
# (optional)
#
# - password
# The password used to authenticate Redis.
# (optional)
#
# - data_ttl
# How long (in hours) to retain metadata in Redis after VM destruction.
# (optional; default: '168')
# Example:
:redis:
server: 'redis.company.com'
# :graphs:
#
# This section contains the server and prefix information for a graphite-
# compatible web front-end where graphs may be viewed. This is used by the
# vmpooler dashboard to retrieve statistics and graphs for a given instance.
#
# NOTE: This is not the endpoint for publishing metrics data. See `graphite:`
# and `statsd:` below.
#
# NOTE: If `graphs:` is not set, for legacy compatibility, `graphite:` will be
# consulted for `server`/`prefix` information to use in locating a
# graph server for our dashboard. `graphs:` is recommended over
# `graphite:`
#
#
# Available configuration parameters:
#
#
# - server
# The FQDN hostname of the statsd daemon.
# (required)
#
# - prefix
# The prefix to use while storing statsd data.
# (optional; default: 'vmpooler')
# :statsd:
#
# This section contains the connection information required to store
# historical data via statsd. This is mutually exclusive with graphite
# and takes precedence.
#
# Available configuration parameters:
#
# - server
# The FQDN hostname of the statsd daemon.
# (required)
#
# - prefix
# The prefix to use while storing statsd data.
# (optional; default: 'vmpooler')
#
# - port
# The UDP port to communicate with the statsd daemon.
# (optional; default: 8125)
# Example:
:statsd:
server: 'statsd.company.com'
prefix: 'vmpooler'
port: 8125
# :graphite:
#
# This section contains the connection information required to store
# historical data in an external Graphite database. This is mutually exclusive
# with statsd.
#
# Available configuration parameters:
#
# - server
# The FQDN hostname of the Graphite server.
# (required)
#
# - prefix
# The prefix to use while storing Graphite data.
# (optional; default: 'vmpooler')
#
# - port
# The TCP port to communicate with the graphite server.
# (optional; default: 2003)
# Example:
:graphite:
server: 'graphite.company.com'
# :auth:
#
# This section contains information related to authenticating users
# for token operations.
#
# Supported Auth Providers:
# - Dummy
# - LDAP
#
# - Dummy Auth Provider
# The Dummy Authentication provider should only be used during development or testing
# If the Username and Password are different then validation succeeds
# If the Username and Password are the same then validation fails
#
# Example:
# :auth:
# provider: 'dummy'
#
# - LDAP Auth Provider
# The LDAP Authentication provider will validate usernames and passwords against an
# existing LDAP service
#
# Available configuration parameters:
#
# - host
# The FQDN hostname of the LDAP server.
#
# - port
# The port used to connect to the LDAP service.
# (optional; default: '389')
#
# - base
# The base DN used for LDAP searches.
#
# - user_object
# The LDAP object-type used to designate a user object.
#
# Example:
# :auth:
# provider: 'ldap'
# :ldap:
# host: 'localhost'
# port: 389
# base: 'ou=users,dc=company,dc=com'
# user_object: 'uid'
:auth:
provider: 'ldap'
:ldap:
host: 'ldap.company.com'
port: 389
base: 'ou=users,dc=company,dc=com'
user_object: 'uid'
# :tagfilter:
#
# Filter tags by regular expression.
# Example:
#
# This example demonstrates discarding everything after a '/' character for
# the 'url' tag, transforming 'foo.com/something.html' to 'foo.com'.
:tagfilter:
url: '(.*)\/'
# :config:
#
# This section contains global configuration information.
#
# Available configuration parameters:
#
# - site_name
# The name of your deployment.
# (optional; default: 'vmpooler')
#
# - logfile
# The path to vmpooler's log file.
# (optional; default: '/var/log/vmpooler.log')
#
# - clone_target
# The target cluster VMs are cloned into (host with least VMs chosen)
# (optional; default: same cluster/host as origin template)
#
# - task_limit
# The number of concurrent VM creation tasks to perform.
# (optional; default: '10')
#
# - timeout
# How long (in minutes) before marking a clone as 'failed' and retrying.
# (optional; default: '15')
#
# - vm_checktime
# How often (in minutes) to check the sanity of VMs in 'ready' queues.
# (optional; default: '15')
#
# - vm_lifetime
# How long (in hours) to keep VMs in 'running' queues before destroying.
# (optional; default: '24')
#
# - vm_lifetime_auth
# Same as vm_lifetime, but applied if a valid authentication token is
# included during the request.
#
# - allowed_tags
# If set, restricts tags to those specified in this array.
#
# - domain
# If set, returns a top-level 'domain' JSON key in POST requests
#
# - prefix
# If set, prefixes all created VMs with this string. This should include
# a separator.
# (optional; default: '')
#
# - migration_limit
# When set to any value greater than 0 enable VM migration at checkout.
# When enabled this capability will evaluate a VM for migration to a different host when it is requested
# in an effort to maintain a more even distribution of load across compute resources.
# The migration_limit ensures that no more than the specified migrations will be evaluated at any one time
# and greatly reduces the possibilty of VMs ending up bunched together on a particular host.
#
# - max_tries
# Set the max number of times a connection should retry in VM providers.
# This optional setting allows a user to dial in retry limits to
# suit your environment.
# (optional; default: 3)
#
# - retry_factor
# When retrying, each attempt sleeps for the try count * retry_factor.
# Increase this number to lengthen the delay between retry attempts.
# This is particularly useful for instances with a large number of pools
# to prevent a thundering herd when retrying connections.
# (optional; default: 10)
# Example:
:config:
site_name: 'vmpooler'
logfile: '/var/log/vmpooler.log'
task_limit: 10
timeout: 15
vm_checktime: 15
vm_lifetime: 12
vm_lifetime_auth: 24
allowed_tags:
- 'created_by'
- 'project'
domain: 'company.com'
prefix: 'poolvm-'
# :pools:
#
# This section contains a list of virtual machine 'pools' for vmpooler to
# create and maintain.
#
# Available configuration parameters (per-pool):
#
# - name
# The name of the pool.
# (required)
#
# - alias
# Other names this pool can be requested as.
# (optional)
#
# - template
# The template or virtual machine target to spawn clones from.
# (required)
#
# - size
# The number of waiting VMs to keep in a pool.
# (required)
#
# - provider
# The name of the VM provider which manage this pool. This should match
# a name in the :providers: section above e.g. vsphere
# (required; will default to vsphere for backwards compatibility)
#
# - clone_target
# Per-pool option to override the global 'clone_target' cluster.
# (optional)
#
# - timeout
# How long (in minutes) before marking a clone as 'failed' and retrying.
# This setting overrides any globally-configured timeout setting.
# (optional; default: '15')
#
# - ready_ttl
# How long (in minutes) to keep VMs in 'ready' queues before destroying.
# (optional; default: no limit)
#
# Provider specific pool settings
# vSphere provider
# - folder
# The vSphere 'folder' destination for spawned clones.
# (required)
#
# - datastore
# The vSphere 'datastore' destination for spawned clones.
# (required)
#
# Example:
:pools:
- name: 'debian-7-i386'
alias: [ 'debian-7-32' ]
template: 'Templates/debian-7-i386'
folder: 'Pooled VMs/debian-7-i386'
datastore: 'vmstorage'
size: 5
timeout: 15
ready_ttl: 1440
provider: vsphere
- name: 'debian-7-x86_64'
alias: [ 'debian-7-64', 'debian-7-amd64' ]
template: 'Templates/debian-7-x86_64'
folder: 'Pooled VMs/debian-7-x86_64'
datastore: 'vmstorage'
size: 5
timeout: 15
ready_ttl: 1440
provider: vsphere