Skip to content

Commit

Permalink
Add check vm locked
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed May 7, 2020
1 parent 816189c commit 4b45d89
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions src/Corsinvest.ProxmoxVE.Diagnostic.Api/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Company>Corsinvest Srl</Company>
<Authors>Daniele Corsini</Authors>
<Copyright>Corsinvest Srl</Copyright>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>cv4pve-diag</AssemblyName>
<Company>Corsinvest Srl</Company>
Expand All @@ -23,6 +23,6 @@
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.3.1" />

<!-- <ProjectReference Include="..\Corsinvest.ProxmoxVE.Diagnostic.Api\Corsinvest.ProxmoxVE.Diagnostic.Api.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Diagnostic.Api" Version="1.0.1" />
<PackageReference Include="Corsinvest.ProxmoxVE.Diagnostic.Api" Version="1.0.2" />
</ItemGroup>
</Project>

0 comments on commit 4b45d89

Please sign in to comment.