This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
cvm_xml_file_in = "./cvm.xml" | |
cvm_xml_file_out = "./cvm-10GB.xml" | |
cvm_memory_gb = 10 | |
cvm_memory_kb = cvm_memory_gb * 1024 * 1024 | |
tree = ET.parse(cvm_xml_file_in) | |
root = tree.getroot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timestamp_us2jst($timestamp_us){ | |
$ts_base = Get-Date "1970/1/1" | |
$ts_base = $ts_base.AddHours(9) | |
$ts_base.AddSeconds($timestamp_us / 1000000) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$images = Get-NTNXImage -IncludeVmDiskSizes | |
$ctrs = Get-NTNXContainer | |
$clsuter = Get-NTNXCluster | |
function timestamp_us2jst($timestamp_us){ | |
$ts_base = Get-Date "1970/1/1" | |
$ts_base = $ts_base.AddHours(9) | |
$ts_base.AddSeconds($timestamp_us / 1000000) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VMNAME=hakobune01 | |
IMAGELIST=all_images.txt | |
cat $IMAGELIST | tail -n +2 | awk '{print $1}' | while read IMG | |
do | |
acli vm.disk_create $VMNAME clone_from_image=$IMG | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VMNAME=Nutanix-Clone-hakobune01 | |
IMAGELIST=all_images.txt | |
N=0 | |
tail -n +2 $IMAGELIST | while read L | |
do | |
IMG=`echo $L | awk '{print $1}'` | |
TYPE=`echo $L | awk '{print $2}'` | |
acli image.create $IMG image_type=$TYPE clone_from_vmdisk=vm:$VMNAME:scsi.$N | |
N=`expr $N + 1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SJIS を BOM なし に変換。 | |
# 使用方法 | |
# PS> to_utf8_noBOM.ps1 SJISファイル 出力ファイルをフルパス | |
# PS> .\to_utf8_noBOM.ps1 C:\work\sjis.txt C:\work\utf8.tx | |
$in_file_name = $args[0] | |
$utfbom_file_name = $in_file_name + "_utf-bom.txt" | |
$out_file_name = $args[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-service | |
labels: | |
app: hello | |
spec: | |
type: NodePort | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
users: | |
- name: ntnx-user | |
groups: wheel | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
ssh-authorized-keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAA(以下省略) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import json | |
import requests | |
import datetime | |
args = sys.argv | |
conf_file = args[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPOPATH=$1 | |
[ "$REPOPATH" = "" ] && REPOPATH=/OVS | |
find $REPOPATH -name vm.cfg | while read L | |
do | |
echo -n `grep ^name $L | awk '{print $3}'` | |
echo -n ' ' | |
echo `grep OVM_simple_name $L | awk '{print $3}'` | |
done |