- Community Home
- >
- Software
- >
- HPE OneView
- >
- Is there a way to do a bulk remove of networks wit...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2015 11:55 AM - edited 03-12-2015 12:00 PM
03-12-2015 11:55 AM - edited 03-12-2015 12:00 PM
Is there a way to do a bulk remove of networks with HP OneView?
Peter had a tedious task question:
************
Was wondering if there is a way of doing a bulk remove of networks on HP OneView without going through the tedious task of removing one by one in the OneView console.
*********
Input from Dung:
************
Hi Peter
You can either use the PowerShell library or Python Library for HP OneView
Example with PowerShell:
Get-HPOVNetwork | Remove-HPOVNetwork
Just want to share with you all the script we have developed.
So Peter had a challenge of deleting about 200 networks created in OneView. The networks' name have the following syntax
ChimPrv_A_x and ChimPrv_B_x where x is in the range of [400, 499]
So we come up with the following script:
400..499 | % {
$A = $_.ToString(“ChimPrv_A_000”) # String pattern ‘000’ is replaced by the number passed to the pipeline
$B = $_.ToString(“ChimPrv_B_000”)
Remove-HPOVNetwork –name $A –force –confirm:$false
Remove-HPOVNetwork –name $B –force –confirm:$false
}
5 Lines to remove 200 networks!
Go , go learn PowerShell!
************
And from Chris:
There is no need for the .ToString() method. The int will be converted to string already if you were to specify the network name as "ChimPrv_A_$_" or "ChimPrv_B_$_" in your pipeline.
************
Suresh provided input:
In my case I wanted to delete all the existing Ethernet networks (eg: in my case 39 Ethernet Networks), so achieved this through the following code snippet using PowerShell.
$script:ethernetNetworksUri = "/rest/ethernet-networks"
function deleteEthernetNetworks()
{
$retVal = Send-HPOVRequest -uri $script:ethernetNetworksUri
for ($i = 0; $i -lt $retVal.members.count; $i++)
{
$delEthUri = $retVal.members[$i].uri
$task = Send-HPOVRequest $delEthUri DELETE
}
}
I followed the same logic to delete the NetworkSets, LIG’s, Enclosure Groups, Enclosures, ServerProfile Templates, ServerProfiles, Storage Volumes etc.
And a reply from Chris:
The Remove-HPOV[resource] CMDLETs can support removing resources en-bulk via PowerShell’s native pipeline. See the example for Remove-HPOVNetwork.
****************
Comments?