Automating NetApp With Ansible
Automating NetApp With Ansible
Senthilkumar Muthusamy
• Aggregates
• Asynchronous Mirroring
• Checking Connections
• Disk Pools
• Hosts and Host Groups (Clusters)
• License Management
• LUN Mapping
• QTrees
• Snapshot Scheduler
• Standard Volumes and Flex Vols
• SVM
• Thin Volumes
• Users, User Roles and Accounts
• Volume Access Groups
• Volume Snapshots
• and much more...
Solution Benefits
• With Ansible customers can automate NetApp solutions to
deliver flexible, scalable and highly reliable storage deployment
and management solutions for NetApp ONTAP, Element and E-
Series storage systems
• Roll storage-infrastructure configurations into your CI/CD
processes and application configurations for maximum agility
with over 60 Ansible modules for NetApp.
AWX Project:
The AWX project—AWX for short—is an open source community
project, sponsored by Red Hat, that enables users to better control
their community Ansible project use in IT environments. AWX is the
upstream project from which the automation controller component is
ultimately derived.
Ansible AWX is the upstream project of Ansible Automation Controller
(formerly Ansible Tower), providing a modern web-UI and API
interface to manage Ansible Playbooks, inventories, Credentials, and
Vaults between your team in your organization. The AWX source code
is available under Apache License 2.0.
1. Login to Ansible AWX.
Create a new project and add the required NetApp ONTAP ansible
modules and all YML or JSON files in Ansible.
Git is a distributed version control and Source Code Management
(SCM) utility.
SCM details.
Understanding Playbooks
Now that we have Ansible installed, let’s understand the special file
that makes things happen. This file is called a ‘playbook’. The
playbook is written in yaml, which is itself a simplified version of json.
A playbook is composed of one or more sections, which each can
contain one or more tasks to run.
Create and store the YAML play books in ansible project location.
Sample playbook file for stopping SVM. It will stop the SVM as per the
input details.
For Ex:
1. To run and deploy this needs a credential.
• Cluster Name
• User name
• Password
• SVM Name
Job type
Credential
Job is running….
Job completed
successfully.
Check the cluster peer status on both the source and destination
cluster.
Creating Source Data Type SVM using Ansible with Playbook Template.
Specify the following input details to create SVM:
1. SVM name
2. Cluster Name
3. SVM DATA LIF
a. IP address and Netmask
b. Node Port
c. Role
d. Access Protocol
e. Source LIF Home Node
4. Aggregate Name
5. Volume Name
6. Share Name
7. DNS and other details.
SVM Name
Play book is running and it will create a SVM with a specified detail.
Login to ONTAP Cluster CLI and check the vserver and SVM data LIF
details.
Volume (ex:share)
created.
• job templates
• workflow templates
• project syncs
Workflow Visualizer
Ansible Tower 3.1 introduced the Workflow Visualizer
(formerly Workflow Editor), which provides a graphical way of linking
together job templates, workflow templates, project syncs, and
inventory syncs to build a workflow template.
Create a new workflow template. (Use Template tab and add workflow
template)
Add the workflow task (quiesce mirror) – select the play book job
template.
Same as add the next workflow task (stop the source SVM(prod) for
test.
Add the configure dr_svm job template play book to configure the
prod_dr SVM automatically.
Workflow template defined by the tasks (job templates)
1. Quiesce Mirror
2. Stop the Source SVM
3. Break the snapmirror
4. Start the Destination SVM
5. Configure the Destination SVM
On Success of the
previous task, it
Quiesce the Stop the source break the snapmirror.
mirror task SVM task
Now you can login to NetApp ONTAP CLI or System Manager and check
the status.
Now access the CIFS share folder using Destination SVM LIF IP address.
Now you begin to see the power that Ansible gives you, and it’s not
limited to just what ONTAP or Element can do. You can use Ansible to
provision storage, and then present that share to a host all in one
playbook.