From 4b45d890b4644f95902d3c6ac744992bdcf97a49 Mon Sep 17 00:00:00 2001 From: Daniele Corsini Date: Thu, 7 May 2020 16:00:22 +0200 Subject: [PATCH] Add check vm locked --- .vscode/launch.json | 9 ++++++++- .../Application.cs | 14 ++++++++++++++ .../Corsinvest.ProxmoxVE.Diagnostic.Api.csproj | 2 +- .../Corsinvest.ProxmoxVE.Diagnostic.csproj | 4 ++-- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d57f7f6..704f2d5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,14 @@ "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Diagnostic/bin/Debug/netcoreapp3.1/cv4pve-diag.dll", - "args": [], + "args": [ + "--host", + "10.92.90.91", + "--username", + "test", + "--password", + "test" + ], "cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Diagnostic", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", diff --git a/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Application.cs b/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Application.cs index f8de2ec..1319c7f 100644 --- a/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Application.cs +++ b/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Application.cs @@ -600,6 +600,20 @@ private static void CheckQemu(ClusterInfo clusterInfo, }); } + //lock + if (vm.Detail.Config["lock"] != null) + { + result.Add(new DiagnosticResult + { + Id = vm.id, + ErrorCode = "WV0001", + Description = $"VM is locked by '{vm.Detail.Config["lock"]}'", + Context = DiagnosticResultContext.Qemu, + SubContext = "Status", + Gravity = DiagnosticResultGravity.Warning, + }); + } + #region check virtio //controller SCSI if (vm.Detail.Config.scsihw != null && diff --git a/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Corsinvest.ProxmoxVE.Diagnostic.Api.csproj b/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Corsinvest.ProxmoxVE.Diagnostic.Api.csproj index aa2b46b..325ba07 100644 --- a/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Corsinvest.ProxmoxVE.Diagnostic.Api.csproj +++ b/src/Corsinvest.ProxmoxVE.Diagnostic.Api/Corsinvest.ProxmoxVE.Diagnostic.Api.csproj @@ -3,7 +3,7 @@ netstandard2.0 true - 1.0.1 + 1.0.2 Corsinvest Srl Daniele Corsini Corsinvest Srl diff --git a/src/Corsinvest.ProxmoxVE.Diagnostic/Corsinvest.ProxmoxVE.Diagnostic.csproj b/src/Corsinvest.ProxmoxVE.Diagnostic/Corsinvest.ProxmoxVE.Diagnostic.csproj index 5d39e12..0e28814 100644 --- a/src/Corsinvest.ProxmoxVE.Diagnostic/Corsinvest.ProxmoxVE.Diagnostic.csproj +++ b/src/Corsinvest.ProxmoxVE.Diagnostic/Corsinvest.ProxmoxVE.Diagnostic.csproj @@ -1,7 +1,7 @@ Exe - 1.0.1 + 1.0.2 netcoreapp3.1 cv4pve-diag Corsinvest Srl @@ -23,6 +23,6 @@ - + \ No newline at end of file