win_log - OpenNebula/one-apps GitHub Wiki

Windows Context Troubleshooting

Contextualization in Windows works in the same way as in Linux. A VM instance with contextualization enabled has an attached ISO image that appears to the Guest OS as a CD-ROM device. The ISO contains the configuration information for the Guest OS. This information was generated by OpenNebula from the parameters initially defined by the user in the CONTEXT section of the VM's template. Every time the VM boots or performs a hotplug operation, it reads the configuration from the ISO and applies the customization.

The context packages are installed at C:\Program Files (x86)\OpenNebula.

The onecontext Service

For troubleshooting, you can run the onecontext service manually.

For example, to stop, then start the service run the below commands in PowerShell:

net stop onecontext
net start onecontext

Then you can obtain information about the service, with:

Get-Service onecontext
Get-WmiObject -Class Win32_Service -Filter "Name='onecontext'"

For example:

PS C:\Users\oneadmin> Get-Service onecontext

Status   Name               DisplayName
------   ----               -----------
Running  onecontext         OpenNebula Contextualization Service


PS C:\Users\oneadmin> Get-WmiObject -Class Win32_Service -Filter "Name='onecontext'"


ExitCode  : 0
Name      : onecontext
ProcessId : 2296
StartMode : Auto
State     : Running
Status    : OK

After stopping and restarting the service, you can check the log file at C:\.onecontext\opennebula-context.log.

Get-Content -Path "C:\.onecontext\opennebula-context.log"

The log file is rotated per service run, so also check the file for the previous run at C:\.onecontext\opennebula-context-old.log.

PS C:\Users\oneadmin> Get-Content -Path "C:\.onecontext\opennebula-context.log"
**********************
Windows PowerShell transcript start
Start time: 20231221070617
Username: WORKGROUP\SYSTEM
RunAs User: WORKGROUP\SYSTEM
Configuration Name:
Machine: WIN-662E6H8G00Q (Microsoft Windows NT 10.0.20348.0)
Host Application: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Unrestricted -file C:\Program Files (x86)\OpenNebula\context.ps1
Process ID: 2328
PSVersion: 5.1.20348.1
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.20348.1
BuildVersion: 10.0.20348.1
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
[2023-12-21 07:06 -08:00] * Running Script: C:\Program Files (x86)\OpenNebula\context.ps1

*********************************
*** ENTERING THE SERVICE LOOP ***
*********************************

[2023-12-21 07:06 -08:00] * Extend partitions

Microsoft DiskPart version 10.0.20348.1

Copyright (C) Microsoft Corporation.
On computer: WIN-662E6H8G00Q

DISKPART>
Please wait while DiskPart scans your configuration...

DiskPart has finished scanning your configuration.

DISKPART>
[2023-12-21 07:06 -08:00] - Extend (C:) Disk: 0 / Part: 3

[2023-12-21 07:06 -08:00] * Enabling Remote Desktop
[2023-12-21 07:06 -08:00] - Enable Remote Desktop Rule Group

Updated 3 rule(s).
Ok.
[2023-12-21 07:06 -08:00] - Enable Allow Terminal Services Connections
[2023-12-21 07:06 -08:00]   ... Success

[2023-12-21 07:06 -08:00] * Enabling Ping

[2023-12-21 07:06 -08:00] - Enable Allow Inbound Echo Requests
The property 'AllowInboundEchoRequest' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files (x86)\OpenNebula\context.ps1:916 char:12
+     $ret = $pro.IcmpSettings.AllowInboundEchoRequest = $true
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
[2023-12-21 07:06 -08:00]   ... Failed

[2023-12-21 07:06 -08:00] * Configuring Network Settings: Intel(R) PRO/1000 MT Network Connection
[2023-12-21 07:06 -08:00] - Release DHCP Lease
[2023-12-21 07:06 -08:00]   ... Failed: 83
[2023-12-21 07:06 -08:00] - Set Static IP
[2023-12-21 07:06 -08:00]   ... Success
[2023-12-21 07:06 -08:00] - Set Gateway
[2023-12-21 07:06 -08:00]   ... Success
[2023-12-21 07:06 -08:00] - Set DNS Server Search Order
[2023-12-21 07:06 -08:00]   ... Success
[2023-12-21 07:06 -08:00] - Set Dynamic DNS Registration
[2023-12-21 07:06 -08:00]   ... Success
[2023-12-21 07:06 -08:00] - No static IPv6 configuration provided, skipping
[2023-12-21 07:06 -08:00] - Ping Interface IP 192.168.4.35
[2023-12-21 07:06 -08:00]   ... Success (4 tries)

[2023-12-21 07:06 -08:00] * Running Scripts

[2023-12-21 07:06 -08:00] * Authorizing SSH_PUBLIC_KEY: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAEF/LH1ZdcTw/6x9dRSLd65zPNIzVkw/+oVQnfZ+CfybA4yxakur0oRk0lVEA1SWN+n0jiKCiLIWooZpT/2OxAio9KEJTjWwvWyH5IRivxtwrvi4oCUyQ+TtWeVC4gbUbfvu2t/SSCZJKA9idJFjHaMZ+TeKoy1fGVbaMjdiCnxXO341opAS1GRTwxR3fI3ucokG/HvlibZKijCVAdd7Ax2CrPfSgCPmq/j3uTzoH7Zjn7gcqFs4cXH1OgtQPABhrDOr/U6HAkSKZfodxquWtA5umsH3qn6EitO/Rx/apzKyv4Cksi6lLHg9BF2rD2Q9XlSp6bKeKhuDmK6vaFOXAY/u+RoEHpunGps7NyBU/VIa6T+/uQ4GngHOBZySlEOFSr19Qj6kPm9h3UbEvFq1HysJeQpEH5hTm+fzVbNwtaumgSzRXftGMYuajA9WXip8z3StnX6jMnJOmI1vg72VcCDgNPlmBmGyrxwhg9gpIoBDD4ft0XHu1iAWhX7YGI2U= oneadmin@oneadmin-XPS-13-9380
processed file: C:\ProgramData\ssh\administrators_authorized_keys
Successfully processed 1 files; Failed processing 0 files
[2023-12-21 07:06 -08:00]   ... Success
[2023-12-21 07:06 -08:00] * Calculating the checksum of the file: C:\.onecontext\.opennebula-context.sh
[2023-12-21 07:06 -08:00]   ... 43A0762BDC1638D3957EC63F0BF5406DC74E44832D15F551D41107A1937F5DCF
[2023-12-21 07:06 -08:00] * Removing the file: C:\.onecontext\.opennebula-context.sh