Guide to Deploying a native Docker Host as a Service from vRealize Automation (vRA) – VMware Cloud Management

In this blog, we outline the step by step process to deploy a Docker Host from vRealize Automation(vRA) 7.3 service catalog using a vRA blueprint.

    Download the ‘CentOS7 with Docker’ .

2. Upload the ‘CentOS with Docker’ blueprint into the vRA environment using CloudClient utility by following steps mentioned below.

Fig 1.0

    Run the Cloudclient as shown in Fig. 1.0
  • Login to vRA account through cloudclient – CloudClient>vRA login userpass -user ‘vRA username’ -tenant ‘tenant name’ -server ‘vRA server URL’ -password ‘vRA
  • Next upload the from step 1 into vRA as shown in Fig 2.0.

Fig 2.0

    Create a CentOS7 x64 base OS template in vCenter with VMware Tools installed. Also, make sure that it has the vRA Application Authoring agent installed. Follow the steps in this link to install the agent.

***make sure to run a data collection in vRA under ‘Infrastructure- >Compute resources -> Cluster name – Data Collection’ there is a change in vCenter to sync the changes into VRA.

    Edit the Blueprint and Software components in vRA added in Step 2 as below:

Fig 3.0

    Click on External, as seen in Fig 3.0 and add the network that’s predefined in the vRA network Profiles. i.e. Choose the network profile defined under Infrastructure -> Reservations-> Network Profiles.

Fig 3.1

  • Change the ID and the machine prefix according to your environment.
  • Select Action: Clone, Provision workflow: CloneWorkflow
  • Select the vSphere template created in Step-3 in ‘Clone from’ field.
  • Next adjust the machine resources accordingly.
  • To Add storage-> +New and add the storage as needed and save.
  • Edit Network tab -> +New to add and choose the predefined network in the network profile.
  • ***Optional – Use the Customization Specification Manager – virtualization spec customized for CentOS7.
  • Save and Finish to save the changes
    Edit Software Component: Docker for CentOS7:

Fig 4.0

Go to vRA->Design->Software Components-> “Docker for cent OS7”->Edit-> Actions As shown in Fig 4.0.

Install Script:#Install Lib dependenciesyum install -y yum-utils device-mapper-persistent-data lvm2#Update our packagesyum -y update -skip-broken#Install Dockeryum -y install docker docker-registry -skip-brokenConfigure:#stop docker servicesystemctl stop docker#enable docker for every rebootsystemctl enable docker#start the docker servicesystemctl start dockerStart :#docker run hello-worldRun Docker5. Check Blueprint Published State:

Copy the below script under Actions and overwrite the existing action items.

    No changes are needed to Software component: “Linux Configuration for CentOS 7”.

Go to Design-> Blueprints-> “CentOS 7 on vSphere – with Docker- UC14” and see if it’s in published state. If not select the same and publish it.

    Catalog Management:

Fig 5.0

Go to Administration> Catalog management-> Services Tab as shown in Fig 5.0

Create New ->name “CentOS 7 on vSphere – with Docker- UC14”-> [add an icon if needed] -> Status change it as Active-> Assign owner to a user or the admin-> [Optional] Assign a support team -> Click OK.

  • Catalog Items:
  • Go to Catalog Items-> select “CentOS 7 on vSphere – with Docker- UC14” and click on configure.
  • Under General tab, edit the Service as “CentOS 7 on vSphere – with Docker- UC14” from the dropdown box.
  • Change the status as Active and click OK to save changes.
  • Go back to Services in step (6. a)->select the item “CentOS 7 on vSphere – with Docker- UC14” and click on “Manage Catalog Items” on the top panel under Catalog screen click on + icon -> add the Catalogs “CentOS 7 on vSphere – with Docker- UC14 + Docker for cent OS7 + Linux Configuration for CentOS 7” and activate this service.
  • Entitlement:

Go to Entitlement page as seen in Fig 6.0 – Select the + icon and add a New Entitlement by name “CentOS 7 on vSphere – with Docker- UC14”.

Fig 6.0

  • Click on Next > under Items & Approvals->Entitled Services add the service created earlier “CentOS 7 on vSphere – with Docker- UC14”
  • Add the entitled Items->CentOS 7 on vSphere – with Docker- UC14.
  • Entitled Actions as select all->Finish-> Activate it.

Fig 7.0 Fig 8.0

(Make sure the status shows active in the end of all the configuration, if not Activate the Entitlements created in this step)

Fig 9.0

    VRA – CentOS7 Deployment and configuration

#Stop the Docker Servicesystemctl stop docker #create the customised docker config filemkdir /etc/systemd/system/docker.service.dtouch /etc/systemd/system/docker.service.d/docker.confecho -e “[Service] \nExecStart= \nExecStart=/usr/bin/docker daemon -H tcp:// -H unix:///var/run/docker.sock \n ” >> /etc/systemd/system/docker.service.d/docker.conf#start the docker Servicesystemctl start docker

    On successful provisioning: vRA should have successfully deployed CentOS7 VM with Docker engine on vCenter as seen in Fig 9.0. Log in to the OS and run command – docker images – to check if docker engine is successfully deployed.

Fig 10.0Fig 11.0

    Adding provisioned Docker host in vRA Container Management portal:
    Login to the newly created CentOS7 virtual machine on vCenter and run the following steps:
  • Check if the port 2375 is open for tcp connections by running the command on the newly deployed # netstat -ntlp.
  • Go to Containers tab-> Host menu on the left -> add a Host button-> edit as given below and click on Add button as shown in Fig 10.0. Add the IP of the CentOS7 VM in the Addresses field along with the port number 2375 as shown below
    Troubleshooting issues:

Listing some of the issues encountered while deployments.

  • Certificate error fixing for IAAS handshake during provisioning the request – Try regenerating the IaaS and the vRA certificate under https://vRA.vic.local:5480
  • Also in the template rerun the script. And reconfigure. -> create the template -> run the data collection.
  • Reservation error: Make sure the resource reservation is sufficient enough for vRA request to be provisioned.
  • Reservation error: Check under – vRA admiral->Infrastructure->Reservations->Click on Existing reservation->Add the required reservation policy-> Resources Add the storage reservations as needed.

Ex: No reservation is available to allocate within the group <BusinessGroup>. Total 56 GB of storage was requested.

    Port error while adding to Container management portal:

Make sure the docker host has the ports 2375 / 2376 open for tcp connection. Check this by running – #netstat -ntlp command. This should have the sockets “::2375” or “::2376” or “” or “” listed as listening mode.


Article by channel:

Read more articles tagged: Cloud