Nutanix supports Docker’s rapid application container build-run-deploy paradigm with a single virtualization platform defined by consumer-grade simplicity and elastic scale. The Nutanix architecture moves beyond legacy three-tier virtualization infrastructures by using automatic scaling as well as pooling and tiering locally attached storage. The Nutanix Enterprise Cloud allows you to provision virtual machines (VMs) that can run a Docker Engine immediately after startup. Rightsized, virtualized environments like those built on the invisible Nutanix infrastructure dispense with the need to manage oversized, individual white-box server estates. Hosting containers in VMs on Nutanix allows container migration, persistent storage for containers using the Nutanix Docker Volume driver, and network and security configuration. The Acropolis Distributed Storage Fabric (DSF) easily handles mixed-workload environments that include both legacy apps (such as Oracle or Microsoft SQL Server) and modern containerized applications. The DSF also ensures data colocation for VMs hosting containers and continual service for those containers from the most performant SSD-backed storage tiers.
Nutanix facilitates DevOps-style workflows with rapid VM snapshot and cloning technologies. These features enable the provision-manage-retire cycles required across any deployment scenario. Administrators can manage these cycles either programmatically with a REST API or with Prism, a single intuitive, browser-based GUI. Prism provides rich analytics to allow full stack monitoring and alerting; single-click, zero-downtime upgrades of the Nutanix appliance software using life cycle management (LCM); VM-centric snapshots and backups; and technologies that facilitate the transfer between hybrid cloud infrastructures. The Docker on Nutanix solution supports rapid deployment and scale-out, making it the ideal platform for any distributed or microservices architecture, from initial development and QA through production.
Audience
This best practices guide is a part of the Nutanix Solutions Library. We intend it as a technical introduction to the Docker on AHV solution for IT architects and administrators.
Purpose
This document covers the following subject areas:
-
Overview of the Nutanix solution.
-
Overview of Docker container technology.
-
Guidelines for installing and optimizing the Docker container stack on AHV.
-
The benefits of implementing the Docker container stack on AHV.
Best Practices for Docker Installation
The complete list of installation procedures for the Docker Engine and associated ecosystem components is available from the Docker website. Consult Docker documentation for the yum-based installation workflow for CentOS (RHEL-based Linux distribution) we use to install Docker Enterprise Edition (Docker EE).
Provisioning Dockerized Virtual Machines
The Nutanix Enterprise Cloud is a fully certified and supported backend target that can host VMs running the Docker Engine. Using the Docker CLI on a remote client, you can provision VMs in a cloud-like fashion. These VMs conform to the AHV format, and on boot they have the necessary Docker Engine installed and enabled. We can then deploy containers on the Dockerized VM.
Docker Machine Can Provision Dockerized VMs on Nutanix AHV
For more details on how to download, configure, and install the required software, please refer to Docker’s information on the Nutanix Docker Volume Plugin (DVP). We enclose a brief synopsis here for convenience.
We qualified the plugin on CentOS 7, RHEL 7.3, and Ubuntu 16.04.2. It may work for older versions, but we haven't tested them yet.
For CentOS:
Install a docker version >= 1.13 by following the instructions here
yum install iscsi-initiator-utils
systemd-tmpfiles --create
systemctl start iscsid
systemctl enable iscsid
Ensure iscsid is running using: systemctl status iscsid
For Ubuntu:
Install a docker version >= 1.13 by following the instructions here
apt-get install open-iscsi
systemd-tmpfiles --create
systemctl start iscsid
systemctl enable iscsid
Ensure iscsid is running using: systemctl status iscsid
Installation
Once you have configured the host VM as described above, you can install the plugin with the following command:
docker plugin install ntnx/nutanix_volume_plugin:[TAG] PRISM_IP="prism-ip" DATASERVICES_IP="dataservices-ip" PRISM_PASSWORD ="prism-passwd" PRISM_USERNAME="username" DEFAULT_CONTAINER="some-storage-container" --alias nutanix
-
PRISM_IP: Prism management IP address of the Nutanix cluster.
-
DATASERVICES_IP: Data service IP configured in the Nutanix cluster.
-
PRISM_USERNAME: User name of the Prism user.
-
PRISM_PASSWORD: The corresponding password for the Prism user.
-
DEFAULT_CONTAINER: The name of an existing storage container on the Nutanix cluster. Use this storage container to store the created persistent volumes.
Check that you’ve installed and enabled the plugin using docker plugin ls.
Creating a Volume with the Nutanix Volume Plugin
Create a persistent Docker volume using the Nutanix Volume plugin:
docker volume create <volume_name> --driver nutanix --opt sizeMb=size
Specifying the size of the volume using sizeMb is optional. The default size of volumes is 10,240 MB (10 GB).
-
Check if the volume is created successfully:
docker volume ls
-
Run a container with the new volume. The following example runs the container with Ubuntu image and lands in the bash shell. mount_location is the mount point inside the container.
docker run -it -v <volume_name>:<mount_location> ubuntu /bin/bash
-
After you remove all the containers associated with the volume, you can remove the volume using the following command:
docker volume rm <volume_name>
Note: If a container is using the volume, Docker doesn’t allow you to remove the volume.
Bear in mind that you can also update the VMs you’ve created in the Prism GUI. The following screenshot shows VMs created using the Docker Machine CLI, which you can administer like any other VMs.
For more information, please follow the following documentation: