VIC Reports "vSphere Integrated Containers does not support mounting directories as a data volume"
search cancel

VIC Reports "vSphere Integrated Containers does not support mounting directories as a data volume"

book

Article ID: 336658

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
When deploying a docker-compose the similar error messages are seen.
ERROR: for container_name Cannot create container for service container_name: Bad request error from portlayer: vSphere Integrated Containers does not support mounting directories as a data volume. 

ERROR: for container_name Cannot create container for service container_name: Bad request error from portlayer: vSphere Integrated Containers does not support mounting directories as a data volume. 
ERROR: Encountered errors while bringing up the project.

The volume mount command starts with a slash / or period slash ./ indicating the local directories the docker-client is running from. The docker compose file might have the volumes defined similar to the following. 

volumes:
      - ./conf/container.env:/docker/env


Resolution

Currently vSphere Integrated Containers does not support mounting volumes backed by local directories. Volumes are required  to be based on VMFS backed volume-stores or NFS backed volume-stores. 

Workaround:
Using Existing Volumes:
    1. Create a volume using
docker volume create.
    2. Attach this to a temporary container that has a shell, like busybox.
    3. Copy the files over to the volume. 
    4. Use the existing volume with new container that was using local directories as a volume store.

Copying the files to the container after creating:
    1. Create the container using
docker create.
    2. Copy the desired files using
docker cp <source_file_name>:<destination_path_and_file_name> <container_id>
    3. Start the container normally using docker start "<container_id>