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 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"
@gowatana
gowatana / Calm-BP-CentOS7-2048.json
Created Jul 9, 2019
Nutanix Calm 2048 Blueprint (CentOS7 Cloud Image)
View Calm-BP-CentOS7-2048.json
{
"api_version": "3.0",
"metadata": {
"creation_time": "1562653370655858",
"kind": "blueprint",
"last_update_time": "1562655036929458",
"name": "centos-2048",
"spec_version": 11
},
"spec": {
@gowatana
gowatana / create_image_from_vm.py
Last active Mar 17, 2019
Nutanix AHV の VM から、イメージサービスに Disk イメージを登録。
View create_image_from_vm.py
import sys
import json
import requests
import datetime
import time
image_create_wait_sec = 2
args = sys.argv
conf_file = args[1]
@gowatana
gowatana / create_image_from_vm.sh
Created Dec 25, 2018
Nutanix AHV の VM からディスク イメージを作成する。
View create_image_from_vm.sh
#!/bin/bash
VM_NAME=$1
[ x == x"$VM_NAME" ] && echo "VM Name wo kudasare."
TS=`date "+%Y%m%d%H%M%S"`
acli vm.disk_list $VM_NAME | grep ^scsi | awk '{print $2}' | while read L
do
DISK_ADDR=`echo 'scsi.'$L`
@gowatana
gowatana / take_ahv_vm_snapshot.yml
Created Dec 24, 2018
Ansible で Nutanix AHV の VM Snapshot を取得する。Nutanix REST API v2
View take_ahv_vm_snapshot.yml
---
- name: Nutnaix AHV Take VM Snapshot
hosts: localhost
connection: local
vars:
prism_address: "Prism のアドレス"
prism_username: "admin"
prism_password: "Prism ユーザのパスワード"
ahv_vm_uuid: "ff156400-4234-4ddf-8d3f-6ac56b9b7a52"
@gowatana
gowatana / nutanix.tf
Created Dec 24, 2018
Terraform Nutanix Provider サンプル。
View nutanix.tf
provider "nutanix" {
username = "admin"
password = "パスワード"
endpoint = "Prism アドレス"
insecure = true
port = 9440
}
resource "nutanix_virtual_machine" "vm01-tf" {
name = "vm01-tf"
You can’t perform that action at this time.