Ambiente » History » Version 49
« Previous -
Version 49/87
(diff) -
Next » -
Current version
Beraldo Leal, 07 Jun 2012 16:50
Ambiente de Desenvolvimento¶
Lista de Servidores¶
- educloud00 - 200.145.46.166
- educloud01 - 200.145.46.167
- educloud02 - 200.145.46.168
- educloud03 - 200.145.46.169
- educloud04 - 200.145.46.170
- educloud05 - 200.145.46.174
- educloud06 - 200.145.46.175
- educloud07 - 200.145.46.173
Desabilitados¶
- educloud05 - 200.145.46.171
- educloud06 - 200.145.46.172
Installing OpenStack Identity Service - Keystone¶
O Keystone é um projeto que provê serviços de "Identidade", "Token", "Catalog" and "Policy" para os componentes do OpenStack. O pacote keystone foi instalado no servidor educloud01.
Este software é feito em python, e por sua vez instala a dependencia keystone-python, uma biblioteca em python para uso do próprio keystone.
Os arquivos de configuração do keystone ficam em /etc/keystone e hoje ele está utilizando como um backend para armazenar os usuários uma base sqlite3, mas ele também permite que seja utilizado uma base LDAP.
Além do daemon (servidor) foi instalado o cliente (também feito em python) python-keystoneclient.
Instalando e configurando o keystone¶
# apt-get install keystone
Delete the keystone.db file created in the /var/lib/keystone directory.
# rm /var/lib/keystone/keystone.db
Install mysql:
# apt-get install python-mysqldb mysql-server
Use sed to edit /etc/mysql/my.cnf to change bind-address from localhost
(127.0.0.1) to any (0.0.0.0) and restart the mysql service, as root:
# sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf # service mysql restart
To configure the MySQL database, create the keystone database.
# mysql -u root -p mysql> CREATE DATABASE keystone; mysql> GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystonepass'; mysql> FLUSH PRIVILEGES; mysql> quit;
Edit keystone.conf to use mysql:
[sql] connection = mysql://keystone:keystonepass@192.168.69.1/keystone
Change in keystone.conf the ADMIN_TOKEN:
admin_token = 012345SECRET99TOKEN012345
Restarte o keystone e inicialize o banco:
# service keystone restart # keystone-manage db_sync
Configuring Services to work with Keystone¶
Crie o arquivo /root/openstackrc, com o seguinte conteudo:
export SERVICE_ENDPOINT=http://192.168.69.1:35357/v2.0/ export SERVICE_TOKEN=012345SECRET99TOKEN012345
Estas variaveis de ambiente sao uteis para evitar ficar passando as opcoes --token e --endpoint para os utilitarios de linha de comando.
Carrege o arquivo:
# source /root/openstackrc
Crie os tenants openstackDemo e service:
# keystone tenant-create --name openstackDemo --description "Default Tenant" --enabled true # keystone tenant-create --name service --description "Service Tenant" --enabled true
Crie o user admin, substitua o tenant_id pelo tentant_id do openstackDemo, criado no item anterior:
# keystone user-create --tenant_id 9c401c9d2b9d41bcabda6919d4aec63a --name admin --pass adminpass --enabled true
Crie os roles admin e user:
# keystone role-create --name admin # keystone role-create --name user
Adicione o user admin ao role admin, fazendo as devidas substituicoes:
# keystone user-role-add --user [admin_user_id] --tenant_id [openstackDemo_tenant_id] --role [admin_role]
Crie um usuario para cada servico, e substitua o tenant_id pelo id do tenant service:
# keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name glance --pass glancepass --enabled true # keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name nova --pass novapass --enabled true # keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name swift --pass swiftpass --enabled true
Adicione os users acima ao role admin, fazendo as devidas substituicoes:
# keystone user-role-add --user [glance_user_id] --tenant_id [service_tenant_id] --role [admin_role] # keystone user-role-add --user [nova_user_id] --tenant_id [service_tenant_id] --role [admin_role] # keystone user-role-add --user [swift_user_id] --tenant_id [service_tenant_id] --role [admin_role]
Definindo os servicos:¶
Ate agora, apenas criamos: tenants, users e roles. O Keystone tambem gerencia os servicos e seus endpoins. Desta forma os componentes do openstack consulta o keystone onde determinado servico encontra-se.
Crie os servicos:
# keystone service-create --name keystone --type identity --description "Keystone Identity Service" # keystone service-create --name nova --type compute --description "Nova Compute Service" # keystone service-create --name volume --type volume --description "Nova Volume Service" # keystone service-create --name glance --type image --description "Glance Image Service" # keystone service-create --name swift --type object-store --description "Object Storage Service"
Crie os endpoints para os respectivos servicos:
# keystone endpoint-create --region RegionOne --service_id [keystone_service_id] --publicurl http://192.168.69.1:5000/v2.0 --internalurl http://192.168.69.1:5000/v2.0 --adminurl http://192.168.69.1:35357/v2.0 # keystone endpoint-create --region RegionOne --service_id [compute_service_id] --publicurl 'http://192.168.69.1:8774/v2/%(tenant_id)s' --internalurl 'http://192.168.69.1:8774/v2/%(tenant_id)s' --adminurl 'http://192.168.69.1:8774/v2/%(tenant_id)s' # keystone endpoint-create --region RegionOne --service_id [volume_service_id] --publicurl 'http://192.168.69.1:8776/v1/%(tenant_id)s' --internalurl 'http://192.168.69.1:8776/v1/%(tenant_id)s' --adminurl 'http://192.168.69.1:8776/v1/%(tenant_id)s' # keystone endpoint-create --region RegionOne --service_id [glance_service_id] --publicurl http://192.168.69.1:9292/v1 --internalurl http://192.168.69.1:9292/v1 --adminurl http://192.168.69.1:9292/v1 # keystone endpoint-create --region RegionOne --service_id [swift_service_id] --publicurl 'http://192.168.69.1:8888/v1/AUTH_%(tenant_id)s' --adminurl 'http://192.168.69.1:8888/' --internalurl 'http://192.168.69.1:8888/v1/AUTH_%(tenant_id)s'
Verificando a instalacao:¶
# sudo apt-get install curl openssl
Faca uma requisicao REST para a API do keystone usando o curl:
# curl -d '{"auth": {"tenantName": "openstackDemo", "passwordCredentials": {"username": "admin", "password": "adminpass"}}}' -H "Content-type: application/json" http://192.168.69.1:35357/v2.0/tokens | python -mjson.tool
O retorno deve conter todos os servicos, endpoins e um token que expira em 24 horas:
{
"access": {
"serviceCatalog": [
{
"endpoints": [
{
"adminURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a",
"internalURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a",
"publicURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "volume",
"type": "volume"
},
{
"endpoints": [
{
"adminURL": "http://192.168.69.1:9292/v1",
"internalURL": "http://192.168.69.1:9292/v1",
"publicURL": "http://192.168.69.1:9292/v1",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "glance",
"type": "image"
},
{
"endpoints": [
{
"adminURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a",
"internalURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a",
"publicURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "nova",
"type": "compute"
},
{
"endpoints": [
{
"adminURL": "http://192.168.69.1:35357/v2.0",
"internalURL": "http://192.168.69.1:5000/v2.0",
"publicURL": "http://192.168.69.1:5000/v2.0",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "keystone",
"type": "identity"
},
{
"endpoints": [
{
"adminURL": "http://192.168.69.1:8888/",
"internalURL": "http://192.168.69.1:8888/v1/AUTH_9c401c9d2b9d41bcabda6919d4aec63a",
"publicURL": "http://192.168.69.1:8888/v1/AUTH_9c401c9d2b9d41bcabda6919d4aec63a",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "swift",
"type": "object-store"
}
],
"token": {
"expires": "2012-06-08T15:31:46Z",
"id": "05b818ff23564d5599c97ea5e1df7bbe",
"tenant": {
"description": "Default Tenant",
"enabled": true,
"id": "9c401c9d2b9d41bcabda6919d4aec63a",
"name": "openstackDemo"
}
},
"user": {
"id": "1fcfbe778fc3428aa30db782056b34d7",
"name": "admin",
"roles": [
{
"id": "a2d6da77c0a54105aab94484e0d2088b",
"name": "admin"
}
],
"roles_links": [],
"username": "admin"
}
}
}
Voce pode tambem listar usuarios, roles, tenants e services:
# keystone user-list +----------------------------------+---------+-------+--------+ | id | enabled | email | name | +----------------------------------+---------+-------+--------+ | 029c5749548946f7b560b2706d31d488 | True | None | glance | | 1fcfbe778fc3428aa30db782056b34d7 | True | None | admin | | 4b75079aeb1b408ebdb286bfb85e719f | True | None | swift | | e25f81d50eb84bdb92907adbd0e41f25 | True | None | nova | +----------------------------------+---------+-------+--------+
# keystone role-list +----------------------------------+-------+ | id | name | +----------------------------------+-------+ | 845e83e4d9bf4d8d8188b1e261dfe103 | user | | a2d6da77c0a54105aab94484e0d2088b | admin | +----------------------------------+-------+
# keystone tenant-list +----------------------------------+---------------+---------+ | id | name | enabled | +----------------------------------+---------------+---------+ | 92920816c7704a8a95c916d34dc7a05c | service | True | | 9c401c9d2b9d41bcabda6919d4aec63a | openstackDemo | True | +----------------------------------+---------------+---------+
# keystone service-list +----------------------------------+----------+----------------+---------------------------+ | id | name | type | description | +----------------------------------+----------+----------------+---------------------------+ | 00486163c7c64c6a86f577627071aafc | nova | compute | Nova Compute Service | | 69d3a6b21c9348acb1042d7d9386ff81 | volume | volume | Nova Volume Service | | 7b09782f9faf448781f5a460acabe258 | swift | object-store | Object Storage Service | | d6b32583a6694e9b828b2a50037623ba | keystone | identity | Keystone Identity Service | | f7f964a71e2a45119dcaede68fafbd78 | glance | image | Glance Image Service | +----------------------------------+----------+----------------+---------------------------+
Installing OpenStack Object Storage - Swift¶
[Descrever o Swift aqui]
Como neste ambiente de desenvolvimento temos apenas um no para storage e este sera o mesmo no que estara instalado o swift-proxy, todos os passos abaixo, sao executados na mesma maquina: educloud01.
Em um ambiente de producao aconselha-se ter pelo menos 05 object storage nodes e 01 object proxy node.
Instalando e configurando o swift¶
# apt-get install swift python-xattr python-memcache rsync memcached python-netifaces
Infelizmente no momento da escrita deste manual o pacote do swift nao automatiza algumas tarefas, como por exemplo, a criacao dos arquivos de configuracao. Teremos que fazer isso manualmente:
# mkdir /etc/swift
Crie o arquivo de configuracao /etc/swift/swift.conf:
[swift-hash] # random unique string that can never change (DO NOT LOSE) swift_hash_path_suffix = fLIbertYgibbitZ
Instalando e configurando os "object nodes"¶
# apt-get install swift-account swift-container swift-object xfsprogs
Cada "Object node" pode ter muitos dispositivos ligados a eles. 'E necessario que seja utilizado o sistema de arquivos xfs.
# fdisk /dev/sdb (set up a single partition) # mkfs.xfs -i size=1024 /dev/sdb1
Este dispositivo deve estar montando em /srv/node/
echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab mkdir -p /srv/node/sdb1 mount /srv/node/sdb1 chown -R swift:swift /srv/node
Configure o rsyncd.conf¶
uid = swift gid = swift log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid address = 192.168.69.1 [account] max connections = 2 path = /srv/node/ read only = false lock file = /var/lock/account.lock [container] max connections = 2 path = /srv/node/ read only = false lock file = /var/lock/container.lock [object] max connections = 2 path = /srv/node/ read only = false lock file = /var/lock/object.lock
Edite o /etc/default/rsync:
RSYNC_ENABLE = true
Restarte o rsync:
service rsync restart
Crie o /etc/swift/account-server.conf:
[DEFAULT] bind_ip = 192.168.69.1 workers = 2 [pipeline:main] pipeline = account-server [app:account-server] use = egg:swift#account [account-replicator] [account-auditor] [account-reaper]
Crie o /etc/swift/container-server.conf:
[DEFAULT] bind_ip = 192.168.69.1 workers = 2 [pipeline:main] pipeline = container-server [app:container-server] use = egg:swift#container [container-replicator] [container-updater] [container-auditor]
Crie o /etc/swift/object-server.conf:
[DEFAULT] bind_ip = 192.168.69.1 workers = 2 [pipeline:main] pipeline = object-server [app:object-server] use = egg:swift#object [object-replicator] [object-updater] [object-auditor]
Instale e configure o swift-proxy¶
# apt-get install swift-proxy memcached
Crie o certificado SSL auto assinado:
cd /etc/swift openssl req -new -x509 -nodes -out cert.crt -keyout cert.key
Modifique o memcached para ouvir na interface da sua rede interna. Edite a seguinte linha no /etc/memcached.conf, mudando
-l 127.0.0.1 to -l 192.168.69.1
Restart o memcached:
service memcached restart
Crie o arquivo /etc/swift/proxy-server.conf:
[DEFAULT]
bind_port = 8888
user = swift
[pipeline:main]
pipeline = catch_errors healthcheck cache authtoken keystone proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true
[filter:keystone]
paste.filter_factory = keystone.middleware.swift_auth:filter_factory
operator_roles = admin, swiftoperator
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = 10
service_port = 5000
service_host = 192.168.69.1
auth_port = 35357
auth_host = 192.168.69.1
auth_token = 012345SECRET99TOKEN012345
admin_token = 012345SECRET99TOKEN012345
auth_protocol = http
[filter:cache]
use = egg:swift#memcache
set log_name = cache
[filter:catch_errors]
use = egg:swift#catch_errors
[filter:healthcheck]
use = egg:swift#healthcheck
Create the account, container and object rings. The builder command is basically creating a builder file with a few parameters. The parameter with the value of 18 represents 2 ^ 18th, the value that the partition will be sized to. Set this "partition power" value based on the total amount of storage you expect your entire ring to use. The value of 1 represents the number of replicas of each object, with the last value being the number of hours to restrict moving a partition more than once.
cd /etc/swift swift-ring-builder account.builder create 18 1 1 swift-ring-builder container.builder create 18 1 1 swift-ring-builder object.builder create 18 1 1
For every storage device on each node add entries to each ring:
swift-ring-builder account.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP>:6002/<DEVICE> 100 swift-ring-builder container.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6001/<DEVICE> 100 swift-ring-builder object.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6000/<DEVICE> 100
Como no nosso caso, apenas temos uma zona, em um storage node e com um device (sdb1), o comando acima ficaria:
swift-ring-builder account.builder add z1-192.168.69.1:6002/sdb1 100 swift-ring-builder container.builder add z1-192.168.69.1:6001/sdb1 100 swift-ring-builder object.builder add z1-192.168.69.1:6000/sdb1 100
Verify the ring contents for each ring:
swift-ring-builder account.builder swift-ring-builder container.builder swift-ring-builder object.builder
Rebalance the rings:
swift-ring-builder account.builder rebalance swift-ring-builder container.builder rebalance swift-ring-builder object.builder rebalance
Altere as permissoes dos arquivos de configuracao:
# chown -R swift:swift /etc/swift/
Inicie o swift-proxy:
swift-init proxy start
Inicie todos os servicos:
swift-init main start swift-init rest start
Verificando a instalacao¶
O arquivo /root/openstackrc vai receber novas variaveis de ambiente, ele deve ficar assim:
# Used for Keystone export SERVICE_ENDPOINT=http://192.168.69.1:35357/v2.0/ export SERVICE_TOKEN=012345SECRET99TOKEN012345 # Used for swift export ST_AUTH=http://192.168.69.1:5000/v2.0 export ST_USER=openstackDemo:admin export ST_KEY=adminpass export OS_REGION_NAME=RegionOne
Carregue o arquivo:
# source /root/openstackrc
Tente obter status do swift:
# swift -V 2.0 stat
- Liste os containers:
# swift -V 2.0 list
Suba alguns arquivos para o swift:
# swift -V 2.0 upload myfiles bigfile1.tgz # swift -V 2.0 upload myfiles bigfile2.tgz
Baixe o container "myfiles":
# cd /tmp/ # swift -V 2.0 download myfiles
Installing OpenStack Image Service - Glance¶
[descrever o glance aqui]
O glance esta instalado na educloud01.
Instalando e configurando o glance¶
# apt-get install glance
Remova o arquivo sqlite.
# rm /var/lib/glance/glance.sqlite
Configuring the Image Service database backend¶
# mysql -u root -p mysql> CREATE DATABASE glance; mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glancepass'; mysql> FLUSH PRIVILEGES; mysql> quit;
Substitua os seguintes arquivos de configuracao em /etc/glance/:
/etc/glance/glance-api.conf:
[DEFAULT] # Show more verbose log output (sets INFO log level output) verbose = True # Show debugging output in logs (sets DEBUG log level output) debug = False # Which backend store should Glance use by default is not specified # in a request to add a new image to Glance? Default: 'file' # Available choices are 'file', 'swift', and 's3' default_store = swift # Address to bind the API server bind_host = 0.0.0.0 # Port the bind the API server to bind_port = 9292 # Log to this file. Make sure you do not set the same log # file for both the API and registry servers! log_file = /var/log/glance/api.log # Backlog requests when creating socket backlog = 4096 # Number of Glance API worker processes to start. # On machines with more than one CPU increasing this value # may improve performance (especially if using SSL with # compression turned on). It is typically recommended to set # this value to the number of CPUs present on your machine. workers = 0 # Role used to identify an authenticated user as administrator #admin_role = admin # ================= Syslog Options ============================ # Send logs to syslog (/dev/log) instead of to file specified # by `log_file` use_syslog = False # Facility to use. If unset defaults to LOG_USER. # syslog_log_facility = LOG_LOCAL0 # ================= SSL Options =============================== # Certificate file to use when starting API server securely # cert_file = /path/to/certfile # Private key file to use when starting API server securely # key_file = /path/to/keyfile # ================= Security Options ========================== # AES key for encrypting store 'location' metadata, including # -- if used -- Swift or S3 credentials # Should be set to a random string of length 16, 24 or 32 bytes # metadata_encryption_key = <16, 24 or 32 char registry metadata key> # ============ Registry Options =============================== # Address to find the registry server registry_host = 0.0.0.0 # Port the registry server is listening on registry_port = 9191 # What protocol to use when connecting to the registry server? # Set to https for secure HTTP communication registry_client_protocol = http # The path to the key file to use in SSL connections to the # registry server, if any. Alternately, you may set the # GLANCE_CLIENT_KEY_FILE environ variable to a filepath of the key file # registry_client_key_file = /path/to/key/file # The path to the cert file to use in SSL connections to the # registry server, if any. Alternately, you may set the # GLANCE_CLIENT_CERT_FILE environ variable to a filepath of the cert file # registry_client_cert_file = /path/to/cert/file # The path to the certifying authority cert file to use in SSL connections # to the registry server, if any. Alternately, you may set the # GLANCE_CLIENT_CA_FILE environ variable to a filepath of the CA cert file # registry_client_ca_file = /path/to/ca/file # ============ Notification System Options ===================== # Notifications can be sent when images are create, updated or deleted. # There are three methods of sending notifications, logging (via the # log_file directive), rabbit (via a rabbitmq queue), qpid (via a Qpid # message queue), or noop (no notifications sent, the default) notifier_strategy = noop # Configuration options if sending notifications via rabbitmq (these are # the defaults) rabbit_host = localhost rabbit_port = 5672 rabbit_use_ssl = false rabbit_userid = guest rabbit_password = guest rabbit_virtual_host = / rabbit_notification_exchange = glance rabbit_notification_topic = glance_notifications # Configuration options if sending notifications via Qpid (these are # the defaults) qpid_notification_exchange = glance qpid_notification_topic = glance_notifications qpid_host = localhost qpid_port = 5672 qpid_username = qpid_password = qpid_sasl_mechanisms = qpid_reconnect_timeout = 0 qpid_reconnect_limit = 0 qpid_reconnect_interval_min = 0 qpid_reconnect_interval_max = 0 qpid_reconnect_interval = 0 qpid_heartbeat = 5 # Set to 'ssl' to enable SSL qpid_protocol = tcp qpid_tcp_nodelay = True # ============ Filesystem Store Options ======================== # Directory that the Filesystem backend store # writes image data to filesystem_store_datadir = /var/lib/glance/images/ # ============ Swift Store Options ============================= # Version of the authentication service to use # Valid versions are '2' for keystone and '1' for swauth and rackspace swift_store_auth_version = 2 # Address where the Swift authentication service lives # Valid schemes are 'http://' and 'https://' # If no scheme specified, default to 'https://' # For swauth, use something like '127.0.0.1:8080/v1.0/' swift_store_auth_address = http://192.168.69.1:35357/v2.0/ # User to authenticate against the Swift authentication service # If you use Swift authentication service, set it to 'account':'user' # where 'account' is a Swift storage account and 'user' # is a user in that account swift_store_user = service:glance # Auth key for the user authenticating against the # Swift authentication service swift_store_key = glancepass # Container within the account that the account should use # for storing images in Swift swift_store_container = glance # Do we create the container if it does not exist? swift_store_create_container_on_put = True # What size, in MB, should Glance start chunking image files # and do a large object manifest in Swift? By default, this is # the maximum object size in Swift, which is 5GB swift_store_large_object_size = 5120 # When doing a large object manifest, what size, in MB, should # Glance write chunks to Swift? This amount of data is written # to a temporary disk buffer during the process of chunking # the image file, and the default is 200MB swift_store_large_object_chunk_size = 200 # Whether to use ServiceNET to communicate with the Swift storage servers. # (If you aren't RACKSPACE, leave this False!) # # To use ServiceNET for authentication, prefix hostname of # `swift_store_auth_address` with 'snet-'. # Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/ swift_enable_snet = False # ============ S3 Store Options ============================= # Address where the S3 authentication service lives # Valid schemes are 'http://' and 'https://' # If no scheme specified, default to 'http://' s3_store_host = 127.0.0.1:8080/v1.0/ # User to authenticate against the S3 authentication service s3_store_access_key = <20-char AWS access key> # Auth key for the user authenticating against the # S3 authentication service s3_store_secret_key = <40-char AWS secret key> # Container within the account that the account should use # for storing images in S3. Note that S3 has a flat namespace, # so you need a unique bucket name for your glance images. An # easy way to do this is append your AWS access key to "glance". # S3 buckets in AWS *must* be lowercased, so remember to lowercase # your AWS access key if you use it in your bucket name below! s3_store_bucket = <lowercased 20-char aws access key>glance # Do we create the bucket if it does not exist? s3_store_create_bucket_on_put = False # When sending images to S3, the data will first be written to a # temporary buffer on disk. By default the platform's temporary directory # will be used. If required, an alternative directory can be specified here. # s3_store_object_buffer_dir = /path/to/dir # ============ RBD Store Options ============================= # Ceph configuration file path # If using cephx authentication, this file should # include a reference to the right keyring # in a client.<USER> section rbd_store_ceph_conf = /etc/ceph/ceph.conf # RADOS user to authenticate as (only applicable if using cephx) rbd_store_user = glance # RADOS pool in which images are stored rbd_store_pool = images # Images will be chunked into objects of this size (in megabytes). # For best performance, this should be a power of two rbd_store_chunk_size = 8 # ============ Delayed Delete Options ============================= # Turn on/off delayed delete delayed_delete = False # Delayed delete time in seconds scrub_time = 43200 # Directory that the scrubber will use to remind itself of what to delete # Make sure this is also set in glance-scrubber.conf scrubber_datadir = /var/lib/glance/scrubber # =============== Image Cache Options ============================= # Base directory that the Image Cache uses image_cache_dir = /var/lib/glance/image-cache/ [paste_deploy] flavor = keystone
/etc/glance/glance-api-paste.ini:
# Default minimal pipeline [pipeline:glance-api] pipeline = versionnegotiation context apiv1app authtoken # Use the following pipeline for keystone auth # i.e. in glance-api.conf: # [paste_deploy] # flavor = keystone # [pipeline:glance-api-keystone] pipeline = versionnegotiation authtoken context apiv1app # Use the following pipeline to enable transparent caching of image files # i.e. in glance-api.conf: # [paste_deploy] # flavor = caching # [pipeline:glance-api-caching] pipeline = versionnegotiation context cache apiv1app # Use the following pipeline for keystone auth with caching # i.e. in glance-api.conf: # [paste_deploy] # flavor = keystone+caching # [pipeline:glance-api-keystone+caching] pipeline = versionnegotiation authtoken context cache apiv1app # Use the following pipeline to enable the Image Cache Management API # i.e. in glance-api.conf: # [paste_deploy] # flavor = cachemanagement # [pipeline:glance-api-cachemanagement] pipeline = versionnegotiation context cache cachemanage apiv1app # Use the following pipeline for keystone auth with cache management # i.e. in glance-api.conf: # [paste_deploy] # flavor = keystone+cachemanagement # [pipeline:glance-api-keystone+cachemanagement] pipeline = versionnegotiation authtoken context cache cachemanage apiv1app [app:apiv1app] paste.app_factory = glance.common.wsgi:app_factory glance.app_factory = glance.api.v1.router:API [filter:versionnegotiation] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.api.middleware.version_negotiation:VersionNegotiationFilter [filter:cache] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.api.middleware.cache:CacheFilter [filter:cachemanage] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.api.middleware.cache_manage:CacheManageFilter [filter:context] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.common.context:ContextMiddleware [filter:authtoken] paste.filter_factory = keystone.middleware.auth_token:filter_factory service_protocol = http service_host = 192.168.69.1 service_port = 5000 auth_host = 192.168.69.1 auth_port = 35357 auth_protocol = http auth_uri = http://192.168.69.1:5000/ admin_tenant_name = service admin_user = glance admin_password = glancepass
/etc/glance/glance-registry.conf:
[DEFAULT] # Show more verbose log output (sets INFO log level output) verbose = True # Show debugging output in logs (sets DEBUG log level output) debug = True # Address to bind the registry server bind_host = 0.0.0.0 # Port the bind the registry server to bind_port = 9191 # Log to this file. Make sure you do not set the same log # file for both the API and registry servers! log_file = /var/log/glance/registry.log # Backlog requests when creating socket backlog = 4096 # SQLAlchemy connection string for the reference implementation # registry server. Any valid SQLAlchemy connection string is fine. # See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine sql_connection = mysql://glance:glancepass@192.168.69.1/glance # Period in seconds after which SQLAlchemy should reestablish its connection # to the database. # # MySQL uses a default `wait_timeout` of 8 hours, after which it will drop # idle connections. This can result in 'MySQL Gone Away' exceptions. If you # notice this, you can lower this value to ensure that SQLAlchemy reconnects # before MySQL can drop the connection. sql_idle_timeout = 3600 # Limit the api to return `param_limit_max` items in a call to a container. If # a larger `limit` query param is provided, it will be reduced to this value. api_limit_max = 1000 # If a `limit` query param is not provided in an api request, it will # default to `limit_param_default` limit_param_default = 25 # Role used to identify an authenticated user as administrator #admin_role = admin # ================= Syslog Options ============================ # Send logs to syslog (/dev/log) instead of to file specified # by `log_file` use_syslog = True # Facility to use. If unset defaults to LOG_USER. # syslog_log_facility = LOG_LOCAL1 # ================= SSL Options =============================== # Certificate file to use when starting registry server securely # cert_file = /path/to/certfile # Private key file to use when starting registry server securely # key_file = /path/to/keyfile [paste_deploy] flavor = keystone
/etc/glance/glance-registry-paste.ini:
# Default minimal pipeline [pipeline:glance-registry] pipeline = context registryapp authtoken # Use the following pipeline for keystone auth # i.e. in glance-registry.conf: # [paste_deploy] # flavor = keystone # [pipeline:glance-registry-keystone] pipeline = authtoken context registryapp [app:registryapp] paste.app_factory = glance.common.wsgi:app_factory glance.app_factory = glance.registry.api.v1:API [filter:context] context_class = glance.registry.context.RequestContext paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.common.context:ContextMiddleware [filter:authtoken] paste.filter_factory = keystone.middleware.auth_token:filter_factory service_protocol = http service_host = 192.168.69.1 service_port = 5000 auth_host = 192.168.69.1 auth_port = 35357 auth_protocol = http auth_uri = http://192.168.69.1:5000/ admin_tenant_name = service admin_user = glance admin_password = glancepass
/etc/glance/glance-scrubber.conf:
[DEFAULT] # Show more verbose log output (sets INFO log level output) verbose = True # Show debugging output in logs (sets DEBUG log level output) debug = False # Log to this file. Make sure you do not set the same log # file for both the API and registry servers! log_file = /var/log/glance/scrubber.log # Send logs to syslog (/dev/log) instead of to file specified by `log_file` use_syslog = False # Should we run our own loop or rely on cron/scheduler to run us daemon = False # Loop time between checking for new items to schedule for delete wakeup_time = 300 sql_connection = mysql://glance:glancepass@192.168.69.1/glance # Directory that the scrubber will use to remind itself of what to delete # Make sure this is also set in glance-api.conf scrubber_datadir = /var/lib/glance/scrubber # Only one server in your deployment should be designated the cleanup host cleanup_scrubber = False # pending_delete items older than this time are candidates for cleanup cleanup_scrubber_time = 86400 # Address to find the registry server for cleanups registry_host = 0.0.0.0 # Port the registry server is listening on registry_port = 9191