VMware Cloud Community
bartekjan
Contributor
Contributor
Jump to solution

Error retrieving file for VIB ... '_SharedFile' object has no attribute 'writing'

Hi,

I would like to export depot to iso. So, I do "export-esximageprofile -imageprofile Community -exporttoiso -filepath 'ESXi-6.5-Custom_r8168_al.iso' -nosignaturecheck -Force". But I receive error like this:

export-esximageprofile : Error retrieving file for VIB 'VMW_bootbank_shim-vmklinux-9-2-3-0_6.5.0-0.0.4564106': ('vib20/shim-vmklinux-9-2-3-0/VMW_bootbank_shim-vmklinux-9-2-3-0_6.5.0-0.0.4564106.vib', "Unable to open VIB archive in streaming mode: '_SharedFile' object
has no attribute 'writing'").
At line:1 char:1
+ export-esximageprofile -imageprofile Community -exporttoiso -filepath ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Export-EsxImageProfile], FaultException
+ FullyQualifiedErrorId : System.ServiceModel.FaultException,VMware.ImageBuilder.Commands.ExportProfile

What is wrong? How can I resolve this problem?

Reply
0 Kudos
1 Solution

Accepted Solutions
carlos29
Contributor
Contributor
Jump to solution

Hi everyone,

I solved this issue downgrading the VMware.ImageBuilder module. I realized that installing an older version of powercli kept the latest version of this module, which after all is the one that performs the exportation. So I installed an older version of the VMware.ImageBuilder module and simply remove the last version from the modules directory, then I tried the exportation again and it worked.

I hope this help.

View solution in original post

Reply
0 Kudos
16 Replies
lamw
Community Manager
Community Manager
Jump to solution

This looks to be same issue as reported here https://communities.vmware.com/t5/ESXi-Discussions/Custom-ISO-fails-at-Export-ESXImageProfile-with-a... 

Are you also using PowerCLI 13 or earlier version?

Reply
0 Kudos
bartekjan
Contributor
Contributor
Jump to solution

PowerCLI 13

Reply
0 Kudos
networkadmin4
Contributor
Contributor
Jump to solution

Hello,

I have the same error. Is there some solution for this?

Thank you

Reply
0 Kudos
maksym007
Expert
Expert
Jump to solution

I thought that Problem was in PowerCLI 13 but now looks somewhere deeper

Reply
0 Kudos
networkadmin4
Contributor
Contributor
Jump to solution

Yes, error is not just when exporting image. Find the error on the picture below.

ew-EsxImageProfile : Cannot process argument transformation on parameter 'CloneProfile'. No image profile has a name
that matches 'ESXi-8.0-20513097-standard'. You may want to use the Get-EsxImageProfile cmdlet to search for an image
profile.
At line:1 char:35
+ ... ew-EsxImageProfile -CloneProfile "ESXi-8.0-20513097-standard" -Name " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-EsxImageProfile], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,VMware.ImageBuilder.Commands.NewImageProfile

Reply
0 Kudos
maksym007
Expert
Expert
Jump to solution

I hope it will be fixed soon

Reply
0 Kudos
carlos29
Contributor
Contributor
Jump to solution

Hi everyone,

I solved this issue downgrading the VMware.ImageBuilder module. I realized that installing an older version of powercli kept the latest version of this module, which after all is the one that performs the exportation. So I installed an older version of the VMware.ImageBuilder module and simply remove the last version from the modules directory, then I tried the exportation again and it worked.

I hope this help.

Reply
0 Kudos
garnt
Contributor
Contributor
Jump to solution

Also hitting this issue. Would be good to get it fixed soon.....

Reply
0 Kudos
networkadmin4
Contributor
Contributor
Jump to solution

Hello,

I solved it by installing PowerCLI version 12.7 and deleting powerCLI 13.0, but just for vmware 7. For vmware vsphere 8 it still doesnt work.

 

Reply
0 Kudos
bartekjan
Contributor
Contributor
Jump to solution

Carlos29 -> Yes. It helped. Thank you.

Reply
0 Kudos
Bilal041987
Contributor
Contributor
Jump to solution

1. For ESXi 8, you can export the image profile with -ExportToBundle switch then you will have to install vCenter 8 and go to Home --> Auto Deploy --> Enable Image Builder --> Software Depots.

Import the zip file that you created.

Click on export. Leave everything default and export the iso.

Secondly, if you want to export image profile using -ExportToISO switch then you must have Python version 3.7.9 instead of 3.7.0 once you installed python 3.7.9 then ImageBuilder will also export the iso as well.

nomanmiannoor
Contributor
Contributor
Jump to solution

Good Job. Really Appreciated👏

Reply
0 Kudos
Medic518
Contributor
Contributor
Jump to solution

..just the PhD (Push here Dummy) step-by-step of carlos29 workaround..

PS Run: Get-Module VMware.ImageBuilder | Uninstall-Module -Force

- navigate to the PowerShell install directory - (C:\Program Files\WindowsPowerShell\Modules\VMware.ImageBuilder) - and delete everything in that directory. 

PS Run: Install-Module -Name VMware.ImageBuilder -RequiredVersion 7.0.3.19599828

 

Tested these steps to downgrade the Vmware.Imagebuilder and re-ran the ExportToISO without any errors. 

Reply
0 Kudos
paralens
Enthusiast
Enthusiast
Jump to solution

Would you please to correct your answer.
The first command is missing a mandatory switch -ListAvailable.
Without -ListAvailable the Get-Module returns only currently loaded modules.
In the case you started powershell just right now the command will return nothing (empty list) resulting in no modules will be uninstalled.

Get-Module -ListAvailable VMware.ImageBuilder | Uninstall-Module -Force
Install-Module -Name VMware.ImageBuilder -RequiredVersion 7.0.3.19599828

Also note that it is not sufficient to downgrade only the VMware.ImageBuilder module.
There is a dependent module called VMware.DeployAutomation.
If you'll try to use ImageBuilder without downgrading all dependent modules you'll get an error from PowerCLI notifying you about dependency issues.

To downgrade all dependent modules (from 8.x to 7.x, alternate numeration used, don't mess with PowerCLI version numeration) use the following command:

Get-Module -ListAvailable VMware* | where { ($_.RequiredModules.Name -contains 'VMware.ImageBuilder') -and ($_.RequiredModules.Version -like '8.*') } | foreach { Uninstall-Module $_.Name -Force; Install-Module $_.Name -MaximumVersion "7.9.9" }

In case of errors just downgrade the VMware.DeployAutomation module only:

"VMware.DeployAutomation" | foreach { Get-Module -ListAvailable $_ | where { $_.Version -Like "8.*" } | Uninstall-Module -Force ; Install-Module $_ -MaximumVersion "7.9.9" }

After downgrade feel free to verify resulted module versions (should be 7.0.3.19599828):

Get-Module -ListAvailable VMware.ImageBuilder | ft Name,Version -AutoSize
Get-Module -ListAvailable VMware.DeployAutomation | ft Name,Version -AutoSize

Reply
0 Kudos
paralens
Enthusiast
Enthusiast
Jump to solution

But most of the people are reporting that this is a Python-related issue.
To resolve the issue just upgrade Python from 3.7.0 to 3.7.9 and reinstall PIP and 'six psutil lxml pyopenssl' packages.
See links below for details:

https://williamlam.com/2022/11/heads-up-unable-to-open-vib-archive-in-streaming-mode-using-export-es... 
https://github.com/VFrontDe-Org/ESXi-Customizer-PS/issues/57 
https://bugs.python.org/issue34035 
https://github.com/VFrontDe-Org/ESXi-Customizer-PS/issues/56#issuecomment-1406854982 

Reply
0 Kudos
aaaapk
Contributor
Contributor
Jump to solution

我也遇到一样的问题,采取了以下措施: 1、卸载了VMware.PowerCLI 的 v13.0.0 2、安装VMware.PowerCLI 的 v12.0.0 就能正常进行自定义iso了,看有人说是由于VMware.PowerCLI 的 v13.n.n版本的问题,可惜没有去测试其他13.n.n的版本。
Reply
0 Kudos