Created
December 25, 2018 14:47
-
-
Save gowatana/81f442b0d55b5529523c51c6f9135343 to your computer and use it in GitHub Desktop.
Nutanix AHV の VM からディスク イメージを作成する。
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/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` | |
IMAGE_NAME=${VM_NAME}_${DISK_ADDR}_${TS} | |
FRMM_VMDISK=vm:${VM_NAME}:${DISK_ADDR} | |
acli image.create ${IMAGE_NAME} image_type=kDiskImage clone_from_vmdisk=${FRMM_VMDISK} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記の投稿むけ。
Nutanix AHV の VM からディスク イメージを作成する。(Bash)
http://blog.ntnx.jp/entry/2018/12/25/235025