Wednesday 23 November 2011

tune2fs -O ^has_journal /dev/sda1

Ghetto cloning of an ESXi guest... Probably not the most elegant method. This clones the host 'billund' to a new host 'markyate'

  1. Power down the guest.
  2. ssh to the host... assuming you have tech support mode enabled (see here) 
  3. cd /vmfs/volumes/{name of the datastore}/
    e.g.  cd /vmfs/volumes/SATA1/
  4. Copy the raw files (this always longer than you want):
  • cp -r {folder containing guest to be cloned} {name of folder to contain new guest}
    (e.g. cp -r billund.contoso.internal markyate.contoso.internal)

use sed to rename each of the files in the directory (I know there's probably a better way)
  • for i in `ls -l | grep -i billund|awk {'print $9'}`; do (mv $i `echo $i|sed -e "s/billund/markyate/g"`);done

use sed to update the paths in each file (that isn't a disk) to reflect the new name
for i in `ls -l | grep -i ongar|grep -v flat|awk {'print $9'}`; do (sed -e "s/billund/ongar/g" $i > $i); done;

No comments:

Post a Comment