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 / 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"/>
@gowatana
gowatana / gist:27979ef6fe8eb81b9aac66228be5e00a
Last active Dec 9, 2018
Oracle Linux 7 KVM での vCPU 定義。
View gist:27979ef6fe8eb81b9aac66228be5e00a
<vcpu placement="static">1</vcpu>
<cpu mode="custom" match="exact" check="full">
<model fallback="forbid">Broadwell-IBRS</model>
<feature policy="require" name="hypervisor"/>
<feature policy="disable" name="erms"/>
<feature policy="require" name="xsaveopt"/>
</cpu>
View gist:3ed5dec20ea550c117211dc03ac26d41
<?xml version="1.0"?>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/vm01.qcow2"/>
<backingStore/>
<target dev="vda" bus="virtio"/>
<alias name="virtio-disk0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
</disk>
@gowatana
gowatana / gist:ee4af1b919d6331373c52f3e56d4cb1c
Created Dec 7, 2018
Nutanix AHV での、ユーザ VM の vDisk 接続。
View gist:ee4af1b919d6331373c52f3e56d4cb1c
<?xml version="1.0"?>
<disk type="network" device="lun">
<driver name="qemu" type="raw" cache="none" error_policy="report" io="native"/>
<source protocol="iscsi" name="iqn.2010-06.com.nutanix:vmdisk-5f37574d-326a-40b0-8824-c14d727f6974/0">
<host name="127.0.0.1" port="3261"/>
</source>
<backingStore/>
<target dev="sda" bus="scsi"/>
<boot order="2"/>
<alias name="scsi0-0-0-0"/>
@gowatana
gowatana / create_vm-snapshot.py
Created Dec 3, 2018
Nutanix AHV で VM スナップショットを作成する。
View create_vm-snapshot.py
import sys
import json
import requests
args = sys.argv
conf_file = args[1]
vm_uuid = args[2]
snapshot_name = args[3]
def main():
View lab-vcsa-67u1.json
{
"__version": "2.13.0",
"__comments": "deploy a VCSA with an embedded-PSC on an ESXi host.",
"new_vcsa": {
"esxi": {
"hostname": "192.168.1.20",
"username": "root",
"password": "VMware1!",
"deployment_network": "VM Network",
"datastore": "datastore1"
@gowatana
gowatana / NotSupported_H5ClientHacks-Xmas.sh
Created Dec 1, 2018 — forked from lamw/gist:a744df89a5b8aab18c2b69af9399565b
Add custom color to vSphere HTML5 UI Header/Footer in vSphere 6.7 Update 1
View NotSupported_H5ClientHacks-Xmas.sh
NEW_HEADER_HEX_COLOR=006400
NEW_BOTTOM_HEX_COLOR=8b0000
BACKUP_FILE=/usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war.bak
if [ ! -e ${BACKUP_FILE} ]; then
cp /usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war ${BACKUP_FILE}
fi
mkdir -p /root/work
cd /root/work
cp /usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war .
unzip h5ngc.war
@gowatana
gowatana / create_pd-snapshot.py
Created Nov 21, 2018
Nutanix REST API v2 で Protection Domain の Snapshotを作成してみる。
View create_pd-snapshot.py
import sys
import json
import requests
import time
args = sys.argv
conf_file = args[1]
pd_name = args[2]
seconds_to_wait_snapshot_report = 5
@gowatana
gowatana / set_vm_power-state.py
Created Nov 11, 2018
Nutanix CE の VM を パワーオン / オフする。
View set_vm_power-state.py
import sys
import json
import requests
import time
args = sys.argv
conf_file = args[1]
vm_list_file = args[2]
power_state = args[3]
seconds_to_wait_task_report = 5
@gowatana
gowatana / get_ntnx_vm-host.py
Created Nov 6, 2018
Nutanix CE の Prism から起動中 VM の AHV ホストを取得する。
View get_ntnx_vm-host.py
import sys
import json
import requests
import datetime
args = sys.argv
conf_file = args[1]
with open(conf_file, "r") as file:
conf = file.read()
You can’t perform that action at this time.