Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config-Based Module Support #275

Merged
merged 1 commit into from Feb 3, 2016

Conversation

akutz
Copy link
Member

@akutz akutz commented Feb 2, 2016

This patch adds support for configuration modules via the REX-Ray configuration source. For example, the following configuration is loaded by default:

rexray:
    modules:
        default-admin:
            type: admin
            desc: The default admin module.
            host: tcp://127.0.0.1:7979
        default-docker:
            type: docker
            desc: The default docker module.
            host: unix:///run/docker/plugins/rexray.sock
            spec: /etc/docker/plugins/rexray.spec

The above configuration indicates that there are two modules that need to be initialized and started:

  1. default-admin
  2. default-docker

Default modules can be overridden in a custom configuration file by simply using the same names as above.

If the host or spec properties are not defined for a docker module, then the sanitized name of the module is used to build the paths to a socket and spec file. For example:

rexray:
    modules:
        "isilon 2":
            type: docker

The above configuration would create a Docker module hosted using a socket file at unix:///run/docker/plugins/isilon-2.sock and spec file at /etc/docker/plugins/isilon-2.spec.

If the configuration file is used to override part of the default-docker module's configuration, for example its description, it's also possible to omit the default-docker module's host and spec properties as well. The difference is that the default-docker module's host and spec properties will default to values based not on the module name but unix:///run/docker/plugins/rexray and /etc/docker/plugins/rexray.spec.

@akutz akutz self-assigned this Feb 2, 2016
@akutz akutz added this to the 0.3.2 milestone Feb 2, 2016
@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

Hi @clintonskitson,

I'm going to assign this to you for testing. I've tested it on my Linux VM and it behaves as I think it should -- modules are started via the configuration file as we discussed. The one difference is that I did use rooted scope-keys for modules. For example, in the PR YAML you'll note that host, type, spec, etc. are all rooted directly under the module.

Since they're required, I figured we'd make it easy.

@akutz akutz assigned clintkitson and unassigned akutz Feb 2, 2016
@akutz akutz force-pushed the feature/config-backed-modules branch from 867769b to a7ada55 Compare February 2, 2016 23:22
@clintkitson
Copy link
Member

@akutz Am I missing something re how this would function? I am getting a driver init error from this. Just remembered the CLI functionality also would need to be addressed. I suppose we can define that the root level config is for the CLI, ie rexray volume mount using a specific module default-docker.

[root@mdm2 vagrant]# cat /etc/rexray/config.yml
rexray:
  storageDrivers:
  - scaleio
modules:
  scaleio1:
    type: docker
    desc: providing pdomain and pool
    host: unix:///run/docker/plugins/scaleio.sock
    spec: /etc/docker/plugins/scaleio.spec
    scaleio:
      endpoint: https://127.0.0.1/api
      insecure: true
      userName: admin
      password: Scaleio123
      systemID: 6ab43c2369cf8a69
      protectionDomainName: pdomain2
      storagePoolName: pool2
  scaleio2:
    type: docker
    desc: providing pdomain2 and pool2
    host: unix:///run/docker/plugins/scaleio2.sock
    spec: /etc/docker/plugins/scaleio2.spec
    scaleio:
      endpoint: https://127.0.0.1/api
      insecure: true
      userName: admin
      password: Scaleio123
      systemID: 6ab43c2369cf8a69
      protectionDomainName: pdomain2
      storagePoolName: pool2

@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

Hi @clintonskitson,

Could you please include the error? Also, what CLI functionality? I already noted that the CLI commands would not be at all guaranteed to work for this RC. That's the tax on the configs-per-module in the file. That said, I did note in Slacker that the command do work for the most part. Again, I'm not sure what error you're seeing.

@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

Hi @clintonskitson,

FWIW, I bet you have an errant tab or incorrect spacing in the above file. It's what bites me most often. At least that's my guess without more information.

@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

Hi @clintonskitson,

I know you love to hear this, but... "it works for me" :)

[0]root@poppy:bin$ env REXRAY_MOCKDRIVERS=true ./rexray service start -f --force

                          ⌐▄Q▓▄Ç▓▄,▄_
                         Σ▄▓▓▓▓▓▓▓▓▓▓▄π
                       ╒▓▓▌▓▓▓▓▓▓▓▓▓▓▀▓▄▄.
                    ,_▄▀▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓▓█
                   │▄▓▓ _▓▓▓▓▓▓▓▓▓┌▓▓▓▓▓█
                  _J┤▓▓▓▓▓▓▓▓▓▓▓▓▓├█▓█▓▀Γ
            ,▄▓▓▓▓▓▓^██▓▓▓▓▓▓▓▓▓▓▓▓▄▀▄▄▓▓Ω▄
            F▌▓▌█ⁿⁿⁿ  ⁿ└▀ⁿ██▓▀▀▀▀▀▀▀▀▀▀▌▓▓▓▌
             'ⁿ_  ,▄▄▄▄▄▄▄▄▄█_▄▄▄▄▄▄▄▄▄ⁿ▀~██
               Γ  ├▓▓▓▓▓█▀ⁿ█▌▓Ω]█▓▓▓▓▓▓ ├▓
               │  ├▓▓▓▓▓▌≡,__▄▓▓▓█▓▓▓▓▓ ╞█~   Y,┐
               ╞  ├▓▓▓▓▓▄▄__^^▓▓▓▌▓▓▓▓▓  ▓   /▓▓▓
                  ├▓▓▓▓▓▓▓▄▄═▄▓▓▓▓▓▓▓▓▓  π ⌐▄▓▓█║n
                _ ├▓▓▓▓▓▓▓▓▓~▓▓▓▓▓▓▓▓▓▓  ▄4▄▓▓▓██
                µ ├▓▓▓▓█▀█▓▓_▓▓███▓▓▓▓▓  ▓▓▓▓▓Ω4
                µ ├▓▀▀L   └ⁿ  ▀   ▀ ▓▓█w ▓▓▓▀ìⁿ
                ⌐ ├_                τ▀▓  Σ⌐└
                ~ ├▓▓  ▄  _     ╒  ┌▄▓▓  Γ
                  ├▓▓▓▌█═┴▓▄╒▀▄_▄▌═¢▓▓▓  ╚
               ⌠  ├▓▓▓▓▓ⁿ▄▓▓▓▓▓▓▓┐▄▓▓▓▓  └
               Ω_.└██▓▀ⁿÇⁿ▀▀▀▀▀▀█≡▀▀▀▀▀   µ
               ⁿ  .▄▄▓▓▓▓▄▄┌ ╖__▓_▄▄▄▄▄*Oⁿ
                 û▌├▓█▓▓▓██ⁿ ¡▓▓▓▓▓▓▓▓█▓╪
                 ╙Ω▀█ ▓██ⁿ    └█▀██▀▓█├█Å
                     ⁿⁿ             ⁿ ⁿ^
:::::::..  .,::::::    .,::      .::::::::..    :::.  .-:.     ::-.
;;;;'';;;; ;;;;''''    ';;;,  .,;; ;;;;'';;;;   ;;';;  ';;.   ;;;;'
 [[[,/[[['  [[cccc       '[[,,[['   [[[,/[[['  ,[[ '[[,  '[[,[[['
 $$$$$$c    $$""""        Y$$$Pcccc $$$$$$c   c$$$cc$$$c   c$$"
 888b "88bo,888oo,__    oP"''"Yo,   888b "88bo,888   888,,8P"'
 MMMM   "W" """"YUMMM,m"       "Mm, MMMM   "W" YMM   ""'mM"

Binary: /home/akutz/go/bin/rexray
SemVer: 
OsArch: 
Branch: 
Commit: 
Formed: 

INFO[0000] created pid file, pid=3247                   
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/scaleio.sock desc=providing pdomain and pool name=scaleio1 type=docker
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/scaleio2.sock desc=providing pdomain2 and pool2 name=scaleio2 type=docker
INFO[0000] created new mod config                        addr=tcp://:7979 desc=The default admin module. name=default-admin type=admin
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/rexray.sock desc=The default docker module. name=default-docker type=docker
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/scaleio.sock name=scaleio1 typeName=docker
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/scaleio2.sock name=scaleio2 typeName=docker
INFO[0000] initialized module instance                   address=tcp://:7979 name=default-admin typeName=admin
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/rexray.sock name=default-docker typeName=docker
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] os driver initialized                         provider=linux
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] started module                                address=unix:///run/docker/plugins/scaleio.sock name=scaleio1 typeName=docker
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] os driver initialized                         provider=linux
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] started module                                address=unix:///run/docker/plugins/scaleio2.sock name=scaleio2 typeName=docker
INFO[0000] started module                                address=tcp://:7979 name=default-admin typeName=admin
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] os driver initialized                         provider=linux
INFO[0000] started module                                address=unix:///run/docker/plugins/rexray.sock name=default-docker typeName=docker
INFO[0000] service sent registered modules start signals 
INFO[0000] service successfully initialized, waiting on stop signal 

Here's my config file:

[0]akutz@poppy:~$ cat /etc/rexray/config.yml
rexray:
  logLevel: info
  osDrivers:
  - linux
  - mockOSDriver
  volumeDrivers:
  - docker
  - mockVolumeDriver
  storageDrivers:
  - mockStorageDriver
  modules:
    default-admin:
      type: admin
      host: tcp://:7979
    scaleio1:
      type: docker
      desc: providing pdomain and pool
      host: unix:///run/docker/plugins/scaleio.sock
      spec: /etc/docker/plugins/scaleio.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2
    scaleio2:
      type: docker
      desc: providing pdomain2 and pool2
      host: unix:///run/docker/plugins/scaleio2.sock
      spec: /etc/docker/plugins/scaleio2.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2 
[0]akutz@poppy:~$ 

@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

The sock files are in place as well:

[0]akutz@poppy:~$ sudo ls -al /run/docker/plugins
total 0
drwxr-xr-x. 2 root root 100 Feb  2 17:47 .
drwx------. 4 root root  80 Feb  2 16:27 ..
srwxr-xr-x. 1 root root   0 Feb  2 17:47 rexray.sock
srwxr-xr-x. 1 root root   0 Feb  2 17:47 scaleio2.sock
srwxr-xr-x. 1 root root   0 Feb  2 17:47 scaleio.sock

@akutz
Copy link
Member Author

akutz commented Feb 2, 2016

And just to make sure, here it is started in the background:

[0]root@poppy:bin$ env REXRAY_MOCKDRIVERS=true ./rexray service start 
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] os driver initialized                         provider=linux
INFO[0000] volume driver initialized                     provider=docker
Starting REX-Ray...SUCCESS!

  The REX-Ray daemon is now running at PID 3264. To
  shutdown the daemon execute the following command:

    sudo /home/akutz/go/bin/rexray stop
[0]root@poppy:bin$ cat /var/log/rexray/rexray.log 

                          ⌐▄Q▓▄Ç▓▄,▄_
                         Σ▄▓▓▓▓▓▓▓▓▓▓▄π
                       ╒▓▓▌▓▓▓▓▓▓▓▓▓▓▀▓▄▄.
                    ,_▄▀▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓▓█
                   │▄▓▓ _▓▓▓▓▓▓▓▓▓┌▓▓▓▓▓█
                  _J┤▓▓▓▓▓▓▓▓▓▓▓▓▓├█▓█▓▀Γ
            ,▄▓▓▓▓▓▓^██▓▓▓▓▓▓▓▓▓▓▓▓▄▀▄▄▓▓Ω▄
            F▌▓▌█ⁿⁿⁿ  ⁿ└▀ⁿ██▓▀▀▀▀▀▀▀▀▀▀▌▓▓▓▌
             'ⁿ_  ,▄▄▄▄▄▄▄▄▄█_▄▄▄▄▄▄▄▄▄ⁿ▀~██
               Γ  ├▓▓▓▓▓█▀ⁿ█▌▓Ω]█▓▓▓▓▓▓ ├▓
               │  ├▓▓▓▓▓▌≡,__▄▓▓▓█▓▓▓▓▓ ╞█~   Y,┐
               ╞  ├▓▓▓▓▓▄▄__^^▓▓▓▌▓▓▓▓▓  ▓   /▓▓▓
                  ├▓▓▓▓▓▓▓▄▄═▄▓▓▓▓▓▓▓▓▓  π ⌐▄▓▓█║n
                _ ├▓▓▓▓▓▓▓▓▓~▓▓▓▓▓▓▓▓▓▓  ▄4▄▓▓▓██
                µ ├▓▓▓▓█▀█▓▓_▓▓███▓▓▓▓▓  ▓▓▓▓▓Ω4
                µ ├▓▀▀L   └ⁿ  ▀   ▀ ▓▓█w ▓▓▓▀ìⁿ
                ⌐ ├_                τ▀▓  Σ⌐└
                ~ ├▓▓  ▄  _     ╒  ┌▄▓▓  Γ
                  ├▓▓▓▌█═┴▓▄╒▀▄_▄▌═¢▓▓▓  ╚
               ⌠  ├▓▓▓▓▓ⁿ▄▓▓▓▓▓▓▓┐▄▓▓▓▓  └
               Ω_.└██▓▀ⁿÇⁿ▀▀▀▀▀▀█≡▀▀▀▀▀   µ
               ⁿ  .▄▄▓▓▓▓▄▄┌ ╖__▓_▄▄▄▄▄*Oⁿ
                 û▌├▓█▓▓▓██ⁿ ¡▓▓▓▓▓▓▓▓█▓╪
                 ╙Ω▀█ ▓██ⁿ    └█▀██▀▓█├█Å
                     ⁿⁿ             ⁿ ⁿ^
:::::::..  .,::::::    .,::      .::::::::..    :::.  .-:.     ::-.
;;;;'';;;; ;;;;''''    ';;;,  .,;; ;;;;'';;;;   ;;';;  ';;.   ;;;;'
 [[[,/[[['  [[cccc       '[[,,[['   [[[,/[[['  ,[[ '[[,  '[[,[[['
 $$$$$$c    $$""""        Y$$$Pcccc $$$$$$c   c$$$cc$$$c   c$$"
 888b "88bo,888oo,__    oP"''"Yo,   888b "88bo,888   888,,8P"'
 MMMM   "W" """"YUMMM,m"       "Mm, MMMM   "W" YMM   ""'mM"

Binary: /home/akutz/go/bin/rexray
SemVer: 
OsArch: 
Branch: 
Commit: 
Formed: 

time="2016-02-02T17:51:43-06:00" level=info msg="dialing /tmp/SKYCycbtTEMnuCJkfInJmmdkjvEyfQwb.sock" 
time="2016-02-02T17:51:43-06:00" level=info msg="created pid file, pid=3264" 
time="2016-02-02T17:51:43-06:00" level=info msg="created new mod config" addr="tcp://:7979" desc="The default admin module." name=default-admin type=admin 
time="2016-02-02T17:51:43-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/rexray.sock" desc="The default docker module." name=default-docker type=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio2.sock" desc="providing pdomain2 and pool2" name=scaleio2 type=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio.sock" desc="providing pdomain and pool" name=scaleio1 type=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="initialized module instance" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-02T17:51:43-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="started module" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-02T17:51:43-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[mockStorageDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T17:51:43-06:00" level=info msg="started module" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[mockStorageDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T17:51:43-06:00" level=info msg="started module" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="[mockStorageDriver]" 
time="2016-02-02T17:51:43-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T17:51:43-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="started module" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-02T17:51:43-06:00" level=info msg="service sent registered modules start signals" 
time="2016-02-02T17:51:43-06:00" level=info msg="service successfully initialized, waiting on stop signal" 
[0]root@poppy:bin$ 

@clintkitson
Copy link
Member

Your config is throwing this at me

[root@mdm2 vagrant]# ./rexray start -l debug
DEBU[0000] updated log level                             logLevel=debug
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
DEBU[0000] core get drivers                              osDrivers=[linux mockOSDriver] storageDrivers=[mockStorageDriver] volumeDrivers=[docker mockVolumeDriver]
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] os driver initialized                         provider=linux
Oops, an error occured!

  no storage drivers initialized


[root@mdm2 vagrant]# ./rexray version
Binary: /home/vagrant/rexray
SemVer: 0.3.2-rc1+8
OsArch: Linux-x86_64
Branch: feature/config-backed-modules
Commit: a7ada55b8b5c96e4c63a357b017ee8df852d7310
Formed: Wed, 03 Feb 2016 00:01:11 UTC

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

export REXRAY_MOCKDRIVERS=true

Then run it. Or use the env command. The mock drivers must be enabled to use them.

@clintkitson
Copy link
Member

Ok, the mocking worked. When I remove the mocking drivers I get this error. It looks like the config isn't making it to the driver init.

DEBU[0000] core get drivers                              osDrivers=[linux] storageDrivers=[scaleio] volumeDrivers=[docker]
DEBU[0000] error initializing driver                     driverName=ScaleIO error.useCerts=false error.provider=ScaleIO error.endpoint= error.insecure=false
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] os driver initialized                         provider=linux
Oops, an error occured!

  no storage drivers initialized

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

It would be helpful if you'd provide your altered config. Did you remember to add back in the storage drivers bit at the top?

rexray:
  storageDrivers: scaleio

@clintkitson
Copy link
Member

rexray:
  logLevel: info
  osDrivers:
  - linux
  volumeDrivers:
  - docker
  storageDrivers:
  - scaleio 
  modules:
    default-admin:
      type: admin
      host: tcp://:7979
    scaleio1:
      type: docker
      desc: providing pdomain and pool
      host: unix:///run/docker/plugins/scaleio.sock
      spec: /etc/docker/plugins/scaleio.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2
    scaleio2:
      type: docker
      desc: providing pdomain2 and pool2
      host: unix:///run/docker/plugins/scaleio2.sock
      spec: /etc/docker/plugins/scaleio2.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2 

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Where is your config file? Is it in a home directory or a shared location?

@clintkitson
Copy link
Member

It is in /etc/rexray/config.yml

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Well, I know it's reading the config correctly. Look at my new config:

[0]akutz@poppy:rexray$ cat /etc/rexray/config.yml 
rexray:
  clint: kitdaughter
  logLevel: info
  osDrivers:
  - linux
  - mockOSDriver
  volumeDrivers:
  - docker
  - mockVolumeDriver
  storageDrivers:
  - mockStorageDriver
  modules:
    default-admin:
      type: admin
      host: tcp://:7979
    scaleio1:
      type: docker
      desc: providing pdomain and pool
      host: unix:///run/docker/plugins/scaleio.sock
      spec: /etc/docker/plugins/scaleio.spec
      rexray:
        clint: kitson
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2
    scaleio2:
      type: docker
      desc: providing pdomain2 and pool2
      host: unix:///run/docker/plugins/scaleio2.sock
      spec: /etc/docker/plugins/scaleio2.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2 
[0]akutz@poppy:rexray$ 
INFO[0000] created pid file, pid=3514                   
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/rexray.sock desc=The default docker module. name=default-docker type=docker
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/scaleio.sock desc=providing pdomain and pool name=scaleio1 type=docker
INFO[0000] created new mod config                        addr=unix:///run/docker/plugins/scaleio2.sock desc=providing pdomain2 and pool2 name=scaleio2 type=docker
INFO[0000] created new mod config                        addr=tcp://:7979 desc=The default admin module. name=default-admin type=admin
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/rexray.sock name=default-docker typeName=docker
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/scaleio.sock name=scaleio1 typeName=docker
INFO[0000] initialized module instance                   address=unix:///run/docker/plugins/scaleio2.sock name=scaleio2 typeName=docker
INFO[0000] initialized module instance                   address=tcp://:7979 name=default-admin typeName=admin
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] os driver initialized                         provider=linux
INFO[0000] rexray.clint=kitdaughter                     
INFO[0000] started module                                address=unix:///run/docker/plugins/rexray.sock name=default-docker typeName=docker
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] rexray.clint=kitson                          
INFO[0000] os driver initialized                         provider=linux
INFO[0000] started module                                address=unix:///run/docker/plugins/scaleio.sock name=scaleio1 typeName=docker
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [mockStorageDriver]                          
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] rexray.clint=kitdaughter                     
INFO[0000] os driver initialized                         provider=linux
INFO[0000] started module                                address=unix:///run/docker/plugins/scaleio2.sock name=scaleio2 typeName=docker
INFO[0000] started module                                address=tcp://:7979 name=default-admin typeName=admin
INFO[0000] service sent registered modules start signals 
INFO[0000] service successfully initialized, waiting on stop signal 

@clintkitson
Copy link
Member

You should be able to use my example config and hit the same exact error. The following line shows that the configured variables aren't making it into the driver.

DEBU[0000] error initializing driver                     driverName=ScaleIO error.useCerts=false error.provider=ScaleIO error.endpoint= error.insecure=false

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Works for me, and I'm no longer enabling the mock drivers (they are listed in the config, but they are useless sans the environment variable that enables them):

[0]root@poppy:bin$ cat /etc/rexray/config.yml 
rexray:
  clint: kitdaughter
  logLevel: debug
  osDrivers:
  - linux
  - mockOSDriver
  volumeDrivers:
  - docker
  - mockVolumeDriver
  storageDrivers:
  - scaleio
  - mockStorageDriver
  modules:
    default-admin:
      type: admin
      host: tcp://:7979
    scaleio1:
      type: docker
      desc: providing pdomain and pool
      host: unix:///run/docker/plugins/scaleio.sock
      spec: /etc/docker/plugins/scaleio.spec
      rexray:
        clint: kitson
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2
    scaleio2:
      type: docker
      desc: providing pdomain2 and pool2
      host: unix:///run/docker/plugins/scaleio2.sock
      spec: /etc/docker/plugins/scaleio2.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2 
[0]root@poppy:bin$ 
[0]root@poppy:bin$ ./rexray service start
DEBU[0000] updated log level                             logLevel=debug
INFO[0000] [linux mockOSDriver]                         
INFO[0000] [docker mockVolumeDriver]                    
INFO[0000] [scaleio mockStorageDriver]                  
DEBU[0000] core get drivers                              osDrivers=[linux mockOSDriver] storageDrivers=[scaleio mockStorageDriver] volumeDrivers=[docker mockVolumeDriver]
INFO[0000] os driver initialized                         provider=linux
INFO[0000] volume driver initialized                     provider=docker
INFO[0000] initializing scaleio driver                   endpoint= insecure=false provider=ScaleIO useCerts=false
DEBU[0000] invoking service start                        os.Args=[./rexray service start]
Starting REX-Ray...DEBU[0000] trying to start service                       client=/tmp/XNBcERjFWehYiAiLnHNhKkBYcsBsbwwo.sock
time="2016-02-02T18:53:14-06:00" level=debug msg="updated log level" logLevel=debug 
time="2016-02-02T18:53:14-06:00" level=debug msg="invoking service start" os.Args=[/home/akutz/go/bin/rexray start --client=/tmp/XNBcERjFWehYiAiLnHNhKkBYcsBsbwwo.sock --logLevel=debug --host=tcp://:7979] 
DEBU[0000] accepted connection                          
DEBU[0000] received data                                
SUCCESS!

  The REX-Ray daemon is now running at PID 3725. To
  shutdown the daemon execute the following command:

    sudo /home/akutz/go/bin/rexray stop

[0]root@poppy:bin$ 

Here's the REX-Ray log grepped down to just the INFO lines as I placed on in the ScaleIO driver to emit the URL. Notice that two of the ScaleIO modules do list the URL while one does not.

Since you're only listing two modules, would you like to guess why a third is appearing? It's the default module we discussed. You're not using it, and therefore since nothing is defined as a default ScaleIO URL, it's trying to initialize to a default, empty value.

It's working exactly as it's designed. Configure the default docker module with the name default-docker per the instructions in the PR. I would have done away with it entirely, but you elected to maintain backwards compatibility. Either define a root config for ScaleIO or override the default docker module.

[0]root@poppy:bin$ cat /var/log/rexray/rexray.log | grep info
time="2016-02-02T18:53:14-06:00" level=info msg="dialing /tmp/XNBcERjFWehYiAiLnHNhKkBYcsBsbwwo.sock" 
time="2016-02-02T18:53:14-06:00" level=info msg="created pid file, pid=3725" 
time="2016-02-02T18:53:14-06:00" level=debug msg="adding flag" defaultValue=warn envVar="REXRAY_LOGLEVEL" flagName=logLevel keyName=rexray.logLevel keyType=0 usage="The log level (error, warn, info, debug)" 
time="2016-02-02T18:53:14-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio.sock" desc="providing pdomain and pool" name=scaleio1 type=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio2.sock" desc="providing pdomain2 and pool2" name=scaleio2 type=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="created new mod config" addr="tcp://:7979" desc="The default admin module." name=default-admin type=admin 
time="2016-02-02T18:53:14-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/rexray.sock" desc="The default docker module." name=default-docker type=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="initialized module instance" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-02T18:53:14-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[scaleio mockStorageDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="initializing scaleio driver" endpoint="https://127.0.0.1/api" insecure=true provider=ScaleIO useCerts=false 
time="2016-02-02T18:53:14-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T18:53:14-06:00" level=info msg="started module" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[scaleio mockStorageDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="initializing scaleio driver" endpoint="https://127.0.0.1/api" insecure=true provider=ScaleIO useCerts=false 
time="2016-02-02T18:53:14-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T18:53:14-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="started module" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="started module" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-02T18:53:14-06:00" level=info msg="[linux mockOSDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[docker mockVolumeDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="[scaleio mockStorageDriver]" 
time="2016-02-02T18:53:14-06:00" level=info msg="initializing scaleio driver" endpoint= insecure=false provider=ScaleIO useCerts=false 
time="2016-02-02T18:53:14-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-02T18:53:14-06:00" level=info msg="started module" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-02T18:53:14-06:00" level=info msg="service sent registered modules start signals" 
time="2016-02-02T18:53:14-06:00" level=info msg="service successfully initialized, waiting on stop signal" 
[0]root@poppy:bin$ 

@clintkitson
Copy link
Member

Are you sure your build isn't dirty? =)

SemVer: 0.3.2-rc1+8
OsArch: Linux-x86_64
Branch: feature/config-backed-modules
Commit: a7ada55b8b5c96e4c63a357b017ee8df852d7310

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

It is, but only because I had to add logging statements & return early from the ScaleIO init method (since my ScaleIO driver will obv. not emit.). Want me to commit what I have exactly? I can revert it prior to the PR merge.

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

There ya go, I just pushed the changes I've been working with:

[0]akutz@pax:rexray$ make version
SemVer: 0.3.2-rc1+9
RpmVer: 0.3.2+rc1+9
Binary: Darwin-x86_64
Branch: feature/config-backed-modules
Commit: 5c28e8402e797af45f7a49b7a3170e49e173c2a8
Formed: Tue, 02 Feb 2016 19:06:37 CST

Here's my config file as well:

/etc/rexray/config.yml

rexray:
  clint: kitdaughter
  logLevel: debug
  osDrivers:
  - linux
  - mockOSDriver
  volumeDrivers:
  - docker
  - mockVolumeDriver
  storageDrivers:
  - scaleio
  - mockStorageDriver
  modules:
    default-admin:
      type: admin
      host: tcp://:7979
    scaleio1:
      type: docker
      desc: providing pdomain and pool
      host: unix:///run/docker/plugins/scaleio.sock
      spec: /etc/docker/plugins/scaleio.spec
      rexray:
        clint: kitson
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2
    scaleio2:
      type: docker
      desc: providing pdomain2 and pool2
      host: unix:///run/docker/plugins/scaleio2.sock
      spec: /etc/docker/plugins/scaleio2.spec
      scaleio:
        endpoint: https://127.0.0.1/api
        insecure: true
        userName: admin
        password: Scaleio123
        systemID: 6ab43c2369cf8a69
        protectionDomainName: pdomain2
        storagePoolName: pool2 

I told you, it worked for me. As Dr. Crusher would say:

image

Or in this case, with your testing. It's working like we decided it should -- the default module loads right up as it did before, for better or worse, and you're no longer configuring it. You need to do so by adding a root scaleio section or configuring a module named default-docker and configuring it for scaleio.

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Please feel free to rethink/reconsider how default modules should behave. I'm fine with whatever. I like this method on which we agreed -- if the config is in error, things fail. We would have noticed it sooner as the logs note that it's the default-docker module failing, except we were distracted by the idea that the new code was the bit failing, never thinking it was because of an error with the previous configuration structure.

@clintkitson
Copy link
Member

That worked for me. Is the problem that the default module initialization is blank so it is bombing out there before moving on?

time="2016-02-03T01:51:10Z" level=debug msg="adding flag" defaultValue=warn envVar="REXRAY_LOGLEVEL" flagName=logLevel keyName=rexray.logLevel keyType=0 usage="The log level (error, warn, info, debug)" 
time="2016-02-03T01:51:10Z" level=info msg="created new mod config" addr="tcp://:7979" desc="The default admin module." name=default-admin type=admin 
time="2016-02-03T01:51:10Z" level=info msg="created new mod config" addr="unix:///run/docker/plugins/rexray.sock" desc="The default docker module." name=default-docker type=docker 
time="2016-02-03T01:51:10Z" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio.sock" desc="providing pdomain and pool" name=scaleio1 type=docker 
time="2016-02-03T01:51:10Z" level=info msg="created new mod config" addr="unix:///run/docker/plugins/scaleio2.sock" desc="providing pdomain2 and pool2" name=scaleio2 type=docker 
time="2016-02-03T01:51:10Z" level=info msg="initialized module instance" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-03T01:51:10Z" level=info msg="initialized module instance" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="initialized module instance" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="started module" address="tcp://:7979" name=default-admin typeName=admin 
time="2016-02-03T01:51:10Z" level=info msg="[linux]" 
time="2016-02-03T01:51:10Z" level=info msg="[docker]" 
time="2016-02-03T01:51:10Z" level=info msg="[scaleio]" 
time="2016-02-03T01:51:10Z" level=info msg="initializing scaleio driver" endpoint= insecure=false provider=ScaleIO useCerts=false 
time="2016-02-03T01:51:10Z" level=info msg="os driver initialized" provider=linux 
time="2016-02-03T01:51:10Z" level=info msg="volume driver initialized" provider=docker 
time="2016-02-03T01:51:10Z" level=info msg="started module" address="unix:///run/docker/plugins/rexray.sock" name=default-docker typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="[linux]" 
time="2016-02-03T01:51:10Z" level=info msg="[docker]" 
time="2016-02-03T01:51:10Z" level=info msg="[scaleio]" 
time="2016-02-03T01:51:10Z" level=info msg="volume driver initialized" provider=docker 
time="2016-02-03T01:51:10Z" level=info msg="initializing scaleio driver" endpoint="https://127.0.0.1/api" insecure=true provider=ScaleIO useCerts=false 
time="2016-02-03T01:51:10Z" level=info msg="os driver initialized" provider=linux 
time="2016-02-03T01:51:10Z" level=info msg="started module" address="unix:///run/docker/plugins/scaleio.sock" name=scaleio1 typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="[linux]" 
time="2016-02-03T01:51:10Z" level=info msg="[docker]" 
time="2016-02-03T01:51:10Z" level=info msg="[scaleio]" 
time="2016-02-03T01:51:10Z" level=info msg="initializing scaleio driver" endpoint="https://127.0.0.1/api" insecure=true provider=ScaleIO useCerts=false 
time="2016-02-03T01:51:10Z" level=info msg="os driver initialized" provider=linux 
time="2016-02-03T01:51:10Z" level=info msg="volume driver initialized" provider=docker 
time="2016-02-03T01:51:10Z" level=info msg="started module" address="unix:///run/docker/plugins/scaleio2.sock" name=scaleio2 typeName=docker 
time="2016-02-03T01:51:10Z" level=info msg="service sent registered modules start signals" 
time="2016-02-03T01:51:10Z" level=info msg="service successfully initialized, waiting on stop signal"

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Is the problem that the default module initialization is blank so it is bombing out there before moving on?

Yes, that's what I said above. And that's by design. If the configuration isn't valid, it fails REX-Ray. Users can either remove the invalid section or fix the problem.

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Specifically, if you don't override it, REX-Ray defines two modules as I note in the commit message as well as the PR description.

rexray:
    modules:
        default-admin:
            type: admin
            desc: The default admin module.
            host: tcp://127.0.0.1:7979
        default-docker:
            type: docker
            desc: The default docker module.
            host: unix:///run/docker/plugins/rexray.sock
            spec: /etc/docker/plugins/rexray.spec

Well, note that there's nothing there that indicates what drivers to use, let alone how those drivers are configured. So just like before, if you fail to configure the default values, the service fails to start. The default modules are expected to be configured because you specifically didn't want to break the previous behavior.

@akutz akutz force-pushed the feature/config-backed-modules branch from 5c28e84 to a7ada55 Compare February 3, 2016 02:07
@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

So what's the verdict?

@clintkitson
Copy link
Member

Been delayed due to running into some other technical stuff. What I've narrowed it down to is the following three configurations. Trying to figure out for simplicity and consistency is we're in the right ball park. Let me play through a few mixtures and get your feedback.

Just adding a module seems to be a bit confusing since

  1. the socket still sits at rexray while the new one sits at a custom place
rexray:
  storageDrivers:
  - isilon
  modules:
    isilon2:
      type: docker
      desc: second isilon instance
      host: unix:///run/docker/plugins/isilon2.sock
      spec: /etc/docker/plugins/isilon2.spec
      isilon:
        endpoint: https://172.17.177.230:8080
        insecure: true
        username: root
        password: P@ssword1!
        volumePath: /rexray
        nfsHost: 172.17.177.230
        quotas: true
        dataSubnet: 172.17.177.0/24
isilon:
  endpoint: https://172.17.177.230:8080
  insecure: true
  username: root
  password: P@ssword1!
  volumePath: /rexray
  nfsHost: 172.17.177.230
  quotas: true
  dataSubnet: 172.17.177.0/24

I think this is getting to be more desirable since all sockets can be customized. But the root isilon scope that refers to the default instance seems odd.

rexray:
  storageDrivers:
  - isilon
  modules:
    default-docker:
      type: docker
      desc: The default docker module.
      host: unix:///run/docker/plugins/isilon1.sock
      spec: /etc/docker/plugins/isilon1.spec
    isilon2:
      type: docker
      desc: second isilon instance
      host: unix:///run/docker/plugins/isilon2.sock
      spec: /etc/docker/plugins/isilon2.spec
      isilon:
        endpoint: https://172.17.177.230:8080
        insecure: true
        username: root
        password: P@ssword1!
        volumePath: /rexray
        nfsHost: 172.17.177.230
        quotas: true
        dataSubnet: 172.17.177.0/24
isilon:
  endpoint: https://172.17.177.230:8080
  insecure: true
  username: root
  password: P@ssword1!
  volumePath: /rexray
  nfsHost: 172.17.177.230
  quotas: true
  dataSubnet: 172.17.177.0/24

I think this one would be ideal. I like it because it is very clear how to configure the modules. This one doesn't work. Thoughts?

rexray:
  storageDrivers:
  - isilon
  modules:
    default-docker:
      type: docker
      desc: The default docker module.
      host: unix:///run/docker/plugins/isilon1.sock
      spec: /etc/docker/plugins/isilon1.spec
      isilon:
        endpoint: https://172.17.177.230:8080
        insecure: true
        username: root
        password: P@ssword1!
        volumePath: /rexray
        nfsHost: 172.17.177.230
        quotas: true
        dataSubnet: 172.17.177.0/24
    isilon2:
      type: docker
      desc: second isilon instance
      host: unix:///run/docker/plugins/isilon2.sock
      spec: /etc/docker/plugins/isilon2.spec
      isilon:
        endpoint: https://172.17.177.230:8080
        insecure: true
        username: root
        password: P@ssword1!
        volumePath: /rexray
        nfsHost: 172.17.177.230
        quotas: true
        dataSubnet: 172.17.177.0/24

@clintkitson
Copy link
Member

DEBU[0000] core get drivers                              osDrivers=[linux] storageDrivers=[isilon] volumeDrivers=[docker]
DEBU[0000] error initializing driver                     driverName=Isilon error.provider=Isilon error.volumePath= error.group= error.insecure=false error.dataSubnet= error.endpoint= error.userName= error.password=
INFO[0000] volume driver initialized                     provider=docker

@akutz akutz force-pushed the feature/config-backed-modules branch from a7ada55 to 567d6f7 Compare February 3, 2016 17:42
@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Okay, I've updated the CLI per out conversation, and based on the logs it looks good to go. Give it a spin.

Logs

[0]root@poppy:bin$ ./rexray start -l debug
DEBU[0000] updated log level                             logLevel=debug
INFO[0000] [linux]                                      
INFO[0000] [docker]                                     
INFO[0000] [isilon]                                     
DEBU[0000] core get drivers                              osDrivers=[linux] storageDrivers=[isilon] volumeDrivers=[docker]
INFO[0000] os driver initialized                         provider=linux
INFO[0000] volume driver initialized                     provider=docker

This line

INFO[0000] initializing isilon                           dataSubnet=172.17.177.0/24 endpoint=https://172.17.177.230:8080 group= insecure=true provider=Isilon userName=root volumePath=/rexray
DEBU[0000] invoking service start                        os.Args=[./rexray start -l debug]
Starting REX-Ray...DEBU[0000] trying to start service                       client=/tmp/lNBivvxUtNGVOJNIoHudlVwFgLmiKAed.sock
time="2016-02-03T11:42:08-06:00" level=debug msg="updated log level" logLevel=debug 
time="2016-02-03T11:42:08-06:00" level=debug msg="invoking service start" os.Args=[/home/akutz/go/bin/rexray start --client=/tmp/lNBivvxUtNGVOJNIoHudlVwFgLmiKAed.sock --logLevel=debug --host=tcp://:7979] 
DEBU[0000] accepted connection                          
DEBU[0000] received data                                
SUCCESS!

  The REX-Ray daemon is now running at PID 4117. To
  shutdown the daemon execute the following command:

    sudo /home/akutz/go/bin/rexray stop

[0]root@poppy:bin$ 

One-Line Change to the CLI

image

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

By the way, if you're happy with the pattern we discussed I'll go ahead and update the documentation explaining module support as well as how to override the default modules.

@clintkitson
Copy link
Member

@akutz Thumbs up, works now.

This is an example of virtualbox with modules that works.

rexray:
  logLevel: warn
  storageDrivers:
  - virtualbox
  mount:
    volume:
      preempt: true
  modules:
    default-docker:
      type: docker
      desc: "The default docker module."
      host: "unix:///run/docker/plugins/vb1.sock"
      virtualbox:
        endpoint: http://10.0.2.2:18083
        tls: false
        volumePath: "/Users/clintonkitson/Repos/vagrant/rexray/Volumes"
        controllerName: SATA
    virtualbox2:
      type: docker
      desc: "The second docker module."
      host: "unix:///run/docker/plugins/vb2.sock"
      virtualbox:
        endpoint: http://10.0.2.2:18083
        tls: false
        volumePath: "/Users/clintonkitson/Repos/vagrant/rexray/Volumes"
        controllerName: SATA

And the contrasted one without modules that works.

rexray:
  logLevel: warn
  storageDrivers:
  - virtualbox
  mount:
    volume:
      preempt: true
virtualbox:
  endpoint: http://10.0.2.2:18083
  tls: false
  volumePath: "/Users/clintonkitson/Repos/vagrant/rexray/Volumes"
  controllerName: SATA

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Great. Please try this one though:

rexray:
  logLevel: warn
  storageDrivers:
  - virtualbox
  mount:
    volume:
      preempt: true
  modules:
    default-docker:
      host: "unix:///run/docker/plugins/vb1.sock"
    virtualbox2:
      type: docker
      desc: "The second docker module."
      host: "unix:///run/docker/plugins/vb2.sock"
virtualbox:
  endpoint: http://10.0.2.2:18083
  tls: false
  volumePath: "/Users/clintonkitson/Repos/vagrant/rexray/Volumes"
  controllerName: SATA

This should have the same effect as the modular config you provided. It's a little closer to an in-between version of the two -- one with defaults (legacy) and one with modules. In the example I provided, only the host value for the default-docker module is overridden.

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Also, we could get sneaky and decalre that aside from default-docker, if a person defines a module like this:

rexray:
  modules:
    vb2:
      type: docker
    vb3:
      type: docker

Then the host path for each of those docker module instances, since they're left undefined, will default to unix:///run/docker/plugins/vb1.sock and unix:///run/docker/plugins/vb3.sock. The name of the module could be used as the base part of the file name for a sock file placed in /run/docker/plugins. Thoughts?

@clintkitson
Copy link
Member

If the module itself applied the base path, ie. /run/docker/plugins, yes.

@clintkitson
Copy link
Member

Working on previous example now.

@clintkitson
Copy link
Member

@akutz the example you gave tests good.

@clintkitson
Copy link
Member

@akutz I made a comment to you on slack re the default-docker module name. Thoughts on making it the default-volume as the name instead? I wouldn't want a breaking change in the config in the future if the underlying default volume driver shifts. Seems to make more sense to keep it abstract for the name.

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Let's leave it as default-docker for now:

  1. It makes sense for today regarding backwards compatibility.
  2. Today the only volume module is the docker module, and in the future we might have a default-mesos, default-kubernetes, etc.
  3. The future is unimportant as we'll shift to libStorage and the REX-Ray config will be deprecated
  4. The properties of the default-docker module may not be the same as some other module.

@clintkitson
Copy link
Member

Roger, agreed.

@akutz akutz force-pushed the feature/config-backed-modules branch from 567d6f7 to 6c3fb0e Compare February 3, 2016 19:48
@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Please see the updated PR description as well as making sure the changes look good to you. I tested them, and they appear to work, but two sets of eyes...

/etc/rexray/config.yml

[0]root@poppy:bin$ cat /etc/rexray/config.yml
rexray:
  logLevel: debug
  storageDrivers:
  - isilon
  modules:
    default-docker:
      host: unix:///run/docker/plugins/isilon1.sock
      spec: /etc/docker/plugins/isilon1.spec
    isilon2:
      type: docker
      isilon:
        endpoint: https://172.17.177.230:8081
isilon:
    endpoint: https://172.17.177.230:8080
    insecure: true
    username: root
    password: P@ssword1!
    volumePath: /rexray
    nfsHost: 172.17.177.230
    quotas: true
    dataSubnet: 172.17.177.0/24

/var/log/rexray/rexray.log

                          ⌐▄Q▓▄Ç▓▄,▄_
                         Σ▄▓▓▓▓▓▓▓▓▓▓▄π
                       ╒▓▓▌▓▓▓▓▓▓▓▓▓▓▀▓▄▄.
                    ,_▄▀▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓▓█
                   │▄▓▓ _▓▓▓▓▓▓▓▓▓┌▓▓▓▓▓█
                  _J┤▓▓▓▓▓▓▓▓▓▓▓▓▓├█▓█▓▀Γ
            ,▄▓▓▓▓▓▓^██▓▓▓▓▓▓▓▓▓▓▓▓▄▀▄▄▓▓Ω▄
            F▌▓▌█ⁿⁿⁿ  ⁿ└▀ⁿ██▓▀▀▀▀▀▀▀▀▀▀▌▓▓▓▌
             'ⁿ_  ,▄▄▄▄▄▄▄▄▄█_▄▄▄▄▄▄▄▄▄ⁿ▀~██
               Γ  ├▓▓▓▓▓█▀ⁿ█▌▓Ω]█▓▓▓▓▓▓ ├▓
               │  ├▓▓▓▓▓▌≡,__▄▓▓▓█▓▓▓▓▓ ╞█~   Y,┐
               ╞  ├▓▓▓▓▓▄▄__^^▓▓▓▌▓▓▓▓▓  ▓   /▓▓▓
                  ├▓▓▓▓▓▓▓▄▄═▄▓▓▓▓▓▓▓▓▓  π ⌐▄▓▓█║n
                _ ├▓▓▓▓▓▓▓▓▓~▓▓▓▓▓▓▓▓▓▓  ▄4▄▓▓▓██
                µ ├▓▓▓▓█▀█▓▓_▓▓███▓▓▓▓▓  ▓▓▓▓▓Ω4
                µ ├▓▀▀L   └ⁿ  ▀   ▀ ▓▓█w ▓▓▓▀ìⁿ
                ⌐ ├_                τ▀▓  Σ⌐└
                ~ ├▓▓  ▄  _     ╒  ┌▄▓▓  Γ
                  ├▓▓▓▌█═┴▓▄╒▀▄_▄▌═¢▓▓▓  ╚
               ⌠  ├▓▓▓▓▓ⁿ▄▓▓▓▓▓▓▓┐▄▓▓▓▓  └
               Ω_.└██▓▀ⁿÇⁿ▀▀▀▀▀▀█≡▀▀▀▀▀   µ
               ⁿ  .▄▄▓▓▓▓▄▄┌ ╖__▓_▄▄▄▄▄*Oⁿ
                 û▌├▓█▓▓▓██ⁿ ¡▓▓▓▓▓▓▓▓█▓╪
                 ╙Ω▀█ ▓██ⁿ    └█▀██▀▓█├█Å
                     ⁿⁿ             ⁿ ⁿ^
:::::::..  .,::::::    .,::      .::::::::..    :::.  .-:.     ::-.
;;;;'';;;; ;;;;''''    ';;;,  .,;; ;;;;'';;;;   ;;';;  ';;.   ;;;;'
 [[[,/[[['  [[cccc       '[[,,[['   [[[,/[[['  ,[[ '[[,  '[[,[[['
 $$$$$$c    $$""""        Y$$$Pcccc $$$$$$c   c$$$cc$$$c   c$$"
 888b "88bo,888oo,__    oP"''"Yo,   888b "88bo,888   888,,8P"'
 MMMM   "W" """"YUMMM,m"       "Mm, MMMM   "W" YMM   ""'mM"

Binary: /home/akutz/go/bin/rexray
SemVer: 
OsArch: 
Branch: 
Commit: 
Formed: 

time="2016-02-03T13:40:08-06:00" level=info msg="dialing /tmp/vCsSFfvpZxhKpqWmfgXzfoUYhzyYyBeb.sock" 
time="2016-02-03T13:40:08-06:00" level=info msg="created pid file, pid=4458" 
time="2016-02-03T13:40:08-06:00" level=debug msg="initializing configuration" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue="tcp://:7979" envVar="REXRAY_HOST" flagName=host keyName=rexray.host keyType=0 usage="The REX-Ray host" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=warn envVar="REXRAY_LOGLEVEL" flagName=logLevel keyName=rexray.logLevel keyType=0 usage="The log level (error, warn, info, debug)" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=linux envVar="REXRAY_OSDRIVERS" flagName=osDrivers keyName=rexray.osDrivers keyType=0 usage="The OS drivers to consider" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="REXRAY_STORAGEDRIVERS" flagName=storageDrivers keyName=rexray.storageDrivers keyType=0 usage="The storage drivers to consider" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=docker envVar="REXRAY_VOLUMEDRIVERS" flagName=volumeDrivers keyName=rexray.volumeDrivers keyType=0 usage="The volume drivers to consider" 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=448 envVar="LINUX_VOLUME_FILEMODE" flagName=linuxVolumeFilemode keyName=linux.volume.filemode keyType=1 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue="/data" envVar="LINUX_VOLUME_ROOTPATH" flagName=linuxVolumeRootpath keyName=linux.volume.rootpath keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="AWS_ACCESSKEY" flagName=awsAccessKey keyName=aws.accessKey keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="AWS_SECRETKEY" flagName=awsSecretKey keyName=aws.secretKey keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="AWS_REGION" flagName=awsRegion keyName=aws.region keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="GCE_KEYFILE" flagName=gceKeyfile keyName=gce.keyfile keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_ENDPOINT" flagName=isilonEndpoint keyName=isilon.endpoint keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="ISILON_INSECURE" flagName=isilonInsecure keyName=isilon.insecure keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_USERNAME" flagName=isilonUserName keyName=isilon.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_GROUP" flagName=isilonGroup keyName=isilon.group keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_PASSWORD" flagName=isilonPassword keyName=isilon.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_VOLUMEPATH" flagName=isilonVolumePath keyName=isilon.volumePath keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_NFSHOST" flagName=isilonNfsHost keyName=isilon.nfsHost keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="ISILON_DATASUBNET" flagName=isilonDataSubnet keyName=isilon.dataSubnet keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="ISILON_QUOTAS" flagName=isilonQuotas keyName=isilon.quotas keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_AUTHURL" flagName=openstackAuthURL keyName=openstack.authURL keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_USERID" flagName=openstackUserID keyName=openstack.userID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_USERNAME" flagName=openstackUserName keyName=openstack.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_PASSWORD" flagName=openstackPassword keyName=openstack.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_TENANTID" flagName=openstackTenantID keyName=openstack.tenantID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_TENANTNAME" flagName=openstackTenantName keyName=openstack.tenantName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_DOMAINID" flagName=openstackDomainID keyName=openstack.domainID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_DOMAINNAME" flagName=openstackDomainName keyName=openstack.domainName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_REGIONNAME" flagName=openstackRegionName keyName=openstack.regionName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="OPENSTACK_AVAILABILITYZONENAME" flagName=openstackAvailabilityZoneName keyName=openstack.availabilityZoneName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_AUTHURL" flagName=rackspaceAuthURL keyName=rackspace.authURL keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_USERID" flagName=rackspaceUserID keyName=rackspace.userID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_USERNAME" flagName=rackspaceUserName keyName=rackspace.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_PASSWORD" flagName=rackspacePassword keyName=rackspace.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_TENANTID" flagName=rackspaceTenantID keyName=rackspace.tenantID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_TENANTNAME" flagName=rackspaceTenantName keyName=rackspace.tenantName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_DOMAINID" flagName=rackspaceDomainID keyName=rackspace.domainID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="RACKSPACE_DOMAINNAME" flagName=rackspaceDomainName keyName=rackspace.domainName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_ENDPOINT" flagName=scaleioEndpoint keyName=scaleio.endpoint keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="SCALEIO_INSECURE" flagName=scaleioInsecure keyName=scaleio.insecure keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="SCALEIO_USECERTS" flagName=scaleioUseCerts keyName=scaleio.useCerts keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_USERID" flagName=scaleioUserID keyName=scaleio.userID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_USERNAME" flagName=scaleioUserName keyName=scaleio.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_PASSWORD" flagName=scaleioPassword keyName=scaleio.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_SYSTEMID" flagName=scaleioSystemID keyName=scaleio.systemID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_SYSTEMNAME" flagName=scaleioSystemName keyName=scaleio.systemName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_PROTECTIONDOMAINID" flagName=scaleioProtectionDomainID keyName=scaleio.protectionDomainID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_PROTECTIONDOMAINNAME" flagName=scaleioProtectionDomainName keyName=scaleio.protectionDomainName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_STORAGEPOOLID" flagName=scaleioStoragePoolID keyName=scaleio.storagePoolID keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="SCALEIO_STORAGEPOOLNAME" flagName=scaleioStoragePoolName keyName=scaleio.storagePoolName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_ENDPOINT" flagName=virtualboxEndpoint keyName=virtualbox.endpoint keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_VOLUMEPATH" flagName=virtualboxVolumePath keyName=virtualbox.volumePath keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_LOCALMACHINENAMEORID" flagName=virtualboxLocalMachineNameOrId keyName=virtualbox.localMachineNameOrId keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_USERNAME" flagName=virtualboxUsername keyName=virtualbox.username keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_PASSWORD" flagName=virtualboxPassword keyName=virtualbox.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="VIRTUALBOX_TLS" flagName=virtualboxTls keyName=virtualbox.tls keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VIRTUALBOX_CONTROLLERNAME" flagName=virtualboxControllerName keyName=virtualbox.controllerName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_SMISHOST" flagName=vmaxSmishost keyName=vmax.smishost keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_SMISPORT" flagName=vmaxSmisport keyName=vmax.smisport keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="VMAX_INSECURE" flagName=vmaxInsecure keyName=vmax.insecure keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_USERNAME" flagName=vmaxUserName keyName=vmax.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_PASSWORD" flagName=vmaxPassword keyName=vmax.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_SID" flagName=vmaxSid keyName=vmax.sid keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_VOLUMEPREFIX" flagName=vmaxVolumePrefix keyName=vmax.volumePrefix keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_STORAGEGROUP" flagName=vmaxStorageGroup keyName=vmax.storageGroup keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="VMAX_VMH_INSECURE" flagName=vmaxVmhInsecure keyName=vmax.vmh.insecure keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_VMH_USERNAME" flagName=vmaxVmhUserName keyName=vmax.vmh.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_VMH_PASSWORD" flagName=vmaxVmhPassword keyName=vmax.vmh.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="VMAX_VMH_HOST" flagName=vmaxVmhHost keyName=vmax.vmh.host keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="XTREMIO_ENDPOINT" flagName=xtremioEndpoint keyName=xtremio.endpoint keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="XTREMIO_INSECURE" flagName=xtremioInsecure keyName=xtremio.insecure keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="XTREMIO_USERNAME" flagName=xtremioUserName keyName=xtremio.userName keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="XTREMIO_PASSWORD" flagName=xtremioPassword keyName=xtremio.password keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="XTREMIO_DEVICEMAPPER" flagName=xtremioDeviceMapper keyName=xtremio.deviceMapper keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="XTREMIO_MULTIPATH" flagName=xtremioMultipath keyName=xtremio.multipath keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="XTREMIO_REMOTEMANAGEMENT" flagName=xtremioRemoteManagement keyName=xtremio.remoteManagement keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="DOCKER_VOLUMETYPE" flagName=dockerVolumeType keyName=docker.volumeType keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=0 envVar="DOCKER_IOPS" flagName=dockerIops keyName=docker.iops keyType=1 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=0 envVar="DOCKER_SIZE" flagName=dockerSize keyName=docker.size keyType=1 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue= envVar="DOCKER_AVAILABILITYZONE" flagName=dockerAvailabilityZone keyName=docker.availabilityZone keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue="/data" envVar="LINUX_VOLUME_ROOTPATH" flagName=linuxVolumeRootpath keyName=linux.volume.rootpath keyType=0 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="adding flag" defaultValue=false envVar="REXRAY_VOLUME_MOUNT_PREEMPT" flagName=preempt keyName=rexray.volume.mount.preempt keyType=2 usage= 
time="2016-02-03T13:40:08-06:00" level=debug msg="loading global config file" path="/etc/rexray/config.yml" 
time="2016-02-03T13:40:08-06:00" level=debug msg="got modules map" count=3 
time="2016-02-03T13:40:08-06:00" level=debug msg="processing module config" name=default-admin 
time="2016-02-03T13:40:08-06:00" level=debug msg="getting scoped config for module" scope=rexray.modules.default-admin 
time="2016-02-03T13:40:08-06:00" level=info msg="created new mod config" addr="tcp://127.0.0.1:7979" desc="The default admin module." name=default-admin type=admin 
time="2016-02-03T13:40:08-06:00" level=debug msg="processing module config" name=default-docker 
time="2016-02-03T13:40:08-06:00" level=debug msg="getting scoped config for module" scope=rexray.modules.default-docker 
time="2016-02-03T13:40:08-06:00" level=info msg="created new mod config" addr="unix:///run/docker/plugins/isilon1.sock" desc="The default docker module." name=default-docker type=docker 
time="2016-02-03T13:40:08-06:00" level=debug msg="processing module config" name=isilon2 
time="2016-02-03T13:40:08-06:00" level=debug msg="getting scoped config for module" scope=rexray.modules.isilon2 
time="2016-02-03T13:40:08-06:00" level=info msg="created new mod config" addr= desc= name=isilon2 type=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="initialized module instance" address="tcp://127.0.0.1:7979" name=default-admin typeName=admin 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=docker 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=linux 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Isilon 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=XtremIO 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Rackspace 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=ScaleIO 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=virtualbox 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=VMAX 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=ec2 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=gce 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Openstack 
time="2016-02-03T13:40:08-06:00" level=info msg="initialized module instance" address="unix:///run/docker/plugins/isilon1.sock" name=default-docker typeName=docker 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=ec2 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=gce 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Openstack 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Rackspace 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=ScaleIO 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=virtualbox 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=VMAX 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=linux 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=Isilon 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=XtremIO 
time="2016-02-03T13:40:08-06:00" level=debug msg="constructed driver" driverName=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="initialized module instance" address= name=isilon2 typeName=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="[linux]" 
time="2016-02-03T13:40:08-06:00" level=info msg="[docker]" 
time="2016-02-03T13:40:08-06:00" level=info msg="[isilon]" 
time="2016-02-03T13:40:08-06:00" level=debug msg="core get drivers" osDrivers=[linux] storageDrivers=[isilon] volumeDrivers=[docker] 
time="2016-02-03T13:40:08-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-03T13:40:08-06:00" level=info msg="initializing isilon driver" dataSubnet="172.17.177.0/24" endpoint="https://172.17.177.230:8081" group= insecure=true provider=Isilon userName=root volumePath="/rexray" 
time="2016-02-03T13:40:08-06:00" level=info msg="storage driver initialized" provider=Isilon 
time="2016-02-03T13:40:08-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-03T13:40:08-06:00" level=debug msg="docker voldriver spec file" path="/etc/docker/plugins/isilon2.spec" 
time="2016-02-03T13:40:08-06:00" level=info msg="started module" address="unix:///run/docker/plugins/isilon2.sock" name=isilon2 typeName=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="started module" address="tcp://127.0.0.1:7979" name=default-admin typeName=admin 
time="2016-02-03T13:40:08-06:00" level=info msg="[linux]" 
time="2016-02-03T13:40:08-06:00" level=info msg="[docker]" 
time="2016-02-03T13:40:08-06:00" level=info msg="[isilon]" 
time="2016-02-03T13:40:08-06:00" level=debug msg="core get drivers" osDrivers=[linux] storageDrivers=[isilon] volumeDrivers=[docker] 
time="2016-02-03T13:40:08-06:00" level=info msg="volume driver initialized" provider=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="initializing isilon driver" dataSubnet="172.17.177.0/24" endpoint="https://172.17.177.230:8080" group= insecure=true provider=Isilon userName=root volumePath="/rexray" 
time="2016-02-03T13:40:08-06:00" level=info msg="storage driver initialized" provider=Isilon 
time="2016-02-03T13:40:08-06:00" level=info msg="os driver initialized" provider=linux 
time="2016-02-03T13:40:08-06:00" level=debug msg="docker voldriver spec file" path="/etc/docker/plugins/isilon1.spec" 
time="2016-02-03T13:40:08-06:00" level=info msg="started module" address="unix:///run/docker/plugins/isilon1.sock" name=default-docker typeName=docker 
time="2016-02-03T13:40:08-06:00" level=info msg="service sent registered modules start signals" 
time="2016-02-03T13:40:08-06:00" level=info msg="service successfully initialized, waiting on stop signal" 

@akutz
Copy link
Member Author

akutz commented Feb 3, 2016

Hi @clintonskitson,

Did you confirm the inferred sock and spec file creation?

This patch adds support for configuration modules via the REX-Ray
configuration source. For example, the following configuration is loaded
by default:

    rexray:
        modules:
            default-admin:
                type:     admin
                desc:     The default admin module.
                host:     tcp://127.0.0.1:7979
                disabled: false
            default-docker:
                type:     docker
                desc:     The default docker module.
                host:     unix:///run/docker/plugins/rexray.sock
                spec:     /etc/docker/plugins/rexray.spec
                disabled: false

The above configuration indicates that there are two modules that need
to be initialized and started:

  1. default-admin
  2. default-docker

Default modules can be overridden in a custom configuration file by
simply using the same names as above.

If the `host` or `spec` properties are not defined for a docker module,
then the sanitized name of the module is used to build the paths to a
socket and spec file. For example:

    rexray:
        modules:
            "isilon 2":
                type: docker

The above configuration would create a Docker module hosted using a
socket file at `unix:///run/docker/plugins/isilon-2.sock` and spec file
at `/etc/docker/plugins/isilon-2.spec`.

If the configuration file is used to override part of the
`default-docker` module's configuration, for example its description,
it's also possible to omit the `default-docker` module's `host` and
`spec` properties as well. The difference is that the `default-docker`
module's `host` and `spec` properties will default to values based not
on the module name but `unix:///run/docker/plugins/rexray` and
`/etc/docker/plugins/rexray.spec`.

Modules can also be disabled using `disabled: true` with any module,
including default modules. This is useful as it allows the disabling of
a module without completely removing its configuration from the file.
@akutz akutz force-pushed the feature/config-backed-modules branch from 6c3fb0e to 7388d25 Compare February 3, 2016 21:47
akutz added a commit that referenced this pull request Feb 3, 2016
@akutz akutz merged commit a5059a3 into rexray:master Feb 3, 2016
@akutz akutz deleted the feature/config-backed-modules branch February 3, 2016 22:01
akutz added a commit to akutz/rexray that referenced this pull request Mar 4, 2016
This patch marks the release of REX-Ray 0.3.2!

NEW FEATURES
* Support for Docker 1.10 and Volume Plugin Interface 1.2 rexray#273
* Stale PID File Prevents Service Start rexray#258
* Module/Personality Support rexray#275
* Isilon Preemption rexray#231
* Isilon Snapshots rexray#260
* boot2Docker Support rexray#263
* ScaleIO Dynamic Storage Pool Support rexray#267

ENHANCEMENTS
* Improved installation documentation rexray#331
* ScaleIO volume name limitation rexray#304
* Docker cache volumes for path operations rexray#306
* Config file validation rexray#312
* Better logging rexray#296
* Documentation Updates rexray#285

BUG FIXES
* Fixes issue with daemon process getting cleaned as part of
  SystemD Cgroup rexray#327
* Fixes regression in 0.3.2 RC3/RC4 resulting in no log file rexray#319
* Fixes no volumes returned on empty list rexray#322
* Fixes "Unsupported FS" when mounting/unmounting with EC2 rexray#321
* ScaleIO re-authentication issue rexray#303
* Docker XtremIO create volume issue rexray#307
* Service status is reported correctly rexray#310

UPDATES
* <del>Go 1.6 rexray#308</del>

THANK YOU
* Dan Forrest
* Kapil Jain
* Alex Kamalov
This was referenced Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants