Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Working example of IP Address configuration missing #347

Open
DennisL68 opened this issue Mar 30, 2020 · 3 comments
Open

Doc: Working example of IP Address configuration missing #347

DennisL68 opened this issue Mar 30, 2020 · 3 comments
Labels
question The issue is a question.

Comments

@DennisL68
Copy link

DennisL68 commented Mar 30, 2020

Verison of PowerShell: 
$PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17763  1007

PowerShell host:
Console

Operating system:
Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture, WindowsDirectory


Caption                 : Microsoft Windows Server 2019 Standard
Version                 : 10.0.17763
ServicePackMajorVersion : 0
OSArchitecture          : 64-bit
WindowsDirectory        : C:\Windows


Version of LabBuilder:
PS C:\Windows\system32> Get-Module -Name LabBuilder -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.5.105  LabBuilder                          {Get-LabResourceModule, Initialize-LabResourceModule, Get-...

I'm stomped, but IP configuration is never applied to my VM's. I'm probably just messing the syntax up, but I can't find any working examples that sets the IP :/

The config below (along with the templates etc.) creates and starts a VM without any errors, but the IP isn't set...

<vm name="APPSRV"
        template="Template Windows Server 2012 R2 - 1GB"
        computername="APPSRV"
        bootorder="40">

      <adapters>
        <adapter name="Adapter1"
          switchname="Test">
          <ipv4 address="10.10.10.15"
            defaultgateway="10.10.10.1"
            subnetmask="24"/>
        </adapter>
      </adapters>

      <datavhds>
        <datavhd vhd="data/disk1.vhdx"
          type="dynamic"
          size="40GB"
          partitionstyle="gpt"
          filesystem="ntfs"/>
      </datavhds>
    </vm>
@DennisL68
Copy link
Author

DennisL68 commented Mar 30, 2020

OK, found the reason in schema\labbuilderconfig-schema.xsd

This optional attribute configures this Virtual Adapter to use a static IPv4 address.
If this attribute is defined then the IPv4 subnetmask attribute should also be defined.
This property of the Virtual Adapter is configured using Desired State Configuration.

So if DSC isn't used, this won't kick neither?

@PlagueHO PlagueHO added the question The issue is a question. label Mar 30, 2020
@PlagueHO
Copy link
Owner

Hi @DennisL68 - that is correct. The block is used to create part of a DSC configuration that is applied to the node when it is first booted.

The Networking configuration is "injected" into the general DSC configuration that is applied to the node.

But you're right - if DSC is not used at all (and disabled) then the node won't get a custom IP configuration. Your use case is completely valid, I just didn't consider that as I actually created this project around DSC.

You could apply a completely empty DSC config to the node - which LabBuilder will then inject the Networking config into for you and apply it. Would that work for you?

@DennisL68
Copy link
Author

DennisL68 commented Mar 31, 2020

I don't know yet. My lab is about DSC itself, to replicate a production scenario.
As long as the DSC config is only injected and not uphold, I would assume that I could just disable the setup DSC and then replace it with my own DSC solution?

If that doesn't work I reckon I'll go with DHCP and do the static IP settings using my own DSC setup instead (although that would break the DHCP production scenario).

I assume the setupcomplete="Scripts\SetupScompleteDebug.cmd" is injected in the VHDX template disk file and not in the VHDX VM disk file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants