cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
675 stars 227 forks source link

Error building online image #269

Closed Brardith closed 5 years ago

Brardith commented 5 years ago

I'm attempting to build using Examples\create-windows-online-cloud-image.ps1 and I am running into this issue:

At C:\Users\Brardith\Documents\windows-openstack-imaging-tools\WinImageBuilder.psm1:113 char:13
+     return (New-Object WIMInterop.WimFile -ArgumentList $WimFilePath)
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

I'm not well-versed with powershell so I'm having trouble figuring out the root cause myself.

ilenghel commented 5 years ago

When using the New-WindowsOnlineImage function the config file specified should have the wim_file_path parameter point at a mounted ISO file which contains the image name referenced by the image_name parameter.

For example, let's consider you have a Windows Server 2012 R2 ISO mounted with drive letter "F:", and you want to build a Datacenter Edition of that OS. In this case you'd need the above mentioned parameters as follows: wim_file_path="F:\Sources\install.wim" image_name="Windows Server 2012 R2 SERVERDATACENTER"

In your case I believe there is no mounted ISO file. Please check if that is the case, and if not, let us know and we can try to debug further.

Brardith commented 5 years ago

I have no idea what's different but I cloned it on a different server, and made some changes to the script, and now it's working fine. I must've had the image_name parameter wrong on the original system I was trying to do to the work on, I definitely had an image mounted. either way, your comment definitely made me examine my config.ini a little closer. :) Thank you for your help.