HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link
composable-infrastructure hpe-oneview hpe-synergy infrastructure infrastructure-as-code oneveiw powershell

POSH-HPOneView

HPE OneView makes it simple to deploy and manage today’s complex hybrid cloud infrastructure. HPE OneView can help you transform your data center to software-defined, and it supports HPE’s broad portfolio of servers, storage, and networking solutions, ensuring the simple and automated management of your hybrid infrastructure. Software-defined intelligence enables a template-driven approach for deploying, provisioning, updating, and integrating compute, storage, and networking infrastructure.

This library enables PowerShell developers, IT automation engineers, or devops personel the ability to utilize HPE OneView's open REST API to automate infrastructure policies and operations. Starting with the HPE OneView 5.00 PowerShell library, PowerShell Core is now supported.

The major changes are:

Build status

AppVeyor 9.10 Branch AppVeyor 9.00 Branch AppVeyor 8.60 Branch AppVeyor 6.60 Branch
Build status PS Gallery Build status PS Gallery Build status PS Gallery Build status PS Gallery

Getting started

To get started, use the Install-Module Cmdlet to install from the PowerShell Gallery to your local system.

For all supported PowerShell and PowerShellCore systems

# Install library from the PowerShell Gallery
Install-Module HPEOneView.910

# Load the module
Import-Module HPEOneView.910

# Connect to your appliance
Connect-OVMgmt -Hostname MyAppliance.FQDN.Name -Credential $MyOneViewCredential

Linux or Mac, including Windows Services for Linux (WSL)

Windows Services for Linux (WSL) is tested and supported using the Ubuntu 18.04 image from the Windows Store. To test and use WSL, Windows 10 1709 (aka Windows 10 Creaters Fall Update) or newer is required. Please see this Microsoft document for further instructions.

For Linux distributions and appliances with a CA signed/issued certificate, you will need to make sure the issuing CA, and CA chain, is exported to PEM format, and placed within the OS SSL cert trusts location. For Ubuntu 18.04, you can:

  1. Place the CA cert in PEM format (the cert format that starts with -----BEGIN CERTIFICATE-----) into /usr/local/shared/ca-certificates.
  2. Execute sudo update-ca-certificates binary, which should look something like:
    chris@desktop2:~$ sudo update-ca-certificates
    Updating certificates in /etc/ssl/certs...
    1 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d...
    done.
  3. If there are any additional cert errors and you simply want to test basic functionality, you can override certificate validation for the library using the following:
    # NOTE:  This is NOT supported in production as this is a security risk.
    [HPEOneView.PKI.SslValidation]::IgnoreCertErrors = $true

Known limitations

The library normally uses FormatPX to fix formatting issues with the Microsoft provided core cmdlets Format-List and Format-Table. However, FormatPX is not currently supported in PowerShellCore yet. So, when attempting to use the default parameter set of Get-OVNetwork, which can return multiple network resource types, only the first network type will properly display. The rest (like Fibre Channel or Fibre Channel over Ethernet) will display their full object properties.

The Get-OVCommandTrace Cmdlet will generate the required output. But due to a limitation in the DotNet Standard API, a prior used API is no longer available, resulting in Verbose and Debug messages from the HPE OneView C# Class Library to not be captured. When reporting errors, and using the Cmdlet, or if you invoke [HPEOneView.Config]::EnableVerbose = $true and/or [HPEOneView.Config]::EnableDebug = $true, the generated output should be recaptured by Select All, copy and then paste into the created log file.

Getting help

First, read the manual. Cmdlets are documented here in a new doc repository. The project wiki is no longer maintained, and will be removed in a future update.

Are you running into a road block? Have an issue with unexpected bahriov? Feel free to open a new issue on the tracker.

You have a general question about the library? For general questions, or need to discuss a topic that doesn't need to be tracked in the issue tracker, please join the new GitHub Discussions for the project: Join the discussion

Still available, but not actively maintained Gitter.im chat room: Join the chat