DefinIT

Automate the deployment of vROps (supporting vDS)

| 18/05/2015 | Tags: , , , ,

powercli-logoRecently I have been looking at William Lam‘s excellent post on automating the deployment of vROps.

After having a play around with it, to suit my own needs, I made some modifications to the Powershell script so it would support distributed switches.

# William Lam
# Edited by Simon Eady to support vDS
# www.virtuallyghetto.com
# Deployment of vRealize Operations Manager 6.0 (vROps)

### NOTE: SSH can not be enabled because hidden properties do not seem to be implemented in Get-OvfConfiguration cmdlet ###

# Load OVF/OVA configuration into a variable
$ovffile = “E:\automation\vRealize-Operations-Manager-Appliance-6.0.1.2523163_OVF10.ova”
$ovfconfig = Get-OvfConfiguration $ovffile

# vSphere Cluster + VM Network configurations
$Cluster = “Name of Cluster
$VMName = “Name of vROps VM
$VDS = “Enter vDS here
$VDSPG = “Enter vDS portgroup here
$VCServer = “Enter vCenter here

$VMHost = Get-Cluster $Cluster | Get-VMHost | Sort MemoryGB | Select -first 1
$Datastore = $VMHost | Get-datastore | Sort FreeSpaceGB -Descending | Select -first 1
$Network = Get-VDPortgroup -VDSwitch $VDS -Name $VDSPG -Server $VCServer

# Fill out the OVF/OVA configuration parameters

# xsmall,small,medium,large,smallrc,largerc
$ovfconfig.DeploymentOption.value = “xsmall”

# IP Address
$ovfConfig.vami.vRealize_Operations_Manager_Appliance.ip0.value = “desired ip of vROps

# Gateway
$ovfConfig.vami.vRealize_Operations_Manager_Appliance.gateway.value = “gateway for environment

# Netmask
$ovfConfig.vami.vRealize_Operations_Manager_Appliance.netmask0.value = “Subnet mask for your environment

# DNS
$ovfConfig.vami.vRealize_Operations_Manager_Appliance.DNS.value = “DNS server IP

# vSphere Portgroup Network Mapping
$ovfconfig.NetworkMapping.Network_1.value = $Network

# IP Protocol
$ovfconfig.IpAssignment.IpProtocol.value = “IPv4”

# Timezone
$ovfconfig.common.vamitimezone.value = “Etc/UTC”

# Deploy the OVF/OVA with the config parameters
Import-VApp -Source $ovffile -OvfConfiguration $ovfconfig -Name $VMName -VMHost $vmhost -Datastore $datastore -DiskStorageFormat thin

 

If it’s of use please go thank William he did the hard work on this one.