ONTAP Discussions

Spreadsheet or script for creating CLI commands for new volumes, luns, and IGs?

Carl-in-Austin
694 Views

Hi all. I'm just curious if anyone has built a spreadsheet (or other method) to create all the commands (vol create, lun create, lun map) (using concatenate or similar) that would create  volumes, luns and igs at the CLI? Then I would copy the commands out of the spreadsheet and paste them into the CLI.  I have to add 40 individual LUNs to 40 different servers. I would like to paste these server names into a column in Excel along with the IG group names and have it put together the CLI commands. If someone has a more efficient way to do this, please share if you don't mind. Its only 40 LUNs this time, but we have a project coming up which will require me to do this for many more production servers. Thanks for the help! Carl

1 ACCEPTED SOLUTION

dhepler
634 Views

Hey Carl,
I don't have the CLI way to do it, but my suggestion is that you take a look at Ansible and maybe ask internally if you have a team that knows Ansible that could assist. It is not a programming language but is powerful and can get your job done. We have some blog posts about automating with Ansible here: https://netapp.io/configuration-management-and-automation/.


Here are some of the commands on the NetApp side that you would need:

Create a volume: https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_volume_module.html#ansible-collections-netapp-ontap-na-ontap-volume-module

Create an iGroup - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_igroup_module.html

 

Create your LUN - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_lun_module.html#ansible-collections-netapp-ontap-na-ontap-lun-module

 

Map your LUN - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_lun_map_module.html#ansible-collections-netapp-ontap-na-ontap-lun-map-module

There are also commands for Linux, Windows and VMWare to automate adding those LUNs to the servers.

There is a bit of a learning curve, I admit, and the initial creating of the necessary files takes a bit if you don't know what you are doing, however this is a great way to automate everything you need to do, from storage to server to network. The good thing is, you will find a community on the netapp.io page under the Discord menu item and there are a lot of resources for finding Ansible examples, including the GitHub page at https://github.com/netapp-automation under ansible.

 

 

View solution in original post

1 REPLY 1

dhepler
635 Views

Hey Carl,
I don't have the CLI way to do it, but my suggestion is that you take a look at Ansible and maybe ask internally if you have a team that knows Ansible that could assist. It is not a programming language but is powerful and can get your job done. We have some blog posts about automating with Ansible here: https://netapp.io/configuration-management-and-automation/.


Here are some of the commands on the NetApp side that you would need:

Create a volume: https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_volume_module.html#ansible-collections-netapp-ontap-na-ontap-volume-module

Create an iGroup - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_igroup_module.html

 

Create your LUN - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_lun_module.html#ansible-collections-netapp-ontap-na-ontap-lun-module

 

Map your LUN - https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_lun_map_module.html#ansible-collections-netapp-ontap-na-ontap-lun-map-module

There are also commands for Linux, Windows and VMWare to automate adding those LUNs to the servers.

There is a bit of a learning curve, I admit, and the initial creating of the necessary files takes a bit if you don't know what you are doing, however this is a great way to automate everything you need to do, from storage to server to network. The good thing is, you will find a community on the netapp.io page under the Discord menu item and there are a lot of resources for finding Ansible examples, including the GitHub page at https://github.com/netapp-automation under ansible.

 

 

Public