Glance¶
-
class
playback.glance.
Glance
(user='ubuntu', hosts=None, key_filename=None, password=None, parallel=True, *args, **kwargs)¶ Bases:
playback.common.Common
Install glance
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 glance instances glance1 = Glance( user='ubuntu', hosts=['controller1'] ) glance2 = Glance( user='ubuntu', hosts=['controller2'] ) # create glance database glance1.create_glance_db( root_db_pass='changeme', glance_db_pass='changeme' ) # create service credentials glance1.create_service_credentials( os_password='changeme', os_auth_url='http://192.168.1.1:35357/v3', glance_pass='changeme', public_endpoint='http://192.168.1.1:9292', internal_endpoint='http://192.168.1.1:9292', admin_endpoint='http://192.168.1.1:9292' ) # install glance glance1.install_glance( connection='mysql+pymysql://glance:changeme@192.168.1.1/glance', auth_uri='http://192.168.1.1:5000', auth_url='http://192.168.1.1:35357', glance_pass='changeme', memcached_servers='controller1:11211,controller2:11211', populate=True ) glance2.install_glance( connection='mysql+pymysql://glance:changeme@192.168.1.1/glance', auth_uri='http://192.168.1.1:5000', auth_url='http://192.168.1.1:35357', glance_pass='changeme', memcached_servers='controller1:11211,controller2:11211' )
-
create_glance_db
(*args, **kwargs)¶ Create the glance database and the user named glance
Parameters: - root_db_pass – the mysql database root passowrd
- glance_db_pass – the password of glance user
Returns: None
-
create_service_credentials
(*args, **kwargs)¶ Create the glance service credentials
Parameters: - os_password – the password of openstack admin user
- os_auth_url – keystone endpoint url e.g. http://CONTROLLER_VIP:35357/v3
- glance_pass – create a passowrd of glance user
- public_endpoint – public endpoint for glance service e.g. http://CONTROLLER_VIP:9292
- internal_endpoint – internal endpoint for glance service e.g. http://CONTROLLER_VIP:9292
- admin_endpoint – admin endpoint for glance service e.g. http://CONTROLLER_VIP:9292
Returns: None
-
install_glance
(*args, **kwargs)¶ Install glance, default store is ceph
Parameters: - connection – The SQLAlchemy connection string to use to connect to the database. (string value) e.g. mysql+pymysql://glance:GLANCE_PASS@CONTROLLER_VIP/glance
- auth_uri – Complete public Identity API endpoint. (string value) e.g. http://CONTROLLER_VIP:5000
- auth_url – The URL to the keystone service. If “use_user_token” is not in effect and using keystone auth, then URL of keystone can be specified. (string value) e.g. http://CONTROLLER_VIP:35357
- glance_pass – passowrd of glance user
- swift_store_auth_address – DEPRECATED! the address where the Swift authentication service is listening e.g. http://CONTROLLER_VIP:5000/v3/
- memcached_servers – 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 – populate the glance database
Returns: None