Skip to content

Instantly share code, notes, and snippets.

Avatar

gowatana

  • Japan
View GitHub Profile
View tanzu-cluster-41.yml
---
kind: TanzuKubernetesCluster
apiVersion: run.tanzu.vmware.com/v1alpha1
metadata:
name: tanzu-cluster-41
spec:
distribution:
version: v1.18.5
topology:
controlPlane:
View get_haproxy_vm_cacert.ps1
# Get HAProxy CA Cert.
# Usage:
# PS> Connect-VIServer $vCenter_Address -Force
# PS> ./get_haproxy_vm_cacert.ps1 $ha_proxy_vm_name
$VMname = $args[0]
$AdvancedSettingName = "guestinfo.dataplaneapi.cacert"
$Base64cert = Get-VM $VMname | Get-AdvancedSetting -Name $AdvancedSettingName
$cert = [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($Base64cert.Value))
$cert
@gowatana
gowatana / get_vm_path.ps1
Created Oct 21, 2020
Print full-path of VM's folder and Resource Pool.
View get_vm_path.ps1
# Print full-path of VM's folder and Resource Pool.
# Created by: gowatana
# Usage:
# PS> Connect-VIServer
# PS> ./get_vm_path.ps1
# PS> ./get_vm_path.ps1 | ft -AutoSize
# PS> ./get_vm_path.ps1 | Export-Csv -Encoding UTF8 -NoTypeInformation -Path ./vm_path.csv
$vm_name = "*"
View tkg-cluster-03.yml
---
kind: TanzuKubernetesCluster
apiVersion: run.tanzu.vmware.com/v1alpha1
metadata:
name: tkg-cluster-03
spec:
distribution:
version: v1.18.5
topology:
controlPlane:
@gowatana
gowatana / list_vsan_components.ps1
Last active Sep 19, 2020
Print vSAN objects and components with ESXi Host.
View list_vsan_components.ps1
# Print vSAN objects and components with ESXi.
# Created by: gowatana
# Usage:
# PS> Connect-VIServer
# PS> ./list_vsan_components.ps1 <VM Name>
# PS> ./list_vsan_components.ps1 <VM Name> | ft -AutoSize
# PS> ./list_vsan_components.ps1 <VM Name> | Export-Csv -Encoding UTF8 -NoTypeInformation -Path ./vsan_components.csv
$vm_names = $args[0]
View httpd_anti-affinity.yml
---
kind: Service
apiVersion: v1
metadata:
name: web-svc
spec:
type: LoadBalancer
ports:
- port: 80
protocol: TCP
View httpd.yml
---
kind: Service
apiVersion: v1
metadata:
name: web-svc
spec:
type: LoadBalancer
ports:
- port: 80
protocol: TCP
@gowatana
gowatana / list_vsan_disk_device_config.ps1
Last active Sep 16, 2020
print vSAN disk device config summary.
View list_vsan_disk_device_config.ps1
# print vSAN disk device config summary
# Created by: gowatana
# Usage:
# PS> Connect-VIServer
# PS> ./list_vsan_disk_device_config.ps1
$log_dir = "./logs"
$time_stamp = Get-Date
$ts = Get-Date -f "yyyyMMdd_hhmmss"
View get_ntnx_vm-ip.py
import sys
import json
import requests
args = sys.argv
conf_file = args[1]
vm_name = args[2]
with open(conf_file, "r") as file:
conf = file.read()
View python3-vm.yml
#cloud-config
disable_root: true
ssh_pwauth: true
package_upgrade: false
users:
- name: nutanix
lock-passwd: false
passwd: $6$oDzrtJla$rMzS0vuH95Q2PjDgqVOsI30MqAYemPK5Y9uYsSpeQWd99R4hqm/JWoJqH4Y81SlbtTMkglp243leccceKNZ9h.
You can’t perform that action at this time.