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
#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
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 |
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 | |
disable_root: false | |
ssh_pwauth: true | |
package_upgrade: false | |
users: | |
- name: ntnx | |
homedir: /home/ntnx | |
shell: /bin/bash |
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
# テナント固有 変数 | |
$tenant_name = "tenant-04" | |
$gw_addr = "10.1.40.1" | |
$nw_addr = "10.1.40.0" | |
$nw_msak_length = 24 | |
# 共通 変数 | |
$tz_name = "tz01" | |
$dlr_id = "edge-5" | |
$esg_id = "edge-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
# VM 固有 変数 | |
$vm_name = "vm41" | |
$ip_addr = "10.1.40.101" | |
$vnic_name = "Network adapter 1" | |
$template_name = "photon-1.0-rev2" | |
# テナント内共通 変数 | |
$nw_msak = "255.255.255.0" | |
$tenant_dns = "10.1.1.1" | |
$domain_name = "go-lab.jp" |
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
# VM 固有 変数 | |
$vm_name = "vm42" | |
$ip_addr = "10.1.40.102" | |
$vnic_name = "Network adapter 1" | |
$template_name = "photon-1.0-rev2" | |
# テナント内共通 変数 | |
$nw_msak = "255.255.255.0" | |
$tenant_dns = "10.1.1.1" | |
$domain_name = "go-lab.jp" |
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
$tenant_nw_config = $args[0] | |
. $tenant_nw_config | |
# テナント 論理スイッチ作成 | |
$tz = Get-NsxTransportZone -name $tz_name | |
$ls = New-NsxLogicalSwitch -TransportZone $tz -Name $ls_name | |
$ls | % {"Logical Switch: " + $_.name + " => objectId: " + $_.objectId} | |
# DLR 接続 | |
$dlr = Get-NsxLogicalRouter -objectId $dlr_id |