Azure / GuestConfiguration

PowerShell module for creating, testing, and publishing custom Guest Configuration
MIT License
5 stars 2 forks source link

Missing libmi.so when using GuestConfiguration cmdlets on many Linux distros - Broken OMI dependency. #297

Open AhmedBM opened 5 months ago

AhmedBM commented 5 months ago

Details of the scenario you tried and the problem that is occurring

When trying to apply a machine configuration package using the GuestConfiguration cmdlets as seen in How to test machine configuration package artifacts on any of the supported distributions the following error occurs:

image

It seems the omi libraries needed by PowerShell DSC are not being found. Upon further inspection, it seems the default search path is not included which is why this issue occurs. Simply adding /opt/omi/lib/ to the search path fixes this problem.

Suggested solution to the issue

Add the OMI libraries to the system library search path

The DSC configuration that is used to reproduce the issue (if applicable)

# OMI install its libs in /opt/omi/lib/, include in search path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/omi/lib/

The operating system the target node is running

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

Version and build of PowerShell the target node is running

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Ubuntu 22.04.4 LTS
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version of the module that was used

 Get-Module -Name 'Guestconfiguration' -ListAvailable | ft Name,Version,Path

Name               Version Path
----               ------- ----
GuestConfiguration 4.5.0   /home/ahmed/.local/share/powershell/Modules/GuestConfiguration/4.5.0/GuestConfiguration.psd1