Install pre-requisites
Install Red Hat OpenStack Services on OpenShift 18
As we will be using RHOSO as the target migration for Vmware use any of the following labs to install RHOSO 18:
Enable Horizon if you didn’t enable it when installing RHOSO
From the Bastion:
oc patch openstackcontrolplanes/openstack-galera-network-isolation -p='[{"op": "replace", "path": "/spec/horizon/enabled", "value": true}]' --type json
oc patch openstackcontrolplane/openstack-galera-network-isolation -p '{"spec": {"horizon": {"template": {"customServiceConfig": "USE_X_FORWARDED_HOST = False" }}}}' --type=merge
Check that the horizon pods are running after enabling it:
oc project openstack
oc get pods -n openstack
[...]
glance-default-single-0 3/3 Running 0 7h3m
horizon-5dbc7bd48c-hfxvw 0/1 Terminating 0 3s
horizon-6bc6f585c5-c8bhn 0/1 ContainerCreating 0 2s
horizon-84f6cc96d7-zhc4k 0/1 ContainerCreating 0 3s
[...]
Get the Route
ROUTE=$(oc get routes horizon -o go-template='https://{{range .status.ingress}}{{.host}}{{end}}')
echo $ROUTE
https://horizon-openstack.apps.86dgb.dynamic.redhatworkshops.io
Horizon username is admin
password openstack
Deploy a Conversion Host in your OpenStack environment
In the hypervisor:
Copy the Centos 9.4 to the bastion host:
scp /var/lib/libvirt/images/centos9-kvm.qcow2 root@192.168.123.100:
In the bastion, map the Compute nodes to the Compute cell that they are connected to:
oc rsh nova-cell0-conductor-0 nova-manage cell_v2 discover_hosts --verbose
Copy the bastion public key to the openstackclient pod:
oc cp /root/.ssh/id_rsa.pub openstack/openstackclient:/home/cloud-admin/.
Copy the Centos 9.4 qcow image to the openstackclient pod:
oc cp /root/centos9-kvm.qcow2 openstack/openstackclient:/home/cloud-admin/.
Access to the openstackclient pod
oc rsh -n openstack openstackclient
Create networks and security groups if you didn’t create it when installing RHOSO 18
export GATEWAY=192.168.123.1
export PUBLIC_NETWORK_CIDR=192.168.123.1/24
export PRIVATE_NETWORK_CIDR=192.168.100.0/24
export PUBLIC_NET_START=192.168.123.91
export PUBLIC_NET_END=192.168.123.99
export DNS_SERVER=8.8.8.8
openstack security group create basic
openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
openstack security group rule create --protocol icmp basic
openstack security group rule create --protocol udp --dst-port 53:53 basic
openstack network create --external --provider-physical-network datacentre --provider-network-type flat public
openstack network create --internal private
openstack subnet create public-net \
--subnet-range $PUBLIC_NETWORK_CIDR \
--no-dhcp \
--dns-nameserver $DNS_SERVER \
--gateway $GATEWAY \
--allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \
--network public
openstack subnet create private-net \
--subnet-range $PRIVATE_NETWORK_CIDR \
--dns-nameserver $DNS_SERVER \
--network private
openstack router create vrouter
openstack router set vrouter --external-gateway public
openstack router add subnet vrouter private-net
Create image and flavors
openstack flavor create --ram 4096 --disk 35 --vcpu 2 --public migrate
openstack keypair create --public-key ~/id_rsa.pub bastion_key
openstack image create centos9-image --container-format bare --disk-format qcow2 --public --file centos9-kvm.qcow2
Create the Server and a Floating IP
openstack server create \
--flavor migrate --key-name bastion_key --network private --security-group basic \
--image centos9-image centos9-ch
openstack floating ip create public --floating-ip-addres 192.168.123.95
Add the floating IP above to the new VM in the next step.
openstack server add floating ip centos9-ch 192.168.123.95
exit
From the bastion access to the VM.
ssh -i /root/.ssh/id_rsa cloud-user@192.168.123.95