Creation of new stack with nfs volume stuck

Hi All,
I am just trying out persistent storage in Rancher server.
I followed this link http://rancher.com/docs/rancher/v1.6/en/rancher-services/storage-service/rancher-nfs/

I tried to create Jenkins stack with nfs and my yml code is below. Stack gets stuck in

version: '2'
services:
  Jenkins:
    ports:
      - 8080:8080
    image: jenkins/jenkins:lts
    stdin_open: true
    volumes:
    - jenkinsdata:/data
volumes:
  jenkinsdata:
    driver: rancher-nfs
    driver_opts:
      onRemove: retain

The screenshot showing the volumes and jenkins stack is attached.
Can you please let me know what is going wrong. Do I need to mount NFS in the host ?

Thanks,
Vishnu

For reliability and consistency, I recommend you mount the NFS on the host, and then specify local (and the path) for the volume.

The whole point of the rancher-nfs module is so that you don’t need to mount NFS on the hosts.

Hers is my YAML for my Jenkins container using rancher-nfs.

version: '2'
volumes:
  jenkins-var-jenkins:
    external: true
    driver: rancher-nfs
  jenkins-etc-ssl-certs:
    external: true
    driver: rancher-nfs
services:
  Jenkins:
   image: jenkins:2.60.2
    stdin_open: true
    volumes:
    - jenkins-var-jenkins:/var/jenkins_home
    - jenkins-etc-ssl-certs:/etc/ssl/certs
    tty: true
  Jenkins-int-lb:
    image: rancher/lb-service-haproxy:v0.7.5
    expose:
    - 8080:8080/tcp
    labels:
      io.rancher.container.agent.role: environmentAdmin
      io.rancher.container.create_agent: 'true'

One difference I notice is that your Volume name Jenkins_jenkinsdata_a37dd is not the same as the volume in the yaml. When I created mine, I created the volume names first, and then referenced them by name in the stack.

Hi @shubbard343,

Thanks. But when I execute your code, the volumes are not getting created and I see this error.

Activating (Failed to locate volume for instance of deployment unit [50b88891-0340-466c-ac1e-fa4de495fe24]: )

Any idea on why this is happening.

Thanks,
Vishnu

Hi @shubbard343,

I solved the issue.

I removed external: true from volumes and it started working. The error is related to https://github.com/rancher/rancher/issues/8497

Thanks for your help.