Mass Deployment of 20+ Qnaps

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
Hickory
New here
Posts: 5
Joined: Thu Dec 01, 2016 11:07 am

Mass Deployment of 20+ Qnaps

Post by Hickory » Thu Dec 01, 2016 11:57 am

Hi All,

The company I work for is purchasing around 20 or so Qnaps. The models are the TVS-663 and TVS-863.

Obviously, setting up these Qnaps manually, one by one is far less than desirable. I have experience with Ansible (If you don't know what that is, you should google it).

With Ansible, I have managed to setup ssh keys, so I can login without a password into the shell.
Note: Ansible requires python-simplejson for its modules, but the Qnap OS does not have this, so you must use the 'raw' module in your playbooks.

I am trying to accomplish the following (all via command line... No GUI)

Code: Select all

roles:
  - ssh           # The only one done so far.
  - host_settings # (hostname, password)
  - network       # (ntp, TimeZone, join to domain)
  - services      # (windows/linux (NFS, SMB/CIFS, File Station))
  - disk          # (All disks in a raid 6)
 



Due to the lack of the qcli documentation, I thought it would be wise to post here if anyone has any insight on these tools and the commands required to pull off the above roles.

Once I have successfully pulled off what I am trying to achieve, I will happily post my efforts onto GitHub for anyone and everyone to use and modify to suit their needs. Credits will go out to all who help contribute :)

OR, If there is another way to centrally deploy/configure 20+ Qnaps, I'm all ears.

Thank you in advance,
Hickory

User avatar
Trexx
Ask me anything
Posts: 5287
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Mass Deployment of 20+ Qnaps

Post by Trexx » Thu Dec 01, 2016 12:26 pm

I would recommend looking into the QCenter application which is designed to help manage/monitor multiple QNAP devices

You can find more information below:

https://www.qnap.com/solution/qcenter/index.php?lang=en
https://www.qnap.com/en/tutorial/con_sh ... ne&cid=141
https://www.qnap.com/en/qa/?cat=23
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

Hickory
New here
Posts: 5
Joined: Thu Dec 01, 2016 11:07 am

Re: Mass Deployment of 20+ Qnaps

Post by Hickory » Thu Dec 01, 2016 1:59 pm

Hi Trexx,

Thank you very much for pointing me in that direction.

I have installed the Q'Center app on the the Nas that I've already configured. Then it told me I needed to install the agent, so I did that too.

Problem started when I tried to add the second nas (completely unconfigured... Powered up with network cables in it). The IP of the second nas is displayed on the LED screen.
I go to add it in the Q'Center app, but it keeps telling me I am entering a wrong password. I know the default password is 'admin' (this is what I use for ssh when unconfigured).

I am rebooting the configured nas now and I will report back with an update as soon as I have one.

Cheers,
Hickory

Hickory
New here
Posts: 5
Joined: Thu Dec 01, 2016 11:07 am

Re: Mass Deployment of 20+ Qnaps

Post by Hickory » Thu Dec 01, 2016 2:06 pm

Same exact issue. It will not add the unconfigured nas.

I cannot be configuring these 20+ Qnaps manually as I will not have physicall access to a number of them. While Q'Center may be a good way to track and monitor them, from what I can tell, I don't think it's going to suit my requirements...

Any advise would be grateful.

Thanks again,
Hickory

squishyhippie
New here
Posts: 2
Joined: Thu Jan 12, 2017 7:28 pm

Re: Mass Deployment of 20+ Qnaps

Post by squishyhippie » Thu Jan 12, 2017 7:53 pm

G'Day Hickory,

Thanks for your post. I stumbled across it when trying to get ansible working with some QNAPs (TVS-663)

Initially I was getting errors related to the python path.

Code: Select all

QNAP1 | FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Shared connection to QNAP1 closed.\r\n",
    "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n",
    "msg": "MODULE FAILURE"
}

After setting ansible_python_interpreter="/usr/local/bin/python" for the host this went away :-)
Sadly it was replaced by a much longer and nastier looking error :-(

Code: Select all

QNAP1 | FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Shared connection to QNAP1 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_NYNEAP/ansible_module_ping.py\", line 44, in <module>\r\n    from ansible.module_utils.basic import AnsibleModule\r\n  File \"/tmp/ansible_NYNEAP/ansible_modlib.zip/ansible/module_utils/basic.py\", line 44, in <module>\r\nImportError: No module named pipes\r\n",
    "msg": "MODULE FAILURE"
}

After trying to locate or install the pipes module in a QNAP friendly way for a while, I thought I'd give the raw module a go (yes it's bad I know!).

Code: Select all

bash-3.2$ ansible -m raw -s -a "hostname" QNAP1
QNAP1 | FAILED | rc=127 >>
sh: sudo: command not found
Shared connection to QNAP1 closed.

At this point I decided to give up and do what I needed to do the old fashioned way for the day.

Have you made any progress getting ansible and your QNAPs to play nice together?

Cheers,

Squishy

Post Reply

Return to “Miscellaneous”