Skip to content

Instantly share code, notes, and snippets.

gowatana

  • Japan
Block or report user

Report or block gowatana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Nutanix-APIv2-hosts_1host-sample.json
{
"service_vmid": "00059788-a2b4-4e5f-1a6e-005056b688d2::2",
"uuid": "9123c38b-7ca7-432b-aa69-771cb56f4375",
"disk_hardware_configs": {
"1": {
"serial_number": "drive-scsi0-0-0-1",
"disk_id": "00059788-a2b4-4e5f-1a6e-005056b688d2::11",
"disk_uuid": "5fa13fd5-f8c0-48a5-91f9-334e943bf64b",
"location": 1,
"bad": false,
@gowatana
gowatana / demo-flow-quaratine.py
Last active Dec 9, 2019
Nutanix Flow で REST API での Quarantine サンプル。
View demo-flow-quaratine.py
#!/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import requests
import urllib3
args = sys.argv
conf_file = args[1]
@gowatana
gowatana / acli-vnic.create.sh
Created Dec 1, 2019
ACLIでNIC追加自動化くん(text / bash 編)
View acli-vnic.create.sh
#!/bin/bash
HELP='Usage: CVM$ bash ./cli-vnic.create.sh VM_LIST_FILE AHV_NETWORK '
VM_LIST_FILE=$1
AHV_NETWORK=$2
CMD_OUTPUT_ONLY_FLG=$3
if [ "$#" -eq 0 ]; then
echo $HELP
exit 1
View lab-vcsa-67u3.json
{
"__version": "2.13.0",
"__comments": [
"deploy a VCSA with an embedded-PSC on an ESXi host.",
"F:/vcsa-cli-installer/win32/vcsa-deploy.exe install --no-esx-ssl-verify --accept-eula --precheck-only ./lab-vcsa-67u3.json",
"F:/vcsa-cli-installer/win32/vcsa-deploy.exe install --no-esx-ssl-verify --accept-eula ./lab-vcsa-67u3.json"
],
"new_vcsa": {
"esxi": {
"hostname": "192.168.1.20",
@gowatana
gowatana / vmx_schedule_vup.ps1
Created Nov 28, 2019
ESXi 仮想マシンのハードウェアバージョンのVUPをスケジュールする。
View vmx_schedule_vup.ps1
$vm_name = $args[0]
$target_vmx_version = $args[1]
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.ScheduledHardwareUpgradeInfo = New-Object VMware.Vim.ScheduledHardwareUpgradeInfo
$spec.ScheduledHardwareUpgradeInfo.UpgradePolicy = "always" # never or onSoftPowerOff or always
$spec.ScheduledHardwareUpgradeInfo.VersionKey = $target_vmx_version
$vms = Get-VM -Name $vm_name
$vms | ForEach-Object {
View game-2048-kondou.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep-game2048
spec:
replicas: 1
selector:
matchLabels:
run: game2048
View clone_vm_k8s-lab.ps1
$lab_id = $args[0]
$folder_name = "ol7-k8s-lab-" + (0 + $lab_id).ToString("00")
$folder = Get-Datacenter "infra-dc-01" | Get-Folder -Name "vm" | New-Folder -Name $folder_name
("k8s-m-" + $lab_id.ToString() + "1"),
("k8s-w-" + $lab_id.ToString() + "1"),
("k8s-w-" + $lab_id.ToString() + "2"),
("k8s-w-" + $lab_id.ToString() + "3")| % {
Get-VM "ol76-min-01" | New-VM -Name $_ `
-ResourcePool "rp-03-lab" `
View Unattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
<TimeZone>Tokyo Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
@gowatana
gowatana / game-2048.yml
Last active Sep 3, 2019
Kubernetesで2048。
View game-2048.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep-game2048
spec:
replicas: 1
selector:
matchLabels:
run: game2048
@gowatana
gowatana / ahv_inventory.py
Created Aug 10, 2019
ansible dynamic inventory script for Nutanix Prism
View ahv_inventory.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import requests
# args = sys.argv
# conf_file = args[1]
conf_file = "/home/gowatana/prism-config.json"
You can’t perform that action at this time.