I believe in Hyper-V!

Hyper-VCategory Archives

About Hyper-V technology

Microsoft MVP (Virtual Machine) Award second time in a row

Microsoft awarded me second time with prestigious award, MVP for Virtual Machine. Like last year I’m happy and proud for that :). Also, this award gives me stimulation to do what I do even more harder and better then before!
Thank you Microsoft for this great MVP Award and I’m proud to be a part of this prestigious community!

 MVP_Horizontal_FullColor
I want to say THANK YOU everyone who support me on the way to this award, especially thanks to people without this would not be possible: To my MVP lead Yulia Belyanina, Maria Terzi, Ben Armstrong, Alessandro Teglia, Microsoft Croatia, MVP Community, Microsoft Community Croatia and BiH, Ekobit… Big thanks to my friends and colleagues Marin Franković, Tomica Kaniški, Luka Manojlović, Ivan Kardum, Toni Petrina, Ognjen Bajić, Adis Jugo, Igor Pavleković, Robert Petrunić, Draško Ivanišević, Tomislav Tipurić, Enis Šahinović, David Hodap and many, many others… sorry if I forget someone.

Let’s back to work ;)

Install the Hyper-V Role in Windows Server 2012 R2 and configure Virtual Switches with PowerShell

Hi to all! In this blog post I’ll describe how to install Hyper-V Role and how to configure Virtual Switches with PowerShell.
With PowerShell we are faster than with GUI, especially if we do in enterprises. And, of course, PowerShell is the coolest then GUI is ;).

Step 1.

Open PowerShell as administrator and type command below and press Enter:

Install-WindowsFeature –Name Hyper-V -IncludeManagementTools -Restart
2

After the server restarts open command prompt and type virtmgmt.msc. Hyper-V console will appear.

3

Step 2.

Now we need to configure virtual switches. On the Hyper-V host machine I have four physical network adapters. One network adapter is dedicated for Hyper-V host management and the other three will be for a virtual machines. All three network adapter will be external virtual switches.
First I want see which network adapter have available on the Hyper-V host.
Open PowerShell as administrator and type command:

Get-NetAdapter

4 
I’ll use Ethernet 2, 3 and 4 as virtual switches on the Hyper-V host.

Step 3.

Open PowerShell ISE as administrator and type following commands:

New-VMSwitch -Name “VmSwitch name” -NetAdapterName “Physical NIC Name
-AllowManagementOS $false

6

Now we have Virtual Switches on our Hyper-V host.

7

We can see Virtual Switches when open Virtual Switch Manager console.

8

This is very simple PowerShell usage, but I hope that it will help someone ;)
If we want to create Virtual Switches to multiple Hyper-V hosts or if we want to do something else with Virtual Switches just need to use different syntax in PowerShell.

Enjoy the day!

Delete obsolete virtual networks with dependency in VMM 2012 SP1

Few days ago I modified network settings on one of Hyper-V hosts and also migrated two of VMs to another Hyper-V host. After VMs migration and changed network settings on the Hyper-V everything has been working like a charm! After I do that, on the Virtual Machine Manager I noticed that two network adapters are still there regardless of what no longer exist in Hyper-V host. That isn’t a problem, right click on VM Network and Logical Networks, and that’s it, but…!? When I tried to delete obsolete virtual network got error that have dependent resources on that VM Network like in the picture below.

Blog4

In other words; when I migrate VMs from one Hyper-V host to another VMM didn’t “release” VMs from VM Networks. I’m sure that everything what I done, I did in the right way!
When opened View Dependent Resources I saw two migrated VMs and connected checkpoints.

Blog3

The same dependencies are on the Logical Networks

2

In the next couple of hours I tried to figure out how to solve the problem! In the pictures below is few examples what I tried to do.

Tried to delete through PowerShell.

VMnetwork

Tried to change all .xml configuration file related to VMs

Blog1

At the end, what did I do? It’s simple but it’s manual work!

Step 1

Export VMs

Blog2

Step 2

Delete exported VMs through Virtual Machine Manager

deleteVm

Step 3

Remove Virtual Network from the VM Networks and from the Logical Networks

Blog5
Blog6
Blog7
Blog8
Blog9
Blog10

Step 4

Import VMs

Blog11

Blog12

We are done!

Enjoy in day ;)

Romeo