Manila

class playback.manila.Manila(user='ubuntu', hosts=None, key_filename=None, password=None, parallel=True, *args, **kwargs)

Bases: playback.common.Common

Install manila 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 manila instances for HA
manila1 = Manila(user='ubuntu', hosts=['controller1'])
manila2 = Manila(user='ubuntu', hosts=['controlelr2'])

# create manila database
manila1.create_manila_db(
    root_db_pass='changeme',
    manila_db_pass='changeme'
)

# create manila service credentials
manila1.create_service_credentials(
    os_password='changeme',
    os_auth_url='http://192.168.1.1:35357/v3',
    manila_pass='changeme',
    public_endpoint_v1='http://192.168.1.1:8786/v1/%\(tenant_id\)s',
    internal_endpoint_v1='http://192.168.1.1:8786/v1/%\(tenant_id\)s',
    admin_endpoint_v1='http://192.168.1.1:8786/v1/%\(tenant_id\)s',
    public_endpoint_v2='http://192.168.1.1:8786/v2/%\(tenant_id\)s',
    internal_endpoint_v2='http://192.168.1.1:8786/v2/%\(tenant_id\)s',
    admin_endpoint_v2='http://192.168.1.1:8786/v2/%\(tenant_id\)s'
)

# install manila on controller nodes
manila1.install_manila(
    connection='mysql+pymysql://manila:changeme@192.168.1.1/manila',
    auth_uri='http://192.168.1.1:5000',
    auth_url='http://192.168.1.1:35357',
    manila_pass='changeme',
    my_ip='192.168.1.2',
    memcached_servers='192.168.1.2:11211,192.168.1.3:11211',
    rabbit_hosts='192.168.1.2,192.168.1.3',
    rabbit_user='openstack',
    rabbit_pass='changeme',
    populate=True
)
manila2.install_manila(
    connection='mysql+pymysql://manila:changeme@192.168.1.1/manila',
    auth_uri='http://192.168.1.1:5000',
    auth_url='http://192.168.1.1:35357',
    manila_pass='changeme',
    my_ip='192.168.1.3',
    memcached_servers='192.168.1.2:11211,192.168.1.3:11211',
    rabbit_hosts='192.168.1.2,192.168.1.3',
    rabbit_user='openstack',
    rabbit_pass='changeme',
    populate=False
)
create_manila_db(*args, **kwargs)

Create manila database and the user named manila

Parameters:
  • root_db_pass – the password of mysql root user
  • manila_db_pass – the password of manila database user
Returns:

None

create_service_credentials(*args, **kwargs)

create the manila service credentials

Parameters:
  • os_password – the password of openstack admin user
  • os_auth_url – keystone endpoint url e.g. http://CONTROLLER_VIP:35357/v3
  • manila_pass – passowrd of manila user
  • public_endpoint_v1 – public endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v1/%\(tenant_id\)s
  • internal_endpoint_v1 – internal endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v1/%\(tenant_id\)s
  • admin_endpoint_v1 – admin endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v1/%\(tenant_id\)s
  • public_endpoint_v2 – public endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v2/%\(tenant_id\)s
  • internal_endpoint_v2 – internal endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v2/%\(tenant_id\)s
  • admin_endpoint_v2 – admin endpoint for manila service e.g. http://CONTROLLER_VIP:8786/v2/%\(tenant_id\)s
Returns:

None

install_manila(*args, **kwargs)

Install manila

Parameters:
  • connection – The SQLAlchemy connection string to use to connect to the database. (string value) e.g. mysql+pymysql://manila:MANILA_PASS@CONTROLLER_VIP/manila
  • auth_uri – Complete public Identity API endpoint. (string value) e.g. http://CONTROLLER_VIP:5000
  • auth_url – keystone admin endpoint e.g. http://CONTROLLER_VIP:35357
  • manila_pass – passowrd of manila user
  • my_ip – IP address of this host. (string value)
  • memcached_servers – Memcached servers or None for in process cache. (list value) e.g. CONTROLLER1:11211,CONTROLLER2:11211
  • rabbit_hosts – RabbitMQ HA cluster host:port pairs. (list value) e.g. CONTROLLER1,CONTROLLER2
  • rabbit_user – The RabbitMQ userid. (string value) e.g. openstack
  • rabbit_pass – The RabbitMQ password. (string value)
  • populate – populate the manila database
Returns:

None