Bootcamp: 2 – Virtual Machines for the Database Team

09Jan12

When most people think of virtualization, what they really mean is VMware, and this is how I will focus this article.  If you aren’t familar with VMware technology, you should read the basics about virtual machines.

To quote:

 A virtual machine is a tightly isolated software container that can run its own operating systems and applications as if it were a physical computer. A virtual machine behaves exactly like a physical computer and contains it own virtual (ie, software-based) CPU, RAM hard disk and network interface card (NIC).

An operating system can’t tell the difference between a virtual machine and a physical machine, nor can applications or other computers on a network. Even the virtual machine thinks it is a “real” computer. Nevertheless, a virtual machine is composed entirely of software and contains no hardware components whatsoever. As a result, virtual machines offer a number of distinct advantages over physical hardware.

In general, VMware virtual machines possess four key characteristics that benefit the user:

  • Compatibility: Virtual machines are compatible with all standard x86 computers
  • Isolation: Virtual machines are isolated from each other as if physically separated
  • Encapsulation: Virtual machines encapsulate a complete computing environment
  • Hardware independence: Virtual machines run independently of underlying hardware

Multiple systems, one machine, no one any the wiser except for the system administrator who teaches them how to share.  From the database point of view, this is FANTASTIC, because it removes a huge number of headaches for DBAs that aren’t related to the database.

Also, because the operating system is encapsulated and machne independent, there are some important things things that you can do with VM’s that are difficult to do with physical machines.

Snapshots

A snapshot preserves the state and data of a virtual machine at a specific point in time.  The state includes the virtual machine’s power state (for example, powered-on, powered-off, suspended).  The data includes all of the files that make up the virtual machine. This includes disks, memory, and other devices, such as virtual network interface cards.

This operation is typically VERY fast compared to a database backup, typically only taking seconds.  This can be a great way to do a simple checkpoint or an incremental backup.  You just quiesce the database, take a VM snapshot and continue on your merry way.

Cloning

A full clone is an independent virtual machine, with no need to access the parent. Full clones do not require an ongoing connection to the parent virtual machine. Because a full clone does not share virtual disks with the parent virtual machine, full clones generally perform better than linked clones. However, full clones take longer to create than linked clones. Creating a full clone can take several minutes if the files involved are large.

This operation is also typically VERY fast compared to a database clone and the clone can be deployed anywhere that you want to.  While there is more work that is needed to be done inside the new VM around database configuration,  there isn’t anything that needs to be done around hardware.

Linked Clones

A linked clone is made from a snapshot of a parent virtual machines. All files available on the parent at the moment of the snapshot continue to remain available to the linked clone. Ongoing changes to the virtual disk of the parent do not affect the linked clone, and changes to the disk of the linked clone do not affect the parent.

Imagine finding a problem in production and in just a few minutes being able to hand your developer a full copy of a 1 TB database that they can query and change at will without impacting anything.  Very difficult to do in the traditional model, easy to do when virtualized.

Pretty cool stuff.

Why This Matters 

In reality virtualization wouldn’t be much more than a nice parlor trick if all you did was create individual VMs and run then on your laptop.  However, virtualizing resources really opens up a world of interesting things for databases, administration, server efficiency, and data movement.

The Takeaway

Virtualization makes running existing databases cheaper and easier.  Also, if you are clever operationally, you can manipulate the container to make the database inside run exactly the way you want it to and at the cost you want to pay.  This is the domain of virtual resource management, which we will cover in detail.  However, the first thing we need to understand is VMware’s virtualization stack.

References 

Introduction to vSphere

Snapshots

Understanding Clones

How does a Snapshot Work

 



No Responses Yet to “Bootcamp: 2 – Virtual Machines for the Database Team”

  1. Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>