Skip to content

Instantly share code, notes, and snippets.

@bottkars
bottkars / configure-ppdm.ps1
Created November 2, 2020 07:13
Configure PPDM initially
$NTP_SERVER="139.162.149.127"
$PPDM_URI="https://ppdm-demo.home.labbuildr.com"
$API=Connect-PPDMapiEndpoint -PPDM_API_URI $PPDM_URI -user -trustCert -force
$Eula=Approve-PPDMEula
$timezone=(Get-PPDMTimezones | Where-Object id -match Berlin).id
Set-PPDMconfigurations -NTPservers $NTP_SERVER -Timezone $timezone -admin_Password 'Password123!'
Get-PPDMconfigurations | Get-PPDMconfigstatus
@bottkars
bottkars / wait_webservice.ps1
Created November 2, 2020 07:00
wait for webserver to reach 200
#Requires -Version 6.0
$env:URL = "https://ppdm-demo.home.labbuildr.com:443/#/fresh"
Write-Host "Waiting for $env:PPDM_URL to become ready for configuration"
do {
Try {
$req = Invoke-WebRequest -Uri "$env:URL" -SkipCertificateCheck -ErrorAction Stop
}
Catch {
$message = $_.exception.message
@bottkars
bottkars / deploy_ppodm.ps1
Created October 30, 2020 11:45
deploy ppdm using govc from powershell
$ovapath="$HOME/Downloads/dellemc-ppdm-sw-19.6.0-3.ova"
$env:GOVC_FOLDER='/home_dc/vm/labbuildr_vms'
$env:GOVC_VM='ppdm_demo'
$env:GOVC_DATASTORE='mgmtvms'
$env:GOVC_HOST='esxi-mgmt.home.labbuildr.com'
$SPEC=govc import.spec $ovapath| ConvertFrom-Json -Depth 7
$SPEC.DiskProvisioning="thin"
# IP Address for your new PPDM
$SPEC.PropertyMapping[0].Key='vami.ip0.brs'
$SPEC.PropertyMapping[0].Value='100.250.1.123'
@bottkars
bottkars / connect_vc.ps1
Last active July 25, 2024 08:44
govc from Powershell
# Set the Basic Parameter
$env:GOVC_URL="vcsa1.home.labbuildr.com" # replace ith your vCenter
$env:GOVC_INSECURE="true" # allow untrusted certs
$env:GOVC_DATASTORE="vsanDatastore" # set the default Datastore
$ovapath="$HOME/Downloads/dellemc-ppdm-sw-19.6.0-3.ova" # the Path to your OVA File
$env:GOVC_FOLDER='/home_dc/vm/labbuildr_vms' # the vm Folder in your vCenter where the Machine can be found
$env:GOVC_VM='ppdm_demo' # the vm Name
$env:GOVC_HOST='e200-n4.home.labbuildr.com' # The target ESXi Host or ClusterNodefor Deployment
$env:GOVC_RESOURCE_POOL='mgmt_vms' # The Optional Resource Pool
@bottkars
bottkars / gist:a5fb1ff5452ce72745ad78f5dec0a94a
Created October 23, 2020 05:00 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@bottkars
bottkars / kubectl-descibe-nodes.txt
Created February 1, 2019 06:41
Kubernetes Azurestack Testing
ubectl --kubeconfig .kube/config.stack describe nodes  ✔  4933
Name: k8s-linuxpool2-22998299-0
Roles: agent
Labels: agentpool=linuxpool2
beta.kubernetes.io/arch=amd64
beta.kubernetes.io/instance-type=Standard_D2_v2
beta.kubernetes.io/os=linux
failure-domain.beta.kubernetes.io/region=local
failure-domain.beta.kubernetes.io/zone=0
kubernetes.azure.com/cluster=k8s
Name NumberOfCores MemoryInMB MaxDataDiskCount OSDiskSizeInMB ResourceDiskSizeInMB
---- ------------- ---------- ---------------- -------------- --------------------
Basic_A0 1 768 1 1047552 20480
Basic_A1 1 1792 2 1047552 40960
Basic_A2 2 3584 4 1047552 61440
Basic_A3 4 7168 8 1047552 122880
Basic_A4 8 14336 16 1047552 245760
Standard_A0 1 768 1 1047552 20480
Standard_A1 1 1792 2 1047552 71680
Standard_A2 2 3584 4 1047552 138240
@bottkars
bottkars / gist:e80b727447678b15d4c3
Last active November 6, 2015 11:42
Labbuildr Workshop
\build-lab.ps1 -UpdatefromGit
Expand-LAB7Zip -Archive D:\2012R2FallUpdate.7z
.\build-lab.ps1 -defaults -DConly -Verbose -savedefaults -Sourcedir D:\Sources
Get-LABDefaults
.\build-lab.ps1 -defaults -DConly
@bottkars
bottkars / gist:11a60a270908f16f8371
Created November 3, 2015 17:37
vmxtoolkit:node_requires
###
$Node_requires = "numactl libaio"
###
$Scriptblock = "yum install -y $Node_requires"
Write-Verbose $Scriptblock
$NodeClone | Invoke-VMXBash -Scriptblock $Scriptblock -Guestuser $Rootuser -Guestpassword $Guestpassword
@bottkars
bottkars / gist:f10f9f7572f8b37e0d76
Created November 3, 2015 17:35
vmxtoolkit:master
###
$Required_Master = "CentOS7 Master"
####
if (!($MasterVMX = get-vmx $Required_Master))
{
Write-Warning "Required Master $Required_Master not found
please download and extraxt $Required_Master to .\$Required_Master
see:
------------------------------------------------
get-help $($MyInvocation.MyCommand.Name) -online