Comments (16)
@TravisEz13, I really like your idea about the xNetworkAdapterName resource instead of needing to change xDNSServerAddress.
I'd also suggest that the xNetworkAdapterName resource should support setting the adapter name based on MAC as well. The reason for this is that I automate VM creation where I know/can set the MAC of each adapter in a VM on creation and automatically assemble the DSC configurations with that in mind. At the moment I'm using unattend.xml to configure the Adapter name on first boot so that xDNSServerAddress etc can be used against a known adapter name. So this would solve a problem for me and get rid of the need to use Unattend.xml.
My 2c. Thanks.
from networkingdsc.
I think we could add support to use a wildcard NIC alias - e.g. ' * ' or ' ethernet* ' . The NIC alias would still remain the key.
from networkingdsc.
I think there was a PR floating around to add support for wildcard aliases? I recall there was one but there was some trouble with it so the PR got closed. @tysonjhayes, do you remember if this was the case? I can't find the Issue or PR though. Perhaps the change could be resuscitated?
from networkingdsc.
from networkingdsc.
Yes it was #57, was recently closed because the author didn't have time to get it fixed up to be merged.
from networkingdsc.
@PlagueHO @tysonjhayes @iainbrighton You may need to query to find the NIC on multiple values (especially on physical machines, Such as the physical media type, the status, etc. Additionally, predicting the name might be difficult if the hardware is not standardized.). A separate resource that sets the name would be more salable (the actual interface alias could be used on every resource instead of needing to put the query code in each resource.)
I've prototyped such a resource as xNetworkAdapterName
from networkingdsc.
@PlagueHO I'm hitting design issues on the resource. My current thought is to write the helpers to perform the work and expose them in the xNetworking module. Then the helpers can be used in a script resource for now until the design work is done.
from networkingdsc.
@TravisEz13 - this sounds like a good approach to me.
I'm presuming that the helper would allow any resource to query the available network adapters based on particular requirements (Is it up, Adapter Number, Device driver etc) and then return the appropriate adapter. This would then allow these criteria to be exposed by parameters in each resource - meaning that an adapter could be chosen without knowing the actual name. Or is this not the approach you're thinking of?
from networkingdsc.
@PlagueHO
I would have a get, set, test method, with query parameters and a name parameter. They would behave like a resource and allow you to build easily a script resource. I plan only to support 2 query parameters to begin with, physical media type (optional, no default) and status (optional, but defaulted to be 'Up'), Other query parameter can be added after the, basic concepts have been worked out.
Get- would tell you the name of the first interface which matches the criteria, and how many match the criteria (an interface with the exact name will always be included,)
Test- would return true if you have an interface matching the name (the query parameter are ignored. I'm assuming you are using a unique name and this shouldn't be a significant issue.)
Set- if there is not already an interface matching the name, take the interface returned my get and rename it to the name you specified.
from networkingdsc.
@PlagueHO FYI, my changes are here NetAdapter. I've integrated the changes into some test work I'm doing.
from networkingdsc.
@TravisEz13 - ah I see. So these three function of the "NetAdapter helper module" could then be consumed by the other Resources to allow them to identify the specific adapter to work on. So each resource would need to be updated to take the same parameters as the "NetAdapter helper module" - is that correct?
Seems like a pretty good approach to me. It also looks like the xNetAdaperName resource you've created is also a great idea. This actually solves a problem I currently have: I'm assigning Network adapter names of the devices using a script run on first boot of a VM - which is a very nasty approach. This new resource will eliminate this - excellent!
Really great stuff there!
from networkingdsc.
@TravisEz13 The xNetAdapterName resource is badly needed, particularly on hypervisors other than Hyper-V. So; chop, chop 😜
from networkingdsc.
@iainbrighton @PlagueHO I've tested my functions. I'm ready to PR, but the names aren't approved. My current idea is that I add a warning that the names of the function and parameters are being designed and may change. Then I can get some feedback about the functions, while there are open questions
from networkingdsc.
@iainbrighton @PlagueHO FYI, I've submitted my PR
from networkingdsc.
I'll close this for now. Someone can open an new issue if an actual resource is needed.
from networkingdsc.
I might implement an xInterfaceName module using this at some point - I could definitely use that myself. I'll log an "New resource" issue in case someone else wants to have a go. Thanks @TravisEz13
from networkingdsc.
Related Issues (20)
- NetAdapterBinding: Use of State & CurrentState Properties is non-idiomatic HOT 6
- IpConfiguration: Can't configure IPv4 address on adapter that only has IPv6 on it
- Update Sampler Build Tasks
- Enable Code Coverage Reporting
- PowerShell-DLM
- Resource parameter naming inconsistent HOT 1
- Include hidden adapters by default? HOT 3
- Remove group of FW rules HOT 1
- NetAdapterAdvancedProperty Constantly Re-Running
- Issue with Networkteaminterface when vlanid is used
- Problem with DSC Automate Account
- Update Azure DevOps Pipeline Images
- Update CI Pipeline Files from Latest Pattern
- Intermittent Integration Test Failures on Windows Server 2022
- Netbios: Fails to disable when NIC has link down HOT 6
- Correct Changelog.md Heading HOT 3
- DnsServerAddress: Fails when trying to rename network adapter when running Test
- NetBios resource failing for Azure VMs with Accelerated Networking enabled
- Firewall resource isn't properly identifying some built-in rules on Windows Server (2019 and 2022 tested) HOT 5
- The first byte of the proxy settings binary was '60' but should have been 0x46. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from networkingdsc.