Kohei Nozaki's blog 

Entries tagged [vmware]

Automating daily cold backup of a virtual machine

Posted on Saturday Jan 31, 2015 at 01:24PM in Technology

I have a virtual machine which is running on VMware Fusion 6, and runs some batch jobs for every weekday. I wrote a backup script for it. it does some annoying work such as mounting, un-mounting and stopping or restarting the vm then simply copies .vmware directory into mounted directory. also purging function is available. see my GitHub repository for detail.

First, I wrote the script with tmutil which manipulates Time Machine via CLI, but it excludes virtual machines while exclusion list is empty so I stopped use it. so the script simply copies with copy task of Ant instead.

As to snapshot - I exclude it from the options because it’s not recommended for production use by VMware (VMware does not recommend running production virtual machines off snapshots on a permanent basis). additionally, they said that AutoProtect should only be used in testing environments. see http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1014509

Backup of a database server on VMware Fusion

Posted on Sunday Jan 25, 2015 at 06:05PM in Technology

There are some opinion about AutoProtect enables backup of a virtual machine with Time Machine, but I decided that I will backup my virtual machine as a regular file after shutdown. because there are some opinion that sometimes snapshots bring corruption of databases. they said that there’s possibility of occurrence of unsaved state during taking snapshots and I don’t want to corrupt my database.

But I don’t know what is difference between database servers and daily use computer? is there no possibility of serious corruption of something in daily use computers? has potentially snapshots some wrong design? is it unnecessary to force quiescing for daily use computer? doesn’t it bring crucial problems like data corruption on databases?

Googling with vmware snapshot database consistency gave me many interesting articles or discussions.

As to the procedure about backup after shutdown, following URL would be good to read:

How to mount Time Capsule from command line:

Installing CentOS 6.5 into VMware Fusion 6.0.2

Posted on Monday Jan 12, 2015 at 11:45PM in Technology

What are the good points of virtual machines?

I'm working to move my personal financial system which is running on a physical machine to virtual machine because its simplicity of maintenance and portability. currently I'm running the system on tower form PC, but it makes annoying noise, and it consumes power much, so I'm going to make the system virtual, and move it to my old MacBook or something.

Backup of virtual machines are so easy because it exists as regular files in the physical machine, and it can be automated easily thanks to OS X's TimeMachine and VMware Fusion's snapshot. and I can easily move its machine running on in case I need to do it. when I want to do some heavy calculation, I can easily copy the whole of the virtual machine to another high-performance environment anytime while running it on low power-consuming machine regularly.


VMware Fusion 6.0.2 supplies "easy installation" function for CentOS 6.5 (not for 7.0). which answers annoying questions instead of me during installation process. all I need to answer were username and password to use. then, VMware will getting almost all of my work done contains installation of VMware Tools. several minutes after, you'll see GUI login prompt. for my purpose GUI is unnecessary but I don't want to do these annoying work by myself so I just followed this way.

I made some changes before installation begins such as following:

  • Increase HDD size to 384GB (There's no need to reserve that actual size in the host machine. actual size increases with actual use in the virtual machine. Increasing of size is impossible when snapshots available, but it's possible after deleting all of snapshots)
  • Increase CPU number to 2
  • Increate amount of memory to 2GB
  • Set network interface to physical (I want to login via ssh from my LAN)
  • Enable VNC daemon

Partitioning that VMware did automatically:

[kyle@localhost ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       374G  2.6G  353G   1% /
tmpfs           935M  228K  935M   1% /dev/shm
/dev/sda1       291M   39M  238M  14% /boot

After installation TODOs:

  • Software update (System -> Administration -> Software Update)
  • Add user to sudoers
    su -
    then insert following:
    kyle    ALL=(ALL)       NOPASSWD: ALL
  • Change timezone to sync the clock
    sudo cp -p  /usr/share/zoneinfo/Japan /etc/localtime
  • Put your ssh public key to ~/.ssh/authorized_keys (make sure to set the permission of .ssh directory to 700, authorized_keys file to 600. if permission wasn't set correctly, password prompt will be appeared)
I would write more about following procedure such as installation of middleware or database.