VIRTUAL HARD DISKS

What is Virtual Storage?

When we create a new virtual machine, its hard disk is virtual and the files of it is stored in the physical computer.

Benefits:

  • Storing our files hardware independently.
  • Exporting the virtual machine to an external disk and the people we give that disk can import and use it from anywhere around the world.
  • Restoring our virtual machine with backup and replicate software without data loss.
  • Duplicating our virtual machine.
  • Taking snapshots, so when we make changes into our guest machine and turn back to the beginning easily.
  • Thin provisioning provides allocating the space virtual machine needs initially and grows over time as it needs more.

We can consider the virtual hard disks under two main subjects: format and type.

Format

  • VHD

It is the old hard disk format which is named by the initials of “Virtual Hard Disk”. It supports virtual hard disks up to 2 TB. It is not resilient to consistency issues that caused by power failures.

  • VHDX

This is a new virtual hard disk format that coming with Windows Server 2012 Hyper-V. It has capacity of 64 TB, and is more resistant to breakdowns, especially in cases of unexpected power failure, has the ability to correct its structure in error situations thanks to its log mechanism. It provides larger sector disks than VHD format and larger block sizes for dynamic and differencing disks.

Type

  • FIXED SIZE

The virtual disks created in the Fixed Size type reserve the specified capacity from the physical disk at first even if there is no data yet. It usually used on production servers because it provides the best performance.

  • DYNAMICALLY EXPANDING

This type of disks thin provision i.e. does not reserve the specified capacity at the beginning, but it can expand to the maximum size that can be reached over time. It is usually used on the test servers that not need performance and do not consume unnecessary space on physical disk.

  • DIFFERENCING

When we want to make changes on the data without affecting the original disk, we create a child disk that only contains the changes on the parent disk and we can revert them. It usually used on the multiple virtual machines that all have the same operating systems and applications because it provides saving disk space by containing only the differences.

Creating a New Virtual Hard Disk in Hyper-V

First, click the “New” under the “Action” segment and select “Hard Disk“.

New Virtual Hard Disk appears and gives us some information. Click “Next“.

Then we choose the format of the virtual hard disk. We click the checkbox near the format that we want to choose and click “Next“.

After that we should choose the type of our virtual hard disk that is mentioned above. After selecting, click “Next“.

Then we specify name of our new virtual hard disk and decide where it will be stored if we do not want the default location.

Then we decide whether we want to create a blank disk or copy the contents of another disk to new one. And adjust the size of it if we want to create a new disk.

Finally, the summary screen appears. After reading, if we agree about all the configurations click “Finish“.

Our new virtual hard disk is now ready to use.

VIRTUAL NETWORK FUNDAMENTALS

WHAT IS VIRTUAL NETWORK?

Virtual networks include virtual network interface cards (NICs), virtual switches and uplinks. Virtual switches connect the virtual NICs of the virtual machines to the uplink as we can see from the figure below. And the uplink connects to the physical network.

Virtual switches offer some advanced features:

  • ARP Spoofing Protection
  • DHCP Guard
  • Port ACLs
  • Bandwidth Limiting
  • VLAN Identification
  • SR-IOV
  • Extensibility

TYPES OF VIRTUAL SWITCHES

External

It is used for virtual machines that need to talk to the systems on the physical network. These systems on the physical network may be physical servers in the environment or virtual machines running on other Hyper-V servers or various services on the WAN. The virtual machines connected to the external switch can talk to each other, the host they are on, other physical servers in the environment and remote virtual machines. External virtual switches are used for virtual machines that need to talk to the outside world. A physical virtual key must be connected to the physical network connection point so that it can talk to the physical network.

  • Internal

It is used only for virtual machines on a given virtualization server (host), and also only for those virtual machines that need to talk to that host. Virtual machines connected to the Internal Virtual Switch cannot go to the physical network. We do not need a physical network port to bind while creating an Internal Virtual Switch. These networks are like (almost) isolated networks that cannot talk to the outside world. This isolated network may only include the host that virtual machines are working on. For this purpose, when an Internal Virtual Switch is created, a virtual network card connected to that Internal Switch is also added to that Hyper-V host.

  • Private

It is used only for virtual machines that need to talk to themselves on a particular virtualization server (host). You can think of Private Virtual Switches as a (completely) isolated network. It does not need a physical network port as it is in the Internal Switches. The virtual machines connected to this network cannot go to the physical network, talk to the host and remote virtual machines. They just talk to other virtual machines connected to this network on the same host.

CREATING VIRTUAL SWITCHES IN HYPER-V

To create a new virtual switch, we select the “Virtual Switch Manager” under the “Actions” area.

We can choose the type of our virtual switch which we have just talked about.

We can give it a name, write details about it, change the connection type and enable the VLAN ID in this tab.

NOTE:

Thanks John Howard for the topologies of virtual networks. ( http://blogs.technet.com/jhoward )

WORKING WITH CHECKPOINTS (SNAPSHOTS) IN HYPER-V

Why Should I Use Checkpoints?

It is the process of taking an image of the current state of a virtual machine and reserving that image point that can be returned later. If we want to make changes on the current state of the virtual machine, and want to see the results of that changes, we can create a checkpoint and turn back, if we do not like it. We can change the configurations of the system for some reasons, we can see if it works or not, and revert it back. It is a very useful but space consuming action. Because checkpoint files are stored in our host machine.

Creating Checkpoints in Hyper-V

We can easily create checkpoints by right-clicking the virtual machine and select “Checkpoint“, or just selecting the virtual machine and clicking the “Checkpoint” under the segment that has a name of the selected machine.

Reverting to Previous State

We can easily turn back the state before the checkpoint by right clicking the state we want to see and select “Apply“. And we can export, rename, delete the checkpoint from there.