origin: oc cluster with oc 1.5.0.alpha.2 fails when persistent data directory used.

When using --host-data-dir option with oc cluster up using oc 1.5.0.alpha.2, get the error:

oc cluster up --host-data-dir "/C/Users/Graha/PowerShift/profiles/oc15/data" --host-config-dir "/C/Users/Graha/PowerShift/profiles/oc15/config" --use-existing-config
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.5.0-alpha.2 image ...
   Pulling image openshift/origin:v1.5.0-alpha.2
   Pulled 1/3 layers, 36% complete
   Pulled 1/3 layers, 70% complete
   Pulled 2/3 layers, 83% complete
   Pulled 3/3 layers, 100% complete
   Extracting
   Image pull complete
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... OK
-- Checking type of volume mount ...
   Using Docker shared volumes for OpenShift volumes
-- Creating host directories ... OK
-- Finding server IP ...
   Using 10.0.75.2 as the server IP
-- Starting OpenShift container ...
   Creating initial OpenShift configuration
   Starting OpenShift using container 'origin'
FAIL
   Error: could not start OpenShift container "origin"
   Details:
     Last 10 lines of "origin" container log:
     2017-01-15 02:43:53.883049 I | etcdserver: name = openshift.local
     2017-01-15 02:43:53.883125 I | etcdserver: data dir = /var/lib/origin/openshift.local.etcd
     2017-01-15 02:43:53.883146 I | etcdserver: member dir = /var/lib/origin/openshift.local.etcd/member
     2017-01-15 02:43:53.883163 I | etcdserver: heartbeat = 100ms
     2017-01-15 02:43:53.883174 I | etcdserver: election = 1000ms
     2017-01-15 02:43:53.883185 I | etcdserver: snapshot count = 10000
     2017-01-15 02:43:53.883201 I | etcdserver: advertise client URLs = https://10.0.75.2:4001
     2017-01-15 02:43:53.883265 I | etcdserver: initial advertise peer URLs = https://10.0.75.2:7001
     2017-01-15 02:43:53.883288 I | etcdserver: initial cluster = openshift.local=https://10.0.75.2:7001
     2017-01-15 02:43:53.897919 C | etcdserver: create wal error: rename /var/lib/origin/openshift.local.etcd/member/wal.tmp /var/lib/origin/openshift.local.etcd/member/wal: permission denied
Version

oc 1.5.0.alpha.2

Steps To Reproduce

Use oc cluster up with --host-data-dir option.

Current Result

Fails on startup.

Expected Result

Should startup.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (14 by maintainers)

Most upvoted comments

I’m using:

VirtualBox 5.1.26 Kubernetes v1.5.2+43a9be4
openshift v1.5.0+031cbe4

Didn’t work for me using --host-data-dir (and others) :

oc cluster up  --logging=true --metrics=true --docker-machine=openshift --use-existing-config=true --host-data-dir=/vm/data --host-config-dir=/vm/config --host-pv-dir=/vm/pv --host-volumes-dir=/vm/volumes

With output:

-- Checking OpenShift client ... OK
-- Checking Docker client ...
   Starting Docker machine 'openshift'
   Started Docker machine 'openshift'
-- Checking Docker version ...
   WARNING: Cannot verify Docker version
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.5.0 image ... OK
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... OK
-- Checking type of volume mount ...
   Using Docker shared volumes for OpenShift volumes
-- Creating host directories ... OK
-- Finding server IP ...
   Using docker-machine IP 192.168.99.100 as the host IP
   Using 192.168.99.100 as the server IP
-- Starting OpenShift container ...
   Starting OpenShift using container 'origin'
FAIL
   Error: could not start OpenShift container "origin"
   Details:
     Last 10 lines of "origin" container log:
     github.com/openshift/origin/vendor/github.com/coreos/pkg/capnslog.(*PackageLogger).Panicf(0xc4202a1600, 0x42b94c0, 0x1f, 0xc4214d9f08, 0x2, 0x2)
        /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go:75 +0x16a
     github.com/openshift/origin/vendor/github.com/coreos/etcd/mvcc/backend.newBackend(0xc4209f84c0, 0x33, 0x5f5e100, 0x2710, 0xc4214d9fa8)
        /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/vendor/github.com/coreos/etcd/mvcc/backend/backend.go:106 +0x341
     github.com/openshift/origin/vendor/github.com/coreos/etcd/mvcc/backend.NewDefaultBackend(0xc4209f84c0, 0x33, 0x461e51, 0xc421471200)
        /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/vendor/github.com/coreos/etcd/mvcc/backend/backend.go:100 +0x4d
     github.com/openshift/origin/vendor/github.com/coreos/etcd/etcdserver.NewServer.func1(0xc4204bf640, 0xc4209f84c0, 0x33, 0xc421079a40)
        /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/vendor/github.com/coreos/etcd/etcdserver/server.go:272 +0x39
     created by github.com/openshift/origin/vendor/github.com/coreos/etcd/etcdserver.NewServer
        /go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/vendor/github.com/coreos/etcd/etcdserver/server.go:274 +0x345

Openshift writes to the directories /vm/… (also defined in VirtualBox) but successfully won’t start.

@bparees or @GrahamDumpleton : Just wondering if you would have any ideas as I’ve seen a couple of your conversations that touched on this problem please?

Thanks.

The first is how do I specify a directory in the VM?

You need to specify a directory that is not a windows directory (which is pretty much anything that’s not /c/blah). In non-windows Docker, it’s easy to just mount the root fs of the vm into a container and explore. However, on Windows, it looks like mounting the root doesn’t work, so using /var is a safe bet. How can you explore it? Simply run a container that mounts it and take a look at what’s there:

docker run -ti --entrypoint=/bin/bash -v /var:/var openshift/origin:latest
$ ls -al /var

Is it enough to just specify a directory outside of that and it lands on the VM?

Pretty much yes, as long as it’s not root (‘/’) as I mentioned above. I tried -v /foo:/foo and it simply creates that directory on the vm

where on the VM would be an appropriate place to store the PV directories?

I’d follow the pattern we already use by default, something under ‘/var/lib/’, like: ‘/var/lib/profiles/[profile]/pv’

And finally, how can I delete the PV directories on the VM when I am destroying a profile?

You can just run a container that mounts the parent directory and remove that directory. For example:

docker run --entrypoint=/bin/bash --rm -v /var:/var openshift/origin:latest -c "rm -rf /var/lib/profiles/myprofile"

Same for copying it to the host drive… just create a container with a given name that mounts the directory, use docker cp to copy the contents, and then delete the container:

docker create --name=mycontainer -v /var:/var openshift/origin:latest
docker cp mycontainer:/var/lib/profiles/myprofile/pv c:\users\graham\profiles\myprofile
docker rm mycontainer