Installing ManageIQ on an AWS EC2 Instance

What did I want to do?

Fergus MacDermot
4 min readApr 8, 2019

I wanted to set up ManageIQ.

The instructions from the Get Started ManageIQ page covers Google Cloud, docker and vagrant. The docker and Google Instructions worked well. However, when running docker, configuring the database for persistence between shutdowns was very difficult due to initialisation issues (see appliance-initialize.sh). I wanted to run on AWS. There are a number of appliance downloads, but I could not find install instructions for the AWS vhd. This page covers what I did to get it working, for the hammer 3 release.

How to install?

After some searching around in the forums, I came across this article by Laurent Domb on installing CloudForms. Cloudforms is the RedHat supported version, and the install instructions worked well for ManageIQ. In summary: we need to download the VHD image, upload that to S3, convert to an AMI and then create an instance based on that image. So, here goes. I am assuming access to an AWS account.

Download, then unzip the vhd for EC2, copy across to S3:

wget -O manageiq.zip http://releases.manageiq.org/manageiq-ec2-hammer-4.zip
### The file is up to 9GB
unzip manageiq.zip
### Create a bucket in S3
bucket=unique-bucket-name
aws s3 mb s3://$bucket
### Upload the file
### Unzipped vhd
file=manageiq-ec2-hammer-3-201903051227-49.vhd
aws s3 cp $file s3://$bucket/

Create policies to allow AMI creation

In each of the files below, update the bucket and file name as necessary. First open a file called vm-import.json that creates a VM import trust policy

Next open a file called role-policy.json to create a role policy that allows snapshot creation

Next open a file that creates an import descriptor

Finally, run these AWS commands to create the policies and convert the VHD

region=ap-northeast-1
aws iam create-role --role-name vmimport --assume-role-policy-document file://vm-import.json
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
## Import the image
aws ec2 import-image --description “manageIQ” --disk-containers file://container.json — region $region
## Check status of the import
aws ec2 describe-import-image-tasks --import-task-ids import-ami-ffut8pit

When the import is complete, we can change the name to something more friendly and remove the original

ami_id=$(aws ec2 describe-import-image-tasks --import-task-ids import-ami-id --output text --query ‘ImportImageTasks[0].ImageId’)
## Change the image name
aws ec2 copy-image --source-image-id $ami_id --source-region $region --region $region --name “manageiq”
## deregister the old image
aws ec2 deregister-image --image-id $ami_id

Clean up the S3 bucket

aws s3 rm s3://$bucket/$file
aws s3 rb s3://$bucket — force

Once the image is available, create an instance via the console or command line. The command line requires too much detail to cover here, so I’ll assume an t2.large instance type has been created.

Start the EVM Server

I could not get the server to start by default and needed to re-create the DB in the following way.

Login to the newly created EC2 instance, here are the aws cli commands for determining the public DNS

## Determine account details
account=$(aws sts get-caller-identity --output text --query ‘Account’)
## Get the image id
ami=$(aws ec2 describe-images --owners $account --filters “Name=name,Values=manageiq” --query ‘Images[*].ImageId’ --output text)
## Get the public DNS
public_dns=$(aws ec2 describe-instances --filters "Name=image-id,Values=$ami" --query 'Reservations[0].Instances[0].PublicDnsName' --output text)
## Login
ssh -i "manageIQ.pem" centos@$public_dns

Once logged in, switch to root user, and view the appliance console menu

sudo su -
## type
appliance_console

You will get a summary page along these lines

Welcome to the ManageIQ Virtual Appliance.To modify the configuration, use a web browser to access the management page.Hostname: ip-***–**–28–19
IPv4 Address: ***.**.28.19/255.255.240.0
IPv4 Gateway: ***.**.16.1
IPv6 Address:
IPV6 Gateway:
Primary DNS: ***.**.0.2
Secondary DNS:
Search Order: ap-northeast-1.compute.internal
MAC Address: 06:92:12:**:**:24
Timezone: Asia/Hong_Kong
Local Database Server: running (primary)
ManageIQ Server: not running
ManageIQ Database: localhost
Database/Region: vmdb_production / 0
External Auth: not configured
ManageIQ Version: hammer-3
Press any key to continue.

Press any key and you will be taken to the Advanced Setting menu. To reset the database make sure the ManageIQ server is not running.

Then choose

7) Configure Database4) Reset Configured Database
Warning: RESETTING A DATABASE WILL DESTROY ANY EXISTING DATA AND CANNOT BE UNDONE.
Are you sure you want to reset the configured database? (Y/N): YEach database region number must be unique.
Enter the database region number:0

Once completed, go back to the Advanced Setting and choose


15) Start EVM Server Processes
Start EVM Server ProcessesStart ManageIQ? (Y/N): Y

Once this is complete, the summary page should now show

ManageIQ Server: running### tail the logs for server start up (it takes a few minutes)
tail -f /var/www/miq/vmdb/log/evm.log
### Verify start up with
curl https://localhost -k
### Any response except connection refused should be ok

Finally, enable the system service so the evm server will start on reboot

systemctl enable evmserverd

How to debug?

Luckily I didn’t need to do much of this. The logs are located

/var/www/miq/vmdb/log

evm.log - back end processes
production.log - gives details of web UI access
api.log - show API calls
audit.log - shows who/what/when/where
## You can also use
journalctl -u evmserverd
journalctl -u evm-watchdog
journalctl -u appliance-initialize

When on the Advanced Setting screen, on a MacBook, ctrl+C will return the console to the summary screen.

Links

CloudForms on AWS, Laurent Domb

ManageIQ Get Started

--

--

Fergus MacDermot

Better engineering through platform engineering. I work 100% remote for an awesome company Ikigai Digital building digital banks in cloud environments.