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
@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]
View check_ntnx_pd-replication.ps1
# Output Nutanix replication summary Report.
#
# Created by: Go Watanabe / @gowatana
# Usage:
# NTNX> Connect-NTNXCluster <Cluster#1VIP> -UserName <USER> -AcceptInvalidSSLCerts -ForcedConnection
# NTNX> Connect-NTNXCluster <Cluster#2VIP> -UserName <USER> -AcceptInvalidSSLCerts -ForcedConnection
# NTNX> .\check_ntnx_pd-replication.ps1
$report_width = 120
$time_stamp = Get-Date -f "yyyy-MM-dd HH:mm:ss"
View lab-vc-02.json
{
"__version": "2.13.0",
"__comments": "deploy a VCSA with an embedded-PSC as a replication partner to another embedded-VCSA, on an ESXi host.",
"new_vcsa": {
"esxi": {
"hostname": "infra-esxi-06.go-lab.jp",
"username": "root",
"password": "パスワード",
"deployment_network": "dvpg-vc-deploy-0000",
"datastore": "vsanDatastore"
@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"
@gowatana
gowatana / get_vm-uuid.py
Created Dec 10, 2018
Nutanix CE で、VM 名から VM UUID を取得する。
View get_vm-uuid.py
import sys
import json
import requests
args = sys.argv
conf_file = args[1]
vm_name = args[2]
def main():
with open(conf_file, "r") as file:
@gowatana
gowatana / get_vm-snapshot.py
Created Dec 10, 2018
Nutanix AHV の VM Snapshot 一覧を取得する。(VM 単位)
View get_vm-snapshot.py
import sys
import json
import requests
import datetime
args = sys.argv
conf_file = args[1]
vm_uuid = args[2]
def main():
@gowatana
gowatana / gist:5558fb11e72796a2f283865976e2adb8
Created Dec 9, 2018
Nutanix AHV での UVM の vCPU 定義情報。
View gist:5558fb11e72796a2f283865976e2adb8
<vcpu placement="static" current="1">240</vcpu>
<cpu mode="custom" match="exact">
<model fallback="forbid">kvm64</model>
<topology sockets="240" cores="1" threads="1"/>
<cache level="3" mode="emulate"/>
<feature policy="require" name="smap"/>
<feature policy="require" name="xsaveopt"/>
<feature policy="require" name="rtm"/>
<feature policy="require" name="tsc_adjust"/>
<feature policy="require" name="tsc-deadline"/>
You can’t perform that action at this time.