vSphere_Integrated_Containers_docker_stop_start
vSphere Integrated Containers – Docker stop and start commands
To get info on containers running, use “docker ps -a”
It is useful for container names, IDs and IP addresses of web containers/applications.
Example 1:
docker@ubuntu:~/vic$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f19f6793ffa busybox “sh” 5 hours ago Up 5 hours naughty_goldberg
Example 2:
docker@ubuntu:~/vic$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f23b1f10281f nginx “nginx -g daemon off;” About a minute ago Up 54 seconds 192.168.1.12:80->80/tcp condescending_euclid
With the container ID, we can and issue “docker start” or “docker stop” to manage power state in vCenter.
docker@ubuntu:~/vic$ docker start 5f19f6793ffa
5f19f6793ffa
If we wanted to remove and delete a container, use docker rm {container ID}
docker@ubuntu:~/vic$ docker rm 5f19f6793ffa
5f19f6793ffa
“docker info” is another useful command for seeing details about your container host
docker@ubuntu:~/vic$ docker info
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: v0.8.0-7315-c8ac999
Storage Driver: vSphere Integrated Containers v0.8.0-7315-c8ac999 Backend Engine
VolumeStores: default
vSphere Integrated Containers v0.8.0-7315-c8ac999 Backend Engine: RUNNING
VCH mhz limit: 7800 Mhz
VCH memory limit: 13.18 GiB
VMware Product: VMware vCenter Server
VMware OS: linux-x64
VMware OS version: 6.5.0
Plugins:
Volume:
Network: bridge
Swarm:
NodeID:
Is Manager: false
Node Address:
Security Options:
Operating System: linux-x64
OSType: linux-x64
Architecture: x86_64
CPUs: 7800
Total Memory: 13.18 GiB
Name: vmvicvchAdmiral
ID: vSphere Integrated Containers
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
Registry: registry-1.docker.io
To get details of a virtual host container, run inspect. The Docker endpoint environment variable is what you would give to your developer.
The endpoint info is added into the vSphere Web client after installing the VIC UI plug-in. Shown below:
docker@ubuntu:~/vic$ sudo ./vic-machine-linux inspect –target=192.168.1.3 –user=administrator@vsphere.local –password=xxxxxx –thumbprint=11:41:53:20:A1:60:81:CB:2B:9B:C3:1D:AF:42:76:AF:A4:35:C3:63 –name vmvicvch001
INFO[2016-12-10T21:47:58-08:00] ### Inspecting VCH ####
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] VCH ID: VirtualMachine:vm-22
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] Installer version: v0.8.0-7315-c8ac999
INFO[2016-12-10T21:47:59-08:00] VCH version: v0.8.0-7315-c8ac999
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] VCH Admin Portal:
INFO[2016-12-10T21:47:59-08:00] https://192.168.1.8:2378
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] Published ports can be reached at:
INFO[2016-12-10T21:47:59-08:00] 192.168.1.8
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] Docker environment variables:
INFO[2016-12-10T21:47:59-08:00] DOCKER_HOST=192.168.1.8:2375
INFO[2016-12-10T21:47:59-08:00]
INFO[2016-12-10T21:47:59-08:00] Connect to docker:
INFO[2016-12-10T21:47:59-08:00] docker -H 192.168.1.8:2375 info
INFO[2016-12-10T21:47:59-08:00] Completed successfully
Portlet UI added from VIC plug-in (Virtual Container Host)
Rob Shaw – 12/13/2016