How to set a root password for your Openstack images

Login via console to your failed openstack deployment

 

While installing Redhat Openstack on Baremetal with lots of complicated networking, you might need to access Linux via the console.  Redhat images do not come with a default username and password. So you need to configure the overcloud-full image to have a default password for root.
$ sudo yum install libguestfs-tools
$ source ./stackrc
$ virt-customize -a overcloud-full.qcow2 --root-password password:YOUR-SECURE-PASSWORD
$ openstack overcloud image upload --update-existing

This will install and set the root password, then upload it to the undercloud Glance. This is the simplest way to update the password. 

In order to add a password to images used in the Overcloud to launch VM Instances. Do the above virt-customize command before creating the image with something like:

 openstack image create --disk-format qcow2  --file rhel-server-7.5-update-4-x86_64-kvm.qcow2 rhel-7.5

Octopus Computer Solutions is a Red Hat business partner. We deploy OpenStack and OpenShift throughout Israel. We have encountered customers which wanted to have an image of the OpenStack host with a customized password. This is a small How-To on how to do it.