This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Askar Kopbayev | |
# | |
# Description: Powershell script to automate validation of NSX-v VTEP connectivity and MTU size along the path. | |
# Blog post: https://vmnomad.blogspot.com/2017/11/validating-nsx-vtep-connectivity.html | |
# | |
# The script requires vCenter an NSX names and credentials and produces two reports: Detailed and Summary. | |
# | |
# clean up all variables | |
foreach ($i in (ls variable:/*)) {rv -ea 0 $i.Name} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get-AuthHeader function - used to collect vRO credentials and produce authorization header | |
function Get-AuthHeader($string) { | |
$bytes = [System.Text.Encoding]::UTF8.GetBytes($string); | |
$encoded = [System.Convert]::ToBase64String($bytes); | |
$cred = "Basic $($encoded)" | |
return $cred; | |
} | |
Function Get-NSXRestAPI{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by Askar Kopbayev | |
# Description: Changes VM Memory reservations on all VMs to 99%, including NSX Edges and Controllers where ReconfigureVM_Task method is disabled. | |
# Credit to William Lam for amazing functions to Enable and Disable Methods http://www.virtuallyghetto.com/2016/07/how-to-easily-disable-vmotion-cross-vcenter-vmotion-for-a-particular-virtual-machine.html | |
Function Enable-vSphereMethod { | |
param( | |
[Parameter( | |
Position=0, | |
Mandatory=$true, | |
ValueFromPipeline=$true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script allows to create replica seeds for vSphere Replication without powering off the source VM and keeping identical UUID | |
.NOTES | |
File Name : xMove-VM.ps1 | |
Author : Askar Kopbayev - @akopbayev | |
Version : 1.0 | |
.LINK | |
http://vmnomad.blogspot.com/creatingreplicaseedsforpoweredOnVMs.html | |
.LINK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Collect the vCenter, Cluster and scratch_datastore | |
Param([String]$vCenter, [String]$Cluster, [String]$Datastore, [String]$Folder) | |
#Function to use multiple colors in one command | |
function Write-Color([String[]]$Text, [ConsoleColor[]]$Color) { | |
for ($i = 0; $i -lt $Text.Length; $i++) { | |
Write-Host $Text[$i] -Foreground $Color[$i] -NoNewLine | |
} | |
Write-Host | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([String]$Inventory, [String]$VC) | |
# Getting credentials | |
do { | |
$user = Read-Host -Prompt 'Enter username for source vCenter' | |
$pass = Read-Host -AsSecureString -Prompt 'Enter password for source vCenter' | |
$cont = Read-Host -Prompt 'Type y to continue' | |
} while($cont -ne 'y') | |
$cred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $user, $pass |