-
Notifications
You must be signed in to change notification settings - Fork 52
Home
HPE OneView is a fresh approach to converged infrastructure management, inspired by the way you expect to work, with a single integrated view of your IT infrastructure. While HPE OneView provides an easy and intuitive web user interface, not all administrators like to manage their infrastructure with a GUI.
This library provides HPE OneView management capabilities for Windows PowerShell. The library can be used as either a CLI or using the core cmdlets to call from wrapper scripts. The core cmdlets are:
This PowerShell module provides access into the HPE OneView REST API with CMDLETs that can be used like a CLI, or scripting interface to automate certain functions. To begin, make sure you have the latest version.
This PowerShell module requires the following minimum versions:
Table 1. Requirements
Library | Components | Version |
---|---|---|
HPE OneView 1.10 | Windows Management Framework (WMF) | 3.0 |
HPE OneView 1.10 | .Net Client Framework | 4.0 |
HPE OneView 1.20 | Windows Management Framework (WMF) | 3.0 |
HPE OneView 1.20 | .Net Client Framework | 4.0 |
HPE OneView 2.00 | Windows Management Framework (WMF) | 4.0 |
HPE OneView 2.00 | .Net Client Framework | 4.6* |
All | FormatPX | v1.1.2.12 or greater** |
All | SnippetPX | v1.0.2.13 or greater** |
*NOTE: Windows Server 2008 R2 SP1 will be required to install the 4.6 .Net Client Framework.
**NOTE: Already included within the Signed Installer.
The installer will verify if your system does not meet the minimum requirements, and provides method to obtain them.
Once the package has been installed, you can launch the HPE OneView CLI shortcut from your Start Menu. Or you can choose to import the module dynamically in your PowerShell runtime by simply calling
Table 2. Import Library Command
HPE OneView POSH Library | Command |
---|---|
1.06 Library | import-module HPOneView |
1.10 Library | import-module HPOneView.110 |
1.20 Library | import-module HPOneView.120 |
2.00 Library | import-module HPOneView.200 |
There are 5 primary CMDLETs to interact with the HPE OneView appliance:
The installer technology used is provided from InnoSetup. Included within the 2.00.604.0
release (older installers do not support full silent installation, as the installer will default to JustMe
), a new directory called Unattended with sample INF files are provided. The only custom key option supported within the Unattended INF answer file is Users
.
Table 3. Supported Users
Key value in Unattended INFF Answer File
Value | Definition | Installation Directory |
---|---|---|
0 | Install to JustMe
|
%UserProfile%\Documents\WindowsPowerShell\Modules |
1 | Install to AllUsers
|
%WinDir%\System32\WindowsPowerShell\v1\Modules |
To execute a silent installation, use the following command line parameters:
HPOneView PowerShell Library.exe /loadinf="{Unattend_File}.inf" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
The Connect-HPOVMgmt
CMDLET will authenticate you to the requested appliance. From there, a variable $ciMgmtSessionId
(Type [PSCustomObject]
) is created in your PowerShell runtime environment that other CMDLETs will use. This object contains a property called sessionId
which contains the authenticated users REST API session token that the internal RestClient
function uses to add the required auth
HTTP header.
Once completed, you can either close out of your PowerShell console, or issue the Disconnect-HPOVMgmt
CMDLET to terminate your session, and return you back to your PowerShell consoles prior state.
New in the HPE OneView 2.00 library is the ability to connect to multiple appliances, which allows the user to execute various CMDLETs without requiring to disconnect and reconnect to other appliances within your PowerShell session. The Connect-HPOVMgmt
CMDLET will authenticate you to the requested appliance. From there, a session object (Type [HPOneView.Appliance.Connection]
) is created and added to a global variable $ConnectedSessions
(Type [System.Collections.ArrayList]
) in your PowerShell runtime environment that other CMDLETs will use. Within the [HPOneView.Appliance.Connection]
object contains a number of properties, of which the connected appliance hostname
value provided by Connect-HPOVMgmt
is stored, along with the SessionID
of your user session.
For more information about multiple appliance connection support, please review get-help about_Appliance_Connections
from your PowerShell console, or read the online wiki page for about_Appliance_Connections.
Once completed, you can either close out of your PowerShell console, or issue the Disconnect-HPOVMgmt
CMDLET to terminate your session, and return you back to your PowerShell consoles prior state.
## Sample Scripts
To ease the use of the HPE OneView PowerShell library, we have included a number of sample scripts administrators can use to quickly get familiar with the capabilities of the library. The sample scripts are part of the Source Code and installer. Depending on which installation selection you chose (Just You, or For Everyone), there is a Samples directory that contain all of the sample scripts. By no means are they exhaustive, but will help you get more familiar with the library.
Sample Scripts location for All Users installation (Click on image for larger view):
Sample Scripts location for Just Me installation (Click on image for larger view):
Others have contributed example scripts to further automate management within the infrastructure. Please use the following links to see other examples not included within the library Samples directory.
- Rename-LANNetwork
- Get-BladeSystemInventory
- Import/Export-OVResources
- Automate Appliance Backup
- Create OV Resources
- Configure iLO settings from OneView
- HPSIM to HPE OneView Tool
## Additional Resources
- HPE OneView Release Notes
- HPE OneView Support Matrix
- HPE OneView Installation Guide
- HPE OneView User Guide
- HPE OneView Online Help
- HPE OneView REST API Reference
- HPE OneView Firmware Management White Paper
- HPE OneView Deployment and Management White Paper
- Virtual Connect Command Line User Guide
- Virtual Connect Enterprise Manager User Guide
- Virtual Connect Enterprise Manager Command Line User Guide
Learn more about HPE OneView at hpe.com/info/HPOneView