Blogs

Automating Storage Provisioning from Jira Tickets using Python & Ansible

By Imran Shaik posted 07-14-2025 12:13

  

Automating Storage Provisioning from Jira Tickets using Python & Ansible 

Introduction 

In modern enterprise environments, the ability to integrate ITSM workflows with infrastructure automation is key to achieving agility and operational excellence. Manual storage provisioning through ticket-based processes often introduces latency, inconsistency, and human error. 

To address this, we implemented a fully automated pipeline that connects Jira-based LUN provisioning requests directly with Hitachi VSP storage orchestration, leveraging Python for event-driven automation and Ansible for declarative infrastructure management. 

The workflow enables seamless, policy-driven provisioning triggered by simple Jira ticket metadata — eliminating manual intervention while ensuring traceability, compliance, and speed. 

In this post, I will share the architecture, tooling, and lessons learned from deploying this solution in a production environment. 

 

Solution Architecture 

This solution automates LUN provisioning on Hitachi VSP storage by integrating Jira-based user requests with a fully automated orchestration pipeline built using Python and Ansible. The goal is to eliminate manual steps, ensure consistent provisioning, and accelerate delivery — all while maintaining traceability and security. 

 

Solution Flow 

 

 

 

Key Roles and Systems 

  • Jira end user (request initiator) 

  • Python automation service 

  • Ansible controller and playbooks 

  • Hitachi VSP storage backend 

  • Logging Layer  

Key Features 

  • Fully event-driven provisioning pipeline 

  • Robust logging and observability 

  • Idempotent and retry-safe design 

  • Secure credential management (.env) 

  • Easily extensible to additional storage operations 

Detailed Workflow 

This section explains the end-to-end process of how LUN provisioning is automated, starting from a simple Jira ticket and culminating in storage volume creation and notification delivery. 

The workflow is designed to be event-driven, idempotent, and auditable. 

 

 Jira Ticket Creation 

  • An end user initiates a LUN provisioning request by creating a ticket for the IPSESE Jira project. 

  • The ticket must include the label: LUN-Request. 

  • The desired LUN size is specified in the ticket description (e.g., "Create LUN with Size: 100GB LUN"). 

  • This serves as the trigger for the automation pipeline. 

 

Python Automation Script: Monitoring Jira 

  • A Python script runs continuously (as a daemon service or via scheduled cron job). 

  • It polls the Jira REST API at defined intervals. 

  • The script looks for: 

  • New tickets with the label LUN-Request. 

  • Tickets that have not yet been processed are available. 

  • When a matching ticket is found, it moves to the parsing stage. 

 

 Parsing Ticket Data 

  • The Python script parses: 

  • The requested LUN size from the ticket description is incorrect. 

  • The ticket key (e.g., IPSE-323), which will be used as part of the LUN name for traceability. 

  • The script validates that: 

  • The size is in an acceptable format. 

  • The ticket has not already triggered a provisioning workflow (to ensure idempotency). 

  • If parsing is successful, the script triggers the provisioning workflow. 

Shape 

Triggering Ansible Playbook 

  • The Python script initiates an Ansible playbook run, passing in: 

  • The parsed LUN size. 

  • The ticket key. 

  • This is done via a secure subprocess or Ansible API call. 

  • The Ansible playbook connects to the target Hitachi VSP storage array. 

 

Hitachi VSP Storage Provisioning 

  • The Ansible playbook: 

  • Authenticates securely with the storage array (using Ansible Vault-stored credentials). 

  • Creates a new LUN volume: 

  • Size = parsed value from the Jira ticket. 

  • Name = based on the Jira ticket key for traceability (e.g., IPSE-323-LUN). 

  • The playbook ensures that: 

  • Operations are idempotent — re-running the playbook will not create duplicate volumes. 

  • Errors are handled gracefully and logged. 

 

 Notification and Logging 

  • After the Ansible playbook run completes: 

  • The Python script will update JIRA ticket with tag name “Lun_Processed,” post that JIRA send an email notification to user with: 

  • The provisioning result (success/failure). 

  • LUN details (name, size, storage system). 

 

  • The script logs all actions to a central log directory (e.g., /opt/Jira-storage-Poller/logs/), including: 

  • Jira polling activity. 

  • Parsing results. 

  • Playbook execution status is. 

  • Notification delivery status. 

  • Optionally, the Jira ticket can be updated with a comment or status change to reflect provisioning completion. 

 

Error Handling & Idempotency 

  • The workflow is designed to: 

  • Safely handle malformed tickets or missing size values. 

  • Skip tickets that have already been processed. 

  • Retry Ansible playbook execution on transient failures. 

  • Ensure that no duplicate LUNs are created for the same Jira request. 

 

Summary 

By integrating Jira-driven workflows with automated LUN provisioning on Hitachi VSP storage, we have significantly improved our operational efficiency, reduced time-to-delivery, and eliminated manual errors from a critical infrastructure process. 

This automation demonstrates the value of combining event-driven Python orchestration with Ansible’s robust automation capabilities, seamlessly bridging ITSM and infrastructure layers. It also reinforces the principle that modern infrastructure teams should treat storage as code, applying the same DevOps mindset traditionally reserved for compute and network layers. 

You can access the automation script I developed here, designed to enhance operational efficiency and streamline key processes.

0 comments
21 views

Permalink