How can i create virtual iSCSI controller with hyper-v wmi api using C#?


Can anyone help me with creating virtual iSCSI controller and assigning it to virtual machine using WMI? I need it because I want to create virtual machine with controller attached to it. As far as I can understand this issue i need to create iscsi setting
data, but I can’t find any reference on which wmi class to use? This is what I am trying to do and It’s not working :

ManagementClass scsiClass =
   new ManagementClass(@"rootvirtualizationv2:Msvm_SCSIProtocolController");

ManagementObject scsiData = scsiClass.CreateInstance();

string[] resourceSettings = new string[3];
// Memory settings.
resourceSettings[0] = memorySettingData.GetText(TextFormat.CimDtd20);
// Processor settings. 
 resourceSettings[1] = processorSettingData.GetText(TextFormat.CimDtd20);
// Add SCSI
 resourceSettings[2] = scsiData.GetText(TextFormat.CimDtd20);

If I remove "scsiData" then virtual machine creates successfully, any help please?

Documentation :

I need to use C#, I can not use powershell…

Read full post . . . .

connecting to virtual machine management service

Hi Techies,

We have server 2016 on IBM x3650 server, facing issue with hyper-v when i open hyper-v manager getting "connecting to virtual machine management service".

We tried below troubleshooting steps.

1.restarted hyper-v management services and WMI

2. rebooted two times.

Any one had experience on this issue, help on this.


Vajram Gajengi

Read full post . . . .

cloned machines have the same MAC address on ‘Hyper-V Ethernet Adapter’

Met a problem yesterday when 2 Windows Server 2016 machines from the same cloned (syspreped) image were not able to ping each other but can ping any other network devices.

After some troubleshooting we noticed that the MAC address are the same on the ‘Hyper-V Ethernet Adapter’ on both machines. The workaround is go to Hyper-V manager, change the virtual switch from external to internal, change it back again to external, this
cause the Hyper-V Ethernet Adapter to get a new MAC address.

This workaround is not good because we have to do the same for hundreds of computers.

Is there a better way to do this like a PowerShell command or a script or a tool?

Valuable skills are not learned, learned skills aren’t valuable.

Read full post . . . .

(Hyper-V 2019) New-VHD command fails to convert virtual disk

Hi all,

The following commands work on Hyper-V Server 2012R2 and 2016:

Mount-VHD -Path "D:Hyper-VVirtual Hard Diskstest.vhdx" -ReadOnly -Passthru

New-VHD -SourceDisk 2 -Path "D:Testnew-disk.vhdx" -Dynamic

but on Hyper-V Server 2019 I get the following error:

New-VHD : Failed to convert the virtual disk.
The system failed to convert
Failed to convert the virtual disk.
The system failed to convert
'?scsi#disk&ven_msft&prod_virtual_disk#2&1f4adffe&0&000003#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}': Incorrect
function. (0x80070001).
At line:1 char:1
+ New-VHD -Path "D:Testnew-disk.vhdx ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-VHD], VirtualizationException
    + FullyQualifiedErrorId : OperationFailed,Microsoft.Vhd.PowerShell.Cmdlets.NewVhd

The disk is attached to a Gen 1 VM and there are no checkpoints associated with it. Not quite sure what the problem is.

Read full post . . . .

VM info

Hi experts

i am logged into one of the VM, from the VM is it possible to know on which hyperv host it resides in.

Read full post . . . .

CheckPoint Operation Failed

Hi experts i am using HyperV 2016. i am trying to take production check point for the vms but i am getting error.

For the VM’s under the integration services below options are selected
Operating system shutdown
Time synchronization
Data Exchange
Backup(volume shadow copy)

Read full post . . . .

Creating Linux VM’s using a kickstart script.

I need to build out some Linux VM’s (OL-7) and don’t want to manually add the networking/config info. There is already repository setup for bare metal linux hosts that will do what I want, but I’m not sure how to add the kickstart file to a new VM that is
booting up. My guess is to connect the virtual floppy, but I’m not sure where/how to create the virtual floppy using the correct format Hyper-V/Microsoft wants.

Has anyone done this before or have a good tutorial URL for this?


Read full post . . . .

Windows Server 2019 standard with REFS file system – Stand alone Hyper-V server


I am planning to deploy a stand alone Windows Server 2019 standard Hyper-V server with ReFS file system. This is primarily for windows server virtualization .The idea is to take benefit of new de-duplication feature of Refs.  I have following questions
around this deployment

1) Is ReFS supported on stand alone Hyper-V deployment? It will have only local disks.

2) Is ReFS de-duplication supported on standard edition of windows server 2019?

3) any known limitation?

Karthik R

Read full post . . . .

Live Migrations No Longer Working After January 2019 Updates

Thanks for the reply Michael

We have found out that the problem is actually caused by the January update (KB4480963 Monthly Rollup) This affects AMD Bulldozer Family 15h, AMD Jaguar Family 16h, and AMD Puma Family 16h second generation microarchitecture one of which our hosts use, 
and is solved, (we must verify) with KB4490512.

However KB4490512 requires a reboot;
We are unable to live migrate between hosts using SCVMM or Failover Cluster Manager although we can cold migrate.
We have 400 plus live VMs over 40 plus hosts and could really do with a solution that would not involve us powering off our VMs



Read full post . . . .

Hyper-V File Server setup recomendation

Hi All,

We have a 2 node Hyper-V cluster running windows server 2012 R2. A third Hyper-V server is located at our DR site that is not part of the cluster however it is using Hyper-V replication for VM between our primary site. The backend connects to a SAN via iSCSI
and we are using CSVs as storage for the VMs.

We have built a VM running windows server 2016 that hosts our company documents and user profiles. The company documents and users profiles reside on seperate .VHDX files. These sit on seperate LUNS presented to the hosts and configured as CSVs. The server
is configured for Hyper-V HA, and we are using DFSR to replicate company documents and user profile data. The data is being replicated to a VM at our DR site running another VM with the same specs.

Since we have a 2 node setup setup in our production site, is there a way i can build a second server so i can redirect the users to point the the second server seamlessly (no downtime) so i can patch one of the systems?

Is there a way to do this so i don’t have to have duplicate data on each of the VM’s?

Thanks in advance.

Read full post . . . .

Go Que Newsroom