GithubHelp home page GithubHelp logo

brandonstiff / unity-powershell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from equelin/unity-powershell

0.0 1.0 0.0 1.28 MB

PowerShell module for managing EMC Unity arrays

Home Page: https://www.powershellgallery.com/packages/Unity-Powershell/

License: MIT License

PowerShell 100.00%

unity-powershell's Introduction

Branch AppVeyor Docs
master Build status Documentation Status
develop Build status Documentation Status

Last release: GitHub version

Unity-Powershell

This is a PowerShell module for managing EMC Unity arrays (physical or virtual). Unity-Powershell is a member of the DevHigh5 program from {code} by Dell EMC(tm).

With this module (version 0.13.0) you can manage:

  • System (DNS,NTP...),
  • Pools (Virtual and physical deployment),
  • Fast Cache (Physical deployment only),
  • LUN (block),
  • VMware LUN (block and NFS),
  • NASServer,
  • Filesystem,
  • CIFS Server and Shares,
  • NFS Server and Shares,
  • vCenter and ESXi servers,
  • iSCSI parameters,
  • Snapshots and snapshots schedules,
  • Performance metrics.

More functionalities will be added later.

Usage

This module try to mimic VMware PowerCLI usage. All resources management functions are available with the powershell's verbs GET, NEW, SET, REMOVE. For example, you can manage Pools with the following commands:

  • Get-UnityPool
  • New-UnityPool
  • Set-UnityPool
  • Remove-UnityPool

Some functions accept pipelining. For example, if you want to delete all the existing LUNS you can do this:

Get-UnityLUN | Remove-UnityLUN

Requirements

  • Powershell 5 (If possible get the latest version)
  • An EMC Unity array ! (virtual or physical)

Instructions

Install the module

#Automated installation (Powershell 5):
    Install-Module Unity-Powershell

# Or manual setup
    # Download the repository
    # Unblock the zip
    # Extract the Unity-Powershell folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

# Import the module
    Import-Module Unity-Powershell  #Alternatively, Import-Module \\Path\To\Unity-Powershell

# Get commands in the module
    Get-Command -Module Unity-Powershell

# Get help
    Get-Help Get-UnityUser -Full
    Get-Help Unity-Powershell

Examples

Connection to the Unity array

The first thing to do is to connect to an EMC Unity array with the command Connect-Unity:

# Connect to the Unity array
    Connect-Unity -Server 192.168.0.1

    Server       User  Name     Model    SerialNumber
    ------       ----  ----     -----    ------------
    192.168.0.1 admin UnityDemo UnityVSA VIRT1919K58MXM

The parameter -TrustAllCerts allow to accept or not untrusted certificates. It is set to $True by default.

# Connect to the Unity array without allowing untrusted certificates
    Connect-Unity -Server 192.168.0.1 -TrustAllCerts $false

    Server       User  Name     Model    SerialNumber
    ------       ----  ----     -----    ------------
    192.168.0.1 admin UnityDemo UnityVSA VIRT1919K58MXM

LUN Management

You can create a new LUN New-UnityLUN, retrieves informations Get-UnityLUN, modify his properties Set-UnityLUN or delete it Remove-UnityLUN

# Create a block LUN
    New-UnityLUN -Name 'LUN01' -Pool 'pool_1' -Size '10GB'

    Id    Name  Pool          IsThinEnabled TieringPolicy SizeTotal   SizeAllocated Type
    --    ----  ----          ------------- ------------- ---------   ------------- ----
    sv_94 LUN01 @{id=pool_1} True          Autotier_High 10737418240 0             Standalone


# Retrieve informations about block LUN
    Get-UnityLUN

    Id    Name  Pool          IsThinEnabled TieringPolicy SizeTotal   SizeAllocated Type
    --    ----  ----          ------------- ------------- ---------   ------------- ----
    sv_94 LUN01 @{id=pool_1} True          Autotier_High 10737418240 0             Standalone
    sv_95 LUN02 @{id=pool_1} True          Autotier_High 10737418240 0             Standalone


# Delete a LUN
    Remove-UnityLUN -ID 'sv_95'

Users Management

You can add a new user New-UnityUser, modify his properties Set-UnityUSer or delete it Remove-UnityUser.

# Retrieve informations about a specific user
    Get-UnityUser -Name 'demo'

    Id        Name Role
    --        ---- ----
    user_demo demo @{id=storageadmin}

# Change the role of the user from storageadmin to operator
    Get-UnityUser -Name 'demo' | Set-UnityUser -Role 'operator'

    Id        Name Role
    --        ---- ----
    user_demo demo @{id=operator}  

# Delete an user
    Remove-UnityUser -ID 'user_demo'

Query ressources

For testing purpose you can query all the ressources of the array with the command Get-UnityItem. You have to provide the URI of the ressource with the parameter -URI. It will returns a powershell object or a JSON item (with the parameter -JSON)without any formatting.

# Retrieve informations about ntp servers. Result is a powershell object
    $response = Get-UnityItem -URI '/api/types/ntpServer/instances?fields=id,addresses'
    $response.entries.content

    id addresses
    -- ---------
    0  {pool.ntp.org}

# Retrieve informations about ntp servers. result is in the JSON format
    $response = Get-UnityItem -URI '/api/types/ntpServer/instances?fields=id,addresses' -JSON

Disconnection

# Disconnect from the EMC Unity Array
    Disconnect-Unity

Author

Erwan Quélin

Special Thanks

  • David Muegge for his blog post about using EMC Unity API with powershell
  • Warren F. for his blog post 'Building a Powershell module'
  • Chris Wahl for his blog posts about powershell and REST API.

License

Copyright 2016-2017 Erwan Quelin and the community.

Licensed under the MIT License.

unity-powershell's People

Contributors

brandonstiff avatar equelin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.