I believe in Hyper-V!

Hyper-VCategory Archives

About Hyper-V technology

Convert/Copy the content of pass-through disks to .VHDX file format

Hi there,

In this blog post I’d like to show you how to convert, copy the content of past-through disk to virtual hard disk, .VHDX.
I’ll not write about differences between those two disk format, will only show you how to simple convert. To be honest, this post is note for me Open-mouthed smile.

So, let’s start, step by step.

  1. Ensure that you shut down the virtual machine that is connected to the pass-through disk.
  2. Make sure you have sufficient hard disk space to store the new VHDX file when it is converted.
  3. Open Hyper-V Manager console.
  4. Select the virtual machine with the pass-through physical hard disk.
  5. In the action pane, click New, and then click Hard Disk.
  6. The New Virtual Hard Disk Wizard appears. Click Next.
  7. Click .VHDX, and then click Next.
  8. Choose which disk type you want, Dynamically expanding or Fixed size, and then click Next. Usually I choose Dynamic virtual disk.
  9. Specify the Name and Location of the new .VHDX file, and then click Next.
  10. Click Copy the contents of the specified physical disk.
  11. Click the name of the appropriate offline physical hard disk from the available physical hard disks, and then click Next.
  12. Click Finish.
  13. At the end, remove pass-trough disk from the virtual machine and add new .VHDX

  14. Start virtual machine and enjoy Winking smile

  15. The contents of the pass-through disk or the direct-attached storage disk will be converted to the .vhdx file format. This might take some time depending on the size.
    For example: For 1.2TB pass-trough disk I needed almost seven hours on the SAS 15K disk drives.

    NOTE: Keep in mind that your virtual machine will be unavailable during the convert/copy process.

    Source: Technet

    image

    Cheers,

    Romeo

Find Hyper-V VM’s host name

Hi,

Long time no see Winking smile. In the last couple of weeks, to be honest, even months I have been to busy with lots of great projects and didn’t have a time to write something new Sad smile. This time I’ll also write something old but very useful! Few months ago I worked in small environment with couple of hundreds virtual machine and knew every name of virtual machines, IP addresses and where my virtual machines are. Since January I have been working in the large IT environment with thousand of Hyper-V virtual machines and now I have problem finding a host of virtual machines!
We have a two ways to find that.
1. On the virtual machine open registry; run—>regedit

image

Under this you will find who is your virtual machine host.

regedit

2. And the faster way, use PowerShell. Open PowerShell as administrator and run command below:
(get-item “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).GetValue(“HostName”)

Capture

image

Cheers,

Romeo

Time-Sync issues and how to resolve it

Hi,

In the last couple of week I had a lot of issues with the Time synchronization in few of my environments and I write this post to have reminder and to help others to solve that.

I’ll explain my situation, environment etc. So, in my situation time difference between domain controllers and other devices can’t be longer than five seconds, if it’s time difference longer than we have a big issue.

What I tried to do? The first I used manual from the official Microsoft site who helped me many times. How to configure internal time server to synchronize with an external time source you can read here.
After I did everything follow this guideline I execute few commands.

1. To check the source time server:
w32tm /query /status
After this command you will see result:
Leap Indicator: 0(no warning)
Stratum: 2 (secondary reference – syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.1403826s
Root Dispersion: 0.0279385s
ReferenceId: 0xD8E500B3 (source IP: PDC IP address)
Last Successful Sync Time: 24.3.2017. 8:39:49
Source: PDC FQDN,0x1
Poll Interval: 10 (1024s)

2. Time resynchronization with another NTP
w32tm /resync
w32rm /resync /rediscover /nowait

3. To force computer to synchronize its time with a specific DC, you can run the Net Time command:
net time \\<DC_name_or_IP> /set /y

4. I ran also the following:
net stop w32time
w32tm /unregister
w32tm /register
net start w32time

and everything was perfect SOME TIME, but after a few days I had the same issue like at the beginning of this story.
I found one great free tool called Windows Time Service which you can download from here.

After software installation, you need to configure few parameters. Keep in mind that we need to configure different time servers on every domain controller in our environment. First we need to install and configure parameters on PDC which will be the primary time server for all others domain controllers in our environment.

NOTE: After installation you will find software under Control Panel. Start application as administrator!

image

Open application and configure parameters like on the picture below. Under Server IP or DNS name enter preferred time servers.

image

Under Server tab configure parameters like in the picture below.

image

Next step, logon on the second domain controller and configure valid parameters. Under Client –> Server IP or DNS name enter FQDN of your PDC and external time servers. Look on the picture below.

image

I configured this two months ago and since than I have no issues with the time difference.
All mentioned above I did it on the physical and virtual (Hyper-V) domain controllers.

Hope this article will be useful for you.

Cheers,

Romeo