Felipe Rodrigues edf064a335 Add commands for share server migration
Implements the commands for performing the share server migration.
They are: share-server-migration-reset-task-state,
share-server-migration-complete, share-server-migration-cancel,
share-server-migration-start, share-server-migration-check
and share-server-migration-get-progress.

Co-Authored-By: Daniel Tapia <danielarthurt@gmail.com>
Co-Authored-By: Andre Beltrami <debeltrami@gmail.com>
Co-Authored-By: Douglas Viroel <viroel@gmail.com>

Change-Id: Id829a375d828a4808306fd1a42bc7548721feb19
Partially-implements: bp share-server-migration
Depends-On: Ic0751027d2c3f1ef7ab0f7836baff3070a230cfd
Depends-On: I46a0cee0a4625d950f02fa7a5bf612de926451b5
2020-09-10 07:40:32 -03:00

55 lines
2.5 KiB
YAML

- name: create the manilaclient config file
file:
path: "{{ manilaclient_config }}"
state: touch
- name: Set OS_ env variables to config
shell:
cmd: |
source {{ base_dir }}/devstack/functions
source {{ base_dir }}/devstack/openrc demo demo &>/dev/null
iniset {{ manilaclient_config }} DEFAULT username $OS_USERNAME
iniset {{ manilaclient_config }} DEFAULT tenant_name $OS_PROJECT_NAME
iniset {{ manilaclient_config }} DEFAULT password $OS_PASSWORD
iniset {{ manilaclient_config }} DEFAULT auth_url $OS_AUTH_URL
iniset {{ manilaclient_config }} DEFAULT project_domain_id $OS_PROJECT_DOMAIN_ID
iniset {{ manilaclient_config }} DEFAULT user_domain_id $OS_USER_DOMAIN_ID
source {{ base_dir }}/devstack/openrc admin demo &>/dev/null
iniset {{ manilaclient_config }} DEFAULT admin_username $OS_USERNAME
iniset {{ manilaclient_config }} DEFAULT admin_tenant_name $OS_TENANT_NAME
iniset {{ manilaclient_config }} DEFAULT admin_password $OS_PASSWORD
iniset {{ manilaclient_config }} DEFAULT admin_auth_url $OS_AUTH_URL
iniset {{ manilaclient_config }} DEFAULT admin_project_domain_id $OS_PROJECT_DOMAIN_ID
iniset {{ manilaclient_config }} DEFAULT admin_user_domain_id $OS_USER_DOMAIN_ID
iniset {{ manilaclient_config }} DEFAULT access_types_mapping "nfs:ip,cifs:user"
# Tests
iniset {{ manilaclient_config }} DEFAULT suppress_errors_in_cleanup false
iniset {{ manilaclient_config }} DEFAULT run_migration_tests true
iniset {{ manilaclient_config }} DEFAULT run_manage_tests true
iniset {{ manilaclient_config }} DEFAULT run_mount_snapshot_tests true
iniset {{ manilaclient_config }} DEFAULT run_share_servers_migration_tests true
args:
executable: "/bin/bash"
- name: create a share network
shell:
cmd: |
source {{ base_dir }}/devstack/functions
source {{ base_dir }}/devstack/openrc demo demo &>/dev/null
NEUTRON_NET=$(openstack network show {{ neutron_network_name }} -c id -f value)
NEUTRON_SUBNET=$(openstack subnet show {{ neutron_subnet_name }} -c id -f value)
manila share-network-create \
--name {{ share_network_name }} \
--neutron-net $NEUTRON_NET \
--neutron-subnet $NEUTRON_SUBNET
iniset {{ manilaclient_config }} DEFAULT share_network {{ share_network_name }}
iniset {{ manilaclient_config }} DEFAULT admin_share_network {{ share_network_name }}
args:
executable: "/bin/bash"