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

Support dock import by command 'osdsctl dock import' #1041

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ThisIsClark
Copy link
Contributor

@ThisIsClark ThisIsClark commented Nov 5, 2019

What this PR does / why we need it:
Support the command "osdsctl dock import" to add backend.

Which issue this PR fixes : fixes #1004

Special notes for your reviewer:
Command:
osdsctl dock import storageType dockConfigFile [-p poolConfigFile]

Nowadays it is just adding the config text in dockConfigFile and poolConfigFile to specific config files in opensds, and the format of the text has not been verified, so if the text's format of dockConfigFile or poolConfigFile is incorrect, it may cause some unexpected error. Should I find some way to check the format of config file's content, or users should ensure the validity of the content of these two config files?

Release note:

########## No dock and pool in the beginning ##########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsctl pool list
WARNING: OPENSDS_ENDPOINT is not specified, use default(http://localhost:50040)
WARNING: Not found Env OPENSDS_AUTH_STRATEGY, use default(noauth)
+----+------+-------------+--------+---------------+--------------+
| Id | Name | Description | Status | TotalCapacity | FreeCapacity |
+----+------+-------------+--------+---------------+--------------+
+----+------+-------------+--------+---------------+--------------+
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsctl dock list
WARNING: OPENSDS_ENDPOINT is not specified, use default(http://localhost:50040)
WARNING: Not found Env OPENSDS_AUTH_STRATEGY, use default(noauth)
+----+------+-------------+----------+------------+
| Id | Name | Description | Endpoint | DriverName |
+----+------+-------------+----------+------------+
+----+------+-------------+----------+------------+

########## Dock config file and pool config file ##########
######## The content of dock.yaml can refer to examples/opensds.conf ########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # cat dock.yaml
[lvm]
name = lvm
description = LVM Test
driver_name = lvm
config_path = /etc/opensds/driver/lvm.yaml
######## The content of pool.yaml can refer to examples/driver/YourStorageType.yaml ########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # cat pool.yaml
tgtBindIp: 10.10.3.111
tgtConfDir: /etc/tgt/conf.d
pool:
  ubuntu-vg:
    diskType: NL-SAS
    availabilityZone: default
    multiAttach: true
    storageType: block
    extras:
      dataStorage:
        provisioningPolicy: Thin
        isSpaceEfficient: false
      ioConnectivity:
        accessProtocol: iscsi
        maxIOPS: 7000000
        maxBWS: 600
      advanced:
        diskType: SSD
        latency: 5ms

########## Run osdsctl dock import ##########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsctl dock import lvm dock.yaml -p pool.yaml
WARNING: OPENSDS_ENDPOINT is not specified, use default(http://localhost:50040)
WARNING: Not found Env OPENSDS_AUTH_STRATEGY, use default(noauth)

########## Restart opensds ##########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # killall osdsdock osdslet osdsapiserver
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsdock -daemon
2019/11/05 10:14:05 Command: modprobe nvme-rdma:
./build/out/bin/osdsdock [PID] 23583 running...
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdslet -daemon
./build/out/bin/osdslet [PID] 23605 running...
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsapiserver -daemon
./build/out/bin/osdsapiserver [PID] 23627 running...

########## Check the dock and pool info ##########
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsctl dock list
WARNING: OPENSDS_ENDPOINT is not specified, use default(http://localhost:50040)
WARNING: Not found Env OPENSDS_AUTH_STRATEGY, use default(noauth)
+--------------------------------------+------+-------------+-------------------+------------+
| Id                                   | Name | Description | Endpoint          | DriverName |
+--------------------------------------+------+-------------+-------------------+------------+
| 7c0511a5-fc99-559e-b72c-2b0fefc2105c | lvm  | LVM Test    | 10.10.3.111:50050 | lvm        |
+--------------------------------------+------+-------------+-------------------+------------+
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) # ./build/out/bin/osdsctl pool list
WARNING: OPENSDS_ENDPOINT is not specified, use default(http://localhost:50040)
WARNING: Not found Env OPENSDS_AUTH_STRATEGY, use default(noauth)
+--------------------------------------+-----------+-------------+--------+---------------+--------------+
| Id                                   | Name      | Description | Status | TotalCapacity | FreeCapacity |
+--------------------------------------+-----------+-------------+--------+---------------+--------------+
| 0ccb1fb8-f230-5e20-b48f-e43cb80ca73f | ubuntu-vg |             |        | 110           | 0            |
+--------------------------------------+-----------+-------------+--------+---------------+--------------+
root@node01:~/gopath/src/github.com/opensds/opensds (SupportDockImport) #

Copy link
Collaborator

@wisererik wisererik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@kumarashit kumarashit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I find some way to check the format of config file's content, or users should ensure the validity of the content of these two config files?
It's always good to add the validation rather than depending upon the user. Let's add the validation when we read the config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supported backend types should be configured dynamically
3 participants