none
Error- Failed to modify device 'Microsoft Synthetic Ethernet Port'

    Question

  • I am trying to modify adapters settings to make them connect to a different virtual switch. Brief stpes in my code are as below-

    Get wmi path ("__PATH" property) of the virtual switch

    query VSSDs of the VM using query-
    "Associators of <VM_WMI_Path> WHERE AssocCLass=Msvm_SettingsDefineState ResultClass=Msvm_VirtualSystemSettingData"

    Get wmi path ("__PATH" property)  of the VSSD

    Query adapters using the VSSD
    "Associators of <VSSD_WMI_PATH> WHERE AssocCLass=Msvm_VirtualSystemSettingDataComponent ResultClass=Msvm_SyntheticEthernetPortSettingData"

    For each nicsetting do the following

    Get Msvm_VirtualSystemManagementService class object
    Get ModifyVirtualSystemResources method object

    CComPtr<IWbemClassObject> pClassInstance = NULL;
    hr = pInParamsDefiniton->SpawnInstance(0, &pClassInstance);
     
    varCommand.Clear(); // varCommand is CComVariant
     
    // let's set up in parameters for ModifyVirtualSystemResources method
    varCommand = pstrVmPath;
    hr = pClassInstance->Put(L"ComputerSystem", 0, &varCommand, 0);
    varCommand.Clear();

    CComSafeArray<BSTR> saVSwitchPath;
    saVSwitchPath.Create();
    saVSwitchPath.Add(_bstr_t(wssVSwitchPath.str().c_str()));
    varCommand = saVSwitchPath;
    hr = nicsetting->Put(L"Connection", 0, &varCommand, 0);
    varCommand.Clear();
    saVSwitchPath.Destroy();
     
    std::wstring xml;
    hr = ConvertWmiObjectToXml_(nicsetting, xml);
     
    CComSafeArray <BSTR> saResoureSettingData;
    saResoureSettingData.Add(_bstr_t(xml.c_str()));
    varCommand = saResoureSettingData;
    hr = pClassInstance->Put(L"ResourceSettingData", 0, &varCommand, 0);
    saResoureSettingData.Destroy();
    varCommand.Clear();
     
    // get full path to the Msvm_VirtualSystemManagementService object
    std::wstring anObjectPath(L"\0", 256); 
    hr = GetWMIObjectPath_(VIRTUALIZATION, className, NULL, anObjectPath); // GetWMIObjectPath_ is my mthod
     
    // execute ModifyVirtualSystemResources method
    CComPtr<IWbemClassObject> pOutParam = NULL;
    hr = m_hyperVService->ExecMethod(_bstr_t(anObjectPath.c_str()), methodName, 0, NULL, pClassInstance, &pOutParam, NULL);

    Operation fails with error- Failed to modify device 'Microsoft Synthetic Ethernet Port'. I found some references on internet where it is mentioned that this is caused by anti virus software.
    I have Symnatec Endpoint Protection on my Hyper-V server. I disaabled that in the hope that it will solve the problem. But it did not. Is there any problem with this code? Is there any security/permissions issue? The program connects to the server using administrator credentials.


    • Edited by bvivekb4u Wednesday, March 14, 2012 7:14 AM
    Wednesday, March 14, 2012 7:12 AM

All replies

  • The error sounds as if you are in the right place.

    Did you check the Hyper-V Server Event Logs - under Applications and Services - Microsoft - Hyper-V

    It will most likely be in the operational log.

    There is also a WMI log buried in there that you can enable tracing on to see if it is a WMI error.

    If it is permissions you should have some deail in the error returned that it is, the account that you use must be in the Local Administrators group of the Hyper-V Server (for full control) or scoped properly in Autohrozation Manager.

    I love this post by Ben regarding associations: http://blogs.msdn.com/b/virtual_pc_guy/archive/2009/03/12/scripting-hyper-v-using-associations.aspx

    You are using SettingData so that should cover whether the VM is on or off....  hmm.

    Take a look a thte comments here: http://itproctology.blogspot.com/2011/11/hyper-v-wmi-association-null-returns.html and see if anything is useful.  Something tells me that you are missing an association or some of the settings.


    Brian Ehlert (hopefully you have found this useful)
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Wednesday, March 14, 2012 2:56 PM
    Moderator
  • I tried digging into event logs and wmi logs. Unfortunately I could not find any hint to the problem/solution. Event ID in the event logs is 14144 and I could not find any helpful reference to this event id.

    The account used is Hyper-V server's administrator account. I tried giving full control to all users in Autohrozation Manager (a wild attempt to get rid of error ;)), but it did not work.

    To make sure that its not a local/remote issue, I tried the same thing in a c# code on the Hyper-V server locally and got the same error. (moving our c++ code and setting up env on Hyper-V server was pain...so wrote a quick c# code).

    Now, I'll go through the links you suggested and see if there is any hint...

    Thanks,

    Vivek.

    Wednesday, March 14, 2012 4:14 PM
  • I think I am connecting and querying objects using correct assosiations....So that does not seem to be a problem....

    This seems to be a security or similar permissions issue....any help please?

    Thursday, March 15, 2012 3:06 PM
  • Are you able to solve this problem? I am also facing the same issue (Adding device using AddVirtualSystemResources)  on Windows 2012.   The reason I found was that the error code value is 32774 (System In Use) on Msvm_ConcreteJob. What could be the issue? I ran the WMI C++ program as well as powershell script. I keep getting the same error code. I have closed hyperv manager and tried but failed. Even I don't have  anitvirus installed as some the threads suggested an issue could be because of installed Antivirus.  Is there any other process holding up the hyper-v manager.  I don't get this when I add/modify the network adapter using hyper-v manager. Any help in this regard is highly appreciated.  

    Wednesday, February 20, 2013 6:53 AM
  • I´ve the same problem and I cannot find a solution for it.

    I´m trying to install the Cisco Nexus 1000V on SCVMM 2012 and I received the error:


    Cisco.Nexus1000VInstaller.Core.SCVMMError: VMM cannot complete the host operation on the server1.loca server because of the error: 'Nexus1000V_VSM_n1000v_1' failed to modify device 'Synthetic Ethernet Port'. (Virtual machine ID 5C98CDF0-E6D8-48DC-AA32-092F039CC2E1)

    Did anybody found a solution?


    Geraldo Viana

    Thursday, July 11, 2013 3:20 PM
  • If I read this right you just want to movea VM from 1 vswitch to another??

     

    $vswitch = get-vmswitch
    $VMS = get-vmnetworkadapter * | sort "VMName"

    Write-Host -foreground "magenta" "****** This Action WILL NOT Stop your VM ******"
    Write-Host -foreground "magenta" "****** Select the VM to change the vSwitch on******"
    Write-Host ""
    Write-Host -foreground "Yellow" "** VM Name, vSwitch Name, NIC Name **"

    #Display a list of the vms
    $i = 1
    $VMS | ForEach-Object {
                    Write-Host "$i $($_.VMName,$_.switchname,$_.name)"
                    $i++
    }

    #Ask for input
    Write-Host ""
    Write-Host -foreground "Red" "Type 0 to exit out of this Menu"
    Write-Host -foreground "magenta" ""
    $SelectedVMIndex = Read-Host "Please select a Number"
    $SelectedVMIndex = $SelectedVMIndex - 1
    $SelectedVM = $VMS[$SelectedVMIndex]
    $VMNAME = $SelectedVM.vmname
    $NIC = $SelectedVM.name

    if($SelectedVMIndex -eq -1)
    {exit}
    else {
    # create numbered array of vswitches
    $i = 1
    $vswitch | ForEach-Object {
                    Write-Host "$i $($_.Name)”
                    $i++
    }

    #Ask for number selection
    Write-Host ""
    $SelectedVMIndex1 = Read-Host "**** Please select a Number to attach the VM too ***”
    $SelectedVMIndex1 = $SelectedVMIndex1 - 1
    $SelectedVM1 = $vswitch[$SelectedVMIndex1]
    $vSwitch1 = $SelectedVM1.name

    Write-Host -foreground "magenta" "Changing Virtual machine $VMNAME vswitch to $vSwitch1”
    Connect-VMNetworkAdapter -VMName $VMNAME -Name $NIC -SwitchName $vSwitch1
    get-vmnetworkadapter $VMNAME | Select vmname,switchname,name,ipaddresses | format-table -autosize
    pause
    }

    If you want to remove the vswitch then that is another thing

    $vswitch = get-vmswitch
    $VMS = get-vmnetworkadapter * | sort "VMName"
     
    Write-Host -foreground "magenta" "****** This Action WILL NOT Stop your VM ******"
    Write-Host -foreground "magenta" "****** Select the VM to plug/unplug from the vSwitch ******"
    Write-Host ""
    Write-Host -foreground "Yellow" "** VM Name, vSwitch Name, NIC Name **"

    #Display a list of the vms
    $i = 1
    $VMS | ForEach-Object {
                    Write-Host "$i $($_.VMName,$_.switchname,$_.name)"
                    $i++
    }

    #Ask for input
    Write-Host ""
    Write-Host -foreground "Red" "Type 0 to exit out of this Menu"
    Write-Host -foreground "magenta" ""
    $SelectedVMIndex = Read-Host "Please select a Number"
    $SelectedVMIndex = $SelectedVMIndex - 1
    $SelectedVM = $VMS[$SelectedVMIndex]
    $VMNAME = $SelectedVM.vmname
    $nic = $SelectedVM.name
    $switch = $SelectedVM.switchname

    if($SelectedVMIndex -eq -1)
    {exit}
    else {
    #Ask for action
    Write-host -foreground "magenta" "1. Plug a VM into a vSwitch"
    Write-host -foreground "magenta" "2. Unplug a VM into a vSwitch"
    $SelectedIndex4 = Read-Host "What do you want to do Plug or Unplug $VMNAME"
    $Selection = $SelectedIndex4

    if($Selection -eq 1)
    {
    # create numbered array of vswitches
    $i = 1
    $vswitch | ForEach-Object {
                    Write-Host "$i $($_.Name)”
                    $i++
    }

    #Ask for number selection
    Write-Host -foreground "magenta" ""
    $SelectedVMIndex1 = Read-Host "**** Please select a Number to attach the VM too ***"
    $SelectedVMIndex1 = $SelectedVMIndex1 - 1
    $SelectedVM1 = $vswitch[$SelectedVMIndex1]
    $Switch2 = $SelectedVM1.name

    Write-Host -foreground "magenta" "Plugging Virtual machine $VMNAME into $Switch2"
    Connect-VMNetworkAdapter -VMName $VMNAME -Name $nic -SwitchName $Switch2
    get-vmnetworkadapter $VMNAME | Select vmname,switchname,name,ipaddresses | format-table -autosize
    pause}

    if($Selection -eq 2)
    {Write-Host -foreground "magenta" "Unplugging Virtual machine $VMNAME from $Switch"
    Get-VMNetworkAdapter -VMName $VMNAME | Where-Object {$_.switchName -eq $Switch -and $_.Name -eq $nic } | Disconnect-VMNetworkAdapter
    get-vmnetworkadapter $VMNAME | Select vmname,switchname,name,ipaddresses | format-table -autosize
    pause}
    }


    James_Stephan@yahoo.com visit my blog stephanco.blogspot.com

    Thursday, July 11, 2013 3:25 PM
  • Hi James,

    No, I´m trying the CISCO Nexus 1000v installation. The installation process crash and show this message.

    Cisco.Nexus1000VInstaller.Core.SCVMMError: VMM cannot complete the host operation on the server1.loca server because of the error: 'Nexus1000V_VSM_n1000v_1' failed to modify device 'Synthetic Ethernet Port'. (Virtual machine ID 5C98CDF0-E6D8-48DC-AA32-092F039CC2E1)

    I don´t know what to do...

    thanks.


    Geraldo Viana

    Thursday, July 11, 2013 5:19 PM
  • I am assuming that Cisco has excellent documentation for the installation of their Nexus.

    However, the Cisco router fully replaces the Hyper-V Switch.  So I would bet that you have an existing virtual switch that you need to toss away before the Cisco can go into place.

    I don't know if you can simply drop it into a running hypervisor with VMs, or if you need to begin with a clean hypervisor without and virtual switches.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Thursday, July 11, 2013 5:26 PM
    Moderator