AutomatedLab / AutomatedLab

AutomatedLab is a provisioning solution and framework that lets you deploy complex labs on HyperV and Azure with simple PowerShell scripts. It supports all Windows operating systems from 2008 R2 to 2022, some Linux distributions and various products like AD, Exchange, PKI, IIS, etc.
MIT License
2.01k stars 358 forks source link

WARNING: System.ArgumentException: Argument passed in is not serializable. #1148

Closed michelkamp closed 3 years ago

michelkamp commented 3 years ago

Description

Suddenly my deploys to azure stopped working.

Expected behavior

The script should deploy several azure vms with AD , SQL roles and custom software installed

Actual behavior

The script deploys the azure vms and other resources but then failed to add the roles and software. I get this error message (see log below for more):

WARNING: System.ArgumentException: Argument passed in is not serializable. Parameter name: value

0:12:00|00:00:00|00:00:00.000| Initialization
20:12:01|00:00:00|00:00:00.765| - Host operating system version: 'Microsoft Windows Server 2012 R2 Standard, 6.3.9600.0'
20:12:01|00:00:00|00:00:00.781| - Creating new lab definition with name 'ScomTraining2021-1'
20:12:01|00:00:00|00:00:00.859| - Location of lab definition files will be 'C:\ProgramData\AutomatedLab/Labs/ScomTraining2021-1'
20:12:04|00:00:03|00:00:03.953| - Location of LabSources folder is 'E:\LabSources'
20:12:32|00:00:31|00:00:31.421| - Added 'https://xxxxxxxxx.file.core.windows.net/labsources/ISOs/en_sql_server_2016_standard_with_service_pack_1_x64_dvd_9540929.ISO'
20:12:33|00:00:32|00:00:00.000| - Adding Azure subscription data
20:12:46|00:00:45|00:00:12.265|   - Using Azure Subscription '[TEST] Visual Studio Enterprise with MSDN' (xxxxx)
20:12:54|00:00:53|00:00:20.578|   - Using Azure Location 'West Europe'
20:12:54|00:00:53|00:00:20.640|   - Trying to locate or create default resource group
20:12:57|00:00:56|00:00:23.828|   - Querying available vm sizes for Azure location 'West Europe'
20:14:10|00:02:10|00:00:00.000|   - Looking for Azure LabSources inside subscription '[Opslogix TEST] Visual Studio Enterprise with MSDN'
20:14:13|00:02:12|00:00:02.968|     - Azure LabSources verified / created
20:14:22|00:02:21|00:00:11.468|   - Querying available operating system images (using cache)
20:14:23|00:02:22|00:00:12.874|   - Azure default resource group name will be 'ScomTraining2021-1'
20:14:23|00:02:22|00:00:12.890|   - Azure data center location will be 'West Europe'
20:14:23|00:02:22|00:00:12.906|   - Finished adding Azure subscription data
20:14:38|00:02:37|00:00:00.000| - Adding Azure machine definition 'AD01'          (Roles: RootDC)
20:14:49|00:02:48|00:00:11.406|   - Done
adding vm SCOMGURU01
20:14:52|00:02:52|00:00:00.000| - Adding Azure machine definition 'SCOMGURU01'    (Roles: SQLServer2016)
20:15:01|00:03:00|00:00:08.593|   - Done
adding agent vm SCOMGURU01-01
20:15:05|00:03:04|00:00:00.000| - Adding Azure machine definition 'SCOMGURU01-01' (Roles: FileServer)
20:15:17|00:03:17|00:00:12.111|   - Done
adding vm SCOMGURU02
20:15:20|00:03:19|00:00:00.000| - Adding Azure machine definition 'SCOMGURU02'    (Roles: SQLServer2016)
20:15:33|00:03:32|00:00:12.216|   - Done
adding agent vm SCOMGURU02-01
20:15:36|00:03:35|00:00:00.000| - Adding Azure machine definition 'SCOMGURU02-01' (Roles: FileServer)
20:15:49|00:03:49|00:00:13.156|   - Done
adding vm SCOMGURU03
20:15:54|00:03:53|00:00:00.000| - Adding Azure machine definition 'SCOMGURU03'    (Roles: SQLServer2016)
20:16:07|00:04:06|00:00:13.140|   - Done
adding agent vm SCOMGURU03-01
20:16:11|00:04:10|00:00:00.000| - Adding Azure machine definition 'SCOMGURU03-01' (Roles: FileServer)
20:16:27|00:04:26|00:00:15.875|   - Done
VERBOSE: [20:16:28][Write-LogFunctionEntry] Install-Lab Entering... (Verbose=True)
20:16:35|00:04:34|00:00:23.312| No DNS server was defined for Azure virtual network while AD is being deployed. Setting DNS server to IP address of 'AD01'
VERBOSE: [20:16:38][Write-ScreenInfo] Done
VERBOSE: [20:16:38][Write-ScreenInfo] 20:16:38|00:04:37|00:00:26.672| Done
20:16:38|00:04:37|00:00:26.672| Done
VERBOSE: [20:16:39][Write-LogFunctionEntry] Import-Lab Entering... (Path=C:\ProgramData\AutomatedLab\Labs\ScomTraining2021-1\Lab.xml)
VERBOSE: [20:16:40][Write-LogFunctionEntry] Clear-Lab Entering... )
VERBOSE: [20:16:40][Write-LogFunctionExit] Clear-Lab...leaving...(Time elapsed: 00:00:00:859)
VERBOSE: [20:16:41][Write-LogFunctionEntry] Test-LabHostRemoting Entering... )
VERBOSE: [20:16:42][Write-LogFunctionExit] Test-LabHostRemoting...leaving...(Time elapsed: 00:00:01:640)
VERBOSE: [20:16:42][Write-ScreenInfo] Validating lab definition
VERBOSE: [20:16:42][Write-ScreenInfo] 20:16:42|00:04:41|00:00:00.000| Validating lab definition
20:16:42|00:04:41|00:00:00.000| Validating lab definition
VERBOSE: [20:16:44][Write-LogFunctionEntry] Clear-Lab Entering... )
VERBOSE: [20:16:44][Write-LogFunctionExit] Clear-Lab...leaving...(Time elapsed: 00:00:00:859)
VERBOSE: [20:16:57][Write-ScreenInfo] Success
VERBOSE: [20:16:57][Write-ScreenInfo] 20:16:57|00:04:56|00:00:14.749| - Success
20:16:57|00:04:56|00:00:14.749| - Success
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.3.1\PackageManagement.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.3.1\PackageManagement.psd1'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.3.1\PackageManagement.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.3.1\PackageManagement.psm1'.
VERBOSE: Exporting cmdlet 'Find-Package'.
VERBOSE: Exporting cmdlet 'Find-PackageProvider'.
VERBOSE: Exporting cmdlet 'Get-Package'.
VERBOSE: Exporting cmdlet 'Get-PackageProvider'.
VERBOSE: Exporting cmdlet 'Get-PackageSource'.
VERBOSE: Exporting cmdlet 'Import-PackageProvider'.
VERBOSE: Exporting cmdlet 'Install-Package'.
VERBOSE: Exporting cmdlet 'Install-PackageProvider'.
VERBOSE: Exporting cmdlet 'Register-PackageSource'.
VERBOSE: Exporting cmdlet 'Save-Package'.
VERBOSE: Exporting cmdlet 'Set-PackageSource'.
VERBOSE: Exporting cmdlet 'Uninstall-Package'.
VERBOSE: Exporting cmdlet 'Unregister-PackageSource'.
VERBOSE: Importing cmdlet 'Find-Package'.
VERBOSE: Importing cmdlet 'Find-PackageProvider'.
VERBOSE: Importing cmdlet 'Get-Package'.
VERBOSE: Importing cmdlet 'Get-PackageProvider'.
VERBOSE: Importing cmdlet 'Get-PackageSource'.
VERBOSE: Importing cmdlet 'Import-PackageProvider'.
VERBOSE: Importing cmdlet 'Install-Package'.
VERBOSE: Importing cmdlet 'Install-PackageProvider'.
VERBOSE: Importing cmdlet 'Register-PackageSource'.
VERBOSE: Importing cmdlet 'Save-Package'.
VERBOSE: Importing cmdlet 'Set-PackageSource'.
VERBOSE: Importing cmdlet 'Uninstall-Package'.
VERBOSE: Importing cmdlet 'Unregister-PackageSource'.
VERBOSE: [20:17:22][Write-ScreenInfo] Lab 'ScomTraining2021-1' hosted on 'Azure' imported with 7 machines
VERBOSE: [20:17:22][Write-ScreenInfo] 20:17:22|00:05:21|00:00:40.077| Lab 'ScomTraining2021-1' hosted on 'Azure' imported with 7 machines
20:17:22|00:05:21|00:00:40.077| Lab 'ScomTraining2021-1' hosted on 'Azure' imported with 7 machines
VERBOSE: [20:17:28][Write-LogFunctionExit] Import-Lab...leaving - return value is 'True'...(Time elapsed: 00:00:03:843)
VERBOSE: [20:17:36][Write-LogFunctionEntry] Get-LabVM Entering... )
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
VERBOSE: [20:17:42][Write-LogFunctionEntry] Get-LabVM Entering... (All=True,IncludeLinux=True)
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
VERBOSE: [20:17:47][Write-LogFunctionEntry] Get-LabVM Entering... (All=True)
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
WARNING: System.ArgumentException: Argument passed in is not serializable.
Parameter name: value
   at System.Collections.ListDictionaryInternal.set_Item(Object key, Object value)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary`2 eventProperties, Boolean populateException)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogUsageEvent(AzurePSQoSEvent qos)
   at Microsoft.WindowsAzure.Commands.Common.MetricHelper.LogQoSEvent(AzurePSQoSEvent qos, Boolean isUsageMetricEnabled, Boolean isErrorMetricEnabled)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.LogQosEvent()
VERBOSE: [20:17:52][Write-ScreenInfo] done
VERBOSE: [20:17:52][Write-ScreenInfo] 20:17:52|00:05:51|00:01:10.234| done
20:17:52|00:05:51|00:01:10.234| done
VERBOSE: [20:17:53][Write-LogFunctionEntry] Get-LabVM Entering... (All=True,IncludeLinux=True)

Steps to reproduce

Environment details

PowerShell Version

Name                           Value                                                                                                                                                                                                        
----                           -----                                                                                                                                                                                                        
PSVersion                      5.1.14409.1018                                                                                                                                                                                               
PSEdition                      Desktop                                                                                                                                                                                                      
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                      
BuildVersion                   10.0.14409.1018                                                                                                                                                                                              
CLRVersion                     4.0.30319.42000                                                                                                                                                                                              
WSManStackVersion              3.0                                                                                                                                                                                                          
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                          
SerializationVersion           1.1.0.1 

AutomatedLab components

Name                      Version  
----                      -------  
AutomatedLab              5.34.0   
AutomatedLab              5.33.0   
AutomatedLab              5.16.0   
AutomatedLab              5.9.0    
AutomatedLab.Common       2.0.216  
AutomatedLab.Common       2.0.178  
AutomatedLab.Common       1.1.113  
AutomatedLab.Common       1.1.51   
AutomatedLabDefinition    5.33.0   
AutomatedLabDefinition    5.9.0    
AutomatedLabDefinition    5.0.0.206
AutomatedLabNotifications 5.33.0   
AutomatedLabNotifications 5.9.0    
AutomatedLabNotifications 5.0.0.206
AutomatedLabUnattended    5.33.0   
AutomatedLabUnattended    5.9.0    
AutomatedLabUnattended    5.0.0.206
AutomatedLabWorker        5.33.0   
AutomatedLabWorker        5.9.0    
AutomatedLabWorker        5.0.0.206
nyanhp commented 3 years ago

I deployed to Azure just three days ago - are you sure it's not a temporary issue? Most of the time issues with Azure labs are due to cmdlets changing, APIs changing, outages, ...

I'll set up a lab my self and let you know the result. In the meantime @michelkamp could you let me know which Azure module version you use? get-installedmodule az

nyanhp commented 3 years ago

By the way: I see your machines are named SCOM... Did you see our new SCOM roles? Give them a try :)

nyanhp commented 3 years ago

Quick update from my end: I've just deployed the sample lab PowerShell Lab Azure with zero issues. I am using version 5.6 of the Az bootstrapper module and the region West Europe as well.

I see that in the gallery we are at 5.8, so I will run a second lab after the update. But I don't expect anything to break with a new minor release. But we'll see.

michelkamp commented 3 years ago

That good news. Indeed we use the script to install a SCOM env. Till now I added custom code to do this. I look over the code : https://github.com/AutomatedLab/AutomatedLab/blob/develop/AutomatedLab/AutomatedLabScom.psm1 And see some addition , setting the SCOM grooming parameters for example:

Configure SCOM retention times

configure the operations manager rentention times

Invoke-LabCommand -ActivityName 'Retention OPS DB' -ScriptBlock { import-module "C:\Program Files*\Operations Manager\Powershell\OperationsManager\OperationsManager.psd1" Set-SCOMDatabaseGroomingSetting -AlertDaysToKeep 7 -AvailabilityHistoryDaysToKeep 7 -EventDaysToKeep 4 -JobStatusDaysToKeep 7 -MaintenanceModeHistoryDaysToKeep 7 -MonitoringJobDaysToKeep 7 -PerformanceDataDaysToKeep 7 -StateChangeEventDaysToKeep 7 Set-SCOMAlertResolutionSetting -HealthyAlertAutoResolveDays 7 -AlertAutoResolveDays 30 } -ComputerName $LabVMs -PassThru

configure the DWH retention time

Invoke-LabCommand -ActivityName 'Retention DWH DB' -ScriptBlock { Invoke-Sqlcmd -Database OperationsManagerDW -Query "UPDATE [OperationsManagerDW].[dbo].[StandardDatasetAggregation] SET [MaxDataAgeDays] = 30" } -ComputerName $LabVMs -PassThru

I will give it a try , as less code I have to maintain the better šŸ˜‰

// michel

From: Jan-Hendrik Peters [MSFT] @.> Sent: Friday, 16 April 2021 11:26 AM To: AutomatedLab/AutomatedLab @.> Cc: michelkamp @.>; Mention @.> Subject: Re: [AutomatedLab/AutomatedLab] WARNING: System.ArgumentException: Argument passed in is not serializable. (#1148)

By the way: I see your machines are named SCOM... Did you see our new SCOM roles? Give them a try :)

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAutomatedLab%2FAutomatedLab%2Fissues%2F1148%23issuecomment-821046294&data=04%7C01%7C%7C170bec71a9ea4064d16b08d900b9a752%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541619630753939%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5QUse381NfIBxkAXj2DUv1kRmVKYmevO%2BYBJlCu3djk%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABT3VMSJEB7FVFQXIFH3IU3TI77CTANCNFSM43BC5WIA&data=04%7C01%7C%7C170bec71a9ea4064d16b08d900b9a752%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541619630753939%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1NF7WMcffQ%2FCCvFh%2Br22nlGLVFMYAh57pdJSTz80bwk%3D&reserved=0.

michelkamp commented 3 years ago

It's the same you used.

PS C:\Windows\system32> get-installedmodule az

Version Name Repository Description


5.6.0 Az PSGallery Microsoft Azure PowerShell - C...

From: Jan-Hendrik Peters [MSFT] @.> Sent: Friday, 16 April 2021 11:25 AM To: AutomatedLab/AutomatedLab @.> Cc: michelkamp @.>; Mention @.> Subject: Re: [AutomatedLab/AutomatedLab] WARNING: System.ArgumentException: Argument passed in is not serializable. (#1148)

I deployed to Azure just three days ago - are you sure it's not a temporary issue? Most of the time issues with Azure labs are due to cmdlets changing, APIs changing, outages, ...

I'll set up a lab my self and let you know the result. In the meantime @michelkamphttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmichelkamp&data=04%7C01%7C%7C2dd5375d4b5a46f041fe08d900b971f2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541618739196432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5qabMA6NuUnePnt47Pw%2F%2B9nbdoXjJcGEuRY6J4A8QPI%3D&reserved=0 could you let me know which Azure module version you use? get-installedmodule az

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAutomatedLab%2FAutomatedLab%2Fissues%2F1148%23issuecomment-821045464&data=04%7C01%7C%7C2dd5375d4b5a46f041fe08d900b971f2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541618739206392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jnAIZf9BnscSWmhfSxsK8Ky4XT0G2zosblhFIhQIgNE%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABT3VMUMKDX6KZ3KN2GFECLTI765BANCNFSM43BC5WIA&data=04%7C01%7C%7C2dd5375d4b5a46f041fe08d900b971f2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541618739206392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=STo2XUdNH4YEmzTntVGcc8QKXSaVE61l%2B8hn0Hy%2FDKU%3D&reserved=0.

michelkamp commented 3 years ago

Did you also deployed a RootDC role ? I get this error if I deploy it to azure . (using local hyper-v it deploys fine) 2:13:15|00:11:28|00:00:01.890| - Waiting for machines to start up.. 12:13:59|00:12:12|00:00:46.296| - Waiting for Root Domain Controllers to complete installation of Active Directo ry and restart....................................Wait-LabADReady : Timeout occured waiting for Active Directory to be ready on Domain Controller: AD01. Retry count is 2 At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\5.34.0\AutomatedLabADDS.psm1:950 char:9

// michel

From: Jan-Hendrik Peters [MSFT] @.> Sent: Friday, 16 April 2021 11:49 AM To: AutomatedLab/AutomatedLab @.> Cc: michelkamp @.>; Mention @.> Subject: Re: [AutomatedLab/AutomatedLab] WARNING: System.ArgumentException: Argument passed in is not serializable. (#1148)

Quick update from my end: I've just deployed the sample lab PowerShell Lab Azure with zero issues. I am using version 5.6 of the Az bootstrapper module and the region West Europe as well.

I see that in the gallery we are at 5.8, so I will run a second lab after the update. But I don't expect anything to break with a new minor release. But we'll see.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAutomatedLab%2FAutomatedLab%2Fissues%2F1148%23issuecomment-821059238&data=04%7C01%7C%7C4387183d94d74e67b1ba08d900bceb4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541633655293132%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=eZC8iofgmGdDRMOf9dFcmhYqZciWIzt7MBbyNMEyYXk%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABT3VMQ4WDCJSFNGJZUSIPTTJAB2JANCNFSM43BC5WIA&data=04%7C01%7C%7C4387183d94d74e67b1ba08d900bceb4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541633655293132%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qOSstUbcXeI8kR%2BiGMDsxh1R%2FrjrtHlf5iaKX5ChTUE%3D&reserved=0.

michelkamp commented 3 years ago

What I also notice on by lab box is that I can't access the PowerShell gallery anymore.

Install-Module AutomatedLab -Force -AllowClobber WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'. PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'AutomatedLab'. Try Get-PSRepository to see all available registered module repositories. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.1.2\PSModule.psm1:9349 char:21

I already have set: add-type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public bool CheckValidationResult( ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { return true; } } "@ [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

And

But still no luck.

I think my lab box is broken ?? or do you have any idea ? Last week it was running fine. No updates done.

// michel

From: Jan-Hendrik Peters [MSFT] @.> Sent: Friday, 16 April 2021 11:49 AM To: AutomatedLab/AutomatedLab @.> Cc: michelkamp @.>; Mention @.> Subject: Re: [AutomatedLab/AutomatedLab] WARNING: System.ArgumentException: Argument passed in is not serializable. (#1148)

Quick update from my end: I've just deployed the sample lab PowerShell Lab Azure with zero issues. I am using version 5.6 of the Az bootstrapper module and the region West Europe as well.

I see that in the gallery we are at 5.8, so I will run a second lab after the update. But I don't expect anything to break with a new minor release. But we'll see.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAutomatedLab%2FAutomatedLab%2Fissues%2F1148%23issuecomment-821059238&data=04%7C01%7C%7C4387183d94d74e67b1ba08d900bceb4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541633655293132%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=eZC8iofgmGdDRMOf9dFcmhYqZciWIzt7MBbyNMEyYXk%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABT3VMQ4WDCJSFNGJZUSIPTTJAB2JANCNFSM43BC5WIA&data=04%7C01%7C%7C4387183d94d74e67b1ba08d900bceb4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541633655293132%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qOSstUbcXeI8kR%2BiGMDsxh1R%2FrjrtHlf5iaKX5ChTUE%3D&reserved=0.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

stale[bot] commented 3 years ago

This issue has been automatically closed because it is has not had activity from the community in the last 40 days.