Configure os-migrate vmware migration kit
Configure the Ansible inventory
Create the ansible inventory:
cat << EOF > inventory.yaml
migrator:
hosts:
localhost:
ansible_connection: local
ansible_python_interpreter: "{{ ansible_playbook_python }}"
conversion_host:
hosts:
192.168.123.95:
ansible_ssh_user: cloud-user
ansible_ssh_private_key_file: /root/.ssh/id_rsa
EOF
Configure the Ansible inventory
Create an alias to use the openstack command in the Red Hat OpenStack Services on OpenShift (RHOSO) deployment:
oc project openstack
alias openstack="oc exec -t openstackclient -- openstack"
Get the security group ID:
SECURITY_GROUP_ID=$(openstack security group list | awk '/ basic / {print $2}')
Create the os_migrate_vars.yamls file:
cat << EOF > os_migrate_vars.yaml
# osm working directory:
os_migrate_vmw_data_dir: /opt/os-migrate
copy_openstack_credentials_to_conv_host: false
# Re-use an already deployed conversion host:
already_deploy_conversion_host: true
# If no mapped network then set the openstack network:
openstack_private_network: private
# Security groups for the instance:
security_groups: ${SECURITY_GROUP_ID}
use_existing_flavor: false
# network settings for openstack:
os_migrate_create_network_port: true
copy_metadata_to_conv_host: true
used_mapped_networks: false
# Use for settings rhel network device:
target_os: rhel
os_migrate_configure_network: true
vms_list:
- haproxy-my-guid
EOF
In the vms_list we specify the list of VMs to be migrated in this example, we will migrate the virtual machine haproxy-my-guid |
Get the project ID and authurl from the tenant we are executing the conversion:
PROJECT_ID=$(openstack project list | grep ' admin ' | awk '{print $2}')
AUTH_URL=$(openstack endpoint list --service identity --interface public -c URL -f value)
And finally create the secrets files with :
cat << EOF > secrets.yaml
# VMware parameters:
esxi_hostname: esxi03002.infra.demo.redhat.com
vcenter_hostname: {vcenter_console}
vcenter_username: {vcenter_full_user}
vcenter_password: {vcenter_password}
vcenter_datacenter: RS01
os_cloud_environ: demo.redhat.com
dst_cloud:
auth:
auth_url: ${AUTH_URL}
username: admin
project_id: ${PROJECT_ID}
project_name: admin
user_domain_name: Default
password: openstack
region_name: regionOne
interface: public
insecure: true
identity_api_version: 3
EOF