Friday, May 08, 2015

VMWare ESXi copy VM and datastore

Lately, one of my drive of my RAID5 array was gone to death. Time for an infrastructure change.

I was glad to buy 4 new drives of 2TB to add new datastore to my vMWare ESXi 5.5 server. My plan is to move all the VMs from the old datastore where the disk is broken (RAID5, previously 4*500GB) to the new datastore (defined as RAID5, 4*2TB).
Then redefined the old LUN as RAID5 on 3*500GB as a NAS server disk (I decided to run FreeNAS 9.3).

Just a note to remember (VMWare ESXi 5.5).
Whilst I was doing a cold copy of all VMs from entire local datastore to an other local datastore, I did a script for that.
But fist of all, remember the steps :
* shutdown the VM
* delete all (consolidate) the snapshot before hands
* I decided to unregister the previous VM via 
vim-cmd vmsvc/unregister <vmid>
you may first want to get vmid from the command : vim-cmd vmsvc/getallvms
* do not use an OS copy command for vmdk file, those files would take the all provisioning space on disk instead of the actual value if it’s “thin”, could be quite surprising in the end.
My actual command I used :
vmkfstools -i "/vmfs/volumes/src/myVM/myVM.vmdk" -d thin "/vmfs/volumes/trg/myVM/myVM.vmdk"
* register the new VM
vim-cmd solo/registervm /vmfs/volumes/trg/myVM/myVM.vmx

As a side note, I was creating new datastores from a newly created LUN, I learnt that we actually cannot make more than one datastore per LUN… Need more datastore ? Create more LUNs. Yes, it requires to think about what you want to do when building the infrastructure from the beginning… 


1 comment:

Video Teraveloka said...

Bonus Tahun Kabisat 29 Febuari 2020

Tahun Kabisat adalah tahun dengan penambahan satu hari akhir bulan febuari setiap 4 tahun sekali. Tanggal ini menjadi istimewa juga karena S1288POKER memberikan bonus TANPA DEPOSIT teruntuk Pemain Baru & Pemain Lama :

Syarat & Ketentuan :

• Bonus Rp 29.000,- Tanpa Deposit
• Untuk 50 Member Claim Tercepat
• Member Baru : Terdaftar Di Bulan Febuari 2020
• Member Lama : Minimal Pernah Melakukan Deposit 10x
• Minimal Withdraw Rp 100.000,-
• Berlaku 29 Febuari 2020 (Tahun Kabisat)
• Waktu Claim Akan Dimulai Saat Pergantian Tanggal (00.01 WIB).
• Jika Terjadi Kecurangan, Maka Admin Berhak Untuk Tindak Tegas
• Keputusan Admin S1288POKER Bersifat Mutlak

(Claim Freechip Disini...)