發表文章

目前顯示的是 4月, 2018的文章

clone VM from AHV to ESXi

圖片
clone VM from AHV to ESXi Reference article: https://acropolis.ninja/export-a-vm-from-nutanix-ahv-to-vmware-esxi/ get vmdk UUID acli vm.get {VM name} export vmdk qemu-img convert -O vmdk nfs://127.0.0.1/{container}/.acropolis/vmdisk/{vmdk UUID} nfs://127.0.0.1/{export container}/{export vmdk name.vmdk} & verify export vmdk processing ps -A |grep qemu if show nothing or done,it’s mean completed mount this comtainer to ESXi host create VM for this vmdk and copy the vmdk file to the VM directory ssh to ESXi host cp {source vmdk path} {destination path} & you can use winscp to verify the copy schedule create the vmdk disk descriptor(Nutanix default use Thin Provisioned) vmkfstools -i {source vmdk} {new vmdk} -d thin mount this vmdk on ESXi VM and it should be power on success if the OS is windows 10,need UEFI boot edi

AHV - migrate specific VM to other node with time

because AHV GUI  can not migrate mutiple VM at one click if you want migrate mutiple VM, you only can one by one select & migrate with GUI or use script (maybe next or next next or next next next version NOS can be resolve...I hope ) this script can migrate VM with similar VM name or specifice VM _________________________ #!/bin/bash # # acli host.list echo "input the VMs that you want to migrate(ex. vm1,vm2,testvm*)" read VM echo "input the destnation host IP...(press ENTER will automatically select host)" read HOST startdate=`date` if [ ! -n "$HOST" ] ; then acli vm.migrate $VM else acli vm.migrate $VM host=$HOST fi echo "start date: $startdate" echo "  end date: `date`" _________________________

AHV - migrate all VM on one node to other node

because my customer got VM fail after he set one node to maintenance mode so...he want a script can manually migrate VM to other node before node enter maintenance __________________________ #!/bin/bash VM=(`virsh list | grep -i -v cvm|gawk -F' ' '{printf("%s\n",$2);}'|awk 'NR>3{print p}{p=$0}'`) for i in ${VM[@]}; do acli vm.migrate $i;done __________________________