Merge remote-tracking branch 'vmware/master'
This commit is contained in:
68
Modules/InstantClone/InstantClone.psm1
Normal file
68
Modules/InstantClone/InstantClone.psm1
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
Function New-InstantClone {
|
||||||
|
<#
|
||||||
|
.NOTES
|
||||||
|
===========================================================================
|
||||||
|
Created by: William Lam
|
||||||
|
Date: Apr 29, 2018
|
||||||
|
Organization: VMware
|
||||||
|
Blog: www.virtuallyghetto.com
|
||||||
|
Twitter: @lamw
|
||||||
|
===========================================================================
|
||||||
|
.SYNOPSIS
|
||||||
|
This function demonstrates the use of the new "Parentless" Instant Clone
|
||||||
|
API that was introduced in vSphere 6.7
|
||||||
|
.DESCRIPTION
|
||||||
|
Function to create new "Parentless" Instant Clones in vSphere 6.7
|
||||||
|
.EXAMPLE
|
||||||
|
$SourceVM = "Foo"
|
||||||
|
$newVMName = Foo-IC-1
|
||||||
|
$guestCustomizationValues = @{
|
||||||
|
"guestinfo.ic.hostname" = $newVMName
|
||||||
|
"guestinfo.ic.ipaddress" = "192.168.30.10"
|
||||||
|
"guestinfo.ic.netmask" = "255.255.255.0"
|
||||||
|
"guestinfo.ic.gateway" = "192.168.30.1"
|
||||||
|
"guestinfo.ic.dns" = "192.168.30.1"
|
||||||
|
}
|
||||||
|
New-InstantClone -SourceVM $SourceVM -DestinationVM $newVMName -CustomizationFields $guestCustomizationValues
|
||||||
|
.NOTES
|
||||||
|
Make sure that you have both a vSphere 6.7 env (VC/ESXi) as well as
|
||||||
|
as the latest PowerCLI 10.1 installed which is reuqired to use vSphere 6.7 APIs
|
||||||
|
#>
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory=$true)][String]$SourceVM,
|
||||||
|
[Parameter(Mandatory=$true)][String]$DestinationVM,
|
||||||
|
[Parameter(Mandatory=$true)][Hashtable]$CustomizationFields
|
||||||
|
)
|
||||||
|
$vm = Get-VM -Name $SourceVM
|
||||||
|
|
||||||
|
$config = @()
|
||||||
|
$CustomizationFields.GetEnumerator() | Foreach-Object {
|
||||||
|
$optionValue = New-Object VMware.Vim.OptionValue
|
||||||
|
$optionValue.Key = $_.Key
|
||||||
|
$optionValue.Value = $_.Value
|
||||||
|
$config += $optionValue
|
||||||
|
}
|
||||||
|
|
||||||
|
# SourceVM must either be running or running but in Frozen State
|
||||||
|
if($vm.PowerState -ne "PoweredOn") {
|
||||||
|
Write-Host -ForegroundColor Red "Instant Cloning is only supported on a PoweredOn or Frozen VM"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
# SourceVM == Powered On
|
||||||
|
if((Get-VM $SourceVM).ExtensionData.Runtime.InstantCloneFrozen -eq $false) {
|
||||||
|
Write-Host -ForegroundColor Red "Instant Cloning from a PoweredOn VM has not been implemented"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
$spec = New-Object VMware.Vim.VirtualMachineInstantCloneSpec
|
||||||
|
$locationSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec
|
||||||
|
$spec.Config = $config
|
||||||
|
$spec.Location = $locationSpec
|
||||||
|
$spec.Name = $DestinationVM
|
||||||
|
|
||||||
|
Write-Host "Creating Instant Clone $DestinationVM ..."
|
||||||
|
$task = $vm.ExtensionData.InstantClone_Task($spec)
|
||||||
|
$task1 = Get-Task -Id ("Task-$($task.value)")
|
||||||
|
$task1 | Wait-Task | Out-Null
|
||||||
|
}
|
||||||
21
Modules/VMware-vCD-Module/LICENSE
Normal file
21
Modules/VMware-vCD-Module/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018 Markus Kraus
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Modulmanifest für das Modul "PSGet_VMware-vCD-Module"
|
# Modulmanifest f<EFBFBD>r das Modul "PSGet_VMware-vCD-Module"
|
||||||
#
|
#
|
||||||
# Generiert von: Markus
|
# Generiert von: Markus
|
||||||
#
|
#
|
||||||
@@ -8,52 +8,52 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
|
|
||||||
# Die diesem Manifest zugeordnete Skript- oder Binärmoduldatei.
|
# Die diesem Manifest zugeordnete Skript- oder Bin<EFBFBD>rmoduldatei.
|
||||||
# RootModule = ''
|
# RootModule = ''
|
||||||
|
|
||||||
# Die Versionsnummer dieses Moduls
|
# Die Versionsnummer dieses Moduls
|
||||||
ModuleVersion = '1.0.0'
|
ModuleVersion = '1.3.0'
|
||||||
|
|
||||||
# ID zur eindeutigen Kennzeichnung dieses Moduls
|
# ID zur eindeutigen Kennzeichnung dieses Moduls
|
||||||
GUID = '1ef8a2de-ca22-4c88-8cdb-e00f35007d2a'
|
GUID = '1ef8a2de-ca22-4c88-8cdb-e00f35007d2a'
|
||||||
|
|
||||||
# Autor dieses Moduls
|
# Autor dieses Moduls
|
||||||
Author = 'Markus'
|
Author = 'Markus Kraus'
|
||||||
|
|
||||||
# Unternehmen oder Hersteller dieses Moduls
|
# Unternehmen oder Hersteller dieses Moduls
|
||||||
CompanyName = 'mycloudrevolution.com'
|
CompanyName = 'mycloudrevolution.com'
|
||||||
|
|
||||||
# Urheberrechtserklärung für dieses Modul
|
# Urheberrechtserkl<EFBFBD>rung f<EFBFBD>r dieses Modul
|
||||||
Copyright = '(c) 2017 Markus. Alle Rechte vorbehalten.'
|
Copyright = '(c) 2017 Markus. Alle Rechte vorbehalten.'
|
||||||
|
|
||||||
# Beschreibung der von diesem Modul bereitgestellten Funktionen
|
# Beschreibung der von diesem Modul bereitgestellten Funktionen
|
||||||
# Description = ''
|
Description = 'This a POwerShell Module based on VMware PowerCLI vCloud Director Module to extend its function'
|
||||||
|
|
||||||
# Die für dieses Modul mindestens erforderliche Version des Windows PowerShell-Moduls
|
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version des Windows PowerShell-Moduls
|
||||||
# PowerShellVersion = ''
|
# PowerShellVersion = ''
|
||||||
|
|
||||||
# Der Name des für dieses Modul erforderlichen Windows PowerShell-Hosts
|
# Der Name des f<EFBFBD>r dieses Modul erforderlichen Windows PowerShell-Hosts
|
||||||
# PowerShellHostName = ''
|
# PowerShellHostName = ''
|
||||||
|
|
||||||
# Die für dieses Modul mindestens erforderliche Version des Windows PowerShell-Hosts
|
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version des Windows PowerShell-Hosts
|
||||||
# PowerShellHostVersion = ''
|
# PowerShellHostVersion = ''
|
||||||
|
|
||||||
# Die für dieses Modul mindestens erforderliche Microsoft .NET Framework-Version
|
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Microsoft .NET Framework-Version
|
||||||
# DotNetFrameworkVersion = ''
|
# DotNetFrameworkVersion = ''
|
||||||
|
|
||||||
# Die für dieses Modul mindestens erforderliche Version der CLR (Common Language Runtime)
|
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version der CLR (Common Language Runtime)
|
||||||
# CLRVersion = ''
|
# CLRVersion = ''
|
||||||
|
|
||||||
# Die für dieses Modul erforderliche Prozessorarchitektur ("Keine", "X86", "Amd64").
|
# Die f<EFBFBD>r dieses Modul erforderliche Prozessorarchitektur ("Keine", "X86", "Amd64").
|
||||||
# ProcessorArchitecture = ''
|
# ProcessorArchitecture = ''
|
||||||
|
|
||||||
# Die Module, die vor dem Importieren dieses Moduls in die globale Umgebung geladen werden müssen
|
# Die Module, die vor dem Importieren dieses Moduls in die globale Umgebung geladen werden m<EFBFBD>ssen
|
||||||
# RequiredModules = @()
|
RequiredModules = @('VMware.VimAutomation.Cloud')
|
||||||
|
|
||||||
# Die Assemblys, die vor dem Importieren dieses Moduls geladen werden müssen
|
# Die Assemblys, die vor dem Importieren dieses Moduls geladen werden m<EFBFBD>ssen
|
||||||
# RequiredAssemblies = @()
|
# RequiredAssemblies = @()
|
||||||
|
|
||||||
# Die Skriptdateien (PS1-Dateien), die vor dem Importieren dieses Moduls in der Umgebung des Aufrufers ausgeführt werden.
|
# Die Skriptdateien (PS1-Dateien), die vor dem Importieren dieses Moduls in der Umgebung des Aufrufers ausgef<EFBFBD>hrt werden.
|
||||||
# ScriptsToProcess = @()
|
# ScriptsToProcess = @()
|
||||||
|
|
||||||
# Die Typdateien (.ps1xml), die beim Importieren dieses Moduls geladen werden sollen
|
# Die Typdateien (.ps1xml), die beim Importieren dieses Moduls geladen werden sollen
|
||||||
@@ -67,10 +67,12 @@ NestedModules = @('functions\Invoke-MyOnBoarding.psm1',
|
|||||||
'functions\New-MyEdgeGateway.psm1',
|
'functions\New-MyEdgeGateway.psm1',
|
||||||
'functions\New-MyOrg.psm1',
|
'functions\New-MyOrg.psm1',
|
||||||
'functions\New-MyOrgAdmin.psm1',
|
'functions\New-MyOrgAdmin.psm1',
|
||||||
'functions\New-MyOrgVdc.psm1')
|
'functions\New-MyOrgVdc.psm1',
|
||||||
|
'functions\New-MyOrgNetwork.psm1'
|
||||||
|
)
|
||||||
|
|
||||||
# Aus diesem Modul zu exportierende Funktionen
|
# Aus diesem Modul zu exportierende Funktionen
|
||||||
FunctionsToExport = 'Invoke-MyOnBoarding', 'New-MyEdgeGateway', 'New-MyOrg', 'New-MyOrgAdmin', 'New-MyOrgVdc'
|
FunctionsToExport = 'Invoke-MyOnBoarding', 'New-MyEdgeGateway', 'New-MyOrg', 'New-MyOrgAdmin', 'New-MyOrgVdc', 'New-MyOrgNetwork'
|
||||||
|
|
||||||
# Aus diesem Modul zu exportierende Cmdlets
|
# Aus diesem Modul zu exportierende Cmdlets
|
||||||
CmdletsToExport = '*'
|
CmdletsToExport = '*'
|
||||||
@@ -90,28 +92,28 @@ AliasesToExport = '*'
|
|||||||
# Liste aller Dateien in diesem Modulpaket
|
# Liste aller Dateien in diesem Modulpaket
|
||||||
# FileList = @()
|
# FileList = @()
|
||||||
|
|
||||||
# Die privaten Daten, die an das in "RootModule/ModuleToProcess" angegebene Modul übergeben werden sollen. Diese können auch eine PSData-Hashtabelle mit zusätzlichen von PowerShell verwendeten Modulmetadaten enthalten.
|
# Die privaten Daten, die an das in "RootModule/ModuleToProcess" angegebene Modul <EFBFBD>bergeben werden sollen. Diese k<EFBFBD>nnen auch eine PSData-Hashtabelle mit zus<EFBFBD>tzlichen von PowerShell verwendeten Modulmetadaten enthalten.
|
||||||
PrivateData = @{
|
PrivateData = @{
|
||||||
|
|
||||||
PSData = @{
|
PSData = @{
|
||||||
|
|
||||||
# Tags applied to this module. These help with module discovery in online galleries.
|
# Tags applied to this module. These help with module discovery in online galleries.
|
||||||
# Tags = @()
|
Tags = @('VMware', 'vCloud', 'PowerCLI', 'vCloudDirector', 'Automation', 'EdgeGateway', 'OrgNetwork')
|
||||||
|
|
||||||
# A URL to the license for this module.
|
# A URL to the license for this module.
|
||||||
# LicenseUri = ''
|
LicenseUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module/blob/master/LICENSE'
|
||||||
|
|
||||||
# A URL to the main website for this project.
|
# A URL to the main website for this project.
|
||||||
# ProjectUri = ''
|
ProjectUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module'
|
||||||
|
|
||||||
# A URL to an icon representing this module.
|
# A URL to an icon representing this module.
|
||||||
# IconUri = ''
|
IconUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module/blob/master/media/vCD_Small.png'
|
||||||
|
|
||||||
# ReleaseNotes of this module
|
# ReleaseNotes of this module
|
||||||
# ReleaseNotes = ''
|
# ReleaseNotes = ''
|
||||||
|
|
||||||
# External dependent modules of this module
|
# External dependent modules of this module
|
||||||
# ExternalModuleDependencies = ''
|
ExternalModuleDependencies = 'VMware.VimAutomation.Cloud'
|
||||||
|
|
||||||
} # End of PSData hashtable
|
} # End of PSData hashtable
|
||||||
|
|
||||||
@@ -120,7 +122,7 @@ PrivateData = @{
|
|||||||
# HelpInfo-URI dieses Moduls
|
# HelpInfo-URI dieses Moduls
|
||||||
# HelpInfoURI = ''
|
# HelpInfoURI = ''
|
||||||
|
|
||||||
# Standardpräfix für Befehle, die aus diesem Modul exportiert werden. Das Standardpräfix kann mit "Import-Module -Prefix" überschrieben werden.
|
# Standardpr<EFBFBD>fix f<EFBFBD>r Befehle, die aus diesem Modul exportiert werden. Das Standardpr<EFBFBD>fix kann mit "Import-Module -Prefix" <EFBFBD>berschrieben werden.
|
||||||
# DefaultCommandPrefix = ''
|
# DefaultCommandPrefix = ''
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#Requires -Version 4
|
Function Invoke-MyOnBoarding {
|
||||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
|
||||||
Function Invoke-MyOnBoarding {
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Creates all vCD Objecst for a new IAAS Customer
|
Creates all vCD Objecst for a new IAAS Customer
|
||||||
@@ -158,18 +156,22 @@ Function Invoke-MyOnBoarding {
|
|||||||
|
|
||||||
if ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "Yes"){
|
if ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "Yes"){
|
||||||
Write-Host "Edge Gateway for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
Write-Host "Edge Gateway for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||||
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
||||||
|
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -Org $Configs.Org.Name -Enabled:$Enabled
|
||||||
|
|
||||||
$EdgeName = $Configs.Org.Name + "-ESG01"
|
$EdgeName = $Configs.Org.Name + "-ESG01"
|
||||||
$EdgeName = $Configs.Org.Name + "-ESG01"
|
$Trash = New-MyEdgeGateway -Name $EdgeName -OrgVDCName $Configs.OrgVdc.Name -Orgname $Configs.Org.Name -ExternalNetwork $Configs.OrgVdc.ExternalNetwork `
|
||||||
|
-IPAddress $Configs.OrgVdc.IPAddress -SubnetMask $Configs.OrgVdc.SubnetMask -Gateway $Configs.OrgVdc.Gateway -IPRangeStart $Configs.OrgVdc.IPRangeStart -IPRangeEnd $Configs.OrgVdc.IPRangeEnd
|
||||||
}
|
}
|
||||||
elseif ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "No"){
|
elseif ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "No"){
|
||||||
Write-Host "External Network for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
Write-Host "External Network for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||||
elseif ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "No"){
|
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
||||||
|
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -ExternalNetwork $Configs.OrgVdc.ExternalNetwork -Org $Configs.Org.Name -Enabled:$Enabled
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "No external Connection for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
Write-Host "No external Connection for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||||
}
|
$Trash = New-PecOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $ProVdcNetworkPool.Name `
|
||||||
|
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -Org $Configs.Org.Name -Enabled:$Enabled
|
||||||
}
|
}
|
||||||
Write-Host "$(Get-Date -Format "yyyy-MM-dd HH:mm:ss") Creating new OrgVdc OK" -ForegroundColor Green
|
Write-Host "$(Get-Date -Format "yyyy-MM-dd HH:mm:ss") Creating new OrgVdc OK" -ForegroundColor Green
|
||||||
Get-OrgVdc -Org $Configs.Org.Name -Name $Configs.OrgVdc.Name | Select-Object Name, Enabled, CpuAllocationGhz, MemoryLimitGB, StorageLimitGB, AllocationModel, ThinProvisioned, UseFastProvisioning, `
|
Get-OrgVdc -Org $Configs.Org.Name -Name $Configs.OrgVdc.Name | Select-Object Name, Enabled, CpuAllocationGhz, MemoryLimitGB, StorageLimitGB, AllocationModel, ThinProvisioned, UseFastProvisioning, `
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#Requires -Version 4
|
Function New-MyEdgeGateway {
|
||||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
|
||||||
Function New-MyEdgeGateway {
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Creates a new Edge Gateway with Default Parameters
|
Creates a new Edge Gateway with Default Parameters
|
||||||
@@ -9,7 +7,6 @@ Function New-MyEdgeGateway {
|
|||||||
Creates a new Edge Gateway with Default Parameters
|
Creates a new Edge Gateway with Default Parameters
|
||||||
|
|
||||||
Default Parameters are:
|
Default Parameters are:
|
||||||
* Size
|
|
||||||
* HA State
|
* HA State
|
||||||
* DNS Relay
|
* DNS Relay
|
||||||
|
|
||||||
@@ -17,14 +14,14 @@ Function New-MyEdgeGateway {
|
|||||||
.NOTES
|
.NOTES
|
||||||
File Name : New-MyEdgeGateway.ps1
|
File Name : New-MyEdgeGateway.ps1
|
||||||
Author : Markus Kraus
|
Author : Markus Kraus
|
||||||
Version : 1.0
|
Version : 1.1
|
||||||
State : Ready
|
State : Ready
|
||||||
|
|
||||||
.LINK
|
.LINK
|
||||||
https://mycloudrevolution.com/
|
https://mycloudrevolution.com/
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
New-MyEdgeGateway -Name "TestEdge" -OrgVDCName "TestVDC" -OrgName "TestOrg" -ExternalNetwork "ExternalNetwork" -IPAddress "192.168.100.1" -SubnetMask "255.255.255.0" -Gateway "192.168.100.254" -IPRangeStart ""192.168.100.2" -IPRangeEnd ""192.168.100.3" -Verbose
|
New-MyEdgeGateway -Name "TestEdge" -OrgVDCName "TestVDC" -OrgName "TestOrg" -Size compact -ExternalNetwork "ExternalNetwork" -IPAddress "192.168.100.1" -SubnetMask "255.255.255.0" -Gateway "192.168.100.254" -IPRangeStart ""192.168.100.2" -IPRangeEnd ""192.168.100.3" -Verbose
|
||||||
|
|
||||||
.PARAMETER Name
|
.PARAMETER Name
|
||||||
Name of the New Edge Gateway as String
|
Name of the New Edge Gateway as String
|
||||||
@@ -35,6 +32,9 @@ Function New-MyEdgeGateway {
|
|||||||
.PARAMETER OrgName
|
.PARAMETER OrgName
|
||||||
Org where the new Edge Gateway should be created as string
|
Org where the new Edge Gateway should be created as string
|
||||||
|
|
||||||
|
.PARAMETER Size
|
||||||
|
Size of the new Edge Gateway as string
|
||||||
|
|
||||||
.PARAMETER ExternalNetwork
|
.PARAMETER ExternalNetwork
|
||||||
External Network of the new Edge Gateway as String
|
External Network of the new Edge Gateway as String
|
||||||
|
|
||||||
@@ -69,6 +69,10 @@ Function New-MyEdgeGateway {
|
|||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Org where the new Edge Gateway should be created as string")]
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Org where the new Edge Gateway should be created as string")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[String] $OrgName,
|
[String] $OrgName,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Size of the new Edge Gateway as string")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[ValidateSet("compact","full")]
|
||||||
|
[String] $Size,
|
||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="External Network of the New Edge Gateway as String")]
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="External Network of the New Edge Gateway as String")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[String] $ExternalNetwork,
|
[String] $ExternalNetwork,
|
||||||
@@ -113,7 +117,7 @@ Function New-MyEdgeGateway {
|
|||||||
$EdgeGateway.Name = $Name
|
$EdgeGateway.Name = $Name
|
||||||
$EdgeGateway.Configuration = New-Object VMware.VimAutomation.Cloud.Views.GatewayConfiguration
|
$EdgeGateway.Configuration = New-Object VMware.VimAutomation.Cloud.Views.GatewayConfiguration
|
||||||
#$EdgeGateway.Configuration.BackwardCompatibilityMode = $false
|
#$EdgeGateway.Configuration.BackwardCompatibilityMode = $false
|
||||||
$EdgeGateway.Configuration.GatewayBackingConfig = "compact"
|
$EdgeGateway.Configuration.GatewayBackingConfig = $Size
|
||||||
$EdgeGateway.Configuration.UseDefaultRouteForDnsRelay = $false
|
$EdgeGateway.Configuration.UseDefaultRouteForDnsRelay = $false
|
||||||
$EdgeGateway.Configuration.HaEnabled = $false
|
$EdgeGateway.Configuration.HaEnabled = $false
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#Requires -Version 4
|
Function New-MyOrg {
|
||||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
|
||||||
Function New-MyOrg {
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Creates a new vCD Org with Default Parameters
|
Creates a new vCD Org with Default Parameters
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#Requires -Version 4
|
Function New-MyOrgAdmin {
|
||||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
|
||||||
Function New-MyOrgAdmin {
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Creates a new vCD Org Admin with Default Parameters
|
Creates a new vCD Org Admin with Default Parameters
|
||||||
|
|||||||
166
Modules/VMware-vCD-Module/functions/New-MyOrgNetwork.psm1
Normal file
166
Modules/VMware-vCD-Module/functions/New-MyOrgNetwork.psm1
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
Function New-MyOrgNetwork {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Creates a new Org Network with Default Parameters
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
File Name : New-MyOrgNetwork.ps1
|
||||||
|
Author : Markus Kraus
|
||||||
|
Version : 1.1
|
||||||
|
State : Ready
|
||||||
|
|
||||||
|
.LINK
|
||||||
|
https://mycloudrevolution.com
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
New-MyOrgNetwork -Name Test -OrgVdcName "Test-OrgVDC" -OrgName "Test-Org" -EdgeName "Test-OrgEdge" -SubnetMask 255.255.255.0 -Gateway 192.168.66.1 -IPRangeStart 192.168.66.100 -IPRangeEnd 192.168.66.200
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
New-MyOrgNetwork -Name Test -OrgVdcName "Test-OrgVDC" -OrgName "Test-Org" -EdgeName "Test-OrgEdge" -SubnetMask 255.255.255.0 -Gateway 192.168.66.1 -IPRangeStart 192.168.66.100 -IPRangeEnd 192.168.66.200 -Shared:$False
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
$params = @{ 'Name' = 'Test';
|
||||||
|
'OrgVdcName'= 'Test-OrgVDC';
|
||||||
|
'OrgName'='Test-Org';
|
||||||
|
'EdgeName'='Test-OrgEdge';
|
||||||
|
'SubnetMask' = '255.255.255.0';
|
||||||
|
'Gateway' = '192.168.66.1';
|
||||||
|
'IPRangeStart' = '192.168.66.100';
|
||||||
|
'IPRangeEnd' = '192.168.66.200'
|
||||||
|
}
|
||||||
|
New-MyOrgNetwork @params -Verbose
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
Name of the New Org Network as String
|
||||||
|
|
||||||
|
.PARAMETER OrgVDCName
|
||||||
|
OrgVDC where the new Org Network should be created as string
|
||||||
|
|
||||||
|
.PARAMETER OrgName
|
||||||
|
Org where the newOrg Networkshould be created as string
|
||||||
|
|
||||||
|
.PARAMETER EdgeName
|
||||||
|
Edge Gateway Name for the new Org Network as String
|
||||||
|
|
||||||
|
.PARAMETER SubnetMask
|
||||||
|
Subnet Mask of the New Org Network as IP Address
|
||||||
|
|
||||||
|
.PARAMETER Gateway
|
||||||
|
Gateway of the New Org Network as IP Address
|
||||||
|
|
||||||
|
.PARAMETER IPRangeStart
|
||||||
|
IP Range Start of the New Org Network as IP Address
|
||||||
|
|
||||||
|
.PARAMETER IPRangeEnd
|
||||||
|
IP Range End of the New Org Network as IP Address
|
||||||
|
|
||||||
|
.PARAMETER Shared
|
||||||
|
Switch for Shared OrgVDC Network
|
||||||
|
|
||||||
|
Default: $True
|
||||||
|
|
||||||
|
.PARAMETER Timeout
|
||||||
|
Timeout for the Org Network to become Ready
|
||||||
|
|
||||||
|
Default: 120s
|
||||||
|
|
||||||
|
#>
|
||||||
|
Param (
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Name of the New Org Network as String")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[String] $Name,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="OrgVDC where the new Org Network should be created as string")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[String] $OrgVdcName,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Org where the new Org Network should be created as string")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[String] $OrgName,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Edge Gateway Name for the new Org Network as String")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[String] $EdgeName,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Subnet Mask of the New Org Network as IP Address")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[IPAddress] $SubnetMask,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Gateway of the New Org Network as IP Address")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[IPAddress] $Gateway,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="IP Range Start the New Org Network as IP Address")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[IPAddress] $IPRangeStart,
|
||||||
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="IP Range End the New Org Network as IP Address")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[IPAddress] $IPRangeEnd,
|
||||||
|
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="Switch for Shared OrgVDC Network")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[Bool] $Shared = $True,
|
||||||
|
[Parameter(Mandatory=$False, ValueFromPipeline=$False,HelpMessage="Timeout for the Org Network to become Ready")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[int] $Timeout = 120
|
||||||
|
)
|
||||||
|
Process {
|
||||||
|
|
||||||
|
## Get Org vDC
|
||||||
|
Write-Verbose "Get Org vDC"
|
||||||
|
[Array] $orgVdc = Get-Org -Name $OrgName | Get-OrgVdc -Name $OrgVdcName
|
||||||
|
|
||||||
|
if ( $orgVdc.Count -gt 1) {
|
||||||
|
throw "Multiple OrgVdcs found!"
|
||||||
|
}
|
||||||
|
elseif ( $orgVdc.Count -lt 1) {
|
||||||
|
throw "No OrgVdc found!"
|
||||||
|
}
|
||||||
|
$orgVdcView = $orgVdc| Get-CIView
|
||||||
|
|
||||||
|
## Get EdgeGateway
|
||||||
|
Write-Verbose "Get EdgeGateway"
|
||||||
|
[Array] $edgeGateway = Search-Cloud -QueryType EdgeGateway -Name $EdgeName | Get-CIView
|
||||||
|
if ( $edgeGateway.Count -gt 1) {
|
||||||
|
throw "Multiple EdgeGateways found!"
|
||||||
|
}
|
||||||
|
elseif ( $edgeGateway.Count -lt 1) {
|
||||||
|
throw "No EdgeGateway found!"
|
||||||
|
}
|
||||||
|
|
||||||
|
## Define Org Network
|
||||||
|
Write-Verbose "Define Org Network"
|
||||||
|
$OrgNetwork = new-object vmware.vimautomation.cloud.views.orgvdcnetwork
|
||||||
|
$OrgNetwork.name = $Name
|
||||||
|
$OrgNetwork.edgegateway = $edgeGateway.id
|
||||||
|
$OrgNetwork.isshared = $Shared
|
||||||
|
|
||||||
|
$OrgNetwork.configuration = new-object vmware.vimautomation.cloud.views.networkconfiguration
|
||||||
|
$OrgNetwork.configuration.fencemode = "natRouted"
|
||||||
|
$OrgNetwork.configuration.ipscopes = new-object vmware.vimautomation.cloud.views.ipscopes
|
||||||
|
|
||||||
|
$Scope = new-object vmware.vimautomation.cloud.views.ipScope
|
||||||
|
$Scope.gateway = $Gateway
|
||||||
|
$Scope.netmask = $SubnetMask
|
||||||
|
|
||||||
|
$Scope.ipranges = new-object vmware.vimautomation.cloud.views.ipranges
|
||||||
|
$Scope.ipranges.iprange = new-object vmware.vimautomation.cloud.views.iprange
|
||||||
|
$Scope.ipranges.iprange[0].startaddress = $IPRangeStart
|
||||||
|
$Scope.ipranges.iprange[0].endaddress = $IPRangeEnd
|
||||||
|
|
||||||
|
$OrgNetwork.configuration.ipscopes.ipscope += $Scope
|
||||||
|
|
||||||
|
## Create Org Network
|
||||||
|
Write-Verbose "Create Org Network"
|
||||||
|
$CreateOrgNetwork = $orgVdcView.CreateNetwork($OrgNetwork)
|
||||||
|
|
||||||
|
## Wait for Org Network to become Ready
|
||||||
|
Write-Verbose "Wait for Org Network to become Ready"
|
||||||
|
while(!(Get-OrgVdcNetwork -Id $CreateOrgNetwork.Id -ErrorAction SilentlyContinue)){
|
||||||
|
$i++
|
||||||
|
Start-Sleep 5
|
||||||
|
if($i -gt $Timeout) { Write-Error "Creating Org Network."; break}
|
||||||
|
Write-Progress -Activity "Creating Org Network" -Status "Wait for Network to become Ready..."
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Creating Org Network" -Completed
|
||||||
|
Start-Sleep 1
|
||||||
|
|
||||||
|
Get-OrgVdcNetwork -Id $CreateOrgNetwork.Id | Select-Object Name, OrgVdc, NetworkType, DefaultGateway, Netmask, StaticIPPool, @{ N='isShared'; E = {$_.ExtensionData.isShared} } | Format-Table -AutoSize
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
#Requires -Version 4
|
Function New-MyOrgVdc {
|
||||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
|
||||||
Function New-MyOrgVdc {
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Creates a new vCD Org VDC with Default Parameters
|
Creates a new vCD Org VDC with Default Parameters
|
||||||
@@ -9,7 +7,6 @@ Function New-MyOrgVdc {
|
|||||||
Creates a new vCD Org VDC with Default Parameters
|
Creates a new vCD Org VDC with Default Parameters
|
||||||
|
|
||||||
Default Parameters are:
|
Default Parameters are:
|
||||||
* Allocation Model
|
|
||||||
* Network Quota
|
* Network Quota
|
||||||
* VM Quota
|
* VM Quota
|
||||||
* 'vCpu In Mhz'
|
* 'vCpu In Mhz'
|
||||||
@@ -20,27 +17,38 @@ Function New-MyOrgVdc {
|
|||||||
.NOTES
|
.NOTES
|
||||||
File Name : New-MyOrgVdc.ps1
|
File Name : New-MyOrgVdc.ps1
|
||||||
Author : Markus Kraus
|
Author : Markus Kraus
|
||||||
Version : 1.2
|
Version : 1.3
|
||||||
State : Ready
|
State : Ready
|
||||||
|
|
||||||
.LINK
|
.LINK
|
||||||
https://mycloudrevolution.com/
|
https://mycloudrevolution.com/
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
New-MyOrgVdc -Name "TestVdc" -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg" -ExternalNetwork "External_OrgVdcNet"
|
New-MyOrgVdc -Name "TestVdc" -AllocationModel AllocationPool -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg" -ExternalNetwork "External_OrgVdcNet"
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
New-MyOrgVdc -Name "TestVdc" -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg"
|
New-MyOrgVdc -Name "TestVdc" -AllocationModel AllocationVApp -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg"
|
||||||
|
|
||||||
.PARAMETER Name
|
.PARAMETER Name
|
||||||
Name of the New Org VDC as String
|
Name of the New Org VDC as String
|
||||||
|
|
||||||
|
.PARAMETER AllocationModel
|
||||||
|
Allocation Model of the New Org VDC as String
|
||||||
|
|
||||||
.PARAMETER CPULimit
|
.PARAMETER CPULimit
|
||||||
CPU Limit (MHz) of the New Org VDC as String
|
CPU Limit (MHz) of the New Org VDC as String
|
||||||
|
|
||||||
|
Default: 0 (Unlimited)
|
||||||
|
|
||||||
|
Note: If AllocationModel is not AllocationVApp (Pay as you go), a limit needs to be set
|
||||||
|
|
||||||
.PARAMETER MEMLimit
|
.PARAMETER MEMLimit
|
||||||
Memory Limit (MB) of the New Org VDC as String
|
Memory Limit (MB) of the New Org VDC as String
|
||||||
|
|
||||||
|
Default: 0 (Unlimited)
|
||||||
|
|
||||||
|
Note: If AllocationModel is not AllocationVApp (Pay as you go), a limit needs to be set
|
||||||
|
|
||||||
.PARAMETER StorageLimit
|
.PARAMETER StorageLimit
|
||||||
Storage Limit (MB) of the New Org VDC as String
|
Storage Limit (MB) of the New Org VDC as String
|
||||||
|
|
||||||
@@ -76,12 +84,16 @@ Function New-MyOrgVdc {
|
|||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Name of the New Org VDC as String")]
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Name of the New Org VDC as String")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[String] $Name,
|
[String] $Name,
|
||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="CPU Limit (MHz) of the New Org VDC as String")]
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Allocation Model of the New Org VDC as String")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[int] $CPULimit,
|
[ValidateSet("AllocationPool","AllocationVApp")]
|
||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Memory Limit (MB) of the New Org VDC as String")]
|
[String] $AllocationModel,
|
||||||
|
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="CPU Limit (MHz) of the New Org VDC as String")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[int] $MEMLimit,
|
[int] $CPULimit = 0,
|
||||||
|
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="Memory Limit (MB) of the New Org VDC as String")]
|
||||||
|
[ValidateNotNullorEmpty()]
|
||||||
|
[int] $MEMLimit = 0,
|
||||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Storage Limit (MB) of the New Org VDC as String")]
|
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Storage Limit (MB) of the New Org VDC as String")]
|
||||||
[ValidateNotNullorEmpty()]
|
[ValidateNotNullorEmpty()]
|
||||||
[int] $StorageLimit,
|
[int] $StorageLimit,
|
||||||
@@ -117,7 +129,7 @@ Function New-MyOrgVdc {
|
|||||||
$providerVdcRef = New-Object VMware.VimAutomation.Cloud.Views.Reference
|
$providerVdcRef = New-Object VMware.VimAutomation.Cloud.Views.Reference
|
||||||
$providerVdcRef.Href = $OrgVdcproviderVdc.Href
|
$providerVdcRef.Href = $OrgVdcproviderVdc.Href
|
||||||
$adminVdc.ProviderVdcReference = $providerVdcRef
|
$adminVdc.ProviderVdcReference = $providerVdcRef
|
||||||
$adminVdc.AllocationModel = "AllocationPool"
|
$adminVdc.AllocationModel = $AllocationModel
|
||||||
$adminVdc.ComputeCapacity = New-Object VMware.VimAutomation.Cloud.Views.ComputeCapacity
|
$adminVdc.ComputeCapacity = New-Object VMware.VimAutomation.Cloud.Views.ComputeCapacity
|
||||||
$adminVdc.ComputeCapacity.Cpu = New-Object VMware.VimAutomation.Cloud.Views.CapacityWithUsage
|
$adminVdc.ComputeCapacity.Cpu = New-Object VMware.VimAutomation.Cloud.Views.CapacityWithUsage
|
||||||
$adminVdc.ComputeCapacity.Cpu.Units = "MHz"
|
$adminVdc.ComputeCapacity.Cpu.Units = "MHz"
|
||||||
@@ -132,8 +144,8 @@ Function New-MyOrgVdc {
|
|||||||
$adminVdc.StorageCapacity.Limit = $StorageLimit
|
$adminVdc.StorageCapacity.Limit = $StorageLimit
|
||||||
$adminVdc.NetworkQuota = 10
|
$adminVdc.NetworkQuota = 10
|
||||||
$adminVdc.VmQuota = 0
|
$adminVdc.VmQuota = 0
|
||||||
$adminVdc.VCpuInMhz = 1000
|
$adminVdc.VCpuInMhz = 2000
|
||||||
$adminVdc.VCpuInMhz2 = 1000
|
$adminVdc.VCpuInMhz2 = 2000
|
||||||
$adminVdc.UsesFastProvisioning = $false
|
$adminVdc.UsesFastProvisioning = $false
|
||||||
$adminVdc.IsThinProvision = $true
|
$adminVdc.IsThinProvision = $true
|
||||||
|
|
||||||
@@ -143,20 +155,21 @@ Function New-MyOrgVdc {
|
|||||||
$orgVdc = $orgED.CreateVdc($adminVdc)
|
$orgVdc = $orgED.CreateVdc($adminVdc)
|
||||||
|
|
||||||
## Wait for getting Ready
|
## Wait for getting Ready
|
||||||
Write-Verbose "Wait for getting Ready"
|
Write-Verbose "Wait for OrgVdc getting Ready after creation"
|
||||||
$i = 0
|
$i = 0
|
||||||
while(($orgVdc = Get-OrgVdc -Name $Name -Verbose:$false).Status -eq "NotReady"){
|
while(($orgVdc = Get-OrgVdc -Name $Name -Verbose:$false).Status -eq "NotReady"){
|
||||||
$i++
|
$i++
|
||||||
Start-Sleep 2
|
Start-Sleep 2
|
||||||
if($i -gt $Timeout) { Write-Error "Creating Org Failed."; break}
|
if($i -gt $Timeout) { Write-Error "Creating OrgVdc Failed."; break}
|
||||||
Write-Progress -Activity "Creating Org" -Status "Wait for Org to become Ready..."
|
Write-Progress -Activity "Creating OrgVdc" -Status "Wait for OrgVdc to become Ready..."
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Creating Org" -Completed
|
Write-Progress -Activity "Creating OrgVdc" -Completed
|
||||||
Start-Sleep 2
|
Start-Sleep 2
|
||||||
|
|
||||||
## Search given Storage Profile
|
## Search given Storage Profile
|
||||||
Write-Verbose "Search given Storage Profile"
|
Write-Verbose "Search given Storage Profile"
|
||||||
$ProVdcStorageProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name $StorageProfile | Get-CIView
|
$Filter = "ProviderVdc==" + $OrgVdcproviderVdc.Id
|
||||||
|
$ProVdcStorageProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name $StorageProfile -Filter $Filter | Get-CIView
|
||||||
|
|
||||||
## Create Storage Profile Object with Settings
|
## Create Storage Profile Object with Settings
|
||||||
Write-Verbose "Create Storage Profile Object with Settings"
|
Write-Verbose "Create Storage Profile Object with Settings"
|
||||||
@@ -174,14 +187,14 @@ Function New-MyOrgVdc {
|
|||||||
$orgVdc.ExtensionData.CreateVdcStorageProfile($UpdateParams)
|
$orgVdc.ExtensionData.CreateVdcStorageProfile($UpdateParams)
|
||||||
|
|
||||||
## Wait for getting Ready
|
## Wait for getting Ready
|
||||||
Write-Verbose "Wait for getting Ready"
|
Write-Verbose "Wait for OrgVdc getting Ready after update"
|
||||||
while(($orgVdc = Get-OrgVdc -Name $name -Verbose:$false).Status -eq "NotReady"){
|
while(($orgVdc = Get-OrgVdc -Name $name -Verbose:$false).Status -eq "NotReady"){
|
||||||
$i++
|
$i++
|
||||||
Start-Sleep 1
|
Start-Sleep 1
|
||||||
if($i -gt $Timeout) { Write-Error "Update Org Failed."; break}
|
if($i -gt $Timeout) { Write-Error "Update OrgVdc Failed."; break}
|
||||||
Write-Progress -Activity "Updating Org" -Status "Wait for Org to become Ready..."
|
Write-Progress -Activity "Updating OrgVdc" -Status "Wait for OrgVdc to become Ready..."
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Updating Org" -Completed
|
Write-Progress -Activity "Updating OrgVdc" -Completed
|
||||||
Start-Sleep 1
|
Start-Sleep 1
|
||||||
|
|
||||||
## Search Any-StorageProfile
|
## Search Any-StorageProfile
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ The Add-HVDesktop adds virtual machines to already exiting pools by using view A
|
|||||||
if (!$confirmFlag -OR $pscmdlet.ShouldProcess($machines)) {
|
if (!$confirmFlag -OR $pscmdlet.ShouldProcess($machines)) {
|
||||||
$desktop_service_helper.Desktop_AddMachinesToManualDesktop($services,$id,$machineList)
|
$desktop_service_helper.Desktop_AddMachinesToManualDesktop($services,$id,$machineList)
|
||||||
}
|
}
|
||||||
return $machineList
|
write-host "Successfully added desktop(s) to pool"
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
Write-Error "Only Automated/Manual pool types support this add operation"
|
Write-Error "Only Automated/Manual pool types support this add operation"
|
||||||
@@ -448,7 +448,7 @@ function Add-HVRDSServer {
|
|||||||
if (!$confirmFlag -OR $pscmdlet.ShouldProcess($rdsServers)) {
|
if (!$confirmFlag -OR $pscmdlet.ShouldProcess($rdsServers)) {
|
||||||
$farm_service_helper.Farm_AddRDSServers($services, $id, $serverList)
|
$farm_service_helper.Farm_AddRDSServers($services, $id, $serverList)
|
||||||
}
|
}
|
||||||
return $serverList
|
write-host "Successfully added RDS Server(s) to Farm"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "Failed to Add RDS Server to Farm with error: $_"
|
Write-Error "Failed to Add RDS Server to Farm with error: $_"
|
||||||
break
|
break
|
||||||
@@ -5101,7 +5101,7 @@ function Get-HVPoolStorageObject {
|
|||||||
$storageObject.Datastores = Get-HVDatastore -DatastoreInfoList $datastoreList -DatastoreNames $datastores -DsStorageOvercommit $StorageOvercommit
|
$storageObject.Datastores = Get-HVDatastore -DatastoreInfoList $datastoreList -DatastoreNames $datastores -DsStorageOvercommit $StorageOvercommit
|
||||||
if ($useSeparateDatastoresReplicaAndOSDisks) {
|
if ($useSeparateDatastoresReplicaAndOSDisks) {
|
||||||
$storageObject.ViewComposerStorageSettings.UseSeparateDatastoresReplicaAndOSDisks = $UseSeparateDatastoresReplicaAndOSDisks
|
$storageObject.ViewComposerStorageSettings.UseSeparateDatastoresReplicaAndOSDisks = $UseSeparateDatastoresReplicaAndOSDisks
|
||||||
$storageObject.ViewComposerStorageSettings.ReplicaDiskDatastore = ($datastoreInfoList | Where-Object { ($_.datastoredata.name -eq $replicaDiskDatastore) -or ($_.datastoredata.path -eq $replicaDiskDatastore)}).id
|
$storageObject.ViewComposerStorageSettings.ReplicaDiskDatastore = ($datastoreList | Where-Object { ($_.datastoredata.name -eq $replicaDiskDatastore) -or ($_.datastoredata.path -eq $replicaDiskDatastore)}).id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($storageObject.Datastores.Count -eq 0) {
|
if ($storageObject.Datastores.Count -eq 0) {
|
||||||
@@ -9233,10 +9233,10 @@ $query_service_helper = New-Object VMware.Hv.GlobalSessionQueryServiceService
|
|||||||
$query=new-object vmware.hv.GlobalSessionQueryServiceQuerySpec
|
$query=new-object vmware.hv.GlobalSessionQueryServiceQuerySpec
|
||||||
|
|
||||||
$SessionList = @()
|
$SessionList = @()
|
||||||
$GetNext = $false
|
|
||||||
foreach ($pod in $services.Pod.Pod_List()) {
|
foreach ($pod in $services.Pod.Pod_List()) {
|
||||||
$query.pod=$pod.id
|
$query.pod=$pod.id
|
||||||
$queryResults = $query_service_helper.GlobalSessionQueryService_QueryWithSpec($services, $query)
|
$queryResults = $query_service_helper.GlobalSessionQueryService_QueryWithSpec($services, $query)
|
||||||
|
$GetNext = $false
|
||||||
do {
|
do {
|
||||||
if ($GetNext) { $queryResults = $query_service_helper.GlobalSessionQueryService_GetNext($services, $queryResults.id) }
|
if ($GetNext) { $queryResults = $query_service_helper.GlobalSessionQueryService_GetNext($services, $queryResults.id) }
|
||||||
$SessionList += $queryResults.results
|
$SessionList += $queryResults.results
|
||||||
@@ -9989,5 +9989,902 @@ function Reset-HVMachine {
|
|||||||
$services.machine.Machine_ResetMachines($machine.id)
|
$services.machine.Machine_ResetMachines($machine.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function Remove-HVMachine(){
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Remove a Horizon View desktop or desktops.
|
||||||
|
|
||||||
Export-ModuleMember Add-HVDesktop,Add-HVRDSServer,Connect-HVEvent,Disconnect-HVEvent,Get-HVPoolSpec,Get-HVInternalName, Get-HVEvent,Get-HVFarm,Get-HVFarmSummary,Get-HVPool,Get-HVPoolSummary,Get-HVMachine,Get-HVMachineSummary,Get-HVQueryResult,Get-HVQueryFilter,New-HVFarm,New-HVPool,Remove-HVFarm,Remove-HVPool,Set-HVFarm,Set-HVPool,Start-HVFarm,Start-HVPool,New-HVEntitlement,Get-HVEntitlement,Remove-HVEntitlement, Set-HVMachine, New-HVGlobalEntitlement, Remove-HVGlobalEntitlement, Get-HVGlobalEntitlement, Set-HVApplicationIcon, Remove-HVApplicationIcon, Get-HVGlobalSettings, Set-HVGlobalSettings, Set-HVGlobalEntitlement, Get-HVResourceStructure, Get-hvlocalsession, Get-HVGlobalSession, Reset-HVMachine
|
.DESCRIPTION
|
||||||
|
Deletes a VM or an array of VM's from Horizon. Utilizes an Or query filter to match machine names.
|
||||||
|
|
||||||
|
.PARAMETER HVServer
|
||||||
|
The Horizon server where the machine to be deleted resides.Parameter is not mandatory,
|
||||||
|
but if you do not specify the server, than make sure you are connected to a Horizon server
|
||||||
|
first with connect-hvserver.
|
||||||
|
|
||||||
|
.PARAMETER MachineNames
|
||||||
|
The name or names of the machine(s) to be deleted. Accepts a single VM or an array of VM names.This is a mandatory parameter.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
remove-HVMachine -HVServer 'horizonserver123' -MachineNames 'LAX-WIN10-002'
|
||||||
|
Deletes VM 'LAX-WIN10-002' from HV Server 'horizonserver123'
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
remove-HVMachine -HVServer 'horizonserver123' -MachineNames $machines
|
||||||
|
Deletes VM's contained within an array of machine names from HV Server 'horizonserver123'
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Jose Rodriguez
|
||||||
|
Author email : jrodsguitar@gmail.com
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.1.1
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $true,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[array]
|
||||||
|
$MachineNames,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HVServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
#Connect to HV Server
|
||||||
|
$services = Get-ViewAPIService -HVServer $HVServer
|
||||||
|
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
#Connect to Query Service
|
||||||
|
$queryService = New-Object 'Vmware.Hv.QueryServiceService'
|
||||||
|
#QUery Definition
|
||||||
|
$queryDefinition = New-Object 'Vmware.Hv.QueryDefinition'
|
||||||
|
#Query Filter
|
||||||
|
$queryDefinition.queryEntityType = 'MachineNamesView'
|
||||||
|
|
||||||
|
#Create Filter Set so we can populate it with QueryFilterEquals data
|
||||||
|
[VMware.Hv.queryfilter[]]$filterSet = @()
|
||||||
|
foreach($machine in $machineNames){
|
||||||
|
|
||||||
|
#queryfilter values
|
||||||
|
$queryFilterEquals = New-Object VMware.Hv.QueryFilterEquals
|
||||||
|
$queryFilterEquals.memberName = "base.name"
|
||||||
|
$queryFilterEquals.value = "$machine"
|
||||||
|
|
||||||
|
$filterSet += $queryFilterEquals
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#Or Filter
|
||||||
|
$orFilter = New-Object VMware.Hv.QueryFilterOr
|
||||||
|
$orFilter.filters = $filterSet
|
||||||
|
|
||||||
|
#Set Definition filter to value of $orfilter
|
||||||
|
$queryDefinition.filter = $orFilter
|
||||||
|
|
||||||
|
#Retrieve query results. Returns all machines to be deleted
|
||||||
|
$queryResults = $queryService.QueryService_Query($services,$queryDefinition)
|
||||||
|
|
||||||
|
#Assign VM Object to variable
|
||||||
|
$deleteThisMachine = $queryResults.Results
|
||||||
|
|
||||||
|
#Machine Service
|
||||||
|
$machineService = new-object VMware.Hv.MachineService
|
||||||
|
|
||||||
|
#Get Machine Service machine object
|
||||||
|
$deleteMachine = $machineService.Machine_GetInfos($services,$deleteThisMachine.Id)
|
||||||
|
|
||||||
|
#If sessions exist on the machines we are going to delete than force kill those sessions.
|
||||||
|
#The deleteMachines method will not work if there are any existing sessions so this step is very important.
|
||||||
|
write-host "Attemtping log off of machines"
|
||||||
|
|
||||||
|
if($deleteMachine.base.session.id){
|
||||||
|
$trys = 0
|
||||||
|
|
||||||
|
do{
|
||||||
|
foreach($session in $deleteMachine.base.session){
|
||||||
|
|
||||||
|
$sessions = $null
|
||||||
|
[VMware.Hv.SessionId[]]$sessions += $session
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
write-host "`n"
|
||||||
|
write-host "Attemtping log off of machines"
|
||||||
|
write-host "`n"
|
||||||
|
$logOffSession = new-object 'VMware.Hv.SessionService'
|
||||||
|
$logOffSession.Session_LogoffSessionsForced($services,$sessions)
|
||||||
|
|
||||||
|
#Wait more for Sessions to end
|
||||||
|
|
||||||
|
Start-Sleep -Seconds 5
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
catch{
|
||||||
|
|
||||||
|
Write-Host "Attempted to Log Off Sessions from below machines but recieved an error. This doesn't usually mean it failed. Typically the session is succesfully logged off but takes some time"
|
||||||
|
write-host "`n"
|
||||||
|
write-host ($deleteMachine.base.Name -join "`n")
|
||||||
|
|
||||||
|
start-sleep -seconds 5
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(($trys -le 10)){
|
||||||
|
|
||||||
|
write-host "`n"
|
||||||
|
write-host "Retrying Logoffs: $trys times"
|
||||||
|
#Recheck existing sessions
|
||||||
|
$deleteMachine = $machineService.Machine_GetInfos($services,$deleteThisMachine.Id)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$trys++
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
until((!$deleteMachine.base.session.id) -or ($trys -gt 10))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#Create delete spec for the DeleteMachines method
|
||||||
|
$deleteSpec = [VMware.Hv.MachineDeleteSpec]::new()
|
||||||
|
$deleteSpec.DeleteFromDisk = $true
|
||||||
|
$deleteSpec.ArchivePersistentDisk = $false
|
||||||
|
|
||||||
|
#Delete the machines
|
||||||
|
write-host "Attempting to Delete:"
|
||||||
|
Write-Output ($deleteMachine.base.Name -join "`n")
|
||||||
|
$bye = $machineService.Machine_DeleteMachines($services,$deleteMachine.id,$deleteSpec)
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get-hvhealth {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Pulls health information from Horizon View
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Queries and returns health information from the local Horizon Pod
|
||||||
|
|
||||||
|
.PARAMETER Servicename
|
||||||
|
The name of the service to query the health for.
|
||||||
|
This will default to Connection server health.
|
||||||
|
Available services are ADDomain,CertificateSSOConnector,ConnectionServer,EventDatabase,SAMLAuthenticator,SecurityServer,ViewComposer,VirtualCenter,Pod
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
get-hvhealth -service connectionserver
|
||||||
|
Returns health for the connectionserver(s)
|
||||||
|
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
get-hvhealth -service ViewComposer
|
||||||
|
Returns health for the View composer server(s)
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $true,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[ValidateSet('ADDomain', 'CertificateSSOConnector', 'ConnectionServer', 'EventDatabase', 'SAMLAuthenticator', 'SecurityServer', 'ViewComposer', 'VirtualCenter', 'pod')]
|
||||||
|
[string]
|
||||||
|
$Servicename = 'ConnectionServer',
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($Servicename) {
|
||||||
|
'ADDomain' {
|
||||||
|
$healthinfo=$services.ADDomainHealth.ADDomainHealth_List()
|
||||||
|
}
|
||||||
|
'CertificateSSOConnector' {
|
||||||
|
$healthinfo=$services.CertificateSSOConnectorHealth.CertificateSSOConnectorHealth_list()
|
||||||
|
}
|
||||||
|
'ConnectionServer' {
|
||||||
|
$healthinfo=$services.ConnectionServerHealth.ConnectionServerHealth_list()
|
||||||
|
}
|
||||||
|
'EventDatabase' {
|
||||||
|
$healthinfo=$services.EventDatabaseHealth.EventDatabaseHealth_Get()
|
||||||
|
}
|
||||||
|
'SAMLAuthenticator' {
|
||||||
|
$healthinfo=$services.SAMLAuthenticatorHealth.SAMLAuthenticatorHealth_List()
|
||||||
|
}
|
||||||
|
'SecurityServer' {
|
||||||
|
$healthinfo=$services.SecurityServerHealth.SecurityServerHealth_List()
|
||||||
|
}
|
||||||
|
'ViewComposer' {
|
||||||
|
$healthinfo=$services.ViewComposerHealth.ViewComposerHealth_List()
|
||||||
|
}
|
||||||
|
'VirtualCenter' {
|
||||||
|
$healthinfo=$services.VirtualCenterHealth.VirtualCenterHealth_List()
|
||||||
|
}
|
||||||
|
'Pod' {
|
||||||
|
$healthinfo=$services.podhealth.PodHealth_List()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($healthinfo){
|
||||||
|
return $healthinfo
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Output "No healthdata found for the $servicename service"
|
||||||
|
}
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function new-hvpodfederation {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Initiates a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Starts the initialisation of a Horizon View Pod Federation. Other pod's can be joined to this federation to form the Cloud Pod Architecture
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
new-hvpodfederation
|
||||||
|
Returns health for the connectionserver(s)
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$services.PodFederation.PodFederation_Initialize()
|
||||||
|
|
||||||
|
Write-Output "The Pod Federation has been initiated. Please wait a couple of minutes and refresh any open admin consoles to use the newly available functionality."
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove-hvpodfederation {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Uninitiates a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Starts the uninitialisation of a Horizon View Pod Federation. It does NOT remove a pod from a federation.
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Starts the Uninitiates a Horizon View Pod Federation.
|
||||||
|
Unintialises
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$services.PodFederation.PodFederation_Uninitialize()
|
||||||
|
|
||||||
|
Write-Output "The uninitialisation of the Pod Federation has been started. Please wait a couple of minutes and refresh any open admin consoles to see the results."
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function get-hvpodfederation {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Returns information about a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns information about a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
get-hvpodfederation
|
||||||
|
Returns information about a Horizon View Pod Federation
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$podfederationinfo=$services.PodFederation.PodFederation_Get()
|
||||||
|
return $podfederationinfo
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function register-hvpod {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Registers a pod in a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Registers a pod in a Horizon View Pod Federation. You have to be connected to the pod you are joining to the federation.
|
||||||
|
|
||||||
|
.PARAMETER ADUserName
|
||||||
|
User principal name of user this is required to be in the domain\username format
|
||||||
|
|
||||||
|
.PARAMETER remoteconnectionserver
|
||||||
|
Servername of a connectionserver that already belongs to the PodFederation
|
||||||
|
|
||||||
|
.PARAMETER ADPassword
|
||||||
|
Password of the type Securestring. Can be created with:
|
||||||
|
$password = Read-Host 'Domain Password' -AsSecureString
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
C:\PS>$adpassword = Read-Host 'Domain Password' -AsSecureString
|
||||||
|
C:\PS>register-hvpod -remoteconnectionserver "servername" -username "user\domain" -password $adpassword
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
register-hvpod -remoteconnectionserver "servername" -username "user\domain"
|
||||||
|
It will now ask for the password
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[String]
|
||||||
|
$remoteconnectionserver,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[ValidatePattern("^.+?[@\\].+?$")]
|
||||||
|
[String]
|
||||||
|
$ADUserName,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[securestring]
|
||||||
|
$ADpassword,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ($ADPassword -eq $null) {
|
||||||
|
#$ADPassword= Read-Host 'Please provide the Active Directory password for user $AdUsername' -AsSecureString
|
||||||
|
#}
|
||||||
|
|
||||||
|
$temppw = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($ADPassword)
|
||||||
|
$PlainPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($temppw)
|
||||||
|
$plainpassword
|
||||||
|
$vcPassword = New-Object VMware.Hv.SecureString
|
||||||
|
$enc = [system.Text.Encoding]::UTF8
|
||||||
|
$vcPassword.Utf8String = $enc.GetBytes($PlainPassword)
|
||||||
|
|
||||||
|
$services.PodFederation.PodFederation_join($remoteconnectionserver,$adusername,$vcpassword)
|
||||||
|
write-host "This pod has been joined to the podfederation."
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function unregister-hvpod {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Removes a pod from a podfederation
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Starts the uninitialisation of a Horizon View Pod Federation. It does NOT remove a pod from a federation.
|
||||||
|
|
||||||
|
.PARAMETER Podname
|
||||||
|
The name of the pod to be removed.
|
||||||
|
|
||||||
|
.PARAMETER Force
|
||||||
|
This can be used to forcefully remove a pod from the pod federation. This can only be done while connected to one of the other pods in the federation
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Unregister-hvpod -podname PODNAME
|
||||||
|
Checks if you are connected to the pod and gracefully unregisters it from the podfedaration
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Unregister-hvpod -podname PODNAME -force
|
||||||
|
Checks if you are connected to the pod and gracefully unregisters it from the podfedaration
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$PodName,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[bool]
|
||||||
|
$force,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$pods=$services.pod.pod_list()
|
||||||
|
$pod=$pods | where-object {$_.displayname -like "$podname"}
|
||||||
|
if ($force -eq $false){
|
||||||
|
if ($pod.localpod -eq $False){
|
||||||
|
Write-Error "You can only gracefully remove a pod when connected to that pod, please connect to a connection server in pod $podname"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
elseif ($pod.localpod -eq $True){
|
||||||
|
write-host "Gracefully removing $podname from the federation"
|
||||||
|
$services.PodFederation.PodFederation_Unjoin()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($force -eq $true){
|
||||||
|
if ($pod.localpod -eq $True){
|
||||||
|
Write-Error "You can only forcefully remove a pod when connected to a different pod, please connect to a connection server in another pod then $podname"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
elseif ($pod.localpod -eq $false){
|
||||||
|
write-host "Forcefully removing $podname from the federation"
|
||||||
|
$services.PodFederation.PodFederation_eject($pod.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function set-hvpodfederation {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Used to change the name of a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Used to change the name of a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
The new name of the Pod Federation.
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
set-hvpodfederation -name "New Name"
|
||||||
|
Will update the name of the current podfederation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$name,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$podservice=new-object vmware.hv.podfederationservice
|
||||||
|
$podservicehelper=$podservice.read($services)
|
||||||
|
$podservicehelper.getDatahelper().setdisplayname($name)
|
||||||
|
$podservice.update($services, $podservicehelper)
|
||||||
|
get-hvpodfederation
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function get-hvsite {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
get-hvsite
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$hvsites=$services1.site.site_list()
|
||||||
|
return $hvsites
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function new-hvsite {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Creates a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Creates a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
Name of the site (required)
|
||||||
|
|
||||||
|
.PARAMETER Description
|
||||||
|
Description of the site (required)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
new-hvsite -name "NAME" -description "DESCRIPTION"
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$name,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$description,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$sitebase=new-object vmware.hv.sitebase
|
||||||
|
$sitebase.displayname=$name
|
||||||
|
$sitebase.description=$description
|
||||||
|
$services.site.site_create($sitebase)
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function set-hvsite {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER Sitename
|
||||||
|
Name of the site to be edited
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
New name of the site (required)
|
||||||
|
|
||||||
|
.PARAMETER Description
|
||||||
|
New description of the site (required)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
set-hvsite -site "CURRENTSITENAME" -name "NAME" -description "DESCRIPTION"
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$sitename,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$name,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$description,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$siteid=$services1.site.site_list() | where-object {$_.base.displayname -like $sitename}
|
||||||
|
$siteservice=new-object vmware.hv.siteservice
|
||||||
|
$sitebasehelper=$siteservice.read($services, $siteid.id)
|
||||||
|
$sitebasehelper.getbasehelper().setdisplayname($name)
|
||||||
|
$sitebasehelper.getbasehelper().setdescription($description)
|
||||||
|
$siteservice.update($services, $sitebasehelper)
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove-hvsite {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
Name of the site (required)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
set-hvsite -site "CURRENTSITENAME" -name "NAME" -description "DESCRIPTION"
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.3.2,7.4
|
||||||
|
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$name,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$siteid=$services1.site.site_list() | where-object {$_.base.displayname -like $name}
|
||||||
|
$services.site.site_delete($siteid.id)
|
||||||
|
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
Export-ModuleMember Add-HVDesktop,Add-HVRDSServer,Connect-HVEvent,Disconnect-HVEvent,Get-HVPoolSpec,Get-HVInternalName, Get-HVEvent,Get-HVFarm,Get-HVFarmSummary,Get-HVPool,Get-HVPoolSummary,Get-HVMachine,Get-HVMachineSummary,Get-HVQueryResult,Get-HVQueryFilter,New-HVFarm,New-HVPool,Remove-HVFarm,Remove-HVPool,Set-HVFarm,Set-HVPool,Start-HVFarm,Start-HVPool,New-HVEntitlement,Get-HVEntitlement,Remove-HVEntitlement, Set-HVMachine, New-HVGlobalEntitlement, Remove-HVGlobalEntitlement, Get-HVGlobalEntitlement, Set-HVApplicationIcon, Remove-HVApplicationIcon, Get-HVGlobalSettings, Set-HVGlobalSettings, Set-HVGlobalEntitlement, Get-HVResourceStructure, Get-hvlocalsession, Get-HVGlobalSession, Reset-HVMachine, Remove-HVMachine, Get-HVHealth, new-hvpodfederation, remove-hvpodfederation, get-hvpodfederation, register-hvpod, unregister-hvpod, set-hvpodfederation,get-hvsite,new-hvsite,set-hvsite,remove-hvsite
|
||||||
|
|||||||
@@ -2,6 +2,31 @@ Prerequisites/Steps to use this module:
|
|||||||
|
|
||||||
1. This module only works for vSphere products that support VM Encryption. E.g. vSphere 6.5 and later.
|
1. This module only works for vSphere products that support VM Encryption. E.g. vSphere 6.5 and later.
|
||||||
2. All the functions in this module only work for KMIP Servers.
|
2. All the functions in this module only work for KMIP Servers.
|
||||||
3. Install the latest version of Powershell and PowerCLI(6.5).
|
3. Install the latest version of Powershell and PowerCLI.
|
||||||
4. Import this module by running: Import-Module -Name "location of this module"
|
4. Import this module by running: Import-Module -Name "location of this module"
|
||||||
5. Get-Command -Module "This module Name" to list all available functions.
|
5. Get-Command -Module "This module Name" to list all available functions.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
Deprecating the below functions related to KMServer and KMSCluster from VMware.VMEncryption and using instead the ones from VMware.VimAutomation.Storage,
|
||||||
|
|
||||||
|
1, VMware.VMEncryption\Get-DefaultKMSCluster, use instead
|
||||||
|
VMware.VimAutomation.Storage\Get-KmsCluster|where {$_.UseAsDefaultKeyProvider}|foreach {$_.id}
|
||||||
|
|
||||||
|
2, VMware.VMEncryption\Get-KMSCluster, use instead
|
||||||
|
VMware.VimAutomation.Storage\Get-KmsCluster|select id
|
||||||
|
|
||||||
|
3, VMware.VMEncryption\Get-KMSClusterInfo, use instead
|
||||||
|
VMware.VimAutomation.Storage\Get-KmsCluster|foreach {$_.extensiondata}
|
||||||
|
|
||||||
|
4, VMware.VMEncryption\Get-KMServerInfo, use instead
|
||||||
|
VMware.VimAutomation.Storage\Get-KeyManagementServer|foreach {$_.extensiondata}
|
||||||
|
|
||||||
|
5, VMware.VMEncryption\New-KMServer, use instead
|
||||||
|
VMware.VimAutomation.Storage\Add-KeyManagementServer
|
||||||
|
|
||||||
|
6, VMware.VMEncryption\Remove-KMServer, use instead
|
||||||
|
VMware.VimAutomation.Storage\Remove-KeyManagementServer
|
||||||
|
|
||||||
|
7, VMware.VMEncryption\Set-DefaultKMSCluster, use instead
|
||||||
|
VMware.VimAutomation.Storage\Set-KmsCluster -UseAsDefaultKeyProvider
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
# Script Module : VMware.VMEncryption
|
# Script Module : VMware.VMEncryption
|
||||||
# Version : 1.0
|
# Version : 1.1
|
||||||
|
|
||||||
# Copyright © 2016 VMware, Inc. All Rights Reserved.
|
# Copyright © 2016 VMware, Inc. All Rights Reserved.
|
||||||
|
|
||||||
@@ -56,8 +56,13 @@ New-VIProperty -Name EncryptionKeyId -ObjectType VirtualMachine -Value {
|
|||||||
|
|
||||||
New-VIProperty -Name Locked -ObjectType VirtualMachine -Value {
|
New-VIProperty -Name Locked -ObjectType VirtualMachine -Value {
|
||||||
Param ($VM)
|
Param ($VM)
|
||||||
|
if ($vm.ExtensionData.Runtime.CryptoState) {
|
||||||
|
$vm.ExtensionData.Runtime.CryptoState -eq "locked"
|
||||||
|
}
|
||||||
|
else {
|
||||||
($vm.extensiondata.Runtime.ConnectionState -eq "invalid") -and ($vm.extensiondata.Config.KeyId)
|
($vm.extensiondata.Runtime.ConnectionState -eq "invalid") -and ($vm.extensiondata.Config.KeyId)
|
||||||
} -BasedOnExtensionProperty 'Runtime.ConnectionState','Config.KeyId' -Force | Out-Null
|
}
|
||||||
|
} -BasedOnExtensionProperty 'Runtime.CryptoState', 'Runtime.ConnectionState','Config.KeyId' -Force | Out-Null
|
||||||
|
|
||||||
New-VIProperty -Name vMotionEncryption -ObjectType VirtualMachine -Value {
|
New-VIProperty -Name vMotionEncryption -ObjectType VirtualMachine -Value {
|
||||||
Param ($VM)
|
Param ($VM)
|
||||||
@@ -113,13 +118,6 @@ Function Enable-VMHostCryptoSafe {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -181,13 +179,6 @@ Function Set-VMHostCryptoKey {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -266,13 +257,6 @@ Function Set-vMotionEncryptionConfig {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Brian Graf, Carrie Yang.
|
Author : Brian Graf, Carrie Yang.
|
||||||
Author email : grafb@vmware.com, yangm@vmware.com
|
Author email : grafb@vmware.com, yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -348,13 +332,6 @@ Function Enable-VMEncryption {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -508,13 +485,6 @@ Function Enable-VMDiskEncryption {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -660,13 +630,6 @@ Function Disable-VMEncryption {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Carrie Yang.
|
Author : Carrie Yang.
|
||||||
Author email : yangm@vmware.com
|
Author email : yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -756,13 +719,6 @@ Function Disable-VMDiskEncryption {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Carrie Yang.
|
Author : Carrie Yang.
|
||||||
Author email : yangm@vmware.com
|
Author email : yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -891,13 +847,6 @@ Function Set-VMEncryptionKey {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Carrie Yang.
|
Author : Carrie Yang.
|
||||||
Author email : yangm@vmware.com
|
Author email : yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1047,13 +996,6 @@ Function Set-VMDiskEncryptionKey {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Carrie Yang.
|
Author : Carrie Yang.
|
||||||
Author email : yangm@vmware.com
|
Author email : yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1170,13 +1112,6 @@ Function Get-VMEncryptionInfo {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Carrie Yang.
|
Author : Carrie Yang.
|
||||||
Author email : yangm@vmware.com
|
Author email : yangm@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1269,13 +1204,6 @@ Function Get-EntityByCryptoKey {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1394,13 +1322,6 @@ Function New-KMServer {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1435,6 +1356,7 @@ Function New-KMServer {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Add-KeyManagementServer instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1553,13 +1475,6 @@ Function Remove-KMServer {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1573,6 +1488,7 @@ Function Remove-KMServer {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Remove-KeyManagementServer instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1630,15 +1546,9 @@ Function Get-KMSCluster {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Get-KmsCluster instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1668,14 +1578,6 @@ Function Get-KMSClusterInfo {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1686,6 +1588,7 @@ Function Get-KMSClusterInfo {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Get-KmsCluster instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1721,13 +1624,6 @@ Function Get-KMServerInfo {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1738,6 +1634,7 @@ Function Get-KMServerInfo {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Get-KeyManagementServer instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1782,13 +1679,6 @@ Function Get-KMServerStatus {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1853,15 +1743,9 @@ Function Get-DefaultKMSCluster {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Get-KmsCluster instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1890,13 +1774,6 @@ Function Set-DefaultKMSCluster {
|
|||||||
.NOTES
|
.NOTES
|
||||||
Author : Baoyin Qiao.
|
Author : Baoyin Qiao.
|
||||||
Author email : bqiao@vmware.com
|
Author email : bqiao@vmware.com
|
||||||
Version : 1.0
|
|
||||||
|
|
||||||
==========Tested Against Environment==========
|
|
||||||
VMware vSphere Hypervisor(ESXi) Version : 6.5
|
|
||||||
VMware vCenter Server Version : 6.5
|
|
||||||
PowerCLI Version : PowerCLI 6.5
|
|
||||||
PowerShell Version : 3.0
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdLetBinding()]
|
[CmdLetBinding()]
|
||||||
@@ -1906,6 +1783,7 @@ Function Set-DefaultKMSCluster {
|
|||||||
[String] $KMSClusterId
|
[String] $KMSClusterId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
write-warning "This cmdlet is deprecated and will be removed in future release. Use VMware.VimAutomation.Storage\Set-KmsCluster instead"
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
@@ -1917,6 +1795,55 @@ Function Set-DefaultKMSCluster {
|
|||||||
$CM.MarkDefault($ProviderId)
|
$CM.MarkDefault($ProviderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Set-VMCryptoUnlock {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
This cmdlet unlocks a locked vm
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This cmdlet unlocks a locked vm
|
||||||
|
|
||||||
|
.PARAMETER VM
|
||||||
|
Specifies the VM you want to unlock
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
PS C:\> Get-VM |where {$_.locked}| Set-VMCryptoUnlock
|
||||||
|
|
||||||
|
Unlock all locked vms
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Fangying Zhang
|
||||||
|
Author email : fzhang@vmware.com
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdLetBinding()]
|
||||||
|
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)]
|
||||||
|
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]$VM
|
||||||
|
)
|
||||||
|
|
||||||
|
Begin {
|
||||||
|
# Confirm the connected VIServer is vCenter Server
|
||||||
|
ConfirmIsVCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
foreach ($thisvm in $vm) {
|
||||||
|
if (!$thisvm.encrypted) {
|
||||||
|
write-warning "$thisvm is not encrypted, will skip $thisvm"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (!$thisvm.Locked) {
|
||||||
|
write-warning "$thisvm may not be locked!"
|
||||||
|
# $thisvm.locked could be false on old 6.5.0 build (bug 1931370), so do not skip $thisvm
|
||||||
|
}
|
||||||
|
write-verbose "try to CryptoUnlock $thisvm"
|
||||||
|
$thisvm.ExtensionData.CryptoUnlock()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Function ConfirmIsVCenter{
|
Function ConfirmIsVCenter{
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>VMware Cloud on AWS VM Request-O-Matic</title><!-- Get a pretty style sheet -->
|
||||||
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div align="center"><img src="vmc-sticker.png" width="200"></div>
|
||||||
|
<h2 align="center">VM Request-O-Matic</h2>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-sm-6 col-sm-push-3">
|
||||||
|
<p>Use this form to create a new VM on VMware Cloud on AWS</p>
|
||||||
|
<form id="vmForm" name="vmForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="username">Your Name</label> <input class="form-control" id="username" name="username" placeholder="Bob Bobber" required="" type="tel">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="emailaddress">Email Address</label> <input class="form-control" id="emailaddress" name="emailaddress" placeholder="Bob@bobber.com" required="" type="tel">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="vmtype">VM Type</label> <select class="form-control" id="vmtype" name="vmtype" required="">
|
||||||
|
<option selected value="40ff3b8c-f6c7-4aa3-8db8-bb631e16ffae">
|
||||||
|
Windows 10 Desktop (4 CPU, 4GB RAM, 25GB HDD)
|
||||||
|
</option>
|
||||||
|
<option value="37561477-a8c2-4aed-9fce-1bb38557c2b0">
|
||||||
|
Windows Server 2016 (8 CPU, 12GB RAM, 100GB HDD)
|
||||||
|
</option>
|
||||||
|
<option value="40ff3b8c-f6c7-4aa3-8db8-bb631e16ffae">
|
||||||
|
Ubuntu Desktop (4 CPU, 4GB RAM, 25GB HDD)
|
||||||
|
</option>
|
||||||
|
<option value="575fbc82-fb0f-4c1f-95c3-3b0fb0613b82">
|
||||||
|
Ubuntu Server (8 CPU, 12GB RAM, 100GB HDD)
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div><button class="btn btn-default" type="submit">Create a VM!</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="hidden alert alert-success" id="success" role="alert">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
Success! Your VM was created successfully, check your email for login instructions.
|
||||||
|
</div>
|
||||||
|
<div class="hidden alert alert-danger" id="error" role="alert">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
Dang. Something went wrong, check your email for next steps.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- get the AWS Javascript library -->
|
||||||
|
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.98.0.min.js">
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// set up Amazon Cognito (create a federated identity pool)
|
||||||
|
// https://us-west-2.console.aws.amazon.com/cognito/create
|
||||||
|
// Initialize the Amazon Cognito credentials provider
|
||||||
|
AWS.config.region = 'us-west-2'; // Region
|
||||||
|
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||||
|
IdentityPoolId: 'us-west-2:e93c4c86-240d-4966-86ef-e56cf60ba468',
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function invokeLambda( e ){
|
||||||
|
|
||||||
|
<!-- pull the variables out of the form -->
|
||||||
|
var username = document.getElementById('username'),
|
||||||
|
emailaddress = document.getElementById('emailaddress');
|
||||||
|
|
||||||
|
|
||||||
|
var selectid = document.getElementById("vmtype");
|
||||||
|
var selectedvm = selectid.options[selectid.selectedIndex].value;
|
||||||
|
|
||||||
|
|
||||||
|
// create JSON object for parameters for invoking Lambda function
|
||||||
|
var lambdaParams = {
|
||||||
|
FunctionName : 'vm-request-o-matic',
|
||||||
|
InvocationType : 'RequestResponse',
|
||||||
|
LogType : 'None',
|
||||||
|
Payload: JSON.stringify({
|
||||||
|
username: username.value,
|
||||||
|
emailaddress: emailaddress.value,
|
||||||
|
vmtype: selectedvm})
|
||||||
|
};
|
||||||
|
|
||||||
|
// create variable to hold data returned by the Lambda function
|
||||||
|
var lambdaResults;
|
||||||
|
|
||||||
|
|
||||||
|
var lambda = new AWS.Lambda({region: 'us-west-2', apiVersion: '2015-03-31'});
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
lambda.invoke(lambdaParams, function(error, data) {
|
||||||
|
if (error) {
|
||||||
|
prompt(error);
|
||||||
|
} else {
|
||||||
|
lambdaResults = JSON.parse(data.Payload);
|
||||||
|
prompt(lambdaResults);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
document.getElementById('vmForm').addEventListener('submit', invokeLambda);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
This is a simple 'serverless application' that allows you to create a VM in
|
||||||
|
an SDDC on VMware Cloud on AWS using a few cool tools including: Lambda,
|
||||||
|
Cognito, S3, and VMware Cloud on AWS.
|
||||||
|
|
||||||
|
Matt Dreyer
|
||||||
|
August 16, 2017
|
||||||
|
|
||||||
|
|
||||||
|
To make this work you need to do the following:
|
||||||
|
|
||||||
|
1. Make sure that the vCenter in your SDDC is publicly accessible, or painfully configure Lambda
|
||||||
|
to run in an VPC and NAT to a specific IP address (which requires even more IAM roles for VPC access).
|
||||||
|
2. Create a working VM, and then Clone it to an OVF template in Content Library
|
||||||
|
3. Use the vCenter API browser to discover the UUID of the your OVF template
|
||||||
|
4. Update the HTML in index.html to match the UUID(s) of the VMs you wish to deploy
|
||||||
|
5. Create a new Lambda function and upload vm-request-form.zip as your code
|
||||||
|
6. Create a new Cognito "Federated Identity" for "anonymous access"
|
||||||
|
7. Update the javascript in index.html to match your new Cognito role
|
||||||
|
8. Create an S3 bucket and configure it for Webhosting
|
||||||
|
9. Upload index.html and vmc-sticker.png into your bucket
|
||||||
|
10. Muck with IAM until Lambda and Cognito get along together
|
||||||
|
(required Cognito role permissions are AWSLambdaExecute and AWSLambdaRole)
|
||||||
Binary file not shown.
@@ -0,0 +1,193 @@
|
|||||||
|
"""
|
||||||
|
|
||||||
|
Basic Tests against the Skyscraper API
|
||||||
|
VMC API documentation available at https://vmc.vmware.com/swagger/index.html#/
|
||||||
|
CSP API documentation is available at https://saas.csp.vmware.com/csp/gateway/api-docs
|
||||||
|
vCenter API documentation is available at https://code.vmware.com/apis/191/vsphere-automation
|
||||||
|
|
||||||
|
Matt Dreyer
|
||||||
|
August 15, 2017
|
||||||
|
|
||||||
|
You can install python 3.6 from https://www.python.org/downloads/windows/
|
||||||
|
|
||||||
|
You can install the dependent python packages locally (handy for Lambda) with:
|
||||||
|
pip install requests -t . --upgrade
|
||||||
|
pip install simplejson -t . --upgrade
|
||||||
|
pip install certifi -t . --upgrade
|
||||||
|
pip install pyvim -t . --upgrade
|
||||||
|
pip install datetime -t . --upgrade
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import requests #need this for Get/Post/Delete
|
||||||
|
import simplejson as json #need this for JSON
|
||||||
|
import datetime #need this for a time stamp
|
||||||
|
|
||||||
|
# To use this script you need to create an OAuth Refresh token for your Org
|
||||||
|
# You can generate an OAuth Refresh Token using the tool at vmc.vmware.com
|
||||||
|
# https://console.cloud.vmware.com/csp/gateway/portal/#/user/tokens
|
||||||
|
strAccessKey = "your key goes here"
|
||||||
|
|
||||||
|
|
||||||
|
#where are our service end points
|
||||||
|
strProdURL = "https://vmc.vmware.com"
|
||||||
|
strCSPProdURL = "https://console.cloud.vmware.com"
|
||||||
|
slackURL = "https://hooks.slack.com/services/T6Mrrrrr/B6TSrrrrr/RUldlEzzeY0Dy3drrrrrr"
|
||||||
|
|
||||||
|
#make a datestamp
|
||||||
|
rightnow = str(datetime.datetime.now())
|
||||||
|
rightnow = rightnow.split(".")[0] #get rid of miliseconds
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def getAccessToken(myKey):
|
||||||
|
params = {'refresh_token': myKey}
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
response = requests.post('https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize', params=params, headers=headers)
|
||||||
|
json_response = response.json()
|
||||||
|
access_token = json_response['access_token']
|
||||||
|
|
||||||
|
# debug only
|
||||||
|
# print(response.status_code)
|
||||||
|
# print(response.json())
|
||||||
|
|
||||||
|
return access_token
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------- Figure out which Org we are in
|
||||||
|
def getTenantID(sessiontoken):
|
||||||
|
|
||||||
|
myHeader = {'csp-auth-token' : sessiontoken}
|
||||||
|
|
||||||
|
response = requests.get( strProdURL + '/vmc/api/orgs', headers=myHeader)
|
||||||
|
|
||||||
|
# debug only
|
||||||
|
# print(response.status_code)
|
||||||
|
# print(response.json())
|
||||||
|
|
||||||
|
# parse the response to grab our tenant id
|
||||||
|
jsonResponse = response.json()
|
||||||
|
strTenant = str(jsonResponse[0]['id'])
|
||||||
|
|
||||||
|
return(strTenant)
|
||||||
|
|
||||||
|
|
||||||
|
#---------------Login to vCenter and get an API token
|
||||||
|
# this will only work if the MGW firewall rules are configured appropriately
|
||||||
|
def vCenterLogin(sddcID, tenantid, sessiontoken):
|
||||||
|
|
||||||
|
#Get the vCenter details from VMC
|
||||||
|
myHeader = {'csp-auth-token' : sessiontoken}
|
||||||
|
myURL = strProdURL + "/vmc/api/orgs/" + tenantid + "/sddcs/" + sddcID
|
||||||
|
response = requests.get(myURL, headers=myHeader)
|
||||||
|
jsonResponse = response.json()
|
||||||
|
|
||||||
|
vCenterURL = jsonResponse['resource_config']['vc_ip']
|
||||||
|
vCenterUsername = jsonResponse['resource_config']['cloud_username']
|
||||||
|
vCenterPassword = jsonResponse['resource_config']['cloud_password']
|
||||||
|
|
||||||
|
|
||||||
|
#Now get an API token from vcenter
|
||||||
|
myURL = vCenterURL + "rest/com/vmware/cis/session"
|
||||||
|
response = requests.post(myURL, auth=(vCenterUsername,vCenterPassword))
|
||||||
|
token = response.json()['value']
|
||||||
|
vCenterAuthHeader = {'vmware-api-session-id':token}
|
||||||
|
|
||||||
|
return(vCenterURL, vCenterAuthHeader)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#------------ Get vCenter inventory and post to slack
|
||||||
|
def getSDDCInventory(sddcID, tenantid, sessiontoken):
|
||||||
|
|
||||||
|
#first we need to get an authentication token from vCenter
|
||||||
|
vCenterURL, vCenterAuthHeader = vCenterLogin(sddcID, tenantid, sessiontoken)
|
||||||
|
|
||||||
|
#now let's get a VM count
|
||||||
|
# for all vms use this : myURL = vCenterURL + "rest/vcenter/vm"
|
||||||
|
# for management vms use this: myURL = vCenterURL + "rest/vcenter/vm?filter.resource_pools=resgroup-54"
|
||||||
|
# for workload vms use this: myURL = vCenterURL + "rest/vcenter/vm?filter.resource_pools=resgroup-55"
|
||||||
|
myURL = vCenterURL + "rest/vcenter/vm"
|
||||||
|
response = requests.get(myURL, headers=vCenterAuthHeader)
|
||||||
|
|
||||||
|
#deal with vAPI wrapping
|
||||||
|
vms = response.json()['value']
|
||||||
|
|
||||||
|
poweredon = []
|
||||||
|
poweredoff = []
|
||||||
|
|
||||||
|
for i in vms:
|
||||||
|
if i['power_state'] == "POWERED_ON":
|
||||||
|
poweredon.append(i['name'])
|
||||||
|
else:
|
||||||
|
poweredoff.append(i['name'])
|
||||||
|
|
||||||
|
vm_on = len(poweredon)
|
||||||
|
vm_off = len(poweredoff)
|
||||||
|
|
||||||
|
#next let's figure out how much space we have left on the datastore
|
||||||
|
myURL = vCenterURL + "rest/vcenter/datastore"
|
||||||
|
response = requests.get(myURL, headers=vCenterAuthHeader)
|
||||||
|
|
||||||
|
#grab the workload datastore
|
||||||
|
datastore = response.json()['value'][1]
|
||||||
|
ds_total = int(datastore['capacity'])
|
||||||
|
ds_free = int(datastore['free_space'])
|
||||||
|
|
||||||
|
usage = int((ds_free / ds_total) * 100)
|
||||||
|
freeTB = ( ds_free / 1024 / 1024 / 1024 / 1024)
|
||||||
|
|
||||||
|
|
||||||
|
jsonSlackMessage = {'text': \
|
||||||
|
"SDDC Inventory Report\n" + \
|
||||||
|
"\t " + str(vm_on) + " Virtual Machines Running\n" + \
|
||||||
|
"\t " + str(vm_off) + " Virtual Machines Powered Off\n" + \
|
||||||
|
"\t " + str(usage) + "% Datastore Capacity Remaining (" + str(int(freeTB)) + " TB)"}
|
||||||
|
|
||||||
|
postSlack(slackURL, jsonSlackMessage)
|
||||||
|
|
||||||
|
return()
|
||||||
|
|
||||||
|
#------------------ Post something to Slack
|
||||||
|
# Slack API info can be found at https://api.slack.com/incoming-webhooks
|
||||||
|
# https://api.slack.com/tutorials/slack-apps-hello-world
|
||||||
|
# Need to create a new App using the Slack API App Builder -- it only needs to do one thing - catch a webhook
|
||||||
|
|
||||||
|
def postSlack(slackURL, slackJSONData):
|
||||||
|
|
||||||
|
slackData = json.dumps(slackJSONData)
|
||||||
|
|
||||||
|
myHeader = {'Content-Type': 'application/json'}
|
||||||
|
response = requests.post(slackURL, slackData, headers=myHeader)
|
||||||
|
|
||||||
|
if response.status_code != 200:
|
||||||
|
raise ValueError(
|
||||||
|
'Request to slack returned an error %s, the response is:\n%s'
|
||||||
|
% (response.status_code, response.text)
|
||||||
|
)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
#---------------- Main ----------------------
|
||||||
|
#--------------------------------------------
|
||||||
|
def lambda_handler(event, context):
|
||||||
|
|
||||||
|
sddcID = " your id goes here"
|
||||||
|
tenantID = "your tenant goes here"
|
||||||
|
|
||||||
|
#Get our access token
|
||||||
|
sessiontoken = getAccessToken(strAccessKey)
|
||||||
|
|
||||||
|
#get the inventory and dump it to
|
||||||
|
getSDDCInventory(sddcID, tenantID, sessiontoken)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
#testing only
|
||||||
|
#lambda_handler(0, 0)
|
||||||
Binary file not shown.
50
Scripts/VMware_Cloud_on_AWS/Create100VMs.ps1
Normal file
50
Scripts/VMware_Cloud_on_AWS/Create100VMs.ps1
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<#
|
||||||
|
.NOTES
|
||||||
|
===========================================================================
|
||||||
|
Created by: Alan Renouf
|
||||||
|
Date: March 27, 2018
|
||||||
|
Organization: VMware
|
||||||
|
Blog: virtu-al.net
|
||||||
|
Twitter: @alanrenouf
|
||||||
|
===========================================================================
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This will allow you to create multiple workloads in the correct locations on VMware Cloud on AWS.
|
||||||
|
|
||||||
|
.Example
|
||||||
|
$vCenter = "vcenter.sddc-52-53-75-20.vmc.vmware.com"
|
||||||
|
$vCenterUser = "cloudadmin@vmc.local"
|
||||||
|
$vCenterPassword = 'VMware1!'
|
||||||
|
$ResourcePool = "Compute-ResourcePool"
|
||||||
|
$Datastore = "WorkloadDatastore"
|
||||||
|
$DestinationFolder = "Workloads"
|
||||||
|
$Template = "Gold_Linux_Template"
|
||||||
|
$VMNamePrefix = "NEWVM"
|
||||||
|
$NumofVMs = 100
|
||||||
|
$RunASync = $true #Set this to $True to create the VMs and not wait for the result before starting the next one
|
||||||
|
#>
|
||||||
|
|
||||||
|
# ------------- VARIABLES SECTION - EDIT THE VARIABLES BELOW -------------
|
||||||
|
$vCenter = "vcenter.sddc-123456789.vmc.vmware.com"
|
||||||
|
$vCenterUser = "cloudadmin@vmc.local"
|
||||||
|
$vCenterPassword = '123456789'
|
||||||
|
$ResourcePool = "Compute-ResourcePool"
|
||||||
|
$Datastore = "WorkloadDatastore"
|
||||||
|
$DestinationFolder = "Workloads"
|
||||||
|
$Template = "Gold_Linux_Template"
|
||||||
|
$VMNamePrefix = "NEWVM"
|
||||||
|
$NumofVMs = 100
|
||||||
|
$RunASync = $true
|
||||||
|
# ------------- END VARIABLES - DO NOT EDIT BELOW THIS LINE -------------
|
||||||
|
|
||||||
|
# Connect to VMC vCenter Server
|
||||||
|
$VCConn = Connect-VIServer -Server $vCenter -User $vCenterUser -Password $vCenterPassword
|
||||||
|
|
||||||
|
1..$NumofVMs | Foreach-Object {
|
||||||
|
Write-Host "Creating $VMNamePrefix$($_)"
|
||||||
|
if ($RunASync){
|
||||||
|
New-VM -Name "$VMNamePrefix$($_)" -Template $Template -ResourcePool $ResourcePool -Datastore $datastore -Location $DestinationFolder -RunAsync
|
||||||
|
} Else {
|
||||||
|
New-VM -Name "$VMNamePrefix$($_)" -Template $Template -ResourcePool $ResourcePool -Datastore $datastore -Location $DestinationFolder
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user