Closed benjFR69 closed 2 years ago
This row get the object to set:
and here we set the DNS Server value:
The problem is that the schema is not an array:
because the property we set expects an array:
Happy to review a PR that changes the schema to an array and enforces that array.
Hello, thanks for this code as it is very uncommon to have something functional for hyperv...
Details of the scenario you tried and the problem that is occurring
When you try to provide a table in the networkingsetting object it does not work as parameter of function is String and not Tab String (MSFT_xVMNetworkAdapter.psm1#L648 )
Verbose logs showing the problem
"module_version": "3.17.0.0", "msg": "Failed to invoke DSC Set method: Incorrect function. ", "reboot_required": false, "verbose_set": [ "Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.", "An LCM method call arrived from computer HOST with user sid S-1-5-21-203002872-2615672331-1556995904-17199.", "[LY-C3-HOST3]: LCM: [ Start Set ] [[xVMNetworkAdapter]DirectResourceAccess]", "[LY-C3-HOST3]: [[xVMNetworkAdapter]DirectResourceAccess] Getting VM Network Adapter information.", "[LY-C3-HOST3]: [[xVMNetworkAdapter]DirectResourceAccess] Adding VM Network Adapter.", "[LY-C3-HOST3]: LCM: [ End Set ] [[xVMNetworkAdapter]DirectResourceAccess] in 1.7500 seconds.", "Operation 'Invoke CimMethod' complete.", "Time taken for configuration job to complete is 1.906 seconds"
Suggested solution to the issue
Change parameter type to "String[]"
The DSC configuration that is used to reproduce the issue (as detailed as possible)
"item": { "NetworkSetting": { "DefaultGateway": "172.99.0.1", "DnsServer": "@("172.99.3.22", "172.993.2")", "IpAddress": "172.99.3.16", "Subnet": "255.255.0.0" }, "name": "default", "switchname": "test", "vlanid": "15" },
We also tried multiple setting : "DnsServer": ["172.99.3.22", "172.99.3.2"], "DnsServer": ("172.99.3.22", "172.99.3.2"), "DnsServer": "172.99.3.22, 172.99.3.2",