VirtualEngine / Lability

Virtual Engine test lab deployment and configuration module
MIT License
282 stars 50 forks source link

Non-English ISO options #387

Open jdhitsolutions opened 4 years ago

jdhitsolutions commented 4 years ago

Are there any options for non-English ISO images?

iainbrighton commented 4 years ago

Hi Jeff,

There are certainly other people using non-English ISOs and you can register additional evaluation ISOs as custom media today.

An alternative would be to include them in the standard definitions, but that will mean manually maintaining the download links for each additional language that's added.

What's your particular use case?

Thanks, Iain

jdhitsolutions commented 4 years ago

I maintain this project https://github.com/pluralsight/PS-AutoLab-Env which is basically a wrapper around Lability. (It is a long story) I have a user looking to add a Spanish culture ISO. I can setup the custom media. But I don't even know where to begin looking for the ISO files.

iainbrighton commented 4 years ago

For which Operating Systems do you need the Spanish ISOs for? Ultimately, they come from the Microsoft Evaluation Center.

jdhitsolutions commented 4 years ago

I found that. Even found the Spanish editions. I guess what I am most curious about is how you find the uri values used in Get-LabMedia? I think if I can find the right link I can register custom media.

iainbrighton commented 4 years ago

I simply register for the evaluation(s), download the media (noting the Uri) and then calculate the checksum (very scientific 😛). There is a little bit of massaging of the Uri to turn them into http://download.microsoft.com/download/ links for consistency, but I don't actually think that's necessary. If you let me know of one that you need I can provide an example?

jdhitsolutions commented 4 years ago

I thought you had a sneaky back-door way to harvest the direct download links. :wink: I was hoping to avoid the registration process. I think I can figure that part out. What I've never tried is to apply English language DSC configs against a non-English target.

iainbrighton commented 4 years ago

It should work as DSC is certainly used on non-English systems, however, some resources might have a problem with the localisation but that will be resource-specific.

Remember to include the custom bootstrap for client OSes! e.g.

$Win10EntVL = @{
    Id = "WIN10_x64_Enterprise_EN_VL";
    Filename = "WIN10_x64_1511_ENT.iso"
    Description = "Windows 10 64bit Enterprise English Volume License 1511";
    Architecture = "x64";
    ImageName = "Windows 10 Enterprise";
    MediaType = "ISO";
    Uri = "\\10.100.50.1\ISOs\en_Windows_10_Enterprise_1511_x64.ISO";
    CustomData = @{
    WindowsOptionalFeature = "NetFx3";
        CustomBootstrap = @(
            "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes",
            "NET USER Administrator /active:yes;",
            "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;",
            "## Kick-start PowerShell remoting on clients to permit applying DSC configurations",
            "Enable-PSRemoting -SkipNetworkProfileCheck -Force;"
        )
    }
}
Register-LabMedia @Win10EntVL;
jdhitsolutions commented 4 years ago

Thanks for the tip.

mgonzcast commented 4 years ago

Hi! I am the guy who asked about the Spanish configuration. My labs are 2012R2 based and will be in a near future 2016. I don´t mind using Lability instead of ps-autolab if that´s easier. In the long term I need to understand the process of creating VMs so I could use these tools not only for development and testing purposes but also for deploying production VMs. I originally thought of using DSC directly but I find it cumbersome for a newbie. Your tools are great because they create MOF DSC files that I could tweak in the future for deploying also in production (Maybe I am mistaken here with this approach)

What I need to do for creating a lab with a DC, Exchange and a CA with 2012R2 for starters?

jdhitsolutions commented 4 years ago

It is possible to tweak one of the configurations to download and use a Spanish ISO. But based on your use case, I don't think this module is really targeted for you. I agree you would be better off downloading the ISO file and building your own Hyper-V setup.

You can download the ISO images you need from https://www.microsoft.com/es-es/evalcenter/evaluate-windows-server-2012-r2

I'd suggest manually building Hyper-V VMS manually with the Hyper-V manager. Once you understand how Hyper-V works, then you can start figuring out the cmdlets.

mgonzcast commented 4 years ago

My main use case is to build test labs for testing. That is what lability and ps-autolab are meant to be? I don´t intend to use DSC right now and I am more in a need for being able to test things NOW. That´s why I find your tools are useful.

So again, what I should do to be able to use a spanish iso? Is it possible to tweak lability or ps-autolab to point to a local resource instead of an URL? For instance another similar project is autolab and they use local ISOs. I don´t quite understand why these tools has to download the ISO everytime I try to install a VM. I copied in ps-autolab ISOs folder an en-US ISO and still the ISO was downloaded from the Microsoft website.

jdhitsolutions commented 4 years ago

The PSAutolab module was specifically designed for lab setups that are part of some Pluralsight courses. While you can use the configurations for other things, it sounds like what you want is the actual Lability module. Yes, you can create a custom configuration to use the Spanish ISO. The ISO only gets downloaded once. The ISOs are under C:\Autolab\ISOs. There is also supposed to be a checksum file for each ISO. I'm assuming if the checksum is missing or wrong, the download happens.

I think the Lability module alone is what you really need so that you can build exactly what you need.

iainbrighton commented 4 years ago

@mgonzcast I'll try and take each question one at a time.

I originally thought of using DSC directly but I find it cumbersome for a newbie. Your tools are great because they create MOF DSC files that I could tweak in the future for deploying also in production.

I don´t intend to use DSC right now and I am more in a need for being able to test things NOW

Lability is built on top of DSC and uses the DSC configuration document (.psd1) to provision the virtual machines. You still need to create the DSC configuration and MOF files yourself. If you don't want to use DSC then Lability is not the tool for you.

PSAutoLab provides DSC configurations for specific Pluralsight courses and abstracts some of the complexities of Lability in the process (please correct me if I'm wrong @jdhitsolutions). If you want to create your own lab setups and want to use PSAutoLab, you'll need to create your own DSC configurations and MOF files. If you don't want to use DSC then PSAutoLab is not the tool for you either.

If you do want to continue to write your own DSC configurations, then I can provide answers to the ISO questions?

Thanks, Iain

jdhitsolutions commented 4 years ago

Yes. The PSAutolab module was written as a wrapper to make it easy for non-PowerShell users to quickly and easily build lab configurations for some Pluralsight courses.

mgonzcast commented 4 years ago

As I said, I want to test a lab with a Spanish ISO

The PSAutolab module was specifically designed for lab setups that are part of some Pluralsight courses. While you can use the configurations for other things, it sounds like what you want is the actual Lability module. Yes, you can create a custom configuration to use the Spanish ISO. The ISO only gets downloaded once. The ISOs are under C:\Autolab\ISOs. There is also supposed to be a checksum file for each ISO. I'm assuming if the checksum is missing or wrong, the download happens.

I think the Lability module alone is what you really need so that you can build exactly what you need.

So If I get you right, I need to create a checksum manually If I want to manually copy the ISO files instead of downloading them?

mgonzcast commented 4 years ago

@mgonzcast I'll try and take each question one at a time.

I originally thought of using DSC directly but I find it cumbersome for a newbie. Your tools are great because they create MOF DSC files that I could tweak in the future for deploying also in production.

I don´t intend to use DSC right now and I am more in a need for being able to test things NOW

Lability is built on top of DSC and uses the DSC configuration document (.psd1) to provision the virtual machines. You still need to create the DSC configuration and MOF files yourself. If you don't want to use DSC then Lability is not the tool for you.

PSAutoLab provides DSC configurations for specific Pluralsight courses and abstracts some of the complexities of Lability in the process (please correct me if I'm wrong @jdhitsolutions). If you want to create your own lab setups and want to use PSAutoLab, you'll need to create your own DSC configurations and MOF files. If you don't want to use DSC then PSAutoLab is not the tool for you either.

If you do want to continue to write your own DSC configurations, then I can provide answers to the ISO questions?

Thanks, Iain

As I said my main intention now is able to create a lab with Spanish ISO for a DC, CA and Exchange in my laptop.

What does exactly Lability do? what is the process generally speaking? What doesn´t Lability do? I don´t mind to use DSC, I just want to avoid the hussle of doing everything manually by myself. I just want a tool that eases the path.

iainbrighton commented 4 years ago

You will need to register custom media for your Spanish ISO. This can either be a local file share or downloaded from the web. Some more details on custom media can be found here.

I would recommend that you skip Windows Server 2012 R2 and go straight to Windows Server 2016. This has PowerShell 5.1 baked in and you'll save yourself a lot of pain with DSC in PowerShell 4 - you've been warned.

The easiest way to register custom media is to take an existing media entry and copy/update it. You can get a list of all available media like this:

Get-LabMedia

Id                                      Arch Media Description
--                                      ---- ----- -----------
2019_x64_Standard_EN_Eval                x64   ISO Windows Server 2019 Standard 64bit English Evaluation with Deskto...
2019_x64_Standard_EN_Core_Eval           x64   ISO Windows Server 2019 Standard 64bit English Evaluation
2019_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2019 Datacenter 64bit English Evaluation with Desk...
2019_x64_Datacenter_EN_Core_Eval         x64   ISO Windows Server 2019 Datacenter Evaluation in Core mode
2016_x64_Standard_EN_Eval                x64   ISO Windows Server 2016 Standard 64bit English Evaluation
2016_x64_Standard_Core_EN_Eval           x64   ISO Windows Server 2016 Standard Core 64bit English Evaluation
2016_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2016 Datacenter 64bit English Evaluation
2016_x64_Datacenter_Core_EN_Eval         x64   ISO Windows Server 2016 Datacenter Core 64bit English Evaluation
2016_x64_Standard_Nano_EN_Eval           x64   ISO Windows Server 2016 Standard Nano 64bit English Evaluation
2016_x64_Datacenter_Nano_EN_Eval         x64   ISO Windows Server 2016 Datacenter Nano 64bit English Evaluation
2012R2_x64_Standard_EN_Eval              x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation
2012R2_x64_Standard_EN_V5_Eval           x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation with WMF 5
2012R2_x64_Standard_EN_V5_1_Eval         x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation with WMF...
2012R2_x64_Standard_Core_EN_Eval         x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation
2012R2_x64_Standard_Core_EN_V5_Eval      x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation wit...
2012R2_x64_Standard_Core_EN_V5_1_Eval    x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation wit...
2012R2_x64_Datacenter_EN_Eval            x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation
2012R2_x64_Datacenter_EN_V5_Eval         x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation with W...
2012R2_x64_Datacenter_EN_V5_1_Eval       x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation with W...
2012R2_x64_Datacenter_Core_EN_Eval       x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation
2012R2_x64_Datacenter_Core_EN_V5_Eval    x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation w...
2012R2_x64_Datacenter_Core_EN_V5_1_Eval  x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation w...
WIN81_x64_Enterprise_EN_Eval             x64   ISO Windows 8.1 64bit Enterprise English Evaluation
WIN81_x64_Enterprise_EN_V5_Eval          x64   ISO Windows 8.1 64bit Enterprise English Evaluation with WMF 5
WIN81_x64_Enterprise_EN_V5_1_Eval        x64   ISO Windows 8.1 64bit Enterprise English Evaluation with WMF 5.1
WIN81_x86_Enterprise_EN_Eval             x86   ISO Windows 8.1 32bit Enterprise English Evaluation
WIN81_x86_Enterprise_EN_V5_Eval          x86   ISO Windows 8.1 32bit Enterprise English Evaluation with WMF 5
WIN81_x86_Enterprise_EN_V5_1_Eval        x86   ISO Windows 8.1 32bit Enterprise English Evaluation with WMF 5.1
WIN10_x64_Enterprise_EN_Eval             x64   ISO Windows 10 64bit Enterprise 1909 English Evaluation
WIN10_x86_Enterprise_EN_Eval             x86   ISO Windows 10 32bit Enterprise 1909 English Evaluation
WIN10_x64_Enterprise_LTSC_EN_Eval        x64   ISO Windows 10 64bit Enterprise LTSC 2019 English Evaluation
WIN10_x86_Enterprise_LTSC_EN_Eval        x86   ISO Windows 10 32bit Enterprise LTSC 2019 English Evaluation

Find the one that closely matches your requirement, e.g. 2016_x64_Datacenter_EN_Eval

Get-LabMedia -Id 2016_x64_Datacenter_EN_Eval | Format-List

Id              : 2016_x64_Datacenter_EN_Eval
Filename        : 2016_x64_EN_Eval.iso
Description     : Windows Server 2016 Datacenter 64bit English Evaluation
Architecture    : x64
ImageName       : 4
MediaType       : ISO
OperatingSystem : Windows
Uri             : http://download.microsoft.com/download/1/4/9/149D5452-9B29-4274-B6B3-5361DBDA30BC/14393.0.161119-1705
                  .RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO
Checksum        : 70721288BBCDFE3239D8F8C0FAE55F1F
CustomData      : @{WindowsOptionalFeature=System.Object[]; MinimumDismVersion=10.0.0.0}
Hotfixes        : {}

Update the values appropriately when running Register-LabMedia

$registerLabMediaParams = @{
    Id = '2016_x64_Datacenter_ES_Eval'
    Filename = '2016_x64_ES_Eval.iso'
    Description = 'Windows Server 2016 Datacenter 64bit Spanish Evaluation'
    Architecture = 'x64'
    MediaType = 'ISO'
    ImageName = 4
    Uri = 'file://iso_source_location'
}
Register-LabMedia @registerLabMediaParams

Id              : 2016_x64_Datacenter_ES_Eval
Filename        : 2016_x64_ES_Eval.iso
Description     : Windows Server 2016 Datacenter 64bit Spanish Evaluation
Architecture    : x64
ImageName       : 4
MediaType       : ISO
OperatingSystem : Windows
Uri             : file://iso_source_location/
Checksum        : 
CustomData      : 
Hotfixes        : 

Copy your localised ISO into the Lability ISO location using the Filename specified when registering the media to avoid any downloads. You can find the configured ISO path by running Get-LabHostDefault cmdlet:

Get-LabHostDefault

ConfigurationPath            : D:\Lability\Configurations
DifferencingVhdPath          : D:\Lability\VMDisks
HotfixPath                   : E:\Lability\Hotfixes
IsoPath                      : E:\Lability\ISOs
ModuleCachePath              : C:\ProgramData\Lability\Modules
ParentVhdPath                : D:\Lability\ParentDisks
RepositoryUri                : https://www.powershellgallery.com/api/v2/package
ResourcePath                 : E:\Lability\Resources
ResourceShareName            : Resources
DisableLocalFileCaching      : False
DisableSwitchEnvironmentName : False
DisableVhdEnvironmentName    : True
EnableCallStackLogging       : False
DismPath                     : C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Dism\Microsoft.Dism.PowerShell.dll

Things to be aware of:

Once you've registered the custom media, you'll need to update the DSC configuration document. We can cover that off after you got your media registered.

iainbrighton commented 4 years ago

What is Lability?

In short, after you have created your DSC configuration(s), configuration document (.psd1) and MOF files, you can add some additional metadata to the .psd1 file. Lability can read this additional metadata and then provision a Hyper-V VM per node, configure the OS, inject the required DSC resources and MOF files.

If you don't use (or don't want to use) Lability you would have to perform the following tasks (per VM) via some other method, e.g. Packer:

  1. Create a Hyper-V VM
  2. Deploy the Operating System
  3. Install all the required DSC modules (if not using a DSC pull server)
  4. Enable PSRemoting and apply the MOF file

Does that clarify things?

mgonzcast commented 4 years ago

You will need to register custom media for your Spanish ISO. This can either be a local file share or downloaded from the web. Some more details on custom media can be found here.

I would recommend that you skip Windows Server 2012 R2 and go straight to Windows Server 2016. This has PowerShell 5.1 baked in and you'll save yourself a lot of pain with DSC in PowerShell 4 - you've been warned.

The easiest way to register custom media is to take an existing media entry and copy/update it. You can get a list of all available media like this:

Get-LabMedia

Id                                      Arch Media Description
--                                      ---- ----- -----------
2019_x64_Standard_EN_Eval                x64   ISO Windows Server 2019 Standard 64bit English Evaluation with Deskto...
2019_x64_Standard_EN_Core_Eval           x64   ISO Windows Server 2019 Standard 64bit English Evaluation
2019_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2019 Datacenter 64bit English Evaluation with Desk...
2019_x64_Datacenter_EN_Core_Eval         x64   ISO Windows Server 2019 Datacenter Evaluation in Core mode
2016_x64_Standard_EN_Eval                x64   ISO Windows Server 2016 Standard 64bit English Evaluation
2016_x64_Standard_Core_EN_Eval           x64   ISO Windows Server 2016 Standard Core 64bit English Evaluation
2016_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2016 Datacenter 64bit English Evaluation
2016_x64_Datacenter_Core_EN_Eval         x64   ISO Windows Server 2016 Datacenter Core 64bit English Evaluation
2016_x64_Standard_Nano_EN_Eval           x64   ISO Windows Server 2016 Standard Nano 64bit English Evaluation
2016_x64_Datacenter_Nano_EN_Eval         x64   ISO Windows Server 2016 Datacenter Nano 64bit English Evaluation
2012R2_x64_Standard_EN_Eval              x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation
2012R2_x64_Standard_EN_V5_Eval           x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation with WMF 5
2012R2_x64_Standard_EN_V5_1_Eval         x64   ISO Windows Server 2012 R2 Standard 64bit English Evaluation with WMF...
2012R2_x64_Standard_Core_EN_Eval         x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation
2012R2_x64_Standard_Core_EN_V5_Eval      x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation wit...
2012R2_x64_Standard_Core_EN_V5_1_Eval    x64   ISO Windows Server 2012 R2 Standard Core 64bit English Evaluation wit...
2012R2_x64_Datacenter_EN_Eval            x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation
2012R2_x64_Datacenter_EN_V5_Eval         x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation with W...
2012R2_x64_Datacenter_EN_V5_1_Eval       x64   ISO Windows Server 2012 R2 Datacenter 64bit English Evaluation with W...
2012R2_x64_Datacenter_Core_EN_Eval       x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation
2012R2_x64_Datacenter_Core_EN_V5_Eval    x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation w...
2012R2_x64_Datacenter_Core_EN_V5_1_Eval  x64   ISO Windows Server 2012 R2 Datacenter Core 64bit English Evaluation w...
WIN81_x64_Enterprise_EN_Eval             x64   ISO Windows 8.1 64bit Enterprise English Evaluation
WIN81_x64_Enterprise_EN_V5_Eval          x64   ISO Windows 8.1 64bit Enterprise English Evaluation with WMF 5
WIN81_x64_Enterprise_EN_V5_1_Eval        x64   ISO Windows 8.1 64bit Enterprise English Evaluation with WMF 5.1
WIN81_x86_Enterprise_EN_Eval             x86   ISO Windows 8.1 32bit Enterprise English Evaluation
WIN81_x86_Enterprise_EN_V5_Eval          x86   ISO Windows 8.1 32bit Enterprise English Evaluation with WMF 5
WIN81_x86_Enterprise_EN_V5_1_Eval        x86   ISO Windows 8.1 32bit Enterprise English Evaluation with WMF 5.1
WIN10_x64_Enterprise_EN_Eval             x64   ISO Windows 10 64bit Enterprise 1909 English Evaluation
WIN10_x86_Enterprise_EN_Eval             x86   ISO Windows 10 32bit Enterprise 1909 English Evaluation
WIN10_x64_Enterprise_LTSC_EN_Eval        x64   ISO Windows 10 64bit Enterprise LTSC 2019 English Evaluation
WIN10_x86_Enterprise_LTSC_EN_Eval        x86   ISO Windows 10 32bit Enterprise LTSC 2019 English Evaluation

Find the one that closely matches your requirement, e.g. 2016_x64_Datacenter_EN_Eval

Get-LabMedia -Id 2016_x64_Datacenter_EN_Eval | Format-List

Id              : 2016_x64_Datacenter_EN_Eval
Filename        : 2016_x64_EN_Eval.iso
Description     : Windows Server 2016 Datacenter 64bit English Evaluation
Architecture    : x64
ImageName       : 4
MediaType       : ISO
OperatingSystem : Windows
Uri             : http://download.microsoft.com/download/1/4/9/149D5452-9B29-4274-B6B3-5361DBDA30BC/14393.0.161119-1705
                  .RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO
Checksum        : 70721288BBCDFE3239D8F8C0FAE55F1F
CustomData      : @{WindowsOptionalFeature=System.Object[]; MinimumDismVersion=10.0.0.0}
Hotfixes        : {}

Update the values appropriately when running Register-LabMedia

$registerLabMediaParams = @{
    Id = '2016_x64_Datacenter_ES_Eval'
    Filename = '2016_x64_ES_Eval.iso'
    Description = 'Windows Server 2016 Datacenter 64bit Spanish Evaluation'
    Architecture = 'x64'
    MediaType = 'ISO'
    ImageName = 4
    Uri = 'file://iso_source_location'
}
Register-LabMedia @registerLabMediaParams

Id              : 2016_x64_Datacenter_ES_Eval
Filename        : 2016_x64_ES_Eval.iso
Description     : Windows Server 2016 Datacenter 64bit Spanish Evaluation
Architecture    : x64
ImageName       : 4
MediaType       : ISO
OperatingSystem : Windows
Uri             : file://iso_source_location/
Checksum        : 
CustomData      : 
Hotfixes        : 

Copy your localised ISO into the Lability ISO location using the Filename specified when registering the media to avoid any downloads. You can find the configured ISO path by running Get-LabHostDefault cmdlet:

Get-LabHostDefault

ConfigurationPath            : D:\Lability\Configurations
DifferencingVhdPath          : D:\Lability\VMDisks
HotfixPath                   : E:\Lability\Hotfixes
IsoPath                      : E:\Lability\ISOs
ModuleCachePath              : C:\ProgramData\Lability\Modules
ParentVhdPath                : D:\Lability\ParentDisks
RepositoryUri                : https://www.powershellgallery.com/api/v2/package
ResourcePath                 : E:\Lability\Resources
ResourceShareName            : Resources
DisableLocalFileCaching      : False
DisableSwitchEnvironmentName : False
DisableVhdEnvironmentName    : True
EnableCallStackLogging       : False
DismPath                     : C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Dism\Microsoft.Dism.PowerShell.dll

Things to be aware of:

  • If you don't specify a checksum, the checksum is not checked
  • As long as a file exists in the ISO location that matches the Filename parameter, e.g. 2016_x64_ES_Eval.iso it won't attempt to download it from the Uri specified

    • If it doesn't exist or the checksum is wrong, it'll get downloaded

Once you've registered the custom media, you'll need to update the DSC configuration document. We can cover that off after you got your media registered.

Many thanks for your throughly answer!

When you say about Powershell 4 or 5.1 you are talking about the OS of the hosting machine, don´t you?

I have Windows 10 Pro as a Host OS, as I said, this is for creating labs in my laptop

mgonzcast commented 4 years ago

What is Lability?

In short, after you have created your DSC configuration(s), configuration document (.psd1) and MOF files, you can add some additional metadata to the .psd1 file. Lability can read this additional metadata and then provision a Hyper-V VM per node, configure the OS, inject the required DSC resources and MOF files.

If you don't use (or don't want to use) Lability you would have to perform the following tasks (per VM) via some other method, e.g. Packer:

  1. Create a Hyper-V VM
  2. Deploy the Operating System
  3. Install all the required DSC modules (if not using a DSC pull server)
  4. Enable PSRemoting and apply the MOF file

Does that clarify things?

It does indeed! Just wondering, there is any tool that help me to create those DSC configuration for my labs or anything prebuilt that I can start with?

Autolab Project (another powershell tool) for instance has several configurations prebuilt so you can select the kind of lab you want to and deploy it. But although I have tried to get an insight of the architecture and if it does use DSC or not from the author, I didn´t get any answer. I asked for Spanish ISO support, the guy tried to do a couple of things but since it´s meant to be for only english ISOs apparently he stop helping me.

Not sure If I could use Autolab to create DSC and mof files, tweak them to use Spanish ISOs and use them to feed Lability

iainbrighton commented 4 years ago

You will want to use PowerShell 5.1 wherever possible! This includes the host machine (or wherever you generate the MOF files) and the nodes/VMs that are applying the configuration. I would avoid Windows Server 2012 R2 as a VM/target and just stick with Windows Server 2016+ and Windows 10.

If you have a PSAutoLab configuration that fits your needs, then it should be as simple as registering your custom media and updating the lab .psd1 file. However, without seeing the configuration document it's difficult to tell.

jdhitsolutions commented 4 years ago

I think the reason 2012R2 came up was because @mgonzcast wanted to test migrating to something newer. I think at this point the best thing is to use the Lability module and its commands not the Autolab commands. Although he is welcome to copy and and use an existing DSC configuration as his starting point. This is now moving into an area where I do not have enough expertise with the Lability module to guide him.

mgonzcast commented 4 years ago
Register-LabMedia @registerLabMediaParams

I have created a Windows 2012R2 spanish iso with:

$registerLabMediaParams = @{ Id = '2012R2_x64_Standard_ES_Eval' Filename = '2012R2_x64_ES_Eval.iso' Description = 'Windows Server 2012 R2 Standard 64bit Spanish Evaluation' Architecture = 'x64' MediaType = 'ISO' ImageName = 2 Uri = 'http://download.microsoft.com/download/9/E/6/9E610F2E-2C25-49EF-820B-408324F9100D/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_ES-ES-IR3_SSS_X64FREE_ES-ES_DV9.ISO' }

Could I use this registration within Ps-AutoLab?

iainbrighton commented 4 years ago

@mgonzcast I think so, but you'll want need to update the media registration with WMF 5.1 first (did I warn you not to use Server 2012 R2!?). You'll need to rerun this:

$registerLabMediaParams = @{
    Id = '2012R2_x64_Standard_ES_Eval'
    Filename = '2012R2_x64_ES_Eval.iso'
    Description = 'Windows Server 2012 R2 Standard 64bit Spanish Evaluation'
    Architecture = 'x64'
    MediaType = 'ISO'
    ImageName = 2
    Uri = 'http://download.microsoft.com/download/9/E/6/9E610F2E-2C25-49EF-820B-408324F9100D/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_ES-ES-IR3_SSS_X64FREE_ES-ES_DV9.ISO'
    Hotfixes = @(
        @{
            Id = 'Win8.1AndW2K12R2-KB3191564-x64.msu'
            Uri = 'https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu'
        }
    )
}
Register-LabMedia @registerLabMediaParams -Force

Which PSAutoLab configuration are you looking at deploying?

mgonzcast commented 4 years ago

@mgonzcast I think so, but you'll want need to update the media registration with WMF 5.1 first (did I warn you not to use Server 2012 R2!?). You'll need to rerun this:

$registerLabMediaParams = @{
    Id = '2012R2_x64_Standard_ES_Eval'
    Filename = '2012R2_x64_ES_Eval.iso'
    Description = 'Windows Server 2012 R2 Standard 64bit Spanish Evaluation'
    Architecture = 'x64'
    MediaType = 'ISO'
    ImageName = 2
    Uri = 'http://download.microsoft.com/download/9/E/6/9E610F2E-2C25-49EF-820B-408324F9100D/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_ES-ES-IR3_SSS_X64FREE_ES-ES_DV9.ISO'
    Hotfixes = @(
        @{
            Id = 'Win8.1AndW2K12R2-KB3191564-x64.msu'
            Uri = 'https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu'
        }
    )
}
Register-LabMedia @registerLabMediaParams -Force

Which PSAutoLab configuration are you looking at deploying?

Done.

For starters I was thinking of deploying this one:

https://github.com/pluralsight/PS-AutoLab-Env/tree/master/Configurations/SingleServer2012R2-GUI

iainbrighton commented 4 years ago

In which case, you'll need to update the media entry to use your new custom media. Change https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Configurations/SingleServer2012R2-GUI/VMConfigurationData.psd1#L109 to read Lability_Media = '2012R2_x64_Standard_ES_Eval'. You can obviously adjust the CPU and memory configuration as needed.

mgonzcast commented 4 years ago

In which case, you'll need to update the media entry to use your new custom media. Change https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Configurations/SingleServer2012R2-GUI/VMConfigurationData.psd1#L109 to read Lability_Media = '2012R2_x64_Standard_ES_Eval'. You can obviously adjust the CPU and memory configuration as needed.

The VM has been installed in Spanish! :)

When I run the tests I get It can´t connect using PSSesion:

`PS C:\Autolab\Configurations\SingleServer2012R2-GUI> invoke-pester .\VMValidate.test.ps1 Pester v4.10.1 Executing all tests in '.\VMValidate.test.ps1'

Executing script .\VMValidate.test.ps1

Describing S12R2GUI [-] [S12R2GUI] Should allow a PSSession but got error: Error de conexión al servidor remoto S12R2GUI. Mensaje de err or: El cliente WinRM no puede procesar la solicitud porque no puede resolverse el nombre de servidor. Para obtener más i nformación, consulte el tema de la Ayuda about_Remote_Troubleshooting. 11ms Expected $true, but got $false. 59: $false | Should Be $True en Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\Assertions\Should.ps 1: línea 163 en Should, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\Assertions\Should.ps1: línea 11 6 en , C:\Autolab\Configurations\SingleServer2012R2-GUI\VMValidate.test.ps1: línea 59 en Invoke-Test, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\It.ps1: línea 289 en ItImpl, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\It.ps1: línea 241 en It, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\It.ps1: línea 132 en , C:\Autolab\Configurations\SingleServer2012R2-GUI\VMValidate.test.ps1: línea 58 en DescribeImpl, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\Describe.ps1: línea 213 en Describe, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Functions\Describe.ps1: línea 105 en , C:\Autolab\Configurations\SingleServer2012R2-GUI\VMValidate.test.ps1: línea 17 en , C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Pester.psm1: línea 1111 en Invoke-Pester, C:\Program Files\WindowsPowerShell\Modules\Pester\4.10.1\Pester.psm1: línea 1137 en , : línea 1 Tests completed in 8.72s`

I run enable-psremoting but still getting an error.

We are getting close! :)

jdhitsolutions commented 4 years ago

You need to be careful about which repo you post in. The Lability module is completely separate from the Autolab module. In my module, you will get errors until the DSC configuration merges. This could be anywhere from 10-40 minutes.

mgonzcast commented 4 years ago

You need to be careful about which repo you post in. The Lability module is completely separate from the Autolab module. In my module, you will get errors until the DSC configuration merges. This could be anywhere from 10-40 minutes.

Not sure what you mean with "until the DSC configuration merges". If I run the unattend-lab command I get one error:

You may need to say "yes" to a Nuget Provider
ADVERTENCIA: MSG:UnableToDownload «https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
ADVERTENCIA: No se puede descargar la lista de proveedores disponibles. Comprueba tu conexión a Internet.
ADVERTENCIA: No se puede descargar desde el URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' a ''.
No se encontró ninguna coincidencia para el criterio de búsqueda especificado para el proveedor 'nuget'. El proveedor
del paquete requiere las etiquetas 'PackageManagement' y 'Provider'. Comprueba si el paquete especificado tiene las
etiquetas.
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
   kageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
   vider

I edit my answer. After leaving the tests running some minutes the tests finished ok :)

Is this error something that I have to worry about?

Do you have any configuration for a lab running a DC, CA and Exchange in 2012R2?

jdhitsolutions commented 4 years ago

We need to move this discussion back to the PSAutolab Issues as it has nothing to do with Lability. DSC configurations need time to process and make all the necessary changes. You will have to set up your own environment to test those things.

mgonzcast commented 4 years ago

@iainbrighton is there any example of SQL Server configuration in the lab configurations folder? I can´t find any

jdhitsolutions commented 4 years ago

@mgonzcast Iain's Lability module doesn't have lab configurations. Don't confuse it with my PSAutolab. But even there, we have no configurations using SQL Server.

wxwx commented 4 months ago

for me it seems like you only have to replace the us-en by the equivalent internationalization tag. I always had good results with de-de for german versions. Maybe you will have to experiment with case (eg. DE-DE). Good luck!