- Community Home
- >
- Software
- >
- HPE OneView
- >
- Is there a way to do a bulk remove of networks wit...
-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- 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?
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP