Cinder¶
-
class
playback.cinder.
Cinder
(user='ubuntu', hosts=None, key_filename=None, password=None, parallel=True, *args, **kwargs)¶ Bases:
playback.common.Common
Install cinder and volume service
Parameters: - user(str) – the user for remote server to login
- hosts(list) – this is a second param
- key_filename(str) – the ssh private key to used, default None
- password(str) – the password for remote server
- parallel(bool) – paralleler execute on remote server, default True
Returns: None
Examples: # create cinder instances for HA cinder1 = Cinder(user='ubuntu', hosts=['controller1']) cinder2 = Cinder(user='ubuntu', hosts=['controller2']) # create cinder database cinder1.create_cinder_db( root_db_pass='changeme', cinder_db_pass='changeme' ) # create cinder service creadentials cinder1.create_service_credentials( os_password='changeme', os_auth_url='http://192.168.1.1:35357/v3', cinder_pass='changeme', public_endpoint_v1='http://192.168.1.1:8776/v1/%\(tenant_id\)s', internal_endpoint_v1='http://192.168.1.1:8776/v1/%\(tenant_id\)s', admin_endpoint_v1='http://192.168.1.1:8776/v1/%\(tenant_id\)s', public_endpoint_v2='http://192.168.1.1:8776/v2/%\(tenant_id\)s', internal_endpoint_v2='http://192.168.1.1:8776/v2/%\(tenant_id\)s', admin_endpoint_v2='http://192.168.1.1:8776/v2/%\(tenant_id\)s' ) # install cinder-api and cinder-volume on controller nodes, the volume backend defaults to ceph (you must have ceph installed) cinder1.install( connection='mysql+pymysql://cinder:changeme@192.168.1.1/cinder', rabbit_user='openstack', rabbit_pass='changeme', rabbit_hosts='192.168.1.2,192.168.1.3', auth_uri='http://192.168.1.1:5000', auth_url='http://192.168.1.1:35357', cinder_pass='changeme', my_ip='192.168.1.2', glance_api_servers='http://192.168.1.1:9292', rbd_secret_uuid='please_use_uuidgen_to_generate', memcached_servers='192.168.1.2:11211,192.168.1.3:11211', populate=True ) cinder2.install( connection='mysql+pymysql://cinder:changeme@192.168.1.1/cinder', rabbit_user='openstack', rabbit_pass='changeme', rabbit_hosts='192.168.1.2,192.168.1.3', auth_uri='http://192.168.1.1:5000', auth_url='http://192.168.1.1:35357', cinder_pass='changeme', my_ip='192.168.1.3', glance_api_servers='http://192.168.1.1:9292', rbd_secret_uuid='please_use_uuidgen_to_generate', memcached_servers='192.168.1.2:11211,192.168.1.3:11211', populate=True )
-
create_cinder_db
(*args, **kwargs)¶ Create a database named cinder and the cinder user
Parameters: - root_db_pass(str) – the password of mysql root account
- cinder_db_pass(str) – the password of cinder user:
-
create_service_credentials
(*args, **kwargs)¶ Create the cinder service credentials
Parameters: - os_password(str) – the password of OpenStack admin user
- os_auth_url(str) – keystone endpoint url e.g. http://CONTROLLER_VIP:35357/v3
- cinder_pass(str) – password of cinder user
- public_endpoint_v1(str) – public endpoint for volume service e.g. http://CONTROLLER_VIP:8776/v1/%\(tenant_id\)s
- internal_endpoint_v1(str) – internal endpoint for volume service e.g. http://CONTROLLER_VIP:8776/v1/%\(tenant_id\)s
- admin_endpoint_v1(str) – admin endpoint for volume service e.g. http://CONTROLLER_VIP:8776/v1/%\(tenant_id\)s
- public_endpoint_v2(str) – public endpoint v2 for volumev2 service e.g. http://CONTROLLER_VIP:8776/v2/%\(tenant_id\)s
- internal_endpoint_v2(str) – internal endpoint v2 for volumev2 service e.g. http://CONTROLLER_VIP:8776/v2/%\(tenant_id\)s
- admin_endpoint_v2(str) – admin endpoint v2 for volumev2 service e.g. http://CONTROLLER_VIP:8776/v2/%\(tenant_id\)s
-
install
(*args, **kwargs)¶ Install cinder and volume service
Parameters: - connection – The SQLAlchemy connection string to use to connect to the database. (string value) e.g. mysql+pymysql://cinder:CINDER_PASS@CONTROLLER_VIP/cinde
- rabbit_hosts – RabbitMQ HA cluster host:port pairs. (list value) e.g. CONTROLLER1,CONTROLLER2
- rabbit_user(str) – The RabbitMQ userid. (string value) e.g. openstack
- rabbit_pass(str) – The RabbitMQ password. (string value)
- auth_uri(str) – Complete public Identity API endpoint. (string value) e.g. http://CONTROLLER_VIP:5000
- auth_url(str) – Complete admin Identity API endpoint. (string value) e.g. http://CONTROLLER_VIP:35357
- cinder_pass(str) – create a password of cinder database user
- my_ip(str) – IP address of this host (string value)
- glance_api_servers(str) – A list of the URLs of glance API servers available to cinder ([http[s]://][hostname|ip]:port). If protocol is not specified it defaults to http. (list value) e.g. http://CONTROLLER_VIP:9292
- rbd_secret_uuid(str) – (String) The libvirt uuid of the secret for the rbd_user volumes (string value) , use uuidgen to generate the ceph uuid
- memcached_servers(str) – Optionally specify a list of memcached server(s) to use for caching. If left undefined, tokens will instead be cached in-process. (list value) e.g. CONTROLLER1:11211,CONTROLLER2:11211
- populate(bool) – Populate the cinder database, default False