TechShizz | All posts tagged 'HyperV'

Windows machine/server stuck in reboot loop

Problem

Windows machine/Server stuck in acontant loop and will not boot into OS

Solution

There is a couple of other options, but we have to go to Command Prompt. So, click on it and it will open up cmd.exe as administrator.

advanced options cmd

Now, we are going to restore the registry. We have seen the reasons for this issue and one of the reasons is a change in registry. So, let’s restore the register to its original state.

Go to C drive by writing C: .

After that we have to go to CD WindowsSystem32.

After that type in CD config.

Now we want to see the files here. Type in DIR and click Enter.

cmd dir

As you can see there is a folder RegBack, go into that folder with CD Regback.

As you can see, there are 5 files (DEFAULT, SAM, SECURITY, SOFTWARE and SYSTEM). These are the registry backups.

cmd regback

Now, go back to the config folder by writing CD.. . After that, type in DIR to see the files in that folder. As you can see now, there are 5 files with the same names. But there is a difference. The files in RegBack folder is for backup, and the files in the config folder are using now.

So, we just need to replace files in the config folder with files from the RegBack folder. But we don’t want to delete files from the config folder, because it’s safer to just rename them. Let’s do it.

You can rename DEFAULT file by writing REN DEFAULT DEFAULT1. It will rename DEFAULT file into DEFAULT1. Do the same thing with the other 4 files.

cmd regback rename

So, once all these files have been renaming, we are going to copy these 5 files from the RegBack folder to the config folder.

Type in CD RegBack to go to the RegBack folder. Now we have to copy all files to the config folder, so just type in COPY * C:WindowsSystem32config.

cmd regback copy

Now go to the previous directory and type in DIR. As you can see, we did it properly, so type in EXIT.

 http://theitbros.com/fix-your-pc-ran-into-a-problem-and-needs-to-restart/ 

How to convert .VMDK to .VHD or .VHDX

First, download the Microsoft Virtual Machine Converter:

Next run powershell as administrator and run the following commands.

  • Import-Module ‘C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1’
  • ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “C:\Ubuntu-disk1.vmdk” -DestinationLiteralPath “C:\Ubuntu-disk1.vhd” -VhdType DynamicHardDisk -VhdFormat Vhd

Hyper V Replicas (non Clustered)


A Hyper V Replica provides a form of high availability which is useful in inter-site failover situations. Failover clusters generally operate in a single site - however if that site is compromised by a natural disaster or a major incident, then the service would fail.

 

With a replica, the VM can be trickled to another site, and in the event that failover is required the service can keep running with a recent copy of the source VM.

 

  1. Go to the settings of the Hyper V host that will hold the replica > Go to Replication Configuration
    1. Click Enable this computer as a replication server
    2. In a production environment, certificates should be used to configure the transfer of the vhd/x file over SSL. A suitable certificate needs to be issued from the company CA and imported into the personal store of both the Primary and the replica server. Also this method allows the replication to another domain even if it's untrusted.
    3. Configure the Authorization and storage section. Allow replication from specified servers and also the location the VHDX file will be stored on the replica machine.
    4. Repeat this on the primary machine
  2. Go to the Firewall and enable "Hyper-V Replica HTTP Listener (TCP-In)" or the HTTPS Version depending on method. This needs to be configured the same on both the primary and the replica server to allow failback.
  3. On the primary server, right click on the VM and click "Enable Replica". Follow the wizard.
  4. Remember that the VMs are likely to be on different subnets, so this needs to be configured in the TCP/IP settings of the VM (not the HV Host) so that when the VM fails over its IP address changes accordingly.

 

This feature can be configured in a daisy chain so that if the replica fails, another replica of that can then take over in a 3 site scenario (or more).

Nested Hyper V in VmWare

To run Hyper-V in VMWare you need to edit the .vmx file and append the following to allow a hyper visor to be virtualised.

hypervisor.cpuid.v0 = “FALSE”

mce.enable = “TRUE”

vhu.enable = “TRUE

Hyper-V Live Migrations

Cluster less

 

Prerequisites

 

  • The disk in use by the VM must not be a differencing disk unless the reference disk is in a shared location.
  • You must remove and ISO files from the CD Drive
  • vSwitch name must be identical on each HV host
  • CPU make must be the same Intel > Intel not Intel > AMD and vi-sa versa.

 

 

  1. Configure both HV Hosts to allow Live Migrations and configure the maximum number of simultaneous migrations. On production network the IP address ranges should be configured to specify the source network of the migrations for security reasons. "Use any should only be used in a lab environment".



2. On the advanced Features tab underneath, select the authentication method. CredSSP can only be used if you can log on to the source VM Host. Kerberos can be used in an Active Directory environment and requires further configuration.

 



3. If Kerberos is selected - go to the computer object of each VM Host to the delegation tab and add the computer of the opposite VM Host and specify for the following services
only like this:
    1. Cifs
    2. Microsoft Virtual System Migration Service

(Screenshot should show HV-Host2 in services list.)