Giter Site home page Giter Site logo

Comments (16)

PlagueHO avatar PlagueHO commented on July 24, 2024 1

@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.

PlagueHO avatar PlagueHO commented on July 24, 2024

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.

PlagueHO avatar PlagueHO commented on July 24, 2024

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.

iainbrighton avatar iainbrighton commented on July 24, 2024

from networkingdsc.

tysonjhayes avatar tysonjhayes commented on July 24, 2024

Yes it was #57, was recently closed because the author didn't have time to get it fixed up to be merged.

from networkingdsc.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@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.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@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.

PlagueHO avatar PlagueHO commented on July 24, 2024

@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.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@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.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@PlagueHO FYI, my changes are here NetAdapter. I've integrated the changes into some test work I'm doing.

from networkingdsc.

PlagueHO avatar PlagueHO commented on July 24, 2024

@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.

iainbrighton avatar iainbrighton commented on July 24, 2024

@TravisEz13 The xNetAdapterName resource is badly needed, particularly on hypervisors other than Hyper-V. So; chop, chop 😜

from networkingdsc.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@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.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

@iainbrighton @PlagueHO FYI, I've submitted my PR

from networkingdsc.

TravisEz13 avatar TravisEz13 commented on July 24, 2024

I'll close this for now. Someone can open an new issue if an actual resource is needed.

from networkingdsc.

PlagueHO avatar PlagueHO commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.