• Call Toll Free: 1-855-909-3300

How to Deploy Photon OS and vSphere Integrated Containers

VMware has been performing lot of work around containers, container management and the complete area of cloud native applications.

Let us discuss two projects here:

● Photon OS (It is a minimal Linux container host designed and developed to boot extremely fast on VMware platforms.)
● vSphere Integrated Containers (It is a way to deploy containers on vSphere. This permits developers to create applications using containers, however, have the vSphere administrator to manage the needed resources required for these containers.

In this blog post, let us walk through the implementation of the Photon OS, and then deploy VIC afterwards. Following with how containers might be deployed on vSphere, and perhaps managed and controlled by a vSphere administrator.

VMware Announces Support for Smart Glasses Under Enterprise Mobility Management Platform

Step 1: Implementation of Photon OS

There are 3 Photon OS distribution formats present for vSphere; a minimal ISO, a complete ISO and an OVA (appliance).

Usually, the OVA are the easiest way to get started. However you might like to use the complete ISO method. This simply implies creating a Linux VM, attaching the ISO to it, and going for the installation. Follow the given guidelines:

✓ Guest OS Family: “Linux”
✓ Guest OS Version: “Other 3.x Linux (64-bit)”.
✓ 2 vCPU
✓ 2GB Memory (minimum)
✓ 20GB Disk (minimum), recommend 40GB for building VIC later
✓ Network interface with internet access

Once implemented, not that SSH is not enabled by default for root, hence you might have to enable that too through the /etc/ssh/sshd_config file.

Now, Login as root (set default password is changeme), alter the root password when ever prompted to conduct so, now, uncomment the “PermitRootLogin” entry, and then, restart sshd as follows:

root [ ~ ]# systemctl restart sshd

Docker also require to be started and enabled:
root [ ~ ]# systemctl start docker
root [ ~ ]# systemctl enable docker

That’s it. Now, you can begin to run docker commands, implement containers and execute few cloud native applications. The example given in the Photon OS docs in Nginx:

root [ ~ ]# docker run -d -p 80:80 vmwarecna/nginx

You might point a browser at that container, and examine that Nginx is up and running.

With this user-friendly approach you are ready to implement VIC using this Photon OS.

Part 2: Implement vSphere Integrated Containers (VIC) v0.1

There are mainly two approaches to get this done. The first approach is to pull down a pre-compiled and ready-to-run version, and the second approach is to create it yourself. In case you are utilizing the appliance approach, or the minimal ISO, several commands and tools are missing. You might require to install the missing commands, like git, wget, tar, gcc, etc.

Let us take another approach and make VIC our self.

To get that done, we just perform a “git clone” of VIC. In case the git binaries are not installed, you might need to add them. To get that done, execute the following command in the Photon OS:

root [ ~ ]# tdnf install git
Installing:
perl-DBIx-Simple noarch 1.35-1.ph1tp2
perl-DBD-SQLite x86_64 1.46-1.ph1tp2
perl-YAML noarch 1.14-1.ph1tp2
perl-DBI x86_64 1.633-1.ph1tp2
perl x86_64 5.18.2-2.ph1tp2
git x86_64 2.1.2-1.ph1tp2
Is this ok [y/N]:y
Downloading 7592028.00 of 7592028.00
Downloading 17943120.00 of 17943120.00
Downloading 800663.00 of 800663.00
Downloading 67718.00 of 67718.00
Downloading 2081562.00 of 2081562.00
Downloading 38049.00 of 38049.00
Testing transaction
Running transaction

Complete!
root [ ~ ]#

Now we are ready with all the bits we require to build. One thing has to be taken into consideration is the disk size. You may land up utilizing all the available space while using the appliance.

Therefore it is recommended to pull down the full ISO, build a Linux VM with a large enough VMDK/plenty of disk space, and setup/install from there.

vmware,vsphere

One more option is to append another VMDK to the appliance, build a filesystem on it, mount it, and then utilize that for the build, however, the appliance might be missing a lot of tools, such that it will be more challenging.

Without further ado, find below the sequence of the steps:
root [ ~ ]# git clone https://github.com/vmware/vic
Cloning into ‘vic’…
remote: Counting objects: 8922, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 8922 (delta 7), reused 0 (delta 0), pack-reused 8881
Receiving objects: 100% (8922/8922), 12.70 MiB | 4.79 MiB/s, done.
Resolving deltas: 100% (2911/2911), done.
Checking connectivity… done.

Change directory to /vic, and begin the compilation:
root [ ~ ]# cd vic
root [ ~/vic ]# docker run -v $(pwd):/go/src/github.com/vmware/vic \
-w /go/src/github.com/vmware/vic golang:1.6 make all
Unable to find image ‘golang:1.6’ locally
1.6: Pulling from library/golang
.
.
<>
.
.
Making bootstrap iso
Constructing initramfs archive
364232 blocks
xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -dev ‘/go/src/github.com/vmware/vic/bin/bootstrap.iso’
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 14.1g free
xorriso : UPDATE : 7 files added in 1 seconds
Added to ISO image: directory ‘/’=’/tmp/tmp.6lB4qQGr7I/bootfs’
xorriso : UPDATE : Writing: 8192s 23.9% fifo 100% buf 50%
xorriso : UPDATE : Writing: 8192s 23.9% fifo 100% buf 50%
ISO image produced: 34162 sectors
Written to medium : 34336 sectors at LBA 32
Writing to ‘/go/src/github.com/vmware/vic/bin/bootstrap.iso’ completed
successfully.

Building installer
root [ ~/vic ]#

OK. We have successfully created VIC. Let’s move ahead and implement a container over vSphere.
root [ ~/vic ]# cd bin
root [ ~/vic/bin ]# ls
appliance-staging.tgz bootstrap.iso install.sh …
appliance.iso docker-engine-server iso-base.tgz …
bootstrap-staging.tgz imagec port-layer-server …
The command we are mainly looking for is install.sh. This creates or builds our containers. What is required is to provide it along with a target with is the login credentials and IP address of an ESXi host.
We also require to provide a target datastore, and also the name of the container (vic-01). the goal here is to deploy a container on an ESXi host:
root [ ~/vic/bin ]# ./install.sh -g -t ‘root:VMware[email protected]′ \
-i vsanDatastore vic-01
# Generating certificate/key pair – private key in vic-01-key.pem
# Logging into the target
./install.sh: line 184: govc: command not found

Oops! There is an amendment. We require to setup and install govc (or go VC). govc is a stated vSphere CLI built on the top of govmomi.

First we need to sort that out next. I am going to store it in its own directory, and fix or set up the GOPATH variable to point to it. You must consider putting this in .bash_profile of the root user such that it persists. The significant step is the ‘go get’:

root [ ~/vic ]# pwd
/root/vic
root [ ~/vic ]# mkdir govmw
root [ ~/vic ]# cd govmw/
root [ ~/vic/govmw ]# pwd
/root/vic/govmw
root [ ~/vic/govmw ]# export GOPATH=/root/vic/govmw
root [ ~/vic/govmw ]# PATH=$PATH:$GOPATH/bin
root [ ~/vic/govmw ]# go get github.com/vmware/govmomi/govc
root [ ~/vic/govmw ]# ls
bin pkg src
root [ ~/vic/govmw ]# ls bin/
govc
root [ ~/vic/govmw ]#
OK, now we have govc, lets try once more to deploy a container:
root [ ~/vic/bin ]# ./install.sh -g -t ‘root:[email protected]′ \
-i vsanDatastore vic-01
# Generating certificate/key pair – private key in vic-01-key.pem
# Logging into the target
# Uploading ISOs
[06-04-16 12:46:05] Uploading… OK
[06-04-16 12:46:07] Uploading… OK
# Creating vSwitch
# Creating Portgroup
# Creating the Virtual Container Host appliance
# Adding network interfaces
# Setting component configuration
# Configuring TLS server
# Powering on the Virtual Container Host
# Setting network identities
# Waiting for IP information
#
# SSH to appliance (default=root:password)
# [email protected]
#
# Log server:
# https://10.27.51.103:2378
#
# Connect to docker:
docker -H 10.27.51.103:2376 –tls –tlscert=’vic-01-cert.pem’ \
–tlskey=’vic-01-key.pem’

DOCKER_OPTS=”–tls –tlscert=’vic-01-cert.pem’ \
–tlskey=’vic-01-key.pem'”
DOCKER_HOST=10.27.51.103:2376
root [ ~/vic/bin ]#

That is comparatively much better. There are even few docker commands provided that permits us to query the containers.
Then, a lot of the docker calls might not have been deployed or implemented, and may fail with errors very similar to “Error response from daemon: vSphere Integrated Containers does not implement container.ContainerStop”.
root [ ~/vic/bin ]# docker -H 10.27.51.104:2376 –tls \
–tlscert=’vic-02-cert.pem’ –tlskey=’vic-02-key.pem’ info
Containers: 0
Images: 0
Storage Driver: Portlayer Storage
CPUs: 0
Total Memory: 0 B
Name: VIC
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: IPv4 forwarding is disabled.
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
root [ ~/vic/bin ]# docker -H 10.27.51.104:2376 –tls \
–tlscert=’vic-02-cert.pem’ –tlskey=’vic-02-key.pem’ version
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 0.0.1
API version: 1.23
Go version: go1.6
Git commit: –
Built: –
OS/Arch: linux/amd64
Experimental: true
root [ ~/vic/bin ]#

Let’s us explore at this container in vSphere:

And that is fundamentally containers with applications being developed by the software developer, however consuming/utilizing resources from vSphere and managed/controlled by the vSphere administrator.

Now, as you may suspect from a v0.1, above mentioned are the very primary steps towards a far more integrated deployment and implementation. But, hopefully it provides you an idea of where we are heading with this (it actually helped me to understand).

As you might observe that there are several ways to begin, and it is user-friendly. This is an opportunity to give it a try.

Author Profile

Angeela Palin
Angeela Palin
Angeela is Techarex Networks' Content Marketing Associate for Intuit products. She has worked as an eCommerce and Marketing Strategist for the last five years, helping businesses with software implementation for Customer Service, CRM and Email Marketing. Angeela thrives in helping companies find the right software solution for their projects. Aside from his obvious passion for Marketing, Angella admits to being a foodie and travel enthusiast.

Leave a Reply

Techarex NetWorks Products