-
Notifications
You must be signed in to change notification settings - Fork 52
VCtoOneView
This document describes a scripted method which can be utilized to migrate an existing Virtual Connect (VC) domain to management under HP OneView. This document describes the purpose, prerequisites, usage, and limitations of this scripted migration process.
There may be features enabled in a Virtual Connect configuration that have not been implemented in the current version of HP OneView. Some of these features may prohibit migrating to OneView. The whitepaper, “Transitioning a Virtual Connect Configuration to HP OneView” contains a full list of these features for the current version of HP OneView.
Before attempting to migrate a VC domain to HP OneView it is highly recommended to capture a backup of the domain configuration. The Virtual Connect Manager (VCM) GUI can be used to save the configuration backup in binary format. The VCM command line interface can used to capture the backup in a scripted format by executing the command “show config”. On VCM version 4.20 or higher, ues “show config –includepoolinfo.” For additional information or instructions on backing up your VC domain and command line options for the Virtual Connect command line interface please refer to Virtual Connect documentation at http://www.hp.com/go/virtualconnect/docs.
Please insure that the candidate Virtual Connect domain is in a healthy status and has no pending updates prior to beginning the migration process. Any updates that are pending when the migration process is started my not be reflected in the generated migration scripts.
The scripting language utilized by the migration process is Windows PowerShell. It is recommended that the reader have some knowledge of the PowerShell language in order to customize or enhance the generated migration scripts described in this paper.
The process and scripts described in this paper are not officially supported by Hewlett-Packard.
Important
VCtoOneView only supports migrating to HP OneView version 1.10 from VCM versions 4.10 – 4.30.
VCtoOneView.ps1 is a migration script generation utility, it does not perform the actual migration. The presence of an HP OneView appliance is not required in order to execute the script. VCtoOneView analyzes a Virtual Connect configuration and translates the VC managed objects into equivalent OneView resources. VCtoOneView then generates migration script(s) that should be analyzed and can be customized and enhanced if desired.
Written by HP field personnel, VCtoOneView is an interim solution for automating the transition from VC Manager to OneView management. Its primary goal is to perform that transition as seamlessly as possible in order to minimize application downtime during the process. VCtoOneView reads the VC configuration information using calls to the VC Manager interface, analyzes it for compatibility with OneView management, and then translates it into objects that can be used by the OneView RESTful interface for migration purposes. This functionality will be included in a future release of HP OneView.
For accessing the VC and Onboard Administrator interfaces, VCtoOneView utilizes a custom set of PowerShell cmdlets provided in HPVCtoOV.dll. This dynamic link library file is provided in the same archive as the VCtoOneView.ps1 PowerShell script. The migration scripts generated by VCtoOneView utilize the HP OneView PowerShell Library that is hosted on CodePlex. The following list of prerequisites are required for using the VCtoOneView script and the HP OneView PowerShell Library.
· Windows Management Framework 3.0
· Windows Management Framework 4.0
Administrative access to both HP OneView, Virtual Connect Manager, and the Onboard Administrator is required. Local administrative access is required on the Windows workstation where the scripts are executed.
VCtoOneView is an interactive script that prompts the user for information at various points of execution. There are three basic usage scenarios for VCtoOneView
1. Compatibility Check
Ex: PS C:\> powershell c:\VCtoOneView.ps1
2. Add Enclosure to a new Enclosure Group – Script Generation
Ex: PS C:\> powershell c:\VCtoOneView.ps1
3. Add Enclosure to existing Enclosure Group – Script Generation
Ex: PS C:\> powershell c:\VCtoOneView.ps1 –addToEnclosureGroup myExistingEnclosureGroup
Each method of execution requires login parameters for both the Onboard Administrator and Virtual Connect Manager. The user is prompted for these parameters during execution.
Note
Certain special characters such as exclamation points (!) and ampersands (&) as the first character in response to input are treated as a ‘prompt command’ by PowerShell causing the input string to not be processed as desired. If an input string contains a special character as the first character, the input string will be processed literally if enclosed in single quotes (see below example). As an alternative, a temporary Administrative user with a password not beginning with an exclamation point can be created for use with the migration process.
Ex. To process the password, !myPassword, enter ‘!myPassword’ at the prompt.
Each time that VCtoOneView is executed against an existing Virtual Connect configuration, analysis is done to determine its compatibility to be managed by HP OneView. This analysis looks for VC features and parameters that prohibit the domain from being managed by HP OneView as well as VC features and parameters that are not currently implemented in HP OneView but do not prohibit the domain from being managed by HP OneView. If no critical errors are identified during the VC configuration analysis, a firmware check is initiated on the Onboard Administrators, Virtual Connect modules and iLOs in the enclosure.
Refer to Appendix A for a full list of configuration checks and their impact on migrating to HP OneView.
The compatibility check is executed at the beginning of this usage scenario. If the compatibility and firmware checks complete without error, VCtoOneView prompts the user to save the configuration output files and generated migration script. By default, VCtoOneView generates a migration script that imports the BladeSystem enclosure and VC settings as the first enclosure in a new enclosure group. No additional command line parameters are required by VCtoOneView to initiate this script generation.
Output script operations:
1. Creates Ethernet networks and SAN fabrics
2. Creates Network Sets
3. Creates the Logical Interconnect Group
4. Creates Uplink Sets for Ethernet and Fibre Channel networks
5. Creates the new Enclosure Group
6. Creates Server Profiles
7. Imports the Enclosure into the new Enclosure Group created in step 5
8. Powers off the server hardware
9. Assigns the Server Profiles to the appropriate Server Hardware
10. Powers on the Server Hardware
To speed up the enclosure import operation and to minimize application downtime, the enclosure group and server profiles have the firmware baseline set to “manage manually” in the generated script.
Note
Although the migration script contains commands to power off the servers, a graceful shutdown of the operating systems cannot be guaranteed. Therefore, it is recommended that the user gracefully shutdown the servers either prior to executing the generated migration script, or prior to confirming the enclosure import operation in the migration script.
Requirements for a successful migration into an existing HP OneView enclosure group:
1. All networks (Ethernet and Fibre Channel) already exist in HP OneView
2. Uplinks set definitions on the candidate enclosure match those of the target enclosure group’s logical interconnect group definition in HP OneView.
3. The candidate enclosure’s interconnect modules are identical and populated in the same bays as that of the target enclosure group’s logical interconnect group definition.
The compatibility check is executed at the beginning of this usage scenario. If the compatibility and firmware checks complete without error, VCtoOneView prompts the user to save the configuration output files and generated migration script. In this scenario a script is generated that will import the enclosure into an existing enclosure group that is specified by the user during script execution.
The example below demonstrates how to initiate VCtoOneView for this usage scenario.
powershell c:\pathto\VCtoOneView.ps1 –addToEnclosureGroup MyExistingGroupName
Output script operations:
1. Creates Network Sets
2. Creates Server Profiles
3. Imports the Enclosure into the specified Enclosure Group
4. Powers off the server hardware
5. Assigns the Server Profiles to the appropriate Server Hardware
6. Powers on the Server Hardware
Note
This usage scenario assumes that the enclosure to be migrated is configured identically as the target enclosure group to which it will be added. No checks are executed that insure that this is the case, so it is important that the user verify the configuration of the candidate VC domain prior to executing the generated migration script.
Note
Although the migration script contains commands to power off the servers, a graceful shutdown of the operating systems cannot be guaranteed. Therefore, it is recommended that the user gracefully shutdown the servers either prior to executing the generated migration script, or prior to confirming the enclosure import operation in the migration script.
VCtoOneView does not directly interact with Virtual Connect Enterprise Manager (VCEM), but still can be used to migrate all members of a VCEM domain group into HP OneView. VCEM already enforces uniformity of configurations across VC domains in the domain group, thus insuring the requirements for a successful migration into a single enclosure group within OneView are already met. The steps to migrate a VCEM domain group into HP OneView are straightforward.
1. Generate a migration script for the first domain by executing VCtoOneView without the –addToEnclosureGroup switch.
2. Generate subsequent migration scripts for the remaining members of the VCEM domain by executing VCtoOneView with the -addToEnclosureGroup switch against each additional member of the VCEM domain group.
3. Remove the domain members from the VCEM domain group.
4. Execute the script generated in step one to create the Enclosure Group, Logical Interconnect Group and populate all networks in HP OneView.
5. Execute the scripts generated in step two, in any order, to add the remaining enclosures to the Enclosure Group in HP OneView.
Note
Unassigned profiles in VCEM are captured in the last domain removed from the domain group and are not migrated to OneView. To capture the unassigned profiles for future reference, please insure you backup each VC domain, or capture the profile information from VCEM using the vcemcli –export command. Ex: vcemcli –export profiles –exportfile c:\myVCEMprofiles.csv
For a full listing of VCEM cli commands and their usage please reference the HP Virtual Connect Enterprise Manager Command Line Interface User Guide.
VCtoOneView generates PowerShell scripts that are used for the actual migration to OneView as well as JSON resource definition files for use by the generated migration scripts. Care should be taken when editing the migration scripts or the JSON resource files.
For uniqueness, names for the resources that will be created in OneView will have the enclosure serial number prepended to the names as they exist in Virtual Connect Manager. These names are coded into the generated script and should not be altered. Once the migration process is complete, the names can be changed without impact to server operation.
The output scripts for actual migration use the naming converntion VCDomainName-migrate.ps1
Please refer to Appendix B for a sample migration script and JSON resource definition file.
Figure 1. VCtoOneView flow diagram
As stated previously, the goal of the migration process described in this whitepaper is to minimize downtime and provide a seamless migration from Virtual Connect management to HP OneView management. To that end, those features and functions of Virtual Connect that are non-essential to the application or server operation are not migrated from Virtual Connect to OneView.
Those features and settings that are not migrated, but are supported by OneView, can be manually enabled or edited in OneView at any point before or after the migration without impacting server operations.;
Important
Currently VCtoOneView only supports migrating to HP OneView version 1.10 from VCM versions 4.10 – 4.30
The list below outlines those settings that are available in OneView but are not migrated as part of this process. These are settings that can be manually added or altered in OneView after the migration with no impact on server operations. For a full list of Virtual Connect features not currently implemented in OneView see the whitepaper, “Transitioning a Virtual Connect Configuration to HP OneView”
· User/group settings and configuration
o LDAP users
o Local users
· SNMP settings
· Firmware baselines (Enclosure Firmware Management settings from the Onboard Administrator)
· Unassigned Virtual Connect Profiles
HP OneView enables the use of firmware baselines when adding enclosures and defining server profiles. Applying baselines to these resources triggers an update attempt during enclosure import or application of a server profile. This update process may delay the amount of time it takes to restore application functionality during the migration process. For that reason, the firmware baseline setting for both enclosures and server profile is set to “manage manually” during resource import and creation on the OneView appliance.
Note that regardless of the firmware baseline setting, if the Onboard Administrator or iLOs are not at the minimum level required for OneView management, they will be automatically updated during the enclosure import process. Virtual Connect modules that are not at the minimum firmware level for OneView management must be manually updated after enclosure import. For this reason, it is recommended that the Onboard Administrators, iLOs, and Virtual Connect modules be updated to at least the minimum level for OneView management prior to attempting the migration process. For a full list of the minimum firmware requirements for OneView management please see the HP OneView Compatibility Guide at http://www.hp.com/go/oneview/docs.
Virtual Connect Manager allows for the overprovisioning of physical links on Flex capable adapters and CNAs through the use of custom and preferred network speed settings. HP OneView does not currently support overprovisioning of the physical adapter port. In translating the profile connections from Virtual Connect to OneView, FlexNICs that have a requested bandwidth exceeding 2500 Mbps will have their bandwidth set to 2500 Mbps when migrated to OneView.
HP OneView allows requested bandwidth settings to be altered in the profile without the need to power down the server to which the profile is applied. Once the migration process is complete, users can adjust the profile connections’ requested bandwidth settings to suit their needs.
Table 1. VCtoOneView compatibility check errors and description |
||
Status |
Message |
Description / Actions |
Critical |
Multi-Enclosure stack identified |
Multi-Enclosure VC domains will not be migrated. |
Critical |
Multi-hop FCoE is enabled on network X |
Multi-hop FCoE support is not currently implemented in OneView. The VC domain cannot be migrated to OneView |
Critical |
Server productname in device bay X is not supported |
An unsupported server was identified in the enclosure. The VC domain cannot be migrated to OneView |
Critical |
Server in device bay X has an adapter in location Y that is unsupported |
An adapter was identified that is unsupported or will be unmanaged by OneView. |
Critical |
Interconnects in adjacent bays X and Y are not identical |
Virtual Connect modules in adjacent horizontal bays must match. The VC domain cannot be migrated to OneView |
Critical |
IO Module productname in IO bay X is not currently supported |
A Virtual Connect module was identified in the enclosure that is not supported by OneView. The VC domain cannot be migrated to OneView |
Critical |
Profile X contains iSCSI connections |
iSCSI connections on the server profile are not yet supported by OneView. The VC domain cannot be migrated. |
Critical |
Profile X contains multi-hop FCoE connections |
Multi-hop FCoE support is not yet implemented in OneView. The VC domain cannot be migrated |
Critical |
ComponentX firmware is below the minimum requirement for import into OneView. |
Firmware for iLO, Onboard Administrator, and Virtual Connect modules must be at a minimum revision to attempt to import the enclosure into OneView. Refer to the OneView compatibility guide at http://www.hp.com/go/oneview/docs. |
Critical |
The iLO model type in bay X is not supported |
An unsupported iLO model was identified. This is a redundant check to the supported servers check. |
Critical |
The iLO model type in bay X is reporting as [Unknown] |
An error is causing the OA to be unable to acquire information regarding the iLO. The VC domain will not be migrated to OneView. |
Critical |
Profile X has unassigned connections |
Unassigned profile connections are not currently supported in OneView. The VC domain cannot be migrated to OneView. Remove the connections from the VC profile, or assign temporary networks to the connections. |
Critical |
Profile X is using mapped VLAN ids on a connection assigned to multiple networks. |
HP OneView does not currently support the ability to set custom VLAN ids on a server connection. Downlink server VLAN ids must match the uplink VLAN ids. |
Critical |
Profile X has connections not mapped to physical hardware |
A Virtual Connect profile has server connections that exceed the number of physical ports. This is not supported by the migration script. Remove the connections and retry the migration. |
Critical |
Profile X contains an untagged network on a connections assigned to multiple networks |
HP OneView does not currently support adding a tunneled/untagged network to a network set (aka VC profile multiple networks). Multiple network assignments must only contain tagged networks in order to be migrated. |
Warning |
Profile X has custom min/max speed settings on Ethernet port Y |
OneView profiles currently only allow a requested bandwidth setting. The migration will utilize the minimum port speed setting of the Virtual Connect profile for the requested bandwidth setting. The speed settings can be altered in OneView after the migration process is complete. |
Warning |
ComponentX firmware is below the minimum requirement for OneView Management. |
Firmware for iLO, Onboard Administrator, and Virtual Connect modules must be at a minimum revision in order to be managed by OneView. Components above the minimum level for import, but below the minimum level for management must be updated. Updating the components after being imported may prolong the migration process. Onboard Administrators and iLOs that are below the minimum level for OneView management will automatically be updated to the minimum level upon enclosure import. Refer to the OneView compatibility guide at http://www.hp.com/go/oneview/docs. |
Warning |
Radius/TACACS authentication is enabled |
Radius and TACACS authentication is not currently implemented in HP OneView and those settings will not be migrated. |
Warning |
Network access groups other than the default exist in the domain |
Networks access groups (NAGs) are not yet implemented in HP OneView and will not be migrated. |
Warning |
Profile X is unassigned and will not be migrated to OneView |
HP OneView profiles are associated with a server hardware type in order to determine BIOS setting and connection capabilities. The migration process cannot determine this association on unassigned Virtual Connect profiles or profiles assigned to empty server bays. Preserve the profile information using the “show config” command of the VCM CLI so that the profile can be manually re-created in OneView if needed. |
Warning |
Profile X has boot settings on FC connections set to “USE-BIOS”, manual steps may be required. |
HP OneView does not currently have an equivalent “USE-BIOS” setting for FC boot parameters. The migration process will set those connections to non-bootable. If the connection is used for fibre channel boot, it must be set to “primary”, or “secondary” in the OneView profile after migration. |
Warning |
Profile X is assigned to an empty server bay and will not be migrated to OneView |
HP OneView profiles are associated with a server hardware type in order to determine BIOS setting and connection capabilities. The migration process cannot determine this association on unassigned Virtual Connect profiles or profiles assigned to empty server bays. Preserve the profile information using the “show config” command of the VCM CLI so that the profile can be manually re-created in OneView if needed. |
Caution
These scripts and object files are for example purposes only, and should not be used to attempt an actual migration.
# 06/06/2014 12:44:05
# Auto-generated OneView configuration script
# Connect to OneView - example parameters provided. Alter for the specific environment
Connect-HPOVMgmt 192.168.0.0 UserName Password
# Create Ethernet and Fibre Channel networks using JSON input file.
# Since this a bulk import operation, the script will exit with error if one of the network
# creation attempts fail.
$netResp = New-HPOVNetwork -importFile "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Networks.JSON"
$ErrorActionPreference = "Inquire"
if($netResp.status -contains "Failed"){
$netResp = $netResp | ? {$_.status -eq "Failed"} | ? {$_.details.errorCode -notmatch "CRM_DUPLICATE_NETWORK_NAME"}
# If the resonse still contains errors it due to other problems than duplicate names. Throw error.
if($netResp){
throw "Error creating one or more networks."
}
}
# Create Network Sets derived from VC Profiles
# Create USE939SBA4-r1e1_vc_domain-NS1
$untaggedNetUri = (Get-HPOVNetwork -name "VLAN-100").uri
$netUris = @()
$netUris += (Get-HPOVNetwork -name "VLAN-100" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-101" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-102" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-103" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-104" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-105" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-106" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-107" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-108" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-109" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-110" -type Ethernet).uri
# Look for existing Network Sets that are identical to this one.
$networkSets = Get-HPOVNetworkSet
# Check if any net sets exists yet and create this one if not
if(!$networkSets){New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS1 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
else{
# Network sets already exist on the appliance
# Compare this net set to existing ones
$netSetExists = $false
ForEach($ns in $networkSets){
if(!(Compare-Object $ns.networkUris $neturis)){
# Found a match - set the variable to true, update profiles file, and break out of the loop
$netSetExists = $true
(Get-Content F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON) | Foreach-Object {$_ -replace "USE939SBA4-r1e1_vc_domain-NS1",$ns.name } | Set-Content "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON"
break
}
}
if(!$netSetExists){
New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS1 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
}
# Create USE939SBA4-r1e1_vc_domain-NS2
$untaggedNetUri = $null
$netUris = @()
$netUris += (Get-HPOVNetwork -name "Prod-Primary" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "Mgmt-Primary" -type Ethernet).uri
# Look for existing Network Sets that are identical to this one.
$networkSets = Get-HPOVNetworkSet
# Check if any net sets exists yet and create this one if not
if(!$networkSets){New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS2 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
else{
# Network sets already exist on the appliance
# Compare this net set to existing ones
$netSetExists = $false
ForEach($ns in $networkSets){
if(!(Compare-Object $ns.networkUris $neturis)){
# Found a match - set the variable to true, update profiles file, and break out of the loop
$netSetExists = $true
(Get-Content F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON) | Foreach-Object {$_ -replace "USE939SBA4-r1e1_vc_domain-NS2",$ns.name } | Set-Content "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON"
break
}
}
if(!$netSetExists){
New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS2 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
}
# Create USE939SBA4-r1e1_vc_domain-NS3
$untaggedNetUri = $null
$netUris = @()
$netUris += (Get-HPOVNetwork -name "Mgmt-Redundant" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "Prod-Redundant" -type Ethernet).uri
# Look for existing Network Sets that are identical to this one.
$networkSets = Get-HPOVNetworkSet
# Check if any net sets exists yet and create this one if not
if(!$networkSets){New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS3 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
else{
# Network sets already exist on the appliance
# Compare this net set to existing ones
$netSetExists = $false
ForEach($ns in $networkSets){
if(!(Compare-Object $ns.networkUris $neturis)){
# Found a match - set the variable to true, update profiles file, and break out of the loop
$netSetExists = $true
(Get-Content F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON) | Foreach-Object {$_ -replace "USE939SBA4-r1e1_vc_domain-NS3",$ns.name } | Set-Content "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON"
break
}
}
if(!$netSetExists){
New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS3 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
}
# Create USE939SBA4-r1e1_vc_domain-NS4
$untaggedNetUri = $null
$netUris = @()
$netUris += (Get-HPOVNetwork -name "VLAN-2" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-3" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-120" -type Ethernet).uri
$netUris += (Get-HPOVNetwork -name "VLAN-200" -type Ethernet).uri
# Look for existing Network Sets that are identical to this one.
$networkSets = Get-HPOVNetworkSet
# Check if any net sets exists yet and create this one if not
if(!$networkSets){New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS4 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
else{
# Network sets already exist on the appliance
# Compare this net set to existing ones
$netSetExists = $false
ForEach($ns in $networkSets){
if(!(Compare-Object $ns.networkUris $neturis)){
# Found a match - set the variable to true, update profiles file, and break out of the loop
$netSetExists = $true
(Get-Content F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON) | Foreach-Object {$_ -replace "USE939SBA4-r1e1_vc_domain-NS4",$ns.name } | Set-Content "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON"
break
}
}
if(!$netSetExists){
New-HPOVNetworkSet -name USE939SBA4-r1e1_vc_domain-NS4 -untaggedNetworkUri $untaggedNetUri -networkUris $netUris
}
}
# Create Logical Interconnect Group (LIG)
# NOTE: SNMP settings are not migrated, and must be applied manually.
# Now create the LIG
New-HPOVLogicalInterconnectGroup -LigName LIG-r1e1_vc_domain-USE939SBA4 -bays @{3 = "VCFC24";2 = "FlexFabric";1 = "FlexFabric";4 = "VCFC24"} -enableIgmpSnooping $false -igmpIdleTimeoutInterval 260 -LoopProtect $true -FastMac $true -FastMACRefresh 5
# Create Ethernet UplinkSets
# First read JSON input for Ethernet UplinkSet definition
$ethUs = [string]::Join("", (gc "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-EthUSs.JSON")) | ConvertFrom-Json
ForEach($e in $ethUs){
New-HPOVUplinkSet -ligName LIG-r1e1_vc_domain-USE939SBA4 -usType $e.usType -usName $e.usName -usNetworks $e.usNetworks -usNativeEthNetwork $e.usNativeEthNetwork -usUplinkPorts $e.usUplinkPorts -usEthMode $e.usEthMode
}
# Create FibreChannel UplinkSets
# First read JSON input for Fibre Channel UplinkSet definition
$fcUs = [string]::Join("", (gc "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-fcUSs.JSON")) | ConvertFrom-Json
ForEach($f in $fcUs){
New-HPOVUplinkSet -ligname LIG-r1e1_vc_domain-USE939SBA4 -usName $f.usName -usType $f.usType -usNetworks $f.usNetworks -usUplinkPorts $f.usUplinkPorts
}
$lUri = (Get-HPOVLogicalInterconnectGroup LIG-r1e1_vc_domain-USE939SBA4).uri
#Create the new enclosure group using the logical interconnect group from above.
$encGroup = New-HPOVEnclosureGroup -name EG-r1e1_vc_domain-USE939SBA4 -logicalInterConnectGroup $lUri
# Create Server-hardware-types
# First read JSON input for SHT definitions
$shts = [string]::Join("", (gc "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-SHTs.JSON")) | ConvertFrom-Json
ForEach($sht in $shts){
$shtTemp = $sht | select * -ExcludeProperty uri, bay
$shtResp = Send-HPOVRequest -method POST -body $shtTemp -uri /rest/server-hardware-types
#If POST was successfull, we get a uri. Add that to the base object for profile assignment
if($shtResp.uri){$sht.uri = $shtResp.uri}
#If not, we get an error. Look for duplicate sht creation error and get uri from message.
else{
if($shtResp.errorCode -eq "SERVER_HARDWARE_TYPE_ALREADY_EXISTS"){
$sht.uri = ($shtResp.message.substring($shtResp.message.indexof("/rest/"))).replace(".", "")
}
#If not a duplcate sht error, something went wrong throw error to terminate script
else{
throw "Fatal error creating server-hardware-type"
}
}
}
# Create Profiles
# First read JSON input for profile definitions
$profiles = [string]::Join("", (gc "F:\VCtoOneView-Dev\out-files\r1e1_vc_domain-Profiles.JSON")) | ConvertFrom-Json
ForEach($p in $profiles){
$pTemp = $p | select * -ExcludeProperty factorySn, enclosureBay
$pTemp.serverHardwareTypeUri = ($shts | ? {$_.bay -eq $p.enclosureBay}).uri
ForEach($c in $pTemp.connections){
$cnet = ($c.networkUri.split("/"))[3]
$cType = ($c.networkUri.split("/"))[2]
if($cType -eq "network-sets") {$c.networkUri=(Get-HPOVNetworkSet $cnet).uri}
else {$c.networkUri=(Get-HPOVNetwork $cnet).uri}
}
$pTemp.enclosureGroupUri = $encGroup.uri
$profileResp = New-HPOVProfile -import -ProfileObj $pTemp
$profileResp | Wait-HPOVTaskComplete
}
#Import the enclosure
#WARNING! Importing the enclosure is destructive to the Virtual Connect domain.
#You will be prompted during execution of this script to confirm the import action.
#You can suppress this prompt by adding "-confirm:$false" to the end of the command.
$encTask = New-HPOVEnclosure -oa 192.168.19.40 -enclGroupName EG-r1e1_vc_domain-USE939SBA4 -user Administrator -pass hpinvent -license OneView
# Wait for the enclosure import to complete prior to attempting profile assignment.
$encTask = $encTask | Wait-HPOVTaskComplete
# Assign profiles to appropriate server hardware
ForEach($p in $profiles){
$sn = $p.FactorySn
# Get the target server hardware object from the appliance.
$sHdwr = Get-HPOVServer | ?{$_.serialNumber -eq $sn}
$shUri = $sHdwr.uri
# Get the power state and power off the server if currently on.
if($sHdwr.powerState -ne "Off"){
$pwrTask = Set-HPOVServerPower $sHdwr Off
$pwrTask = $pwrTask | Wait-HPOVTaskComplete
# If soft power task fails, attemp force power off
if(($pwrTask.taskState -eq "Error") -and ($pwrTask.taskStatus -match "Unable to power off")){
$pwrTask = Set-HPOVServerPower $sHdwr -powerState Off -powerControl PressAndHold
$pwrTask = $pwrTask | Wait-HPOVTaskComplete
}
}
# Retrieve the profile object from the appliance.
$serverProfile = Get-HPOVProfile -name $p.name
#Update the profile object to assign it to actual hardware
$serverProfile.serverHardwareUri = $shUri
$spTask = Send-HPOVRequest -uri $serverProfile.uri -method PUT -body $serverProfile
$spTask | Wait-HPOVTaskComplete
Set-HPOVServerPower $sHdwr
}
[
{
"enclosureGroupUri": null,
"boot": {
"order": [
"CD",
"Floppy",
"USB",
"HardDisk",
"PXE"
],
"manageBoot": true
},
"bios": {
"manageBios": false
},
"FactorySn": "3UI12507AS",
"serverHardwareTypeUri": null,
"macType": "Virtual",
"name": "USE943TK2K-Enc2-ESX-Host-Bay1",
"type": "ServerProfileV3",
"serialNumber": "VCX0000101",
"connections": [
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:00",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/ethernet-networks/LAB_NetworkA",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:02",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/ethernet-networks/LAB_NetworkB",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:04",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/ethernet-networks/NR_VM_A",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:06",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/ethernet-networks/NR_VM_B",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
}
],
"uuid": "1be4e7ae-78ab-4112-a3fd-cc624a49dca6",
"enclosureBay": 1,
"serialNumberType": "UserDefined",
"wwnType": "Physical",
"firmware": {
"manageFirmware": false
}
},
{
"enclosureGroupUri": null,
"boot": {
"order": [
"CD",
"Floppy",
"USB",
"HardDisk",
"PXE"
],
"manageBoot": true
},
"bios": {
"manageBios": false
},
"FactorySn": "2M4124469H",
"serverHardwareTypeUri": null,
"macType": "Virtual",
"name": "USE943TK2K-Enc2-ESX-Host-Bay3",
"type": "ServerProfileV3",
"serialNumber": "VCX0000102",
"connections": [
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:08",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/network-sets/USE939SBA4-r1e1_vc_domain-NS2",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:0A",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/network-sets/USE939SBA4-r1e1_vc_domain-NS3",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:0C",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/network-sets/USE939SBA4-r1e1_vc_domain-NS4",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:0E",
"maximumMbps": 100,
"wwpnType": "Physical",
"portId": "AUTO",
"wwpn": null,
"networkUri": "/rest/network-sets/USE939SBA4-r1e1_vc_domain-NS4",
"functionType": "Ethernet",
"wwnn": null,
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 100
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:10",
"maximumMbps": 4000,
"wwpnType": "UserDefined",
"portId": "AUTO",
"wwpn": "50:06:0B:00:00:C2:66:00",
"networkUri": "/rest/fc-networks/EN1-SANA",
"functionType": "FibreChannel",
"wwnn": "50:06:0B:00:00:C2:66:01",
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 4000
},
{
"macType": "UserDefined",
"mac": "00:17:A4:77:04:11",
"maximumMbps": 4000,
"wwpnType": "UserDefined",
"portId": "AUTO",
"wwpn": "50:06:0B:00:00:C2:66:02",
"networkUri": "/rest/fc-networks/EN1-SANB",
"functionType": "FibreChannel",
"wwnn": "50:06:0B:00:00:C2:66:03",
"boot": {
"targets": [
],
"priority": "NotBootable"
},
"requestedMbps": 4000
}
],
"uuid": "b9fd66f3-327a-46e0-a400-dec91be6eb2c",
"enclosureBay": 3,
"serialNumberType": "UserDefined",
"wwnType": "Physical",
"firmware": {
"manageFirmware": false
}
}
]