mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Previously the vsphere provider assumed that there was one and only one datacenter (DC) in the vsphere instance. However this is simply not true for many vSphere installations. This commit: - Adds the ability to define a vSphere datacenter at the Pool or Provider level whereby the Pool setting takes precedence - If no datacenter is specified the default behaviour of picking the first DC in the vSphere instance - Updated all tests for the new setting - Update the vmpooler configuration file example with relevant setting name and expected behaviour - Fixed a bug in the rvmomi_helper whereby if no DC was found it would return all DCs. This is opposite behaviour of the real RBVMOMI library as it returns nil
496 lines
14 KiB
Text
496 lines
14 KiB
Text
---
|
|
:providers:
|
|
# :providers:
|
|
#
|
|
# This section contains the VM providers for VMs and Pools
|
|
# The currently supported backing services are:
|
|
# - vsphere
|
|
# - dummy
|
|
#
|
|
# - provider_class
|
|
# For multiple providers, specify one of the supported backing services (vsphere or dummy)
|
|
# (optional: will default to it's parent :key: name eg. 'vsphere')
|
|
#
|
|
# If you want to support more than one provider with different parameters (server, username or passwords) you have to specify the
|
|
# backing service in the provider_class configuration parameter for example 'vsphere' or 'dummy'. Each pool can specify
|
|
# the provider to use.
|
|
#
|
|
# Multiple providers example:
|
|
|
|
:vsphere-pdx:
|
|
server: 'vsphere.pdx.company.com'
|
|
username: 'vmpooler-pdx'
|
|
password: 'swimsw1msw!m'
|
|
provider_class: 'vsphere'
|
|
:vsphere-bfs:
|
|
server: 'vsphere.bfs.company.com'
|
|
username: 'vmpooler-bfs'
|
|
password: 'swimsw1msw!m'
|
|
provider_class: 'vsphere'
|
|
|
|
# :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)
|
|
#
|
|
# - datacenter
|
|
# The datacenter within vCenter to manage VMs. This can be overridden in the pool configuration
|
|
# (optional: default is the first datacenter in vSphere)
|
|
#
|
|
# 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)
|
|
# If you have more than one provider, this is where you would choose which
|
|
# one to use for this pool
|
|
#
|
|
# - 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)
|
|
#
|
|
# - datacenter
|
|
# The datacenter within vCenter to manage VMs.
|
|
# (optional: default is the first datacenter in vSphere)
|
|
#
|
|
# 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
|