Container port mapping is not retained when a container VM is restarted from the vSphere UI
book
Article ID: 316995
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
Symptoms:
After powering off a vSphere Integrated Container (VIC) VM using the web client, the mapped docker port is lost but the container still functions.
You see messages similar to the following, showing that the desired port is failed, in the Portlayer.log file.
Dec 12 2020 00:08:47.633Z ERROR Handler for POST /v1.25/containers/aabec0e9f65c4835a6e1853a3ead9c4f0a7682581cdc8912c34e2b4329140d49/start returned error: Server error from portlayer: error mapping ports: port 9798 is not available
Environment
VMware vSphere Integrated Containers 1.x
Resolution
This is expected behavior. It is not recommend to perform operations on VIC VMs from vCenter directly. You should use docker start/stop/restart to operate the container VM so that the portmap will be kept in the container configuration.