From 39f96f93ce9dbb99cab8c181b2578e7e8eb2fe45 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 29 Jul 2025 16:31:15 -0700 Subject: [PATCH 01/21] CI: improve logging when reunning Pester specs --- ci/tasks/test-units-bosh-psmodules/run.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/tasks/test-units-bosh-psmodules/run.ps1 b/ci/tasks/test-units-bosh-psmodules/run.ps1 index 145b80aaa..8b64a9a55 100644 --- a/ci/tasks/test-units-bosh-psmodules/run.ps1 +++ b/ci/tasks/test-units-bosh-psmodules/run.ps1 @@ -10,20 +10,22 @@ Import-Module "$moduleDir\Pester\$($pesterModule.Version)\Pester.psm1" $status = (Get-Service -Name "wuauserv").Status $startupType = (Get-Service "wuauserv" | Select-Object -ExpandProperty StartType) -Write-Host "-----------------------------------" + +Write-Host "-------------------------------------------" Write-Host "wuauserv Status = '$status'" Write-Host "wuauserv StartType = '$startupType'" Write-Host Write-Host "Running specs under: $(Get-Location)\stemcell-builder\$env:MODULES_DIR" +Write-Host "-------------------------------------------" Write-Host -Write-Host "-----------------------------------" $result = 0 $testModules = Get-ChildItem "stemcell-builder\$env:MODULES_DIR" -recurse | Where-Object {$_.name -match ".*.Tests.ps1"} | ForEach-Object {$_.DirectoryName} foreach ($module in $testModules) { $moduleName = $(Split-Path -Path $module -Leaf) - Write-Host "START Testing: $moduleName" + Write-Host + Write-Host "------------------------------- $moduleName" Push-Location "$module" # Do not set $ErrorActionPreference and let Pester handle it nativetly; setting it to Stop globally will @@ -33,7 +35,7 @@ foreach ($module in $testModules) { if ($results.FailedCount -gt 0) { $result += $results.FailedCount } - Write-Host "FINISH Testing: $moduleName" + Write-Host "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $moduleName" Write-Host Pop-Location } From 2bb5283ddd7a475f3264c45541febe0799670b49 Mon Sep 17 00:00:00 2001 From: aram price Date: Thu, 31 Jul 2025 13:41:05 -0700 Subject: [PATCH 02/21] CI: place the packer key on disk via create-aws-stemcell/run This replaces a separate create-packer-ci-key task to make `fly execute` easier. --- ci/pipelines/stemcells-windows.yml | 12 ++---------- ci/tasks/create-aws-stemcell/run | 8 ++++++-- ci/tasks/create-aws-stemcell/task.yml | 2 +- ci/tasks/create-packer-ci-key/task.yml | 13 ------------- 4 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 ci/tasks/create-packer-ci-key/task.yml diff --git a/ci/pipelines/stemcells-windows.yml b/ci/pipelines/stemcells-windows.yml index aedffd4d4..fdb992fff 100644 --- a/ci/pipelines/stemcells-windows.yml +++ b/ci/pipelines/stemcells-windows.yml @@ -1384,11 +1384,6 @@ jobs: params: pre: build tags: [*worker_tag] - - task: create-packer-ci-key - image: bosh-windows-stemcell-builder-ci-image - file: bosh-windows-stemcell-builder-ci/ci/tasks/create-packer-ci-key/task.yml - params: - PACKER_CI: ((bosh_windows_aws_packer_ci_private_key.private_key)) - task: create-aws-stemcell attempts: 3 timeout: 2h @@ -1400,6 +1395,7 @@ jobs: PACKER_AWS_ACCESS_KEY: ((aws-stemcells_aws_access_key.username)) PACKER_AWS_SECRET_KEY: ((aws-stemcells_aws_access_key.password)) PACKER_REGION: ((AWS_PACKER_REGION)) + PACKER_CI_PRIVATE_KEY: ((bosh_windows_aws_packer_ci_private_key.private_key)) OS_VERSION: windows((BASE_OS_VERSION)) OUTPUT_BUCKET_NAME: aws-regional-stemcells-((BASE_OS_VERSION)) VM_PREFIX: packer-prod-((BASE_OS_VERSION)) @@ -1564,11 +1560,6 @@ jobs: - get: blobstore-gcs-cli - get: windows-bsdtar - get: windows-winsw - - task: create-packer-ci-key - image: bosh-windows-stemcell-builder-ci-image - file: bosh-windows-stemcell-builder-ci/ci/tasks/create-packer-ci-key/task.yml - params: - PACKER_CI: ((bosh_windows_aws_govcloud_packer_ci_private_key.private_key)) - task: create-aws-govcloud-stemcell attempts: 3 timeout: 1h30m @@ -1579,6 +1570,7 @@ jobs: AWS_REGION: us-gov-west-1 PACKER_AWS_SECRET_KEY: ((packer_user_gov_aws_access_key.password)) PACKER_REGION: ((AWS_GOVCLOUD_PACKER_REGION)) + PACKER_CI_PRIVATE_KEY: ((bosh_windows_aws_govcloud_packer_ci_private_key.private_key)) OS_VERSION: windows((BASE_OS_VERSION)) OUTPUT_BUCKET_NAME: aws-regional-stemcells-((BASE_OS_VERSION)) VM_PREFIX: packer-prod-((BASE_OS_VERSION)) diff --git a/ci/tasks/create-aws-stemcell/run b/ci/tasks/create-aws-stemcell/run index 9b89319e1..54d0235c8 100755 --- a/ci/tasks/create-aws-stemcell/run +++ b/ci/tasks/create-aws-stemcell/run @@ -2,6 +2,8 @@ set -eu -o pipefail set -x +CONCOURSE_ROOT="$(pwd)" + if [ -n "${AWS_ROLE_ARN}" ]; then aws configure --profile creds_account set aws_access_key_id "${PACKER_AWS_ACCESS_KEY}" set +x @@ -18,13 +20,15 @@ else export AWS_SECRET_KEY="${PACKER_AWS_SECRET_KEY}" set -x fi +export PACKER_CI_PRIVATE_KEY_LOCATION="${CONCOURSE_ROOT}/packer-ci-private-key/packer_key" +mkdir -p "$(dirname "${PACKER_CI_PRIVATE_KEY_LOCATION}")" +echo "${PACKER_CI_PRIVATE_KEY}" > "${PACKER_CI_PRIVATE_KEY_LOCATION}" +chmod 600 "${PACKER_CI_PRIVATE_KEY_LOCATION}" pushd lgpo-binary unzip LGPO.zip popd -CONCOURSE_ROOT="$(pwd)" - "${CONCOURSE_ROOT}/bosh-windows-stemcell-builder-ci/ci/tasks/build-agent-zip/run.sh" "${CONCOURSE_ROOT}/bosh-windows-stemcell-builder-ci/ci/tasks/build-psmodules-zip/run.sh" diff --git a/ci/tasks/create-aws-stemcell/task.yml b/ci/tasks/create-aws-stemcell/task.yml index c6f870704..89d2bc18e 100644 --- a/ci/tasks/create-aws-stemcell/task.yml +++ b/ci/tasks/create-aws-stemcell/task.yml @@ -8,7 +8,6 @@ inputs: - name: version - name: lgpo-binary - name: sshd - - name: packer-ci-private-key - name: bosh-agent-release - name: blobstore-dav-cli - name: blobstore-s3-cli @@ -31,6 +30,7 @@ params: AWS_ROLE_ARN: PACKER_AWS_ACCESS_KEY: PACKER_AWS_SECRET_KEY: + PACKER_CI_PRIVATE_KEY: PACKER_REGION: VM_PREFIX: diff --git a/ci/tasks/create-packer-ci-key/task.yml b/ci/tasks/create-packer-ci-key/task.yml deleted file mode 100644 index 5ae954e87..000000000 --- a/ci/tasks/create-packer-ci-key/task.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -platform: linux -outputs: - - name: packer-ci-private-key - -run: - path: bash - args: - - "-c" - - 'echo "$PACKER_CI" > packer-ci-private-key/key && chmod 600 packer-ci-private-key/key' - -params: - PACKER_CI: From f78b22cf1a86ada7bede21a7f03555cebee7382f Mon Sep 17 00:00:00 2001 From: aram price Date: Thu, 31 Jul 2025 17:30:32 -0700 Subject: [PATCH 03/21] CI: remove `attempts: 3` from IaaS builds These rarely fail intermittently and multiple attempts slow down feedback. At least as of 2025... - cleanup quoting in pipeline yaml --- ci/pipelines/stemcells-windows.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ci/pipelines/stemcells-windows.yml b/ci/pipelines/stemcells-windows.yml index fdb992fff..645b23dd5 100644 --- a/ci/pipelines/stemcells-windows.yml +++ b/ci/pipelines/stemcells-windows.yml @@ -231,8 +231,8 @@ resources: - name: lgpo-binary type: file-url source: - url: "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip" - filename: "LGPO.zip" + url: https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip + filename: LGPO.zip # type: semver - name: aws-build-number @@ -1385,7 +1385,6 @@ jobs: pre: build tags: [*worker_tag] - task: create-aws-stemcell - attempts: 3 timeout: 2h file: bosh-windows-stemcell-builder-ci/ci/tasks/create-aws-stemcell/task.yml image: bosh-windows-stemcell-builder-ci-image @@ -1561,7 +1560,6 @@ jobs: - get: windows-bsdtar - get: windows-winsw - task: create-aws-govcloud-stemcell - attempts: 3 timeout: 1h30m file: bosh-windows-stemcell-builder-ci/ci/tasks/create-aws-stemcell/task.yml image: bosh-windows-stemcell-builder-ci-image @@ -1729,7 +1727,6 @@ jobs: pre: build tags: [*worker_tag] - task: create-azure-stemcell - attempts: 3 file: bosh-windows-stemcell-builder-ci/ci/tasks/create-azure-stemcell/task.yml image: bosh-windows-stemcell-builder-ci-image params: @@ -1927,7 +1924,6 @@ jobs: pre: build tags: [*worker_tag] - task: create-gcp-stemcell - attempts: 3 file: bosh-windows-stemcell-builder-ci/ci/tasks/create-gcp-stemcell/task.yml image: bosh-windows-stemcell-builder-ci-image params: From cb25a846822111699e1ad784ee588969b4c37dc2 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 12 Aug 2025 12:23:53 -0700 Subject: [PATCH 04/21] CI: logging and organization in powershell tasks --- ci/common-scripts/setup-windows-container.psm1 | 2 ++ ci/tasks/test-integration-stembuild-windows/run.ps1 | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/common-scripts/setup-windows-container.psm1 b/ci/common-scripts/setup-windows-container.psm1 index 3d0b1c0e3..411741848 100644 --- a/ci/common-scripts/setup-windows-container.psm1 +++ b/ci/common-scripts/setup-windows-container.psm1 @@ -3,8 +3,10 @@ function Set-TmpDir $working_directory = Get-Location $guid = $( New-Guid ).Guid $temp_directory=Join-Path -Path $working_directory.path -ChildPath "temp-$guid" + Write-Host *** Creating and setting temp environment variables to $temp_directory *** New-Item -Path $temp_directory -ItemType Directory $env:TMP=$temp_directory + $env:TEMP=$temp_directory $env:SystemTemp=$temp_directory } diff --git a/ci/tasks/test-integration-stembuild-windows/run.ps1 b/ci/tasks/test-integration-stembuild-windows/run.ps1 index 1975a2e3d..082bbb7fc 100644 --- a/ci/tasks/test-integration-stembuild-windows/run.ps1 +++ b/ci/tasks/test-integration-stembuild-windows/run.ps1 @@ -12,8 +12,6 @@ $env:PATH += ";c:\var\vcap\packages\git\usr\bin" $ROOT_DIR=Get-Location Write-Host "ROOT: $ROOT_DIR" -$env:VM_NAME= cat $ROOT_DIR/integration-vm-name/name - $TMP_DIR=Join-Path $ROOT_DIR tmp Write-Host *** creating and setting temp environment variable to $TMP_DIR*** @@ -23,9 +21,14 @@ $env:TMP=$TMP_DIR $env:TEMP=$TMP_DIR $env:SystemTemp=$TMP_DIR +$env:VM_NAME= cat $ROOT_DIR/integration-vm-name/name $env:TARGET_VM_IP = cat $ROOT_DIR/nimbus-ips/name $env:STEMBUILD_VERSION = cat $ROOT_DIR/version/version +$vcenterCertPath="$TMP_DIR\vcenter_ca.crt" +Write-Output $env:VCENTER_CA_CERT > $vcenterCertPath +$env:GOVC_TLS_CA_CERTS=$vcenterCertPath + Set-Location stemcell-builder\stembuild Write-Host ***Runninng integration tests*** From 6a2922c2e79719fe8c7d1f49fd90f82537d6cf14 Mon Sep 17 00:00:00 2001 From: aram price Date: Thu, 31 Jul 2025 14:10:47 -0700 Subject: [PATCH 05/21] Powershell: remove Enable-Hyper-V function This function no longer appears to be used within the windows stemcell repositoires. This was likely needed for versions of Windows older than the one currently being built (windows-2019). --- modules/BOSH.Utils/BOSH.Utils.Tests.ps1 | 16 ---------------- modules/BOSH.Utils/BOSH.Utils.psd1 | 3 +-- modules/BOSH.Utils/BOSH.Utils.psm1 | 5 ----- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/modules/BOSH.Utils/BOSH.Utils.Tests.ps1 b/modules/BOSH.Utils/BOSH.Utils.Tests.ps1 index 033ba04b7..b77940991 100644 --- a/modules/BOSH.Utils/BOSH.Utils.Tests.ps1 +++ b/modules/BOSH.Utils/BOSH.Utils.Tests.ps1 @@ -495,20 +495,4 @@ Describe "BOSH.Utils" { { New-VersionFile } | Should -Throw '-Version parameter must be specified as major.minor`[.whatever`]' } } - - Describe "Enable-Hyper-V" { - - AfterEach { - Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -norestart - } - - It "Enables Hyper V" { - getWindowsOptionalFeatureState("Microsoft-Hyper-V") | Should -MatchExactly "Disabled" - - Enable-Hyper-V - - getWindowsOptionalFeatureState("Microsoft-Hyper-V") | Should -MatchExactly "Enabled" - } - - } } \ No newline at end of file diff --git a/modules/BOSH.Utils/BOSH.Utils.psd1 b/modules/BOSH.Utils/BOSH.Utils.psd1 index 6859ddf03..89195bbf4 100644 --- a/modules/BOSH.Utils/BOSH.Utils.psd1 +++ b/modules/BOSH.Utils/BOSH.Utils.psd1 @@ -26,8 +26,7 @@ 'Get-OSVersionString', 'Get-WinRMConfig', 'Get-WUCerts', - 'New-VersionFile', - 'Enable-Hyper-V' + 'New-VersionFile' ) CmdletsToExport = @() VariablesToExport = '*' diff --git a/modules/BOSH.Utils/BOSH.Utils.psm1 b/modules/BOSH.Utils/BOSH.Utils.psm1 index 42ff40bf4..bf379d4e7 100644 --- a/modules/BOSH.Utils/BOSH.Utils.psm1 +++ b/modules/BOSH.Utils/BOSH.Utils.psm1 @@ -436,8 +436,3 @@ function Invoke-Remove-Item ) Remove-Item -path $path } - -function Enable-Hyper-V -{ - Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -norestart -} From f7c7808d0d5ec4054186383de33b784080c1dcfd Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 5 Aug 2025 16:39:34 -0700 Subject: [PATCH 06/21] nit: cleanup comments, formatting, lint issues --- stembuild/construct/vmconstruct.go | 2 +- stembuild/integration/interrupt_test.go | 4 ++-- stembuild/package_stemcell/ovftool/ovftool.go | 10 +++++----- stembuild/package_stemcell/ovftool/ovftool_windows.go | 1 + stembuild/package_stemcell/packager/vmdk_packager.go | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/stembuild/construct/vmconstruct.go b/stembuild/construct/vmconstruct.go index cfaef52e2..e4d45cb73 100644 --- a/stembuild/construct/vmconstruct.go +++ b/stembuild/construct/vmconstruct.go @@ -340,7 +340,7 @@ func EncodePowershellCommand(command []byte) string { for _, utf16char := range utf16Command { b := make([]byte, 2) binary.LittleEndian.PutUint16(b, utf16char) - byteCommand.Write(b) // This write never returns an error. + byteCommand.Write(b) } return base64.StdEncoding.EncodeToString(byteCommand.Bytes()) } diff --git a/stembuild/integration/interrupt_test.go b/stembuild/integration/interrupt_test.go index b75794b05..83055eb27 100644 --- a/stembuild/integration/interrupt_test.go +++ b/stembuild/integration/interrupt_test.go @@ -8,10 +8,10 @@ import ( "path/filepath" "time" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/test/helpers" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/test/helpers" ) var _ = Describe("Interrupts", func() { diff --git a/stembuild/package_stemcell/ovftool/ovftool.go b/stembuild/package_stemcell/ovftool/ovftool.go index 119ad9465..383781275 100644 --- a/stembuild/package_stemcell/ovftool/ovftool.go +++ b/stembuild/package_stemcell/ovftool/ovftool.go @@ -8,7 +8,7 @@ import ( "path/filepath" ) -var stopWalk = errors.New("stop walk") //nolint:staticcheck +var errStopWalk = errors.New("stop walk") func findExecutable(root, name string) (string, error) { var file string @@ -19,19 +19,19 @@ func findExecutable(root, name string) (string, error) { if !fi.IsDir() && fi.Name() == name { if s, err := exec.LookPath(path); err == nil { file = s - return stopWalk + return errStopWalk } } return nil } err := filepath.Walk(root, walkFn) if file == "" { - if err == nil || errors.Is(err, stopWalk) { + if err == nil || errors.Is(err, errStopWalk) { err = fmt.Errorf("executable file not found in: %s", root) } // CEV: this should never happen - if errors.Is(err, stopWalk) { - err = fmt.Errorf("executable file not found in: %s - exec.LookPath error.", root) //nolint:staticcheck + if errors.Is(err, errStopWalk) { + err = fmt.Errorf("executable file not found in: %s - exec.LookPath error", root) } return "", &exec.Error{Name: name, Err: err} } diff --git a/stembuild/package_stemcell/ovftool/ovftool_windows.go b/stembuild/package_stemcell/ovftool/ovftool_windows.go index 7971817cd..cc5c1e6c5 100644 --- a/stembuild/package_stemcell/ovftool/ovftool_windows.go +++ b/stembuild/package_stemcell/ovftool/ovftool_windows.go @@ -63,5 +63,6 @@ func Ovftool(installPaths []string) (string, error) { return path, nil } } + return "", &exec.Error{Name: name, Err: exec.ErrNotFound} } diff --git a/stembuild/package_stemcell/packager/vmdk_packager.go b/stembuild/package_stemcell/packager/vmdk_packager.go index adf2098d5..bbe17fcbc 100644 --- a/stembuild/package_stemcell/packager/vmdk_packager.go +++ b/stembuild/package_stemcell/packager/vmdk_packager.go @@ -64,12 +64,12 @@ func (r *CancelReader) Read(p []byte) (int, error) { } } -// returns a io.Writer that returns an error when VmdkPackager c is stopped +// Writer returns a io.Writer that returns an error when VmdkPackager c is stopped func (c *VmdkPackager) Writer(w io.Writer) *CancelWriter { return &CancelWriter{w: w, stop: c.Stop} } -// returns a io.Reader that returns an error when VmdkPackager c is stopped +// Reader returns a io.Reader that returns an error when VmdkPackager c is stopped func (c *VmdkPackager) Reader(r io.Reader) *CancelReader { return &CancelReader{r: r, stop: c.Stop} } From 27b7c881041584f8d5145e39b10d2a25e13b9196 Mon Sep 17 00:00:00 2001 From: aram price Date: Wed, 6 Aug 2025 16:36:09 -0700 Subject: [PATCH 07/21] stembuild: reorganize Makefile - add `stembuild/out/` to gitignore --- .gitignore | 1 + stembuild/Makefile | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index daae466e1..a4dbee4f6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .envrc .vscode +stembuild/out/ stembuild/stembuild stembuild/stembuild.exe stembuild/StemcellAutomation.zip diff --git a/stembuild/Makefile b/stembuild/Makefile index 45f6d90b4..9d7630864 100644 --- a/stembuild/Makefile +++ b/stembuild/Makefile @@ -33,19 +33,18 @@ out/stembuild.exe : assets $(GOSRC) clean : rm -rf version/version.go assets/StemcellAutomation.zip out/* - units : stubbed-stemcell-automation-zip go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --skip-package integration,iaas_cli iaas_cli : go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --flake-attempts 2 iaas_cli +integration : stubbed-stemcell-automation-zip + go run github.com/onsi/ginkgo/v2/ginkgo run -r --timeout 3h -vv --randomize-all --keep-going --flake-attempts 2 integration + integration-build : stubbed-stemcell-automation-zip $(GOSRC) go build -o $(COMMAND) -ldflags $(LD_FLAGS) . -integration : stubbed-stemcell-automation-zip - go run github.com/onsi/ginkgo/v2/ginkgo run -r -vv --timeout 3h --randomize-all --keep-going --flake-attempts 2 integration - stubbed-stemcell-automation-zip : $(CP) integration/construct/assets/StemcellAutomation.zip assets/ From 1e20172fed3e6ad03aae6665c9769c733a8deadc Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 5 Aug 2025 17:10:10 -0700 Subject: [PATCH 08/21] stembuild: replace mockgen with counterfeiter mockgen was used in only on place - regenerate counterfeiter fakes --- .../fake_construct_cmd_validator.go | 4 - .../fake_construct_messenger.go | 8 - .../fake_manager_factory.go | 4 - .../fake_osand_version_getter.go | 6 - .../commandparserfakes/fake_packager.go | 6 - .../fake_packager_factory.go | 2 - .../fake_packager_messenger.go | 10 - .../fake_vcenter_manager.go | 8 - .../commandparserfakes/fake_vm_construct.go | 2 - .../fake_vmpreparer_factory.go | 2 - .../fake_construct_messenger.go | 48 - .../constructfakes/fake_guest_manager.go | 6 - .../constructfakes/fake_iaas_client.go | 10 - .../constructfakes/fake_reboot_waiter_i.go | 2 - .../constructfakes/fake_script_executor_i.go | 4 - .../constructfakes/fake_version_getter.go | 2 - .../fake_vmconnection_validator.go | 2 - .../constructfakes/fake_win_rmenabler.go | 2 - .../constructfakes/fake_zip_unarchiver.go | 2 - stembuild/filesystem/filesystem.go | 4 +- .../filesystemfakes/fake_file_system.go | 114 + stembuild/filesystem/mock/mock_filesystem.go | 49 - stembuild/go.mod | 1 - stembuild/go.sum | 9 - .../fake_download_client.go | 2 - .../guest_managerfakes/fake_file_manager.go | 4 - .../guest_managerfakes/fake_proc_manager.go | 6 - .../vcenter_managerfakes/fake_finder.go | 10 - .../fake_finder_creator.go | 2 - .../fake_govmomi_client.go | 2 - .../vcenter_managerfakes/fake_ops_manager.go | 4 - .../fake_vim25client_creator.go | 2 - .../iaas_cli/iaas_clifakes/fake_cli_runner.go | 4 - .../packager/vmdk_packager_test.go | 79 +- stembuild/poller/pollerfakes/fake_poller_i.go | 2 - .../fake_reboot_checker_i.go | 2 - .../remotemanagerfakes/fake_remote_manager.go | 12 - .../remotemanagerfakes/fake_win_rmclient.go | 4 - .../fake_win_rmclient_factory_i.go | 2 - stembuild/tools/tools.go | 1 - .../vendor/github.com/golang/mock/AUTHORS | 12 - .../github.com/golang/mock/CONTRIBUTORS | 37 - .../vendor/github.com/golang/mock/LICENSE | 202 -- .../github.com/golang/mock/gomock/call.go | 445 ---- .../github.com/golang/mock/gomock/callset.go | 113 - .../golang/mock/gomock/controller.go | 336 --- .../github.com/golang/mock/gomock/matchers.go | 341 --- .../github.com/golang/mock/mockgen/mockgen.go | 701 ------ .../golang/mock/mockgen/model/model.go | 495 ----- .../github.com/golang/mock/mockgen/parse.go | 644 ------ .../github.com/golang/mock/mockgen/reflect.go | 256 --- .../golang/mock/mockgen/version.1.11.go | 26 - .../golang/mock/mockgen/version.1.12.go | 35 - .../vendor/golang.org/x/mod/modfile/print.go | 184 -- .../vendor/golang.org/x/mod/modfile/read.go | 964 --------- .../vendor/golang.org/x/mod/modfile/rule.go | 1904 ----------------- .../vendor/golang.org/x/mod/modfile/work.go | 333 --- stembuild/vendor/modules.txt | 6 - 58 files changed, 160 insertions(+), 7319 deletions(-) create mode 100644 stembuild/filesystem/filesystemfakes/fake_file_system.go delete mode 100644 stembuild/filesystem/mock/mock_filesystem.go delete mode 100644 stembuild/vendor/github.com/golang/mock/AUTHORS delete mode 100644 stembuild/vendor/github.com/golang/mock/CONTRIBUTORS delete mode 100644 stembuild/vendor/github.com/golang/mock/LICENSE delete mode 100644 stembuild/vendor/github.com/golang/mock/gomock/call.go delete mode 100644 stembuild/vendor/github.com/golang/mock/gomock/callset.go delete mode 100644 stembuild/vendor/github.com/golang/mock/gomock/controller.go delete mode 100644 stembuild/vendor/github.com/golang/mock/gomock/matchers.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/mockgen.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/model/model.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/parse.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/reflect.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/version.1.11.go delete mode 100644 stembuild/vendor/github.com/golang/mock/mockgen/version.1.12.go delete mode 100644 stembuild/vendor/golang.org/x/mod/modfile/print.go delete mode 100644 stembuild/vendor/golang.org/x/mod/modfile/read.go delete mode 100644 stembuild/vendor/golang.org/x/mod/modfile/rule.go delete mode 100644 stembuild/vendor/golang.org/x/mod/modfile/work.go diff --git a/stembuild/commandparser/commandparserfakes/fake_construct_cmd_validator.go b/stembuild/commandparser/commandparserfakes/fake_construct_cmd_validator.go index 3631ae718..457087b25 100644 --- a/stembuild/commandparser/commandparserfakes/fake_construct_cmd_validator.go +++ b/stembuild/commandparser/commandparserfakes/fake_construct_cmd_validator.go @@ -150,10 +150,6 @@ func (fake *FakeConstructCmdValidator) PopulatedArgsReturnsOnCall(i int, result1 func (fake *FakeConstructCmdValidator) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.lGPOInDirectoryMutex.RLock() - defer fake.lGPOInDirectoryMutex.RUnlock() - fake.populatedArgsMutex.RLock() - defer fake.populatedArgsMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go b/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go index edd3186e4..ff0475ca5 100644 --- a/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go +++ b/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go @@ -145,14 +145,6 @@ func (fake *FakeConstructMessenger) LGPONotFoundCalls(stub func()) { func (fake *FakeConstructMessenger) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.argumentsNotProvidedMutex.RLock() - defer fake.argumentsNotProvidedMutex.RUnlock() - fake.cannotConnectToVMMutex.RLock() - defer fake.cannotConnectToVMMutex.RUnlock() - fake.cannotPrepareVMMutex.RLock() - defer fake.cannotPrepareVMMutex.RUnlock() - fake.lGPONotFoundMutex.RLock() - defer fake.lGPONotFoundMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_manager_factory.go b/stembuild/commandparser/commandparserfakes/fake_manager_factory.go index 74dc72584..4eba7d730 100644 --- a/stembuild/commandparser/commandparserfakes/fake_manager_factory.go +++ b/stembuild/commandparser/commandparserfakes/fake_manager_factory.go @@ -131,10 +131,6 @@ func (fake *FakeManagerFactory) VCenterManagerReturnsOnCall(i int, result1 *vcen func (fake *FakeManagerFactory) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.setConfigMutex.RLock() - defer fake.setConfigMutex.RUnlock() - fake.vCenterManagerMutex.RLock() - defer fake.vCenterManagerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_osand_version_getter.go b/stembuild/commandparser/commandparserfakes/fake_osand_version_getter.go index 95b5495d1..07a7eab09 100644 --- a/stembuild/commandparser/commandparserfakes/fake_osand_version_getter.go +++ b/stembuild/commandparser/commandparserfakes/fake_osand_version_getter.go @@ -213,12 +213,6 @@ func (fake *FakeOSAndVersionGetter) GetVersionWithPatchNumberReturnsOnCall(i int func (fake *FakeOSAndVersionGetter) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.getOsMutex.RLock() - defer fake.getOsMutex.RUnlock() - fake.getVersionMutex.RLock() - defer fake.getVersionMutex.RUnlock() - fake.getVersionWithPatchNumberMutex.RLock() - defer fake.getVersionWithPatchNumberMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_packager.go b/stembuild/commandparser/commandparserfakes/fake_packager.go index 318032e43..6f368d51c 100644 --- a/stembuild/commandparser/commandparserfakes/fake_packager.go +++ b/stembuild/commandparser/commandparserfakes/fake_packager.go @@ -214,12 +214,6 @@ func (fake *FakePackager) ValidateSourceParametersReturnsOnCall(i int, result1 e func (fake *FakePackager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.packageMutex.RLock() - defer fake.packageMutex.RUnlock() - fake.validateFreeSpaceForPackageMutex.RLock() - defer fake.validateFreeSpaceForPackageMutex.RUnlock() - fake.validateSourceParametersMutex.RLock() - defer fake.validateSourceParametersMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_packager_factory.go b/stembuild/commandparser/commandparserfakes/fake_packager_factory.go index 331ab14fb..53cf5c1f2 100644 --- a/stembuild/commandparser/commandparserfakes/fake_packager_factory.go +++ b/stembuild/commandparser/commandparserfakes/fake_packager_factory.go @@ -98,8 +98,6 @@ func (fake *FakePackagerFactory) NewPackagerReturnsOnCall(i int, result1 command func (fake *FakePackagerFactory) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.newPackagerMutex.RLock() - defer fake.newPackagerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go b/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go index 9e7e011fc..45adc4208 100644 --- a/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go +++ b/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go @@ -200,16 +200,6 @@ func (fake *FakePackagerMessenger) SourceParametersAreInvalidArgsForCall(i int) func (fake *FakePackagerMessenger) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.cannotCreatePackagerMutex.RLock() - defer fake.cannotCreatePackagerMutex.RUnlock() - fake.doesNotHaveEnoughSpaceMutex.RLock() - defer fake.doesNotHaveEnoughSpaceMutex.RUnlock() - fake.invalidOutputConfigMutex.RLock() - defer fake.invalidOutputConfigMutex.RUnlock() - fake.packageFailedMutex.RLock() - defer fake.packageFailedMutex.RUnlock() - fake.sourceParametersAreInvalidMutex.RLock() - defer fake.sourceParametersAreInvalidMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_vcenter_manager.go b/stembuild/commandparser/commandparserfakes/fake_vcenter_manager.go index 6a4b86290..814297320 100644 --- a/stembuild/commandparser/commandparserfakes/fake_vcenter_manager.go +++ b/stembuild/commandparser/commandparserfakes/fake_vcenter_manager.go @@ -328,14 +328,6 @@ func (fake *FakeVCenterManager) OperationsManagerReturnsOnCall(i int, result1 *g func (fake *FakeVCenterManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.findVMMutex.RLock() - defer fake.findVMMutex.RUnlock() - fake.guestManagerMutex.RLock() - defer fake.guestManagerMutex.RUnlock() - fake.loginMutex.RLock() - defer fake.loginMutex.RUnlock() - fake.operationsManagerMutex.RLock() - defer fake.operationsManagerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_vm_construct.go b/stembuild/commandparser/commandparserfakes/fake_vm_construct.go index 2ebeb977d..aae4805e1 100644 --- a/stembuild/commandparser/commandparserfakes/fake_vm_construct.go +++ b/stembuild/commandparser/commandparserfakes/fake_vm_construct.go @@ -78,8 +78,6 @@ func (fake *FakeVmConstruct) PrepareVMReturnsOnCall(i int, result1 error) { func (fake *FakeVmConstruct) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.prepareVMMutex.RLock() - defer fake.prepareVMMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go b/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go index 82baa1729..eb84ef0d7 100644 --- a/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go +++ b/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go @@ -95,8 +95,6 @@ func (fake *FakeVMPreparerFactory) NewReturnsOnCall(i int, result1 commandparser func (fake *FakeVMPreparerFactory) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.newMutex.RLock() - defer fake.newMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_construct_messenger.go b/stembuild/construct/constructfakes/fake_construct_messenger.go index 2a462fadd..437b2f376 100644 --- a/stembuild/construct/constructfakes/fake_construct_messenger.go +++ b/stembuild/construct/constructfakes/fake_construct_messenger.go @@ -705,54 +705,6 @@ func (fake *FakeConstructMessenger) WinRMDisconnectedForRebootCalls(stub func()) func (fake *FakeConstructMessenger) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.createProvisionDirStartedMutex.RLock() - defer fake.createProvisionDirStartedMutex.RUnlock() - fake.createProvisionDirSucceededMutex.RLock() - defer fake.createProvisionDirSucceededMutex.RUnlock() - fake.enableWinRMStartedMutex.RLock() - defer fake.enableWinRMStartedMutex.RUnlock() - fake.enableWinRMSucceededMutex.RLock() - defer fake.enableWinRMSucceededMutex.RUnlock() - fake.executePostRebootScriptStartedMutex.RLock() - defer fake.executePostRebootScriptStartedMutex.RUnlock() - fake.executePostRebootScriptSucceededMutex.RLock() - defer fake.executePostRebootScriptSucceededMutex.RUnlock() - fake.executePostRebootWarningMutex.RLock() - defer fake.executePostRebootWarningMutex.RUnlock() - fake.executeSetupScriptStartedMutex.RLock() - defer fake.executeSetupScriptStartedMutex.RUnlock() - fake.executeSetupScriptSucceededMutex.RLock() - defer fake.executeSetupScriptSucceededMutex.RUnlock() - fake.extractArtifactsStartedMutex.RLock() - defer fake.extractArtifactsStartedMutex.RUnlock() - fake.extractArtifactsSucceededMutex.RLock() - defer fake.extractArtifactsSucceededMutex.RUnlock() - fake.logOutUsersStartedMutex.RLock() - defer fake.logOutUsersStartedMutex.RUnlock() - fake.logOutUsersSucceededMutex.RLock() - defer fake.logOutUsersSucceededMutex.RUnlock() - fake.rebootHasFinishedMutex.RLock() - defer fake.rebootHasFinishedMutex.RUnlock() - fake.rebootHasStartedMutex.RLock() - defer fake.rebootHasStartedMutex.RUnlock() - fake.shutdownCompletedMutex.RLock() - defer fake.shutdownCompletedMutex.RUnlock() - fake.uploadArtifactsStartedMutex.RLock() - defer fake.uploadArtifactsStartedMutex.RUnlock() - fake.uploadArtifactsSucceededMutex.RLock() - defer fake.uploadArtifactsSucceededMutex.RUnlock() - fake.uploadFileStartedMutex.RLock() - defer fake.uploadFileStartedMutex.RUnlock() - fake.uploadFileSucceededMutex.RLock() - defer fake.uploadFileSucceededMutex.RUnlock() - fake.validateVMConnectionStartedMutex.RLock() - defer fake.validateVMConnectionStartedMutex.RUnlock() - fake.validateVMConnectionSucceededMutex.RLock() - defer fake.validateVMConnectionSucceededMutex.RUnlock() - fake.waitingForShutdownMutex.RLock() - defer fake.waitingForShutdownMutex.RUnlock() - fake.winRMDisconnectedForRebootMutex.RLock() - defer fake.winRMDisconnectedForRebootMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_guest_manager.go b/stembuild/construct/constructfakes/fake_guest_manager.go index 80868997f..539c906c9 100644 --- a/stembuild/construct/constructfakes/fake_guest_manager.go +++ b/stembuild/construct/constructfakes/fake_guest_manager.go @@ -261,12 +261,6 @@ func (fake *FakeGuestManager) StartProgramInGuestReturnsOnCall(i int, result1 in func (fake *FakeGuestManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.downloadFileInGuestMutex.RLock() - defer fake.downloadFileInGuestMutex.RUnlock() - fake.exitCodeForProgramInGuestMutex.RLock() - defer fake.exitCodeForProgramInGuestMutex.RUnlock() - fake.startProgramInGuestMutex.RLock() - defer fake.startProgramInGuestMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_iaas_client.go b/stembuild/construct/constructfakes/fake_iaas_client.go index a0ff71504..833854a2b 100644 --- a/stembuild/construct/constructfakes/fake_iaas_client.go +++ b/stembuild/construct/constructfakes/fake_iaas_client.go @@ -418,16 +418,6 @@ func (fake *FakeIaasClient) WaitForExitReturnsOnCall(i int, result1 int, result2 func (fake *FakeIaasClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.isPoweredOffMutex.RLock() - defer fake.isPoweredOffMutex.RUnlock() - fake.makeDirectoryMutex.RLock() - defer fake.makeDirectoryMutex.RUnlock() - fake.startMutex.RLock() - defer fake.startMutex.RUnlock() - fake.uploadArtifactMutex.RLock() - defer fake.uploadArtifactMutex.RUnlock() - fake.waitForExitMutex.RLock() - defer fake.waitForExitMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_reboot_waiter_i.go b/stembuild/construct/constructfakes/fake_reboot_waiter_i.go index 0b6df2de1..ec9c4fe1c 100644 --- a/stembuild/construct/constructfakes/fake_reboot_waiter_i.go +++ b/stembuild/construct/constructfakes/fake_reboot_waiter_i.go @@ -78,8 +78,6 @@ func (fake *FakeRebootWaiterI) WaitForRebootFinishedReturnsOnCall(i int, result1 func (fake *FakeRebootWaiterI) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.waitForRebootFinishedMutex.RLock() - defer fake.waitForRebootFinishedMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_script_executor_i.go b/stembuild/construct/constructfakes/fake_script_executor_i.go index 3f976129a..3255c2fd2 100644 --- a/stembuild/construct/constructfakes/fake_script_executor_i.go +++ b/stembuild/construct/constructfakes/fake_script_executor_i.go @@ -167,10 +167,6 @@ func (fake *FakeScriptExecutorI) ExecuteSetupScriptReturnsOnCall(i int, result1 func (fake *FakeScriptExecutorI) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.executePostRebootScriptMutex.RLock() - defer fake.executePostRebootScriptMutex.RUnlock() - fake.executeSetupScriptMutex.RLock() - defer fake.executeSetupScriptMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_version_getter.go b/stembuild/construct/constructfakes/fake_version_getter.go index ed7065300..6d55c0401 100644 --- a/stembuild/construct/constructfakes/fake_version_getter.go +++ b/stembuild/construct/constructfakes/fake_version_getter.go @@ -78,8 +78,6 @@ func (fake *FakeVersionGetter) GetVersionReturnsOnCall(i int, result1 string) { func (fake *FakeVersionGetter) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.getVersionMutex.RLock() - defer fake.getVersionMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_vmconnection_validator.go b/stembuild/construct/constructfakes/fake_vmconnection_validator.go index b740da067..fb041d533 100644 --- a/stembuild/construct/constructfakes/fake_vmconnection_validator.go +++ b/stembuild/construct/constructfakes/fake_vmconnection_validator.go @@ -78,8 +78,6 @@ func (fake *FakeVMConnectionValidator) ValidateReturnsOnCall(i int, result1 erro func (fake *FakeVMConnectionValidator) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.validateMutex.RLock() - defer fake.validateMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_win_rmenabler.go b/stembuild/construct/constructfakes/fake_win_rmenabler.go index 5865db43c..6e5495408 100644 --- a/stembuild/construct/constructfakes/fake_win_rmenabler.go +++ b/stembuild/construct/constructfakes/fake_win_rmenabler.go @@ -78,8 +78,6 @@ func (fake *FakeWinRMEnabler) EnableReturnsOnCall(i int, result1 error) { func (fake *FakeWinRMEnabler) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.enableMutex.RLock() - defer fake.enableMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/construct/constructfakes/fake_zip_unarchiver.go b/stembuild/construct/constructfakes/fake_zip_unarchiver.go index daa7d220c..37d1a5665 100644 --- a/stembuild/construct/constructfakes/fake_zip_unarchiver.go +++ b/stembuild/construct/constructfakes/fake_zip_unarchiver.go @@ -97,8 +97,6 @@ func (fake *FakeZipUnarchiver) UnzipReturnsOnCall(i int, result1 []byte, result2 func (fake *FakeZipUnarchiver) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.unzipMutex.RLock() - defer fake.unzipMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/filesystem/filesystem.go b/stembuild/filesystem/filesystem.go index 47c1d2c3f..cae8712d8 100644 --- a/stembuild/filesystem/filesystem.go +++ b/stembuild/filesystem/filesystem.go @@ -1,6 +1,8 @@ package filesystem -//go:generate go run github.com/golang/mock/mockgen -source=filesystem.go -destination=mock/mock_filesystem.go FileSystem +//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate + +//counterfeiter:generate . FileSystem type FileSystem interface { GetAvailableDiskSpace(path string) (uint64, error) } diff --git a/stembuild/filesystem/filesystemfakes/fake_file_system.go b/stembuild/filesystem/filesystemfakes/fake_file_system.go new file mode 100644 index 000000000..4adcc26ab --- /dev/null +++ b/stembuild/filesystem/filesystemfakes/fake_file_system.go @@ -0,0 +1,114 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package filesystemfakes + +import ( + "sync" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem" +) + +type FakeFileSystem struct { + GetAvailableDiskSpaceStub func(string) (uint64, error) + getAvailableDiskSpaceMutex sync.RWMutex + getAvailableDiskSpaceArgsForCall []struct { + arg1 string + } + getAvailableDiskSpaceReturns struct { + result1 uint64 + result2 error + } + getAvailableDiskSpaceReturnsOnCall map[int]struct { + result1 uint64 + result2 error + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeFileSystem) GetAvailableDiskSpace(arg1 string) (uint64, error) { + fake.getAvailableDiskSpaceMutex.Lock() + ret, specificReturn := fake.getAvailableDiskSpaceReturnsOnCall[len(fake.getAvailableDiskSpaceArgsForCall)] + fake.getAvailableDiskSpaceArgsForCall = append(fake.getAvailableDiskSpaceArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.GetAvailableDiskSpaceStub + fakeReturns := fake.getAvailableDiskSpaceReturns + fake.recordInvocation("GetAvailableDiskSpace", []interface{}{arg1}) + fake.getAvailableDiskSpaceMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeFileSystem) GetAvailableDiskSpaceCallCount() int { + fake.getAvailableDiskSpaceMutex.RLock() + defer fake.getAvailableDiskSpaceMutex.RUnlock() + return len(fake.getAvailableDiskSpaceArgsForCall) +} + +func (fake *FakeFileSystem) GetAvailableDiskSpaceCalls(stub func(string) (uint64, error)) { + fake.getAvailableDiskSpaceMutex.Lock() + defer fake.getAvailableDiskSpaceMutex.Unlock() + fake.GetAvailableDiskSpaceStub = stub +} + +func (fake *FakeFileSystem) GetAvailableDiskSpaceArgsForCall(i int) string { + fake.getAvailableDiskSpaceMutex.RLock() + defer fake.getAvailableDiskSpaceMutex.RUnlock() + argsForCall := fake.getAvailableDiskSpaceArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeFileSystem) GetAvailableDiskSpaceReturns(result1 uint64, result2 error) { + fake.getAvailableDiskSpaceMutex.Lock() + defer fake.getAvailableDiskSpaceMutex.Unlock() + fake.GetAvailableDiskSpaceStub = nil + fake.getAvailableDiskSpaceReturns = struct { + result1 uint64 + result2 error + }{result1, result2} +} + +func (fake *FakeFileSystem) GetAvailableDiskSpaceReturnsOnCall(i int, result1 uint64, result2 error) { + fake.getAvailableDiskSpaceMutex.Lock() + defer fake.getAvailableDiskSpaceMutex.Unlock() + fake.GetAvailableDiskSpaceStub = nil + if fake.getAvailableDiskSpaceReturnsOnCall == nil { + fake.getAvailableDiskSpaceReturnsOnCall = make(map[int]struct { + result1 uint64 + result2 error + }) + } + fake.getAvailableDiskSpaceReturnsOnCall[i] = struct { + result1 uint64 + result2 error + }{result1, result2} +} + +func (fake *FakeFileSystem) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeFileSystem) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ filesystem.FileSystem = new(FakeFileSystem) diff --git a/stembuild/filesystem/mock/mock_filesystem.go b/stembuild/filesystem/mock/mock_filesystem.go deleted file mode 100644 index 3cc9db6a8..000000000 --- a/stembuild/filesystem/mock/mock_filesystem.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: filesystem.go - -// Package mock_filesystem is a generated GoMock package. -package mock_filesystem - -import ( - reflect "reflect" - - gomock "github.com/golang/mock/gomock" -) - -// MockFileSystem is a mock of FileSystem interface. -type MockFileSystem struct { - ctrl *gomock.Controller - recorder *MockFileSystemMockRecorder -} - -// MockFileSystemMockRecorder is the mock recorder for MockFileSystem. -type MockFileSystemMockRecorder struct { - mock *MockFileSystem -} - -// NewMockFileSystem creates a new mock instance. -func NewMockFileSystem(ctrl *gomock.Controller) *MockFileSystem { - mock := &MockFileSystem{ctrl: ctrl} - mock.recorder = &MockFileSystemMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockFileSystem) EXPECT() *MockFileSystemMockRecorder { - return m.recorder -} - -// GetAvailableDiskSpace mocks base method. -func (m *MockFileSystem) GetAvailableDiskSpace(path string) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAvailableDiskSpace", path) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetAvailableDiskSpace indicates an expected call of GetAvailableDiskSpace. -func (mr *MockFileSystemMockRecorder) GetAvailableDiskSpace(path interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAvailableDiskSpace", reflect.TypeOf((*MockFileSystem)(nil).GetAvailableDiskSpace), path) -} diff --git a/stembuild/go.mod b/stembuild/go.mod index f44fccaf8..966bcb01d 100644 --- a/stembuild/go.mod +++ b/stembuild/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/concourse/pool-resource v1.1.1 - github.com/golang/mock v1.6.0 github.com/google/subcommands v1.2.0 github.com/google/uuid v1.6.0 github.com/masterzen/winrm v0.0.0-20240702205601-3fad6e106085 diff --git a/stembuild/go.sum b/stembuild/go.sum index fd426da69..9873a1042 100644 --- a/stembuild/go.sum +++ b/stembuild/go.sum @@ -32,8 +32,6 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -124,7 +122,6 @@ github.com/tidwall/transform v0.0.0-20201103190739-32f242e2dbde/go.mod h1:MvrEmd github.com/vmware/govmomi v0.51.0 h1:n3RLS9aw/irTOKbiIyJzAb6rOat4YOVv/uDoRsNTSQI= github.com/vmware/govmomi v0.51.0/go.mod h1:3ywivawGRfMP2SDCeyKqxTl2xNIHTXF0ilvp72dot5A= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= @@ -136,7 +133,6 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58 golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= @@ -147,7 +143,6 @@ golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -156,7 +151,6 @@ golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= @@ -170,8 +164,6 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -190,7 +182,6 @@ golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= diff --git a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_download_client.go b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_download_client.go index 85e49af6d..d1f37f95d 100644 --- a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_download_client.go +++ b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_download_client.go @@ -105,8 +105,6 @@ func (fake *FakeDownloadClient) DownloadReturnsOnCall(i int, result1 io.ReadClos func (fake *FakeDownloadClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.downloadMutex.RLock() - defer fake.downloadMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_file_manager.go b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_file_manager.go index 6413b9c0c..d6682c553 100644 --- a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_file_manager.go +++ b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_file_manager.go @@ -178,10 +178,6 @@ func (fake *FakeFileManager) TransferURLReturnsOnCall(i int, result1 *url.URL, r func (fake *FakeFileManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.initiateFileTransferFromGuestMutex.RLock() - defer fake.initiateFileTransferFromGuestMutex.RUnlock() - fake.transferURLMutex.RLock() - defer fake.transferURLMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_proc_manager.go b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_proc_manager.go index 87d6d8b71..1b6d0ecb5 100644 --- a/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_proc_manager.go +++ b/stembuild/iaas_cli/iaas_clients/guest_manager/guest_managerfakes/fake_proc_manager.go @@ -248,12 +248,6 @@ func (fake *FakeProcManager) StartProgramReturnsOnCall(i int, result1 int64, res func (fake *FakeProcManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.clientMutex.RLock() - defer fake.clientMutex.RUnlock() - fake.listProcessesMutex.RLock() - defer fake.listProcessesMutex.RUnlock() - fake.startProgramMutex.RLock() - defer fake.startProgramMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder.go index c207350db..d5e01c847 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder.go @@ -406,16 +406,6 @@ func (fake *FakeFinder) VirtualMachineReturnsOnCall(i int, result1 *object.Virtu func (fake *FakeFinder) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.datacenterOrDefaultMutex.RLock() - defer fake.datacenterOrDefaultMutex.RUnlock() - fake.folderOrDefaultMutex.RLock() - defer fake.folderOrDefaultMutex.RUnlock() - fake.resourcePoolOrDefaultMutex.RLock() - defer fake.resourcePoolOrDefaultMutex.RUnlock() - fake.setDatacenterMutex.RLock() - defer fake.setDatacenterMutex.RUnlock() - fake.virtualMachineMutex.RLock() - defer fake.virtualMachineMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder_creator.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder_creator.go index af852e4d5..85e6a6920 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder_creator.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_finder_creator.go @@ -91,8 +91,6 @@ func (fake *FakeFinderCreator) NewFinderReturnsOnCall(i int, result1 *find.Finde func (fake *FakeFinderCreator) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.newFinderMutex.RLock() - defer fake.newFinderMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_govmomi_client.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_govmomi_client.go index 3aa34bb16..9342f5798 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_govmomi_client.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_govmomi_client.go @@ -91,8 +91,6 @@ func (fake *FakeGovmomiClient) LoginReturnsOnCall(i int, result1 error) { func (fake *FakeGovmomiClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.loginMutex.RLock() - defer fake.loginMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_ops_manager.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_ops_manager.go index 1feb72c9e..730cab52a 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_ops_manager.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_ops_manager.go @@ -171,10 +171,6 @@ func (fake *FakeOpsManager) ProcessManagerReturnsOnCall(i int, result1 *guest.Pr func (fake *FakeOpsManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.fileManagerMutex.RLock() - defer fake.fileManagerMutex.RUnlock() - fake.processManagerMutex.RLock() - defer fake.processManagerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_vim25client_creator.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_vim25client_creator.go index 03def3504..e11517278 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_vim25client_creator.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_managerfakes/fake_vim25client_creator.go @@ -97,8 +97,6 @@ func (fake *FakeVim25ClientCreator) NewClientReturnsOnCall(i int, result1 *vim25 func (fake *FakeVim25ClientCreator) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.newClientMutex.RLock() - defer fake.newClientMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/iaas_cli/iaas_clifakes/fake_cli_runner.go b/stembuild/iaas_cli/iaas_clifakes/fake_cli_runner.go index 4e5146bb7..223be06a3 100644 --- a/stembuild/iaas_cli/iaas_clifakes/fake_cli_runner.go +++ b/stembuild/iaas_cli/iaas_clifakes/fake_cli_runner.go @@ -179,10 +179,6 @@ func (fake *FakeCliRunner) RunWithOutputReturnsOnCall(i int, result1 string, res func (fake *FakeCliRunner) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.runMutex.RLock() - defer fake.runMutex.RUnlock() - fake.runWithOutputMutex.RLock() - defer fake.runWithOutputMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/package_stemcell/packager/vmdk_packager_test.go b/stembuild/package_stemcell/packager/vmdk_packager_test.go index c0fa69eb2..d8d696284 100644 --- a/stembuild/package_stemcell/packager/vmdk_packager_test.go +++ b/stembuild/package_stemcell/packager/vmdk_packager_test.go @@ -8,12 +8,11 @@ import ( "os" "path/filepath" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" - mockfilesystem "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem/mock" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem/filesystemfakes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/packager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/test/helpers" @@ -112,86 +111,94 @@ var _ = Describe("VmdkPackager", func() { }) Describe("ValidateFreeSpaceForPackage", func() { - var ( - mockCtrl *gomock.Controller - mockFileSystem *mockfilesystem.MockFileSystem - ) + var fakeFileSystem *filesystemfakes.FakeFileSystem + + BeforeEach(func() { + fakeFileSystem = &filesystemfakes.FakeFileSystem{} + }) Context("When VMDK file is invalid", func() { + BeforeEach(func() { + fakeFileSystem.GetAvailableDiskSpaceReturns(0, errors.New("error getting available disk space")) + }) + It("returns an error", func() { vmdkPackager.BuildOptions.VMDKFile = "" - mockCtrl = gomock.NewController(GinkgoT()) - mockFileSystem = mockfilesystem.NewMockFileSystem(mockCtrl) - - err := vmdkPackager.ValidateFreeSpaceForPackage(mockFileSystem) + err := vmdkPackager.ValidateFreeSpaceForPackage(fakeFileSystem) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("could not get vmdk info")) - }) }) Context("When filesystem has enough free space for stemcell (twice the size of the expected free space)", func() { - It("does not return an error", func() { - vmdkPackager.BuildOptions.VMDKFile = filepath.Join("..", "..", "test", "data", "expected.vmdk") - - mockCtrl = gomock.NewController(GinkgoT()) - mockFileSystem = mockfilesystem.NewMockFileSystem(mockCtrl) + var expectFreeSpace uint64 + BeforeEach(func() { + vmdkPackager.BuildOptions.VMDKFile = filepath.Join("..", "..", "test", "data", "expected.vmdk") vmdkFile, err := os.Stat(vmdkPackager.BuildOptions.VMDKFile) Expect(err).ToNot(HaveOccurred()) - testVmdkSize := vmdkFile.Size() - expectFreeSpace := uint64(testVmdkSize)*2 + (packager.Gigabyte / 2) + expectFreeSpace = uint64(testVmdkSize)*2 + (packager.Gigabyte / 2) + fakeFileSystem.GetAvailableDiskSpaceReturns(expectFreeSpace*2, nil) + }) + + It("does not return an error", func() { directoryPath := filepath.Dir(vmdkPackager.BuildOptions.VMDKFile) - mockFileSystem.EXPECT().GetAvailableDiskSpace(directoryPath).Return(uint64(expectFreeSpace*2), nil).AnyTimes() - err = vmdkPackager.ValidateFreeSpaceForPackage(mockFileSystem) + err := vmdkPackager.ValidateFreeSpaceForPackage(fakeFileSystem) Expect(err).To(Not(HaveOccurred())) + Expect(fakeFileSystem.GetAvailableDiskSpaceCallCount()).To(Equal(1)) + Expect(fakeFileSystem.GetAvailableDiskSpaceArgsForCall(0)).To(Equal(directoryPath)) }) }) - Context("When filesystem does not have enough free space for stemcell (half the size of the expected free space", func() { - It("returns error", func() { - vmdkPackager.BuildOptions.VMDKFile = filepath.Join("..", "..", "test", "data", "expected.vmdk") - mockCtrl = gomock.NewController(GinkgoT()) - mockFileSystem = mockfilesystem.NewMockFileSystem(mockCtrl) + Context("When filesystem does not have enough free space for stemcell (half the size of the expected free space", func() { + var expectFreeSpace uint64 + BeforeEach(func() { + vmdkPackager.BuildOptions.VMDKFile = filepath.Join("..", "..", "test", "data", "expected.vmdk") vmdkFile, err := os.Stat(vmdkPackager.BuildOptions.VMDKFile) Expect(err).ToNot(HaveOccurred()) - testVmdkSize := vmdkFile.Size() - expectFreeSpace := uint64(testVmdkSize)*2 + (packager.Gigabyte / 2) + expectFreeSpace = uint64(testVmdkSize)*2 + (packager.Gigabyte / 2) - directoryPath := filepath.Dir(vmdkPackager.BuildOptions.VMDKFile) - mockFileSystem.EXPECT().GetAvailableDiskSpace(directoryPath).Return(uint64(expectFreeSpace/2), nil).AnyTimes() + fakeFileSystem.GetAvailableDiskSpaceReturns(expectFreeSpace/2, nil) + }) - err = vmdkPackager.ValidateFreeSpaceForPackage(mockFileSystem) + It("returns error", func() { + directoryPath := filepath.Dir(vmdkPackager.BuildOptions.VMDKFile) + err := vmdkPackager.ValidateFreeSpaceForPackage(fakeFileSystem) Expect(err).To(HaveOccurred()) expectedErrorMsg := "Not enough space to create stemcell. Free up " Expect(err.Error()).To(ContainSubstring(expectedErrorMsg)) + + Expect(fakeFileSystem.GetAvailableDiskSpaceCallCount()).To(Equal(1)) + Expect(fakeFileSystem.GetAvailableDiskSpaceArgsForCall(0)).To(Equal(directoryPath)) }) }) Context("When filesystem fails to provide free space", func() { + BeforeEach(func() { + fakeFileSystem.GetAvailableDiskSpaceReturns(4, errors.New("error getting available disk space")) + }) + It("returns error specifying that given disk could not provide free space", func() { vmdkPackager.BuildOptions.VMDKFile = filepath.Join("..", "..", "test", "data", "expected.vmdk") - - mockCtrl = gomock.NewController(GinkgoT()) - mockFileSystem = mockfilesystem.NewMockFileSystem(mockCtrl) - directoryPath := filepath.Dir(vmdkPackager.BuildOptions.VMDKFile) - mockFileSystem.EXPECT().GetAvailableDiskSpace(directoryPath).Return(uint64(4), errors.New("some error")).AnyTimes() - err := vmdkPackager.ValidateFreeSpaceForPackage(mockFileSystem) + err := vmdkPackager.ValidateFreeSpaceForPackage(fakeFileSystem) Expect(err).To(HaveOccurred()) expectedErrorMsg := "could not check free space on disk: " Expect(err.Error()).To(ContainSubstring(expectedErrorMsg)) + + Expect(fakeFileSystem.GetAvailableDiskSpaceCallCount()).To(Equal(1)) + Expect(fakeFileSystem.GetAvailableDiskSpaceArgsForCall(0)).To(Equal(directoryPath)) }) }) }) diff --git a/stembuild/poller/pollerfakes/fake_poller_i.go b/stembuild/poller/pollerfakes/fake_poller_i.go index a7f68fb66..88f14143e 100644 --- a/stembuild/poller/pollerfakes/fake_poller_i.go +++ b/stembuild/poller/pollerfakes/fake_poller_i.go @@ -90,8 +90,6 @@ func (fake *FakePollerI) PollReturnsOnCall(i int, result1 error) { func (fake *FakePollerI) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.pollMutex.RLock() - defer fake.pollMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/remotemanager/remotemanagerfakes/fake_reboot_checker_i.go b/stembuild/remotemanager/remotemanagerfakes/fake_reboot_checker_i.go index 3e8a3b687..39390d3c7 100644 --- a/stembuild/remotemanager/remotemanagerfakes/fake_reboot_checker_i.go +++ b/stembuild/remotemanager/remotemanagerfakes/fake_reboot_checker_i.go @@ -83,8 +83,6 @@ func (fake *FakeRebootCheckerI) RebootHasFinishedReturnsOnCall(i int, result1 bo func (fake *FakeRebootCheckerI) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.rebootHasFinishedMutex.RLock() - defer fake.rebootHasFinishedMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/remotemanager/remotemanagerfakes/fake_remote_manager.go b/stembuild/remotemanager/remotemanagerfakes/fake_remote_manager.go index dc944545d..effa769c6 100644 --- a/stembuild/remotemanager/remotemanagerfakes/fake_remote_manager.go +++ b/stembuild/remotemanager/remotemanagerfakes/fake_remote_manager.go @@ -446,18 +446,6 @@ func (fake *FakeRemoteManager) UploadArtifactReturnsOnCall(i int, result1 error) func (fake *FakeRemoteManager) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.canLoginVMMutex.RLock() - defer fake.canLoginVMMutex.RUnlock() - fake.canReachVMMutex.RLock() - defer fake.canReachVMMutex.RUnlock() - fake.executeCommandMutex.RLock() - defer fake.executeCommandMutex.RUnlock() - fake.executeCommandWithTimeoutMutex.RLock() - defer fake.executeCommandWithTimeoutMutex.RUnlock() - fake.extractArchiveMutex.RLock() - defer fake.extractArchiveMutex.RUnlock() - fake.uploadArtifactMutex.RLock() - defer fake.uploadArtifactMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient.go b/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient.go index c801998ab..fb896a711 100644 --- a/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient.go +++ b/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient.go @@ -166,10 +166,6 @@ func (fake *FakeWinRMClient) RunReturnsOnCall(i int, result1 int, result2 error) func (fake *FakeWinRMClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.createShellMutex.RLock() - defer fake.createShellMutex.RUnlock() - fake.runMutex.RLock() - defer fake.runMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient_factory_i.go b/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient_factory_i.go index f2df093da..91c3208d0 100644 --- a/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient_factory_i.go +++ b/stembuild/remotemanager/remotemanagerfakes/fake_win_rmclient_factory_i.go @@ -93,8 +93,6 @@ func (fake *FakeWinRMClientFactoryI) BuildReturnsOnCall(i int, result1 remoteman func (fake *FakeWinRMClientFactoryI) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.buildMutex.RLock() - defer fake.buildMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/stembuild/tools/tools.go b/stembuild/tools/tools.go index 29b313879..3a7dab915 100644 --- a/stembuild/tools/tools.go +++ b/stembuild/tools/tools.go @@ -4,7 +4,6 @@ package tools import ( - _ "github.com/golang/mock/mockgen" _ "github.com/maxbrunsfeld/counterfeiter/v6" _ "github.com/onsi/ginkgo/v2/ginkgo" ) diff --git a/stembuild/vendor/github.com/golang/mock/AUTHORS b/stembuild/vendor/github.com/golang/mock/AUTHORS deleted file mode 100644 index 660b8ccc8..000000000 --- a/stembuild/vendor/github.com/golang/mock/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -# This is the official list of GoMock authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Alex Reece -Google Inc. diff --git a/stembuild/vendor/github.com/golang/mock/CONTRIBUTORS b/stembuild/vendor/github.com/golang/mock/CONTRIBUTORS deleted file mode 100644 index def849cab..000000000 --- a/stembuild/vendor/github.com/golang/mock/CONTRIBUTORS +++ /dev/null @@ -1,37 +0,0 @@ -# This is the official list of people who can contribute (and typically -# have contributed) code to the gomock repository. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# The submission process automatically checks to make sure -# that people submitting code are listed in this file (by email address). -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# http://code.google.com/legal/individual-cla-v1.0.html -# http://code.google.com/legal/corporate-cla-v1.0.html -# -# The agreement for individuals can be filled out on the web. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. - -# Names should be added to this file like so: -# Name -# -# An entry with two email addresses specifies that the -# first address should be used in the submit logs and -# that the second address should be recognized as the -# same person when interacting with Rietveld. - -# Please keep the list sorted. - -Aaron Jacobs -Alex Reece -David Symonds -Ryan Barrett diff --git a/stembuild/vendor/github.com/golang/mock/LICENSE b/stembuild/vendor/github.com/golang/mock/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/stembuild/vendor/github.com/golang/mock/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/stembuild/vendor/github.com/golang/mock/gomock/call.go b/stembuild/vendor/github.com/golang/mock/gomock/call.go deleted file mode 100644 index 13c9f44b1..000000000 --- a/stembuild/vendor/github.com/golang/mock/gomock/call.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -// Call represents an expected call to a mock. -type Call struct { - t TestHelper // for triggering test failures on invalid call setup - - receiver interface{} // the receiver of the method call - method string // the name of the method - methodType reflect.Type // the type of the method - args []Matcher // the args - origin string // file and line number of call setup - - preReqs []*Call // prerequisite calls - - // Expectations - minCalls, maxCalls int - - numCalls int // actual number made - - // actions are called when this Call is called. Each action gets the args and - // can set the return values by returning a non-nil slice. Actions run in the - // order they are created. - actions []func([]interface{}) []interface{} -} - -// newCall creates a *Call. It requires the method type in order to support -// unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - t.Helper() - - // TODO: check arity, types. - mArgs := make([]Matcher, len(args)) - for i, arg := range args { - if m, ok := arg.(Matcher); ok { - mArgs[i] = m - } else if arg == nil { - // Handle nil specially so that passing a nil interface value - // will match the typed nils of concrete args. - mArgs[i] = Nil() - } else { - mArgs[i] = Eq(arg) - } - } - - // callerInfo's skip should be updated if the number of calls between the user's test - // and this line changes, i.e. this code is wrapped in another anonymous function. - // 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test. - origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { - // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) - for i := 0; i < methodType.NumOut(); i++ { - rets[i] = reflect.Zero(methodType.Out(i)).Interface() - } - return rets - }} - return &Call{t: t, receiver: receiver, method: method, methodType: methodType, - args: mArgs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions} -} - -// AnyTimes allows the expectation to be called 0 or more times -func (c *Call) AnyTimes() *Call { - c.minCalls, c.maxCalls = 0, 1e8 // close enough to infinity - return c -} - -// MinTimes requires the call to occur at least n times. If AnyTimes or MaxTimes have not been called or if MaxTimes -// was previously called with 1, MinTimes also sets the maximum number of calls to infinity. -func (c *Call) MinTimes(n int) *Call { - c.minCalls = n - if c.maxCalls == 1 { - c.maxCalls = 1e8 - } - return c -} - -// MaxTimes limits the number of calls to n times. If AnyTimes or MinTimes have not been called or if MinTimes was -// previously called with 1, MaxTimes also sets the minimum number of calls to 0. -func (c *Call) MaxTimes(n int) *Call { - c.maxCalls = n - if c.minCalls == 1 { - c.minCalls = 0 - } - return c -} - -// DoAndReturn declares the action to run when the call is matched. -// The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) DoAndReturn(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - c.t.Helper() - vArgs := make([]reflect.Value, len(args)) - ft := v.Type() - if c.methodType.NumIn() != ft.NumIn() { - c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin) - return nil - } - for i := 0; i < len(args); i++ { - if args[i] != nil { - vArgs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vArgs[i] = reflect.Zero(ft.In(i)) - } - } - vRets := v.Call(vArgs) - rets := make([]interface{}, len(vRets)) - for i, ret := range vRets { - rets[i] = ret.Interface() - } - return rets - }) - return c -} - -// Do declares the action to run when the call is matched. The function's -// return values are ignored to retain backward compatibility. To use the -// return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) Do(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - c.t.Helper() - if c.methodType.NumIn() != v.Type().NumIn() { - c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, v.Type().NumIn(), c.methodType.NumIn(), c.origin) - return nil - } - vArgs := make([]reflect.Value, len(args)) - ft := v.Type() - for i := 0; i < len(args); i++ { - if args[i] != nil { - vArgs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vArgs[i] = reflect.Zero(ft.In(i)) - } - } - v.Call(vArgs) - return nil - }) - return c -} - -// Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { - c.t.Helper() - - mt := c.methodType - if len(rets) != mt.NumOut() { - c.t.Fatalf("wrong number of arguments to Return for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, len(rets), mt.NumOut(), c.origin) - } - for i, ret := range rets { - if got, want := reflect.TypeOf(ret), mt.Out(i); got == want { - // Identical types; nothing to do. - } else if got == nil { - // Nil needs special handling. - switch want.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - // ok - default: - c.t.Fatalf("argument %d to Return for %T.%v is nil, but %v is not nillable [%s]", - i, c.receiver, c.method, want, c.origin) - } - } else if got.AssignableTo(want) { - // Assignable type relation. Make the assignment now so that the generated code - // can return the values with a type assertion. - v := reflect.New(want).Elem() - v.Set(reflect.ValueOf(ret)) - rets[i] = v.Interface() - } else { - c.t.Fatalf("wrong type of argument %d to Return for %T.%v: %v is not assignable to %v [%s]", - i, c.receiver, c.method, got, want, c.origin) - } - } - - c.addAction(func([]interface{}) []interface{} { - return rets - }) - - return c -} - -// Times declares the exact number of times a function call is expected to be executed. -func (c *Call) Times(n int) *Call { - c.minCalls, c.maxCalls = n, n - return c -} - -// SetArg declares an action that will set the nth argument's value, -// indirected through a pointer. Or, in the case of a slice, SetArg -// will copy value's elements into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { - c.t.Helper() - - mt := c.methodType - // TODO: This will break on variadic methods. - // We will need to check those at invocation time. - if n < 0 || n >= mt.NumIn() { - c.t.Fatalf("SetArg(%d, ...) called for a method with %d args [%s]", - n, mt.NumIn(), c.origin) - } - // Permit setting argument through an interface. - // In the interface case, we don't (nay, can't) check the type here. - at := mt.In(n) - switch at.Kind() { - case reflect.Ptr: - dt := at.Elem() - if vt := reflect.TypeOf(value); !vt.AssignableTo(dt) { - c.t.Fatalf("SetArg(%d, ...) argument is a %v, not assignable to %v [%s]", - n, vt, dt, c.origin) - } - case reflect.Interface: - // nothing to do - case reflect.Slice: - // nothing to do - default: - c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]", - n, at, c.origin) - } - - c.addAction(func(args []interface{}) []interface{} { - v := reflect.ValueOf(value) - switch reflect.TypeOf(args[n]).Kind() { - case reflect.Slice: - setSlice(args[n], v) - default: - reflect.ValueOf(args[n]).Elem().Set(v) - } - return nil - }) - return c -} - -// isPreReq returns true if other is a direct or indirect prerequisite to c. -func (c *Call) isPreReq(other *Call) bool { - for _, preReq := range c.preReqs { - if other == preReq || preReq.isPreReq(other) { - return true - } - } - return false -} - -// After declares that the call may only match after preReq has been exhausted. -func (c *Call) After(preReq *Call) *Call { - c.t.Helper() - - if c == preReq { - c.t.Fatalf("A call isn't allowed to be its own prerequisite") - } - if preReq.isPreReq(c) { - c.t.Fatalf("Loop in call order: %v is a prerequisite to %v (possibly indirectly).", c, preReq) - } - - c.preReqs = append(c.preReqs, preReq) - return c -} - -// Returns true if the minimum number of calls have been made. -func (c *Call) satisfied() bool { - return c.numCalls >= c.minCalls -} - -// Returns true if the maximum number of calls have been made. -func (c *Call) exhausted() bool { - return c.numCalls >= c.maxCalls -} - -func (c *Call) String() string { - args := make([]string, len(c.args)) - for i, arg := range c.args { - args[i] = arg.String() - } - arguments := strings.Join(args, ", ") - return fmt.Sprintf("%T.%v(%s) %s", c.receiver, c.method, arguments, c.origin) -} - -// Tests if the given call matches the expected call. -// If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { - if !c.methodType.IsVariadic() { - if len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - - for i, m := range c.args { - if !m.Matches(args[i]) { - return fmt.Errorf( - "expected call at %s doesn't match the argument at index %d.\nGot: %v\nWant: %v", - c.origin, i, formatGottenArg(m, args[i]), m, - ) - } - } - } else { - if len(c.args) < c.methodType.NumIn()-1 { - return fmt.Errorf("expected call at %s has the wrong number of matchers. Got: %d, want: %d", - c.origin, len(c.args), c.methodType.NumIn()-1) - } - if len(c.args) != c.methodType.NumIn() && len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - if len(args) < len(c.args)-1 { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: greater than or equal to %d", - c.origin, len(args), len(c.args)-1) - } - - for i, m := range c.args { - if i < c.methodType.NumIn()-1 { - // Non-variadic args - if !m.Matches(args[i]) { - return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), formatGottenArg(m, args[i]), m) - } - continue - } - // The last arg has a possibility of a variadic argument, so let it branch - - // sample: Foo(a int, b int, c ...int) - if i < len(c.args) && i < len(args) { - if m.Matches(args[i]) { - // Got Foo(a, b, c) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC) - // Got Foo(a, b) want Foo(matcherA, matcherB) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD) - continue - } - } - - // The number of actual args don't match the number of matchers, - // or the last matcher is a slice and the last arg is not. - // If this function still matches it is because the last matcher - // matches all the remaining arguments or the lack of any. - // Convert the remaining arguments, if any, into a slice of the - // expected type. - vArgsType := c.methodType.In(c.methodType.NumIn() - 1) - vArgs := reflect.MakeSlice(vArgsType, 0, len(args)-i) - for _, arg := range args[i:] { - vArgs = reflect.Append(vArgs, reflect.ValueOf(arg)) - } - if m.Matches(vArgs.Interface()) { - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b) want Foo(matcherA, matcherB, someEmptySliceMatcher) - break - } - // Wrong number of matchers or not match. Fail. - // Got Foo(a, b) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD, matcherE) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB) - - return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), formatGottenArg(m, args[i:]), c.args[i]) - } - } - - // Check that all prerequisite calls have been satisfied. - for _, preReqCall := range c.preReqs { - if !preReqCall.satisfied() { - return fmt.Errorf("expected call at %s doesn't have a prerequisite call satisfied:\n%v\nshould be called before:\n%v", - c.origin, preReqCall, c) - } - } - - // Check that the call is not exhausted. - if c.exhausted() { - return fmt.Errorf("expected call at %s has already been called the max number of times", c.origin) - } - - return nil -} - -// dropPrereqs tells the expected Call to not re-check prerequisite calls any -// longer, and to return its current set. -func (c *Call) dropPrereqs() (preReqs []*Call) { - preReqs = c.preReqs - c.preReqs = nil - return -} - -func (c *Call) call() []func([]interface{}) []interface{} { - c.numCalls++ - return c.actions -} - -// InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { - for i := 1; i < len(calls); i++ { - calls[i].After(calls[i-1]) - } -} - -func setSlice(arg interface{}, v reflect.Value) { - va := reflect.ValueOf(arg) - for i := 0; i < v.Len(); i++ { - va.Index(i).Set(v.Index(i)) - } -} - -func (c *Call) addAction(action func([]interface{}) []interface{}) { - c.actions = append(c.actions, action) -} - -func formatGottenArg(m Matcher, arg interface{}) string { - got := fmt.Sprintf("%v (%T)", arg, arg) - if gs, ok := m.(GotFormatter); ok { - got = gs.Got(arg) - } - return got -} diff --git a/stembuild/vendor/github.com/golang/mock/gomock/callset.go b/stembuild/vendor/github.com/golang/mock/gomock/callset.go deleted file mode 100644 index 49dba787a..000000000 --- a/stembuild/vendor/github.com/golang/mock/gomock/callset.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "bytes" - "errors" - "fmt" -) - -// callSet represents a set of expected calls, indexed by receiver and method -// name. -type callSet struct { - // Calls that are still expected. - expected map[callSetKey][]*Call - // Calls that have been exhausted. - exhausted map[callSetKey][]*Call -} - -// callSetKey is the key in the maps in callSet -type callSetKey struct { - receiver interface{} - fname string -} - -func newCallSet() *callSet { - return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)} -} - -// Add adds a new expected call. -func (cs callSet) Add(call *Call) { - key := callSetKey{call.receiver, call.method} - m := cs.expected - if call.exhausted() { - m = cs.exhausted - } - m[key] = append(m[key], call) -} - -// Remove removes an expected call. -func (cs callSet) Remove(call *Call) { - key := callSetKey{call.receiver, call.method} - calls := cs.expected[key] - for i, c := range calls { - if c == call { - // maintain order for remaining calls - cs.expected[key] = append(calls[:i], calls[i+1:]...) - cs.exhausted[key] = append(cs.exhausted[key], call) - break - } - } -} - -// FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { - key := callSetKey{receiver, method} - - // Search through the expected calls. - expected := cs.expected[key] - var callsErrors bytes.Buffer - for _, call := range expected { - err := call.matches(args) - if err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - } else { - return call, nil - } - } - - // If we haven't found a match then search through the exhausted calls so we - // get useful error messages. - exhausted := cs.exhausted[key] - for _, call := range exhausted { - if err := call.matches(args); err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - continue - } - _, _ = fmt.Fprintf( - &callsErrors, "all expected calls for method %q have been exhausted", method, - ) - } - - if len(expected)+len(exhausted) == 0 { - _, _ = fmt.Fprintf(&callsErrors, "there are no expected calls of the method %q for that receiver", method) - } - - return nil, errors.New(callsErrors.String()) -} - -// Failures returns the calls that are not satisfied. -func (cs callSet) Failures() []*Call { - failures := make([]*Call, 0, len(cs.expected)) - for _, calls := range cs.expected { - for _, call := range calls { - if !call.satisfied() { - failures = append(failures, call) - } - } - } - return failures -} diff --git a/stembuild/vendor/github.com/golang/mock/gomock/controller.go b/stembuild/vendor/github.com/golang/mock/gomock/controller.go deleted file mode 100644 index f054200d5..000000000 --- a/stembuild/vendor/github.com/golang/mock/gomock/controller.go +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package gomock is a mock framework for Go. -// -// Standard usage: -// (1) Define an interface that you wish to mock. -// type MyInterface interface { -// SomeMethod(x int64, y string) -// } -// (2) Use mockgen to generate a mock from the interface. -// (3) Use the mock in a test: -// func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t) -// defer mockCtrl.Finish() -// -// mockObj := something.NewMockMyInterface(mockCtrl) -// mockObj.EXPECT().SomeMethod(4, "blah") -// // pass mockObj to a real object and play with it. -// } -// -// By default, expected calls are not enforced to run in any particular order. -// Call order dependency can be enforced by use of InOrder and/or Call.After. -// Call.After can create more varied call order dependencies, but InOrder is -// often more convenient. -// -// The following examples create equivalent call order dependencies. -// -// Example of using Call.After to chain expected call order: -// -// firstCall := mockObj.EXPECT().SomeMethod(1, "first") -// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) -// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) -// -// Example of using InOrder to declare expected call order: -// -// gomock.InOrder( -// mockObj.EXPECT().SomeMethod(1, "first"), -// mockObj.EXPECT().SomeMethod(2, "second"), -// mockObj.EXPECT().SomeMethod(3, "third"), -// ) -package gomock - -import ( - "context" - "fmt" - "reflect" - "runtime" - "sync" -) - -// A TestReporter is something that can be used to report test failures. It -// is satisfied by the standard library's *testing.T. -type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) -} - -// TestHelper is a TestReporter that has the Helper method. It is satisfied -// by the standard library's *testing.T. -type TestHelper interface { - TestReporter - Helper() -} - -// cleanuper is used to check if TestHelper also has the `Cleanup` method. A -// common pattern is to pass in a `*testing.T` to -// `NewController(t TestReporter)`. In Go 1.14+, `*testing.T` has a cleanup -// method. This can be utilized to call `Finish()` so the caller of this library -// does not have to. -type cleanuper interface { - Cleanup(func()) -} - -// A Controller represents the top-level control of a mock ecosystem. It -// defines the scope and lifetime of mock objects, as well as their -// expectations. It is safe to call Controller's methods from multiple -// goroutines. Each test should create a new Controller and invoke Finish via -// defer. -// -// func TestFoo(t *testing.T) { -// ctrl := gomock.NewController(t) -// defer ctrl.Finish() -// // .. -// } -// -// func TestBar(t *testing.T) { -// t.Run("Sub-Test-1", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// t.Run("Sub-Test-2", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// }) -type Controller struct { - // T should only be called within a generated mock. It is not intended to - // be used in user code and may be changed in future versions. T is the - // TestReporter passed in when creating the Controller via NewController. - // If the TestReporter does not implement a TestHelper it will be wrapped - // with a nopTestHelper. - T TestHelper - mu sync.Mutex - expectedCalls *callSet - finished bool -} - -// NewController returns a new Controller. It is the preferred way to create a -// Controller. -// -// New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods. -func NewController(t TestReporter) *Controller { - h, ok := t.(TestHelper) - if !ok { - h = &nopTestHelper{t} - } - ctrl := &Controller{ - T: h, - expectedCalls: newCallSet(), - } - if c, ok := isCleanuper(ctrl.T); ok { - c.Cleanup(func() { - ctrl.T.Helper() - ctrl.finish(true, nil) - }) - } - - return ctrl -} - -type cancelReporter struct { - t TestHelper - cancel func() -} - -func (r *cancelReporter) Errorf(format string, args ...interface{}) { - r.t.Errorf(format, args...) -} -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { - defer r.cancel() - r.t.Fatalf(format, args...) -} - -func (r *cancelReporter) Helper() { - r.t.Helper() -} - -// WithContext returns a new Controller and a Context, which is cancelled on any -// fatal failure. -func WithContext(ctx context.Context, t TestReporter) (*Controller, context.Context) { - h, ok := t.(TestHelper) - if !ok { - h = &nopTestHelper{t: t} - } - - ctx, cancel := context.WithCancel(ctx) - return NewController(&cancelReporter{t: h, cancel: cancel}), ctx -} - -type nopTestHelper struct { - t TestReporter -} - -func (h *nopTestHelper) Errorf(format string, args ...interface{}) { - h.t.Errorf(format, args...) -} -func (h *nopTestHelper) Fatalf(format string, args ...interface{}) { - h.t.Fatalf(format, args...) -} - -func (h nopTestHelper) Helper() {} - -// RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { - ctrl.T.Helper() - - recv := reflect.ValueOf(receiver) - for i := 0; i < recv.Type().NumMethod(); i++ { - if recv.Type().Method(i).Name == method { - return ctrl.RecordCallWithMethodType(receiver, method, recv.Method(i).Type(), args...) - } - } - ctrl.T.Fatalf("gomock: failed finding method %s on %T", method, receiver) - panic("unreachable") -} - -// RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - ctrl.T.Helper() - - call := newCall(ctrl.T, receiver, method, methodType, args...) - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - ctrl.expectedCalls.Add(call) - - return call -} - -// Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { - ctrl.T.Helper() - - // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { - ctrl.T.Helper() - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args) - if err != nil { - // callerInfo's skip should be updated if the number of calls between the user's test - // and this line changes, i.e. this code is wrapped in another anonymous function. - // 0 is us, 1 is controller.Call(), 2 is the generated mock, and 3 is the user's test. - origin := callerInfo(3) - ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err) - } - - // Two things happen here: - // * the matching call no longer needs to check prerequite calls, - // * and the prerequite calls are no longer expected, so remove them. - preReqCalls := expected.dropPrereqs() - for _, preReqCall := range preReqCalls { - ctrl.expectedCalls.Remove(preReqCall) - } - - actions := expected.call() - if expected.exhausted() { - ctrl.expectedCalls.Remove(expected) - } - return actions - }() - - var rets []interface{} - for _, action := range actions { - if r := action(args); r != nil { - rets = r - } - } - - return rets -} - -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. -// -// New in go1.14+, if you are passing a *testing.T into NewController function you no -// longer need to call ctrl.Finish() in your test methods. -func (ctrl *Controller) Finish() { - // If we're currently panicking, probably because this is a deferred call. - // This must be recovered in the deferred function. - err := recover() - ctrl.finish(false, err) -} - -func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) { - ctrl.T.Helper() - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - if ctrl.finished { - if _, ok := isCleanuper(ctrl.T); !ok { - ctrl.T.Fatalf("Controller.Finish was called more than once. It has to be called exactly once.") - } - return - } - ctrl.finished = true - - // Short-circuit, pass through the panic. - if panicErr != nil { - panic(panicErr) - } - - // Check that all remaining expected calls are satisfied. - failures := ctrl.expectedCalls.Failures() - for _, call := range failures { - ctrl.T.Errorf("missing call(s) to %v", call) - } - if len(failures) != 0 { - if !cleanup { - ctrl.T.Fatalf("aborting test due to missing call(s)") - return - } - ctrl.T.Errorf("aborting test due to missing call(s)") - } -} - -// callerInfo returns the file:line of the call site. skip is the number -// of stack frames to skip when reporting. 0 is callerInfo's call site. -func callerInfo(skip int) string { - if _, file, line, ok := runtime.Caller(skip + 1); ok { - return fmt.Sprintf("%s:%d", file, line) - } - return "unknown file" -} - -// isCleanuper checks it if t's base TestReporter has a Cleanup method. -func isCleanuper(t TestReporter) (cleanuper, bool) { - tr := unwrapTestReporter(t) - c, ok := tr.(cleanuper) - return c, ok -} - -// unwrapTestReporter unwraps TestReporter to the base implementation. -func unwrapTestReporter(t TestReporter) TestReporter { - tr := t - switch nt := t.(type) { - case *cancelReporter: - tr = nt.t - if h, check := tr.(*nopTestHelper); check { - tr = h.t - } - case *nopTestHelper: - tr = nt.t - default: - // not wrapped - } - return tr -} diff --git a/stembuild/vendor/github.com/golang/mock/gomock/matchers.go b/stembuild/vendor/github.com/golang/mock/gomock/matchers.go deleted file mode 100644 index 2822fb2c8..000000000 --- a/stembuild/vendor/github.com/golang/mock/gomock/matchers.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strings" -) - -// A Matcher is a representation of a class of values. -// It is used to represent the valid or expected arguments to a mocked method. -type Matcher interface { - // Matches returns whether x is a match. - Matches(x interface{}) bool - - // String describes what the matcher matches. - String() string -} - -// WantFormatter modifies the given Matcher's String() method to the given -// Stringer. This allows for control on how the "Want" is formatted when -// printing . -func WantFormatter(s fmt.Stringer, m Matcher) Matcher { - type matcher interface { - Matches(x interface{}) bool - } - - return struct { - matcher - fmt.Stringer - }{ - matcher: m, - Stringer: s, - } -} - -// StringerFunc type is an adapter to allow the use of ordinary functions as -// a Stringer. If f is a function with the appropriate signature, -// StringerFunc(f) is a Stringer that calls f. -type StringerFunc func() string - -// String implements fmt.Stringer. -func (f StringerFunc) String() string { - return f() -} - -// GotFormatter is used to better print failure messages. If a matcher -// implements GotFormatter, it will use the result from Got when printing -// the failure message. -type GotFormatter interface { - // Got is invoked with the received value. The result is used when - // printing the failure message. - Got(got interface{}) string -} - -// GotFormatterFunc type is an adapter to allow the use of ordinary -// functions as a GotFormatter. If f is a function with the appropriate -// signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string - -// Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { - return f(got) -} - -// GotFormatterAdapter attaches a GotFormatter to a Matcher. -func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { - return struct { - GotFormatter - Matcher - }{ - GotFormatter: s, - Matcher: m, - } -} - -type anyMatcher struct{} - -func (anyMatcher) Matches(interface{}) bool { - return true -} - -func (anyMatcher) String() string { - return "is anything" -} - -type eqMatcher struct { - x interface{} -} - -func (e eqMatcher) Matches(x interface{}) bool { - // In case, some value is nil - if e.x == nil || x == nil { - return reflect.DeepEqual(e.x, x) - } - - // Check if types assignable and convert them to common type - x1Val := reflect.ValueOf(e.x) - x2Val := reflect.ValueOf(x) - - if x1Val.Type().AssignableTo(x2Val.Type()) { - x1ValConverted := x1Val.Convert(x2Val.Type()) - return reflect.DeepEqual(x1ValConverted.Interface(), x2Val.Interface()) - } - - return false -} - -func (e eqMatcher) String() string { - return fmt.Sprintf("is equal to %v (%T)", e.x, e.x) -} - -type nilMatcher struct{} - -func (nilMatcher) Matches(x interface{}) bool { - if x == nil { - return true - } - - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, - reflect.Ptr, reflect.Slice: - return v.IsNil() - } - - return false -} - -func (nilMatcher) String() string { - return "is nil" -} - -type notMatcher struct { - m Matcher -} - -func (n notMatcher) Matches(x interface{}) bool { - return !n.m.Matches(x) -} - -func (n notMatcher) String() string { - return "not(" + n.m.String() + ")" -} - -type assignableToTypeOfMatcher struct { - targetType reflect.Type -} - -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { - return reflect.TypeOf(x).AssignableTo(m.targetType) -} - -func (m assignableToTypeOfMatcher) String() string { - return "is assignable to " + m.targetType.Name() -} - -type allMatcher struct { - matchers []Matcher -} - -func (am allMatcher) Matches(x interface{}) bool { - for _, m := range am.matchers { - if !m.Matches(x) { - return false - } - } - return true -} - -func (am allMatcher) String() string { - ss := make([]string, 0, len(am.matchers)) - for _, matcher := range am.matchers { - ss = append(ss, matcher.String()) - } - return strings.Join(ss, "; ") -} - -type lenMatcher struct { - i int -} - -func (m lenMatcher) Matches(x interface{}) bool { - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == m.i - default: - return false - } -} - -func (m lenMatcher) String() string { - return fmt.Sprintf("has length %d", m.i) -} - -type inAnyOrderMatcher struct { - x interface{} -} - -func (m inAnyOrderMatcher) Matches(x interface{}) bool { - given, ok := m.prepareValue(x) - if !ok { - return false - } - wanted, ok := m.prepareValue(m.x) - if !ok { - return false - } - - if given.Len() != wanted.Len() { - return false - } - - usedFromGiven := make([]bool, given.Len()) - foundFromWanted := make([]bool, wanted.Len()) - for i := 0; i < wanted.Len(); i++ { - wantedMatcher := Eq(wanted.Index(i).Interface()) - for j := 0; j < given.Len(); j++ { - if usedFromGiven[j] { - continue - } - if wantedMatcher.Matches(given.Index(j).Interface()) { - foundFromWanted[i] = true - usedFromGiven[j] = true - break - } - } - } - - missingFromWanted := 0 - for _, found := range foundFromWanted { - if !found { - missingFromWanted++ - } - } - extraInGiven := 0 - for _, used := range usedFromGiven { - if !used { - extraInGiven++ - } - } - - return extraInGiven == 0 && missingFromWanted == 0 -} - -func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) { - xValue := reflect.ValueOf(x) - switch xValue.Kind() { - case reflect.Slice, reflect.Array: - return xValue, true - default: - return reflect.Value{}, false - } -} - -func (m inAnyOrderMatcher) String() string { - return fmt.Sprintf("has the same elements as %v", m.x) -} - -// Constructors - -// All returns a composite Matcher that returns true if and only all of the -// matchers return true. -func All(ms ...Matcher) Matcher { return allMatcher{ms} } - -// Any returns a matcher that always matches. -func Any() Matcher { return anyMatcher{} } - -// Eq returns a matcher that matches on equality. -// -// Example usage: -// Eq(5).Matches(5) // returns true -// Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } - -// Len returns a matcher that matches on length. This matcher returns false if -// is compared to a type that is not an array, chan, map, slice, or string. -func Len(i int) Matcher { - return lenMatcher{i} -} - -// Nil returns a matcher that matches if the received value is nil. -// -// Example usage: -// var x *bytes.Buffer -// Nil().Matches(x) // returns true -// x = &bytes.Buffer{} -// Nil().Matches(x) // returns false -func Nil() Matcher { return nilMatcher{} } - -// Not reverses the results of its given child matcher. -// -// Example usage: -// Not(Eq(5)).Matches(4) // returns true -// Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { - if m, ok := x.(Matcher); ok { - return notMatcher{m} - } - return notMatcher{Eq(x)} -} - -// AssignableToTypeOf is a Matcher that matches if the parameter to the mock -// function is assignable to the type of the parameter to this function. -// -// Example usage: -// var s fmt.Stringer = &bytes.Buffer{} -// AssignableToTypeOf(s).Matches(time.Second) // returns true -// AssignableToTypeOf(s).Matches(99) // returns false -// -// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() -// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { - if xt, ok := x.(reflect.Type); ok { - return assignableToTypeOfMatcher{xt} - } - return assignableToTypeOfMatcher{reflect.TypeOf(x)} -} - -// InAnyOrder is a Matcher that returns true for collections of the same elements ignoring the order. -// -// Example usage: -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false -func InAnyOrder(x interface{}) Matcher { - return inAnyOrderMatcher{x} -} diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/mockgen.go b/stembuild/vendor/github.com/golang/mock/mockgen/mockgen.go deleted file mode 100644 index 50487070e..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/mockgen.go +++ /dev/null @@ -1,701 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// MockGen generates mock implementations of Go interfaces. -package main - -// TODO: This does not support recursive embedded interfaces. -// TODO: This does not support embedding package-local interfaces in a separate file. - -import ( - "bytes" - "encoding/json" - "flag" - "fmt" - "go/token" - "io" - "io/ioutil" - "log" - "os" - "os/exec" - "path" - "path/filepath" - "sort" - "strconv" - "strings" - "unicode" - - "github.com/golang/mock/mockgen/model" - - "golang.org/x/mod/modfile" - toolsimports "golang.org/x/tools/imports" -) - -const ( - gomockImportPath = "github.com/golang/mock/gomock" -) - -var ( - version = "" - commit = "none" - date = "unknown" -) - -var ( - source = flag.String("source", "", "(source mode) Input Go source file; enables source mode.") - destination = flag.String("destination", "", "Output file; defaults to stdout.") - mockNames = flag.String("mock_names", "", "Comma-separated interfaceName=mockName pairs of explicit mock names to use. Mock names default to 'Mock'+ interfaceName suffix.") - packageOut = flag.String("package", "", "Package of the generated code; defaults to the package of the input with a 'mock_' prefix.") - selfPackage = flag.String("self_package", "", "The full package import path for the generated code. The purpose of this flag is to prevent import cycles in the generated code by trying to include its own package. This can happen if the mock's package is set to one of its inputs (usually the main one) and the output is stdio so mockgen cannot detect the final output package. Setting this flag will then tell mockgen which import to exclude.") - writePkgComment = flag.Bool("write_package_comment", true, "Writes package documentation comment (godoc) if true.") - copyrightFile = flag.String("copyright_file", "", "Copyright file used to add copyright header") - - debugParser = flag.Bool("debug_parser", false, "Print out parser results only.") - showVersion = flag.Bool("version", false, "Print version.") -) - -func main() { - flag.Usage = usage - flag.Parse() - - if *showVersion { - printVersion() - return - } - - var pkg *model.Package - var err error - var packageName string - if *source != "" { - pkg, err = sourceMode(*source) - } else { - if flag.NArg() != 2 { - usage() - log.Fatal("Expected exactly two arguments") - } - packageName = flag.Arg(0) - interfaces := strings.Split(flag.Arg(1), ",") - if packageName == "." { - dir, err := os.Getwd() - if err != nil { - log.Fatalf("Get current directory failed: %v", err) - } - packageName, err = packageNameOfDir(dir) - if err != nil { - log.Fatalf("Parse package name failed: %v", err) - } - } - pkg, err = reflectMode(packageName, interfaces) - } - if err != nil { - log.Fatalf("Loading input failed: %v", err) - } - - if *debugParser { - pkg.Print(os.Stdout) - return - } - - dst := os.Stdout - if len(*destination) > 0 { - if err := os.MkdirAll(filepath.Dir(*destination), os.ModePerm); err != nil { - log.Fatalf("Unable to create directory: %v", err) - } - f, err := os.Create(*destination) - if err != nil { - log.Fatalf("Failed opening destination file: %v", err) - } - defer f.Close() - dst = f - } - - outputPackageName := *packageOut - if outputPackageName == "" { - // pkg.Name in reflect mode is the base name of the import path, - // which might have characters that are illegal to have in package names. - outputPackageName = "mock_" + sanitize(pkg.Name) - } - - // outputPackagePath represents the fully qualified name of the package of - // the generated code. Its purposes are to prevent the module from importing - // itself and to prevent qualifying type names that come from its own - // package (i.e. if there is a type called X then we want to print "X" not - // "package.X" since "package" is this package). This can happen if the mock - // is output into an already existing package. - outputPackagePath := *selfPackage - if outputPackagePath == "" && *destination != "" { - dstPath, err := filepath.Abs(filepath.Dir(*destination)) - if err == nil { - pkgPath, err := parsePackageImport(dstPath) - if err == nil { - outputPackagePath = pkgPath - } else { - log.Println("Unable to infer -self_package from destination file path:", err) - } - } else { - log.Println("Unable to determine destination file path:", err) - } - } - - g := new(generator) - if *source != "" { - g.filename = *source - } else { - g.srcPackage = packageName - g.srcInterfaces = flag.Arg(1) - } - g.destination = *destination - - if *mockNames != "" { - g.mockNames = parseMockNames(*mockNames) - } - if *copyrightFile != "" { - header, err := ioutil.ReadFile(*copyrightFile) - if err != nil { - log.Fatalf("Failed reading copyright file: %v", err) - } - - g.copyrightHeader = string(header) - } - if err := g.Generate(pkg, outputPackageName, outputPackagePath); err != nil { - log.Fatalf("Failed generating mock: %v", err) - } - if _, err := dst.Write(g.Output()); err != nil { - log.Fatalf("Failed writing to destination: %v", err) - } -} - -func parseMockNames(names string) map[string]string { - mocksMap := make(map[string]string) - for _, kv := range strings.Split(names, ",") { - parts := strings.SplitN(kv, "=", 2) - if len(parts) != 2 || parts[1] == "" { - log.Fatalf("bad mock names spec: %v", kv) - } - mocksMap[parts[0]] = parts[1] - } - return mocksMap -} - -func usage() { - _, _ = io.WriteString(os.Stderr, usageText) - flag.PrintDefaults() -} - -const usageText = `mockgen has two modes of operation: source and reflect. - -Source mode generates mock interfaces from a source file. -It is enabled by using the -source flag. Other flags that -may be useful in this mode are -imports and -aux_files. -Example: - mockgen -source=foo.go [other options] - -Reflect mode generates mock interfaces by building a program -that uses reflection to understand interfaces. It is enabled -by passing two non-flag arguments: an import path, and a -comma-separated list of symbols. -Example: - mockgen database/sql/driver Conn,Driver - -` - -type generator struct { - buf bytes.Buffer - indent string - mockNames map[string]string // may be empty - filename string // may be empty - destination string // may be empty - srcPackage, srcInterfaces string // may be empty - copyrightHeader string - - packageMap map[string]string // map from import path to package name -} - -func (g *generator) p(format string, args ...interface{}) { - fmt.Fprintf(&g.buf, g.indent+format+"\n", args...) -} - -func (g *generator) in() { - g.indent += "\t" -} - -func (g *generator) out() { - if len(g.indent) > 0 { - g.indent = g.indent[0 : len(g.indent)-1] - } -} - -// sanitize cleans up a string to make a suitable package name. -func sanitize(s string) string { - t := "" - for _, r := range s { - if t == "" { - if unicode.IsLetter(r) || r == '_' { - t += string(r) - continue - } - } else { - if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' { - t += string(r) - continue - } - } - t += "_" - } - if t == "_" { - t = "x" - } - return t -} - -func (g *generator) Generate(pkg *model.Package, outputPkgName string, outputPackagePath string) error { - if outputPkgName != pkg.Name && *selfPackage == "" { - // reset outputPackagePath if it's not passed in through -self_package - outputPackagePath = "" - } - - if g.copyrightHeader != "" { - lines := strings.Split(g.copyrightHeader, "\n") - for _, line := range lines { - g.p("// %s", line) - } - g.p("") - } - - g.p("// Code generated by MockGen. DO NOT EDIT.") - if g.filename != "" { - g.p("// Source: %v", g.filename) - } else { - g.p("// Source: %v (interfaces: %v)", g.srcPackage, g.srcInterfaces) - } - g.p("") - - // Get all required imports, and generate unique names for them all. - im := pkg.Imports() - im[gomockImportPath] = true - - // Only import reflect if it's used. We only use reflect in mocked methods - // so only import if any of the mocked interfaces have methods. - for _, intf := range pkg.Interfaces { - if len(intf.Methods) > 0 { - im["reflect"] = true - break - } - } - - // Sort keys to make import alias generation predictable - sortedPaths := make([]string, len(im)) - x := 0 - for pth := range im { - sortedPaths[x] = pth - x++ - } - sort.Strings(sortedPaths) - - packagesName := createPackageMap(sortedPaths) - - g.packageMap = make(map[string]string, len(im)) - localNames := make(map[string]bool, len(im)) - for _, pth := range sortedPaths { - base, ok := packagesName[pth] - if !ok { - base = sanitize(path.Base(pth)) - } - - // Local names for an imported package can usually be the basename of the import path. - // A couple of situations don't permit that, such as duplicate local names - // (e.g. importing "html/template" and "text/template"), or where the basename is - // a keyword (e.g. "foo/case"). - // try base0, base1, ... - pkgName := base - i := 0 - for localNames[pkgName] || token.Lookup(pkgName).IsKeyword() { - pkgName = base + strconv.Itoa(i) - i++ - } - - // Avoid importing package if source pkg == output pkg - if pth == pkg.PkgPath && outputPackagePath == pkg.PkgPath { - continue - } - - g.packageMap[pth] = pkgName - localNames[pkgName] = true - } - - if *writePkgComment { - g.p("// Package %v is a generated GoMock package.", outputPkgName) - } - g.p("package %v", outputPkgName) - g.p("") - g.p("import (") - g.in() - for pkgPath, pkgName := range g.packageMap { - if pkgPath == outputPackagePath { - continue - } - g.p("%v %q", pkgName, pkgPath) - } - for _, pkgPath := range pkg.DotImports { - g.p(". %q", pkgPath) - } - g.out() - g.p(")") - - for _, intf := range pkg.Interfaces { - if err := g.GenerateMockInterface(intf, outputPackagePath); err != nil { - return err - } - } - - return nil -} - -// The name of the mock type to use for the given interface identifier. -func (g *generator) mockName(typeName string) string { - if mockName, ok := g.mockNames[typeName]; ok { - return mockName - } - - return "Mock" + typeName -} - -func (g *generator) GenerateMockInterface(intf *model.Interface, outputPackagePath string) error { - mockType := g.mockName(intf.Name) - - g.p("") - g.p("// %v is a mock of %v interface.", mockType, intf.Name) - g.p("type %v struct {", mockType) - g.in() - g.p("ctrl *gomock.Controller") - g.p("recorder *%vMockRecorder", mockType) - g.out() - g.p("}") - g.p("") - - g.p("// %vMockRecorder is the mock recorder for %v.", mockType, mockType) - g.p("type %vMockRecorder struct {", mockType) - g.in() - g.p("mock *%v", mockType) - g.out() - g.p("}") - g.p("") - - g.p("// New%v creates a new mock instance.", mockType) - g.p("func New%v(ctrl *gomock.Controller) *%v {", mockType, mockType) - g.in() - g.p("mock := &%v{ctrl: ctrl}", mockType) - g.p("mock.recorder = &%vMockRecorder{mock}", mockType) - g.p("return mock") - g.out() - g.p("}") - g.p("") - - // XXX: possible name collision here if someone has EXPECT in their interface. - g.p("// EXPECT returns an object that allows the caller to indicate expected use.") - g.p("func (m *%v) EXPECT() *%vMockRecorder {", mockType, mockType) - g.in() - g.p("return m.recorder") - g.out() - g.p("}") - - g.GenerateMockMethods(mockType, intf, outputPackagePath) - - return nil -} - -type byMethodName []*model.Method - -func (b byMethodName) Len() int { return len(b) } -func (b byMethodName) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b byMethodName) Less(i, j int) bool { return b[i].Name < b[j].Name } - -func (g *generator) GenerateMockMethods(mockType string, intf *model.Interface, pkgOverride string) { - sort.Sort(byMethodName(intf.Methods)) - for _, m := range intf.Methods { - g.p("") - _ = g.GenerateMockMethod(mockType, m, pkgOverride) - g.p("") - _ = g.GenerateMockRecorderMethod(mockType, m) - } -} - -func makeArgString(argNames, argTypes []string) string { - args := make([]string, len(argNames)) - for i, name := range argNames { - // specify the type only once for consecutive args of the same type - if i+1 < len(argTypes) && argTypes[i] == argTypes[i+1] { - args[i] = name - } else { - args[i] = name + " " + argTypes[i] - } - } - return strings.Join(args, ", ") -} - -// GenerateMockMethod generates a mock method implementation. -// If non-empty, pkgOverride is the package in which unqualified types reside. -func (g *generator) GenerateMockMethod(mockType string, m *model.Method, pkgOverride string) error { - argNames := g.getArgNames(m) - argTypes := g.getArgTypes(m, pkgOverride) - argString := makeArgString(argNames, argTypes) - - rets := make([]string, len(m.Out)) - for i, p := range m.Out { - rets[i] = p.Type.String(g.packageMap, pkgOverride) - } - retString := strings.Join(rets, ", ") - if len(rets) > 1 { - retString = "(" + retString + ")" - } - if retString != "" { - retString = " " + retString - } - - ia := newIdentifierAllocator(argNames) - idRecv := ia.allocateIdentifier("m") - - g.p("// %v mocks base method.", m.Name) - g.p("func (%v *%v) %v(%v)%v {", idRecv, mockType, m.Name, argString, retString) - g.in() - g.p("%s.ctrl.T.Helper()", idRecv) - - var callArgs string - if m.Variadic == nil { - if len(argNames) > 0 { - callArgs = ", " + strings.Join(argNames, ", ") - } - } else { - // Non-trivial. The generated code must build a []interface{}, - // but the variadic argument may be any type. - idVarArgs := ia.allocateIdentifier("varargs") - idVArg := ia.allocateIdentifier("a") - g.p("%s := []interface{}{%s}", idVarArgs, strings.Join(argNames[:len(argNames)-1], ", ")) - g.p("for _, %s := range %s {", idVArg, argNames[len(argNames)-1]) - g.in() - g.p("%s = append(%s, %s)", idVarArgs, idVarArgs, idVArg) - g.out() - g.p("}") - callArgs = ", " + idVarArgs + "..." - } - if len(m.Out) == 0 { - g.p(`%v.ctrl.Call(%v, %q%v)`, idRecv, idRecv, m.Name, callArgs) - } else { - idRet := ia.allocateIdentifier("ret") - g.p(`%v := %v.ctrl.Call(%v, %q%v)`, idRet, idRecv, idRecv, m.Name, callArgs) - - // Go does not allow "naked" type assertions on nil values, so we use the two-value form here. - // The value of that is either (x.(T), true) or (Z, false), where Z is the zero value for T. - // Happily, this coincides with the semantics we want here. - retNames := make([]string, len(rets)) - for i, t := range rets { - retNames[i] = ia.allocateIdentifier(fmt.Sprintf("ret%d", i)) - g.p("%s, _ := %s[%d].(%s)", retNames[i], idRet, i, t) - } - g.p("return " + strings.Join(retNames, ", ")) - } - - g.out() - g.p("}") - return nil -} - -func (g *generator) GenerateMockRecorderMethod(mockType string, m *model.Method) error { - argNames := g.getArgNames(m) - - var argString string - if m.Variadic == nil { - argString = strings.Join(argNames, ", ") - } else { - argString = strings.Join(argNames[:len(argNames)-1], ", ") - } - if argString != "" { - argString += " interface{}" - } - - if m.Variadic != nil { - if argString != "" { - argString += ", " - } - argString += fmt.Sprintf("%s ...interface{}", argNames[len(argNames)-1]) - } - - ia := newIdentifierAllocator(argNames) - idRecv := ia.allocateIdentifier("mr") - - g.p("// %v indicates an expected call of %v.", m.Name, m.Name) - g.p("func (%s *%vMockRecorder) %v(%v) *gomock.Call {", idRecv, mockType, m.Name, argString) - g.in() - g.p("%s.mock.ctrl.T.Helper()", idRecv) - - var callArgs string - if m.Variadic == nil { - if len(argNames) > 0 { - callArgs = ", " + strings.Join(argNames, ", ") - } - } else { - if len(argNames) == 1 { - // Easy: just use ... to push the arguments through. - callArgs = ", " + argNames[0] + "..." - } else { - // Hard: create a temporary slice. - idVarArgs := ia.allocateIdentifier("varargs") - g.p("%s := append([]interface{}{%s}, %s...)", - idVarArgs, - strings.Join(argNames[:len(argNames)-1], ", "), - argNames[len(argNames)-1]) - callArgs = ", " + idVarArgs + "..." - } - } - g.p(`return %s.mock.ctrl.RecordCallWithMethodType(%s.mock, "%s", reflect.TypeOf((*%s)(nil).%s)%s)`, idRecv, idRecv, m.Name, mockType, m.Name, callArgs) - - g.out() - g.p("}") - return nil -} - -func (g *generator) getArgNames(m *model.Method) []string { - argNames := make([]string, len(m.In)) - for i, p := range m.In { - name := p.Name - if name == "" || name == "_" { - name = fmt.Sprintf("arg%d", i) - } - argNames[i] = name - } - if m.Variadic != nil { - name := m.Variadic.Name - if name == "" { - name = fmt.Sprintf("arg%d", len(m.In)) - } - argNames = append(argNames, name) - } - return argNames -} - -func (g *generator) getArgTypes(m *model.Method, pkgOverride string) []string { - argTypes := make([]string, len(m.In)) - for i, p := range m.In { - argTypes[i] = p.Type.String(g.packageMap, pkgOverride) - } - if m.Variadic != nil { - argTypes = append(argTypes, "..."+m.Variadic.Type.String(g.packageMap, pkgOverride)) - } - return argTypes -} - -type identifierAllocator map[string]struct{} - -func newIdentifierAllocator(taken []string) identifierAllocator { - a := make(identifierAllocator, len(taken)) - for _, s := range taken { - a[s] = struct{}{} - } - return a -} - -func (o identifierAllocator) allocateIdentifier(want string) string { - id := want - for i := 2; ; i++ { - if _, ok := o[id]; !ok { - o[id] = struct{}{} - return id - } - id = want + "_" + strconv.Itoa(i) - } -} - -// Output returns the generator's output, formatted in the standard Go style. -func (g *generator) Output() []byte { - src, err := toolsimports.Process(g.destination, g.buf.Bytes(), nil) - if err != nil { - log.Fatalf("Failed to format generated source code: %s\n%s", err, g.buf.String()) - } - return src -} - -// createPackageMap returns a map of import path to package name -// for specified importPaths. -func createPackageMap(importPaths []string) map[string]string { - var pkg struct { - Name string - ImportPath string - } - pkgMap := make(map[string]string) - b := bytes.NewBuffer(nil) - args := []string{"list", "-json"} - args = append(args, importPaths...) - cmd := exec.Command("go", args...) - cmd.Stdout = b - cmd.Run() - dec := json.NewDecoder(b) - for dec.More() { - err := dec.Decode(&pkg) - if err != nil { - log.Printf("failed to decode 'go list' output: %v", err) - continue - } - pkgMap[pkg.ImportPath] = pkg.Name - } - return pkgMap -} - -func printVersion() { - if version != "" { - fmt.Printf("v%s\nCommit: %s\nDate: %s\n", version, commit, date) - } else { - printModuleVersion() - } -} - -// parseImportPackage get package import path via source file -// an alternative implementation is to use: -// cfg := &packages.Config{Mode: packages.NeedName, Tests: true, Dir: srcDir} -// pkgs, err := packages.Load(cfg, "file="+source) -// However, it will call "go list" and slow down the performance -func parsePackageImport(srcDir string) (string, error) { - moduleMode := os.Getenv("GO111MODULE") - // trying to find the module - if moduleMode != "off" { - currentDir := srcDir - for { - dat, err := ioutil.ReadFile(filepath.Join(currentDir, "go.mod")) - if os.IsNotExist(err) { - if currentDir == filepath.Dir(currentDir) { - // at the root - break - } - currentDir = filepath.Dir(currentDir) - continue - } else if err != nil { - return "", err - } - modulePath := modfile.ModulePath(dat) - return filepath.ToSlash(filepath.Join(modulePath, strings.TrimPrefix(srcDir, currentDir))), nil - } - } - // fall back to GOPATH mode - goPaths := os.Getenv("GOPATH") - if goPaths == "" { - return "", fmt.Errorf("GOPATH is not set") - } - goPathList := strings.Split(goPaths, string(os.PathListSeparator)) - for _, goPath := range goPathList { - sourceRoot := filepath.Join(goPath, "src") + string(os.PathSeparator) - if strings.HasPrefix(srcDir, sourceRoot) { - return filepath.ToSlash(strings.TrimPrefix(srcDir, sourceRoot)), nil - } - } - return "", errOutsideGoPath -} diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/model/model.go b/stembuild/vendor/github.com/golang/mock/mockgen/model/model.go deleted file mode 100644 index 2c6a62ceb..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/model/model.go +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package model contains the data model necessary for generating mock implementations. -package model - -import ( - "encoding/gob" - "fmt" - "io" - "reflect" - "strings" -) - -// pkgPath is the importable path for package model -const pkgPath = "github.com/golang/mock/mockgen/model" - -// Package is a Go package. It may be a subset. -type Package struct { - Name string - PkgPath string - Interfaces []*Interface - DotImports []string -} - -// Print writes the package name and its exported interfaces. -func (pkg *Package) Print(w io.Writer) { - _, _ = fmt.Fprintf(w, "package %s\n", pkg.Name) - for _, intf := range pkg.Interfaces { - intf.Print(w) - } -} - -// Imports returns the imports needed by the Package as a set of import paths. -func (pkg *Package) Imports() map[string]bool { - im := make(map[string]bool) - for _, intf := range pkg.Interfaces { - intf.addImports(im) - } - return im -} - -// Interface is a Go interface. -type Interface struct { - Name string - Methods []*Method -} - -// Print writes the interface name and its methods. -func (intf *Interface) Print(w io.Writer) { - _, _ = fmt.Fprintf(w, "interface %s\n", intf.Name) - for _, m := range intf.Methods { - m.Print(w) - } -} - -func (intf *Interface) addImports(im map[string]bool) { - for _, m := range intf.Methods { - m.addImports(im) - } -} - -// AddMethod adds a new method, de-duplicating by method name. -func (intf *Interface) AddMethod(m *Method) { - for _, me := range intf.Methods { - if me.Name == m.Name { - return - } - } - intf.Methods = append(intf.Methods, m) -} - -// Method is a single method of an interface. -type Method struct { - Name string - In, Out []*Parameter - Variadic *Parameter // may be nil -} - -// Print writes the method name and its signature. -func (m *Method) Print(w io.Writer) { - _, _ = fmt.Fprintf(w, " - method %s\n", m.Name) - if len(m.In) > 0 { - _, _ = fmt.Fprintf(w, " in:\n") - for _, p := range m.In { - p.Print(w) - } - } - if m.Variadic != nil { - _, _ = fmt.Fprintf(w, " ...:\n") - m.Variadic.Print(w) - } - if len(m.Out) > 0 { - _, _ = fmt.Fprintf(w, " out:\n") - for _, p := range m.Out { - p.Print(w) - } - } -} - -func (m *Method) addImports(im map[string]bool) { - for _, p := range m.In { - p.Type.addImports(im) - } - if m.Variadic != nil { - m.Variadic.Type.addImports(im) - } - for _, p := range m.Out { - p.Type.addImports(im) - } -} - -// Parameter is an argument or return parameter of a method. -type Parameter struct { - Name string // may be empty - Type Type -} - -// Print writes a method parameter. -func (p *Parameter) Print(w io.Writer) { - n := p.Name - if n == "" { - n = `""` - } - _, _ = fmt.Fprintf(w, " - %v: %v\n", n, p.Type.String(nil, "")) -} - -// Type is a Go type. -type Type interface { - String(pm map[string]string, pkgOverride string) string - addImports(im map[string]bool) -} - -func init() { - gob.Register(&ArrayType{}) - gob.Register(&ChanType{}) - gob.Register(&FuncType{}) - gob.Register(&MapType{}) - gob.Register(&NamedType{}) - gob.Register(&PointerType{}) - - // Call gob.RegisterName to make sure it has the consistent name registered - // for both gob decoder and encoder. - // - // For a non-pointer type, gob.Register will try to get package full path by - // calling rt.PkgPath() for a name to register. If your project has vendor - // directory, it is possible that PkgPath will get a path like this: - // ../../../vendor/github.com/golang/mock/mockgen/model - gob.RegisterName(pkgPath+".PredeclaredType", PredeclaredType("")) -} - -// ArrayType is an array or slice type. -type ArrayType struct { - Len int // -1 for slices, >= 0 for arrays - Type Type -} - -func (at *ArrayType) String(pm map[string]string, pkgOverride string) string { - s := "[]" - if at.Len > -1 { - s = fmt.Sprintf("[%d]", at.Len) - } - return s + at.Type.String(pm, pkgOverride) -} - -func (at *ArrayType) addImports(im map[string]bool) { at.Type.addImports(im) } - -// ChanType is a channel type. -type ChanType struct { - Dir ChanDir // 0, 1 or 2 - Type Type -} - -func (ct *ChanType) String(pm map[string]string, pkgOverride string) string { - s := ct.Type.String(pm, pkgOverride) - if ct.Dir == RecvDir { - return "<-chan " + s - } - if ct.Dir == SendDir { - return "chan<- " + s - } - return "chan " + s -} - -func (ct *ChanType) addImports(im map[string]bool) { ct.Type.addImports(im) } - -// ChanDir is a channel direction. -type ChanDir int - -// Constants for channel directions. -const ( - RecvDir ChanDir = 1 - SendDir ChanDir = 2 -) - -// FuncType is a function type. -type FuncType struct { - In, Out []*Parameter - Variadic *Parameter // may be nil -} - -func (ft *FuncType) String(pm map[string]string, pkgOverride string) string { - args := make([]string, len(ft.In)) - for i, p := range ft.In { - args[i] = p.Type.String(pm, pkgOverride) - } - if ft.Variadic != nil { - args = append(args, "..."+ft.Variadic.Type.String(pm, pkgOverride)) - } - rets := make([]string, len(ft.Out)) - for i, p := range ft.Out { - rets[i] = p.Type.String(pm, pkgOverride) - } - retString := strings.Join(rets, ", ") - if nOut := len(ft.Out); nOut == 1 { - retString = " " + retString - } else if nOut > 1 { - retString = " (" + retString + ")" - } - return "func(" + strings.Join(args, ", ") + ")" + retString -} - -func (ft *FuncType) addImports(im map[string]bool) { - for _, p := range ft.In { - p.Type.addImports(im) - } - if ft.Variadic != nil { - ft.Variadic.Type.addImports(im) - } - for _, p := range ft.Out { - p.Type.addImports(im) - } -} - -// MapType is a map type. -type MapType struct { - Key, Value Type -} - -func (mt *MapType) String(pm map[string]string, pkgOverride string) string { - return "map[" + mt.Key.String(pm, pkgOverride) + "]" + mt.Value.String(pm, pkgOverride) -} - -func (mt *MapType) addImports(im map[string]bool) { - mt.Key.addImports(im) - mt.Value.addImports(im) -} - -// NamedType is an exported type in a package. -type NamedType struct { - Package string // may be empty - Type string -} - -func (nt *NamedType) String(pm map[string]string, pkgOverride string) string { - if pkgOverride == nt.Package { - return nt.Type - } - prefix := pm[nt.Package] - if prefix != "" { - return prefix + "." + nt.Type - } - - return nt.Type -} - -func (nt *NamedType) addImports(im map[string]bool) { - if nt.Package != "" { - im[nt.Package] = true - } -} - -// PointerType is a pointer to another type. -type PointerType struct { - Type Type -} - -func (pt *PointerType) String(pm map[string]string, pkgOverride string) string { - return "*" + pt.Type.String(pm, pkgOverride) -} -func (pt *PointerType) addImports(im map[string]bool) { pt.Type.addImports(im) } - -// PredeclaredType is a predeclared type such as "int". -type PredeclaredType string - -func (pt PredeclaredType) String(map[string]string, string) string { return string(pt) } -func (pt PredeclaredType) addImports(map[string]bool) {} - -// The following code is intended to be called by the program generated by ../reflect.go. - -// InterfaceFromInterfaceType returns a pointer to an interface for the -// given reflection interface type. -func InterfaceFromInterfaceType(it reflect.Type) (*Interface, error) { - if it.Kind() != reflect.Interface { - return nil, fmt.Errorf("%v is not an interface", it) - } - intf := &Interface{} - - for i := 0; i < it.NumMethod(); i++ { - mt := it.Method(i) - // TODO: need to skip unexported methods? or just raise an error? - m := &Method{ - Name: mt.Name, - } - - var err error - m.In, m.Variadic, m.Out, err = funcArgsFromType(mt.Type) - if err != nil { - return nil, err - } - - intf.AddMethod(m) - } - - return intf, nil -} - -// t's Kind must be a reflect.Func. -func funcArgsFromType(t reflect.Type) (in []*Parameter, variadic *Parameter, out []*Parameter, err error) { - nin := t.NumIn() - if t.IsVariadic() { - nin-- - } - var p *Parameter - for i := 0; i < nin; i++ { - p, err = parameterFromType(t.In(i)) - if err != nil { - return - } - in = append(in, p) - } - if t.IsVariadic() { - p, err = parameterFromType(t.In(nin).Elem()) - if err != nil { - return - } - variadic = p - } - for i := 0; i < t.NumOut(); i++ { - p, err = parameterFromType(t.Out(i)) - if err != nil { - return - } - out = append(out, p) - } - return -} - -func parameterFromType(t reflect.Type) (*Parameter, error) { - tt, err := typeFromType(t) - if err != nil { - return nil, err - } - return &Parameter{Type: tt}, nil -} - -var errorType = reflect.TypeOf((*error)(nil)).Elem() - -var byteType = reflect.TypeOf(byte(0)) - -func typeFromType(t reflect.Type) (Type, error) { - // Hack workaround for https://golang.org/issue/3853. - // This explicit check should not be necessary. - if t == byteType { - return PredeclaredType("byte"), nil - } - - if imp := t.PkgPath(); imp != "" { - return &NamedType{ - Package: impPath(imp), - Type: t.Name(), - }, nil - } - - // only unnamed or predeclared types after here - - // Lots of types have element types. Let's do the parsing and error checking for all of them. - var elemType Type - switch t.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Ptr, reflect.Slice: - var err error - elemType, err = typeFromType(t.Elem()) - if err != nil { - return nil, err - } - } - - switch t.Kind() { - case reflect.Array: - return &ArrayType{ - Len: t.Len(), - Type: elemType, - }, nil - case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.String: - return PredeclaredType(t.Kind().String()), nil - case reflect.Chan: - var dir ChanDir - switch t.ChanDir() { - case reflect.RecvDir: - dir = RecvDir - case reflect.SendDir: - dir = SendDir - } - return &ChanType{ - Dir: dir, - Type: elemType, - }, nil - case reflect.Func: - in, variadic, out, err := funcArgsFromType(t) - if err != nil { - return nil, err - } - return &FuncType{ - In: in, - Out: out, - Variadic: variadic, - }, nil - case reflect.Interface: - // Two special interfaces. - if t.NumMethod() == 0 { - return PredeclaredType("interface{}"), nil - } - if t == errorType { - return PredeclaredType("error"), nil - } - case reflect.Map: - kt, err := typeFromType(t.Key()) - if err != nil { - return nil, err - } - return &MapType{ - Key: kt, - Value: elemType, - }, nil - case reflect.Ptr: - return &PointerType{ - Type: elemType, - }, nil - case reflect.Slice: - return &ArrayType{ - Len: -1, - Type: elemType, - }, nil - case reflect.Struct: - if t.NumField() == 0 { - return PredeclaredType("struct{}"), nil - } - } - - // TODO: Struct, UnsafePointer - return nil, fmt.Errorf("can't yet turn %v (%v) into a model.Type", t, t.Kind()) -} - -// impPath sanitizes the package path returned by `PkgPath` method of a reflect Type so that -// it is importable. PkgPath might return a path that includes "vendor". These paths do not -// compile, so we need to remove everything up to and including "/vendor/". -// See https://github.com/golang/go/issues/12019. -func impPath(imp string) string { - if strings.HasPrefix(imp, "vendor/") { - imp = "/" + imp - } - if i := strings.LastIndex(imp, "/vendor/"); i != -1 { - imp = imp[i+len("/vendor/"):] - } - return imp -} - -// ErrorInterface represent built-in error interface. -var ErrorInterface = Interface{ - Name: "error", - Methods: []*Method{ - { - Name: "Error", - Out: []*Parameter{ - { - Name: "", - Type: PredeclaredType("string"), - }, - }, - }, - }, -} diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/parse.go b/stembuild/vendor/github.com/golang/mock/mockgen/parse.go deleted file mode 100644 index bf6902cd5..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/parse.go +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -// This file contains the model construction by parsing source files. - -import ( - "errors" - "flag" - "fmt" - "go/ast" - "go/build" - "go/importer" - "go/parser" - "go/token" - "go/types" - "io/ioutil" - "log" - "path" - "path/filepath" - "strconv" - "strings" - - "github.com/golang/mock/mockgen/model" -) - -var ( - imports = flag.String("imports", "", "(source mode) Comma-separated name=path pairs of explicit imports to use.") - auxFiles = flag.String("aux_files", "", "(source mode) Comma-separated pkg=path pairs of auxiliary Go source files.") -) - -// sourceMode generates mocks via source file. -func sourceMode(source string) (*model.Package, error) { - srcDir, err := filepath.Abs(filepath.Dir(source)) - if err != nil { - return nil, fmt.Errorf("failed getting source directory: %v", err) - } - - packageImport, err := parsePackageImport(srcDir) - if err != nil { - return nil, err - } - - fs := token.NewFileSet() - file, err := parser.ParseFile(fs, source, nil, 0) - if err != nil { - return nil, fmt.Errorf("failed parsing source file %v: %v", source, err) - } - - p := &fileParser{ - fileSet: fs, - imports: make(map[string]importedPackage), - importedInterfaces: make(map[string]map[string]*ast.InterfaceType), - auxInterfaces: make(map[string]map[string]*ast.InterfaceType), - srcDir: srcDir, - } - - // Handle -imports. - dotImports := make(map[string]bool) - if *imports != "" { - for _, kv := range strings.Split(*imports, ",") { - eq := strings.Index(kv, "=") - k, v := kv[:eq], kv[eq+1:] - if k == "." { - dotImports[v] = true - } else { - p.imports[k] = importedPkg{path: v} - } - } - } - - // Handle -aux_files. - if err := p.parseAuxFiles(*auxFiles); err != nil { - return nil, err - } - p.addAuxInterfacesFromFile(packageImport, file) // this file - - pkg, err := p.parseFile(packageImport, file) - if err != nil { - return nil, err - } - for pkgPath := range dotImports { - pkg.DotImports = append(pkg.DotImports, pkgPath) - } - return pkg, nil -} - -type importedPackage interface { - Path() string - Parser() *fileParser -} - -type importedPkg struct { - path string - parser *fileParser -} - -func (i importedPkg) Path() string { return i.path } -func (i importedPkg) Parser() *fileParser { return i.parser } - -// duplicateImport is a bit of a misnomer. Currently the parser can't -// handle cases of multi-file packages importing different packages -// under the same name. Often these imports would not be problematic, -// so this type lets us defer raising an error unless the package name -// is actually used. -type duplicateImport struct { - name string - duplicates []string -} - -func (d duplicateImport) Error() string { - return fmt.Sprintf("%q is ambiguous because of duplicate imports: %v", d.name, d.duplicates) -} - -func (d duplicateImport) Path() string { log.Fatal(d.Error()); return "" } -func (d duplicateImport) Parser() *fileParser { log.Fatal(d.Error()); return nil } - -type fileParser struct { - fileSet *token.FileSet - imports map[string]importedPackage // package name => imported package - importedInterfaces map[string]map[string]*ast.InterfaceType // package (or "") => name => interface - - auxFiles []*ast.File - auxInterfaces map[string]map[string]*ast.InterfaceType // package (or "") => name => interface - - srcDir string -} - -func (p *fileParser) errorf(pos token.Pos, format string, args ...interface{}) error { - ps := p.fileSet.Position(pos) - format = "%s:%d:%d: " + format - args = append([]interface{}{ps.Filename, ps.Line, ps.Column}, args...) - return fmt.Errorf(format, args...) -} - -func (p *fileParser) parseAuxFiles(auxFiles string) error { - auxFiles = strings.TrimSpace(auxFiles) - if auxFiles == "" { - return nil - } - for _, kv := range strings.Split(auxFiles, ",") { - parts := strings.SplitN(kv, "=", 2) - if len(parts) != 2 { - return fmt.Errorf("bad aux file spec: %v", kv) - } - pkg, fpath := parts[0], parts[1] - - file, err := parser.ParseFile(p.fileSet, fpath, nil, 0) - if err != nil { - return err - } - p.auxFiles = append(p.auxFiles, file) - p.addAuxInterfacesFromFile(pkg, file) - } - return nil -} - -func (p *fileParser) addAuxInterfacesFromFile(pkg string, file *ast.File) { - if _, ok := p.auxInterfaces[pkg]; !ok { - p.auxInterfaces[pkg] = make(map[string]*ast.InterfaceType) - } - for ni := range iterInterfaces(file) { - p.auxInterfaces[pkg][ni.name.Name] = ni.it - } -} - -// parseFile loads all file imports and auxiliary files import into the -// fileParser, parses all file interfaces and returns package model. -func (p *fileParser) parseFile(importPath string, file *ast.File) (*model.Package, error) { - allImports, dotImports := importsOfFile(file) - // Don't stomp imports provided by -imports. Those should take precedence. - for pkg, pkgI := range allImports { - if _, ok := p.imports[pkg]; !ok { - p.imports[pkg] = pkgI - } - } - // Add imports from auxiliary files, which might be needed for embedded interfaces. - // Don't stomp any other imports. - for _, f := range p.auxFiles { - auxImports, _ := importsOfFile(f) - for pkg, pkgI := range auxImports { - if _, ok := p.imports[pkg]; !ok { - p.imports[pkg] = pkgI - } - } - } - - var is []*model.Interface - for ni := range iterInterfaces(file) { - i, err := p.parseInterface(ni.name.String(), importPath, ni.it) - if err != nil { - return nil, err - } - is = append(is, i) - } - return &model.Package{ - Name: file.Name.String(), - PkgPath: importPath, - Interfaces: is, - DotImports: dotImports, - }, nil -} - -// parsePackage loads package specified by path, parses it and returns -// a new fileParser with the parsed imports and interfaces. -func (p *fileParser) parsePackage(path string) (*fileParser, error) { - newP := &fileParser{ - fileSet: token.NewFileSet(), - imports: make(map[string]importedPackage), - importedInterfaces: make(map[string]map[string]*ast.InterfaceType), - auxInterfaces: make(map[string]map[string]*ast.InterfaceType), - srcDir: p.srcDir, - } - - var pkgs map[string]*ast.Package - if imp, err := build.Import(path, newP.srcDir, build.FindOnly); err != nil { - return nil, err - } else if pkgs, err = parser.ParseDir(newP.fileSet, imp.Dir, nil, 0); err != nil { - return nil, err - } - - for _, pkg := range pkgs { - file := ast.MergePackageFiles(pkg, ast.FilterFuncDuplicates|ast.FilterUnassociatedComments|ast.FilterImportDuplicates) - if _, ok := newP.importedInterfaces[path]; !ok { - newP.importedInterfaces[path] = make(map[string]*ast.InterfaceType) - } - for ni := range iterInterfaces(file) { - newP.importedInterfaces[path][ni.name.Name] = ni.it - } - imports, _ := importsOfFile(file) - for pkgName, pkgI := range imports { - newP.imports[pkgName] = pkgI - } - } - return newP, nil -} - -func (p *fileParser) parseInterface(name, pkg string, it *ast.InterfaceType) (*model.Interface, error) { - iface := &model.Interface{Name: name} - for _, field := range it.Methods.List { - switch v := field.Type.(type) { - case *ast.FuncType: - if nn := len(field.Names); nn != 1 { - return nil, fmt.Errorf("expected one name for interface %v, got %d", iface.Name, nn) - } - m := &model.Method{ - Name: field.Names[0].String(), - } - var err error - m.In, m.Variadic, m.Out, err = p.parseFunc(pkg, v) - if err != nil { - return nil, err - } - iface.AddMethod(m) - case *ast.Ident: - // Embedded interface in this package. - embeddedIfaceType := p.auxInterfaces[pkg][v.String()] - if embeddedIfaceType == nil { - embeddedIfaceType = p.importedInterfaces[pkg][v.String()] - } - - var embeddedIface *model.Interface - if embeddedIfaceType != nil { - var err error - embeddedIface, err = p.parseInterface(v.String(), pkg, embeddedIfaceType) - if err != nil { - return nil, err - } - } else { - // This is built-in error interface. - if v.String() == model.ErrorInterface.Name { - embeddedIface = &model.ErrorInterface - } else { - return nil, p.errorf(v.Pos(), "unknown embedded interface %s", v.String()) - } - } - // Copy the methods. - for _, m := range embeddedIface.Methods { - iface.AddMethod(m) - } - case *ast.SelectorExpr: - // Embedded interface in another package. - filePkg, sel := v.X.(*ast.Ident).String(), v.Sel.String() - embeddedPkg, ok := p.imports[filePkg] - if !ok { - return nil, p.errorf(v.X.Pos(), "unknown package %s", filePkg) - } - - var embeddedIface *model.Interface - var err error - embeddedIfaceType := p.auxInterfaces[filePkg][sel] - if embeddedIfaceType != nil { - embeddedIface, err = p.parseInterface(sel, filePkg, embeddedIfaceType) - if err != nil { - return nil, err - } - } else { - path := embeddedPkg.Path() - parser := embeddedPkg.Parser() - if parser == nil { - ip, err := p.parsePackage(path) - if err != nil { - return nil, p.errorf(v.Pos(), "could not parse package %s: %v", path, err) - } - parser = ip - p.imports[filePkg] = importedPkg{ - path: embeddedPkg.Path(), - parser: parser, - } - } - if embeddedIfaceType = parser.importedInterfaces[path][sel]; embeddedIfaceType == nil { - return nil, p.errorf(v.Pos(), "unknown embedded interface %s.%s", path, sel) - } - embeddedIface, err = parser.parseInterface(sel, path, embeddedIfaceType) - if err != nil { - return nil, err - } - } - // Copy the methods. - // TODO: apply shadowing rules. - for _, m := range embeddedIface.Methods { - iface.AddMethod(m) - } - default: - return nil, fmt.Errorf("don't know how to mock method of type %T", field.Type) - } - } - return iface, nil -} - -func (p *fileParser) parseFunc(pkg string, f *ast.FuncType) (inParam []*model.Parameter, variadic *model.Parameter, outParam []*model.Parameter, err error) { - if f.Params != nil { - regParams := f.Params.List - if isVariadic(f) { - n := len(regParams) - varParams := regParams[n-1:] - regParams = regParams[:n-1] - vp, err := p.parseFieldList(pkg, varParams) - if err != nil { - return nil, nil, nil, p.errorf(varParams[0].Pos(), "failed parsing variadic argument: %v", err) - } - variadic = vp[0] - } - inParam, err = p.parseFieldList(pkg, regParams) - if err != nil { - return nil, nil, nil, p.errorf(f.Pos(), "failed parsing arguments: %v", err) - } - } - if f.Results != nil { - outParam, err = p.parseFieldList(pkg, f.Results.List) - if err != nil { - return nil, nil, nil, p.errorf(f.Pos(), "failed parsing returns: %v", err) - } - } - return -} - -func (p *fileParser) parseFieldList(pkg string, fields []*ast.Field) ([]*model.Parameter, error) { - nf := 0 - for _, f := range fields { - nn := len(f.Names) - if nn == 0 { - nn = 1 // anonymous parameter - } - nf += nn - } - if nf == 0 { - return nil, nil - } - ps := make([]*model.Parameter, nf) - i := 0 // destination index - for _, f := range fields { - t, err := p.parseType(pkg, f.Type) - if err != nil { - return nil, err - } - - if len(f.Names) == 0 { - // anonymous arg - ps[i] = &model.Parameter{Type: t} - i++ - continue - } - for _, name := range f.Names { - ps[i] = &model.Parameter{Name: name.Name, Type: t} - i++ - } - } - return ps, nil -} - -func (p *fileParser) parseType(pkg string, typ ast.Expr) (model.Type, error) { - switch v := typ.(type) { - case *ast.ArrayType: - ln := -1 - if v.Len != nil { - var value string - switch val := v.Len.(type) { - case (*ast.BasicLit): - value = val.Value - case (*ast.Ident): - // when the length is a const defined locally - value = val.Obj.Decl.(*ast.ValueSpec).Values[0].(*ast.BasicLit).Value - case (*ast.SelectorExpr): - // when the length is a const defined in an external package - usedPkg, err := importer.Default().Import(fmt.Sprintf("%s", val.X)) - if err != nil { - return nil, p.errorf(v.Len.Pos(), "unknown package in array length: %v", err) - } - ev, err := types.Eval(token.NewFileSet(), usedPkg, token.NoPos, val.Sel.Name) - if err != nil { - return nil, p.errorf(v.Len.Pos(), "unknown constant in array length: %v", err) - } - value = ev.Value.String() - } - - x, err := strconv.Atoi(value) - if err != nil { - return nil, p.errorf(v.Len.Pos(), "bad array size: %v", err) - } - ln = x - } - t, err := p.parseType(pkg, v.Elt) - if err != nil { - return nil, err - } - return &model.ArrayType{Len: ln, Type: t}, nil - case *ast.ChanType: - t, err := p.parseType(pkg, v.Value) - if err != nil { - return nil, err - } - var dir model.ChanDir - if v.Dir == ast.SEND { - dir = model.SendDir - } - if v.Dir == ast.RECV { - dir = model.RecvDir - } - return &model.ChanType{Dir: dir, Type: t}, nil - case *ast.Ellipsis: - // assume we're parsing a variadic argument - return p.parseType(pkg, v.Elt) - case *ast.FuncType: - in, variadic, out, err := p.parseFunc(pkg, v) - if err != nil { - return nil, err - } - return &model.FuncType{In: in, Out: out, Variadic: variadic}, nil - case *ast.Ident: - if v.IsExported() { - // `pkg` may be an aliased imported pkg - // if so, patch the import w/ the fully qualified import - maybeImportedPkg, ok := p.imports[pkg] - if ok { - pkg = maybeImportedPkg.Path() - } - // assume type in this package - return &model.NamedType{Package: pkg, Type: v.Name}, nil - } - - // assume predeclared type - return model.PredeclaredType(v.Name), nil - case *ast.InterfaceType: - if v.Methods != nil && len(v.Methods.List) > 0 { - return nil, p.errorf(v.Pos(), "can't handle non-empty unnamed interface types") - } - return model.PredeclaredType("interface{}"), nil - case *ast.MapType: - key, err := p.parseType(pkg, v.Key) - if err != nil { - return nil, err - } - value, err := p.parseType(pkg, v.Value) - if err != nil { - return nil, err - } - return &model.MapType{Key: key, Value: value}, nil - case *ast.SelectorExpr: - pkgName := v.X.(*ast.Ident).String() - pkg, ok := p.imports[pkgName] - if !ok { - return nil, p.errorf(v.Pos(), "unknown package %q", pkgName) - } - return &model.NamedType{Package: pkg.Path(), Type: v.Sel.String()}, nil - case *ast.StarExpr: - t, err := p.parseType(pkg, v.X) - if err != nil { - return nil, err - } - return &model.PointerType{Type: t}, nil - case *ast.StructType: - if v.Fields != nil && len(v.Fields.List) > 0 { - return nil, p.errorf(v.Pos(), "can't handle non-empty unnamed struct types") - } - return model.PredeclaredType("struct{}"), nil - case *ast.ParenExpr: - return p.parseType(pkg, v.X) - } - - return nil, fmt.Errorf("don't know how to parse type %T", typ) -} - -// importsOfFile returns a map of package name to import path -// of the imports in file. -func importsOfFile(file *ast.File) (normalImports map[string]importedPackage, dotImports []string) { - var importPaths []string - for _, is := range file.Imports { - if is.Name != nil { - continue - } - importPath := is.Path.Value[1 : len(is.Path.Value)-1] // remove quotes - importPaths = append(importPaths, importPath) - } - packagesName := createPackageMap(importPaths) - normalImports = make(map[string]importedPackage) - dotImports = make([]string, 0) - for _, is := range file.Imports { - var pkgName string - importPath := is.Path.Value[1 : len(is.Path.Value)-1] // remove quotes - - if is.Name != nil { - // Named imports are always certain. - if is.Name.Name == "_" { - continue - } - pkgName = is.Name.Name - } else { - pkg, ok := packagesName[importPath] - if !ok { - // Fallback to import path suffix. Note that this is uncertain. - _, last := path.Split(importPath) - // If the last path component has dots, the first dot-delimited - // field is used as the name. - pkgName = strings.SplitN(last, ".", 2)[0] - } else { - pkgName = pkg - } - } - - if pkgName == "." { - dotImports = append(dotImports, importPath) - } else { - if pkg, ok := normalImports[pkgName]; ok { - switch p := pkg.(type) { - case duplicateImport: - normalImports[pkgName] = duplicateImport{ - name: p.name, - duplicates: append([]string{importPath}, p.duplicates...), - } - case importedPkg: - normalImports[pkgName] = duplicateImport{ - name: pkgName, - duplicates: []string{p.path, importPath}, - } - } - } else { - normalImports[pkgName] = importedPkg{path: importPath} - } - } - } - return -} - -type namedInterface struct { - name *ast.Ident - it *ast.InterfaceType -} - -// Create an iterator over all interfaces in file. -func iterInterfaces(file *ast.File) <-chan namedInterface { - ch := make(chan namedInterface) - go func() { - for _, decl := range file.Decls { - gd, ok := decl.(*ast.GenDecl) - if !ok || gd.Tok != token.TYPE { - continue - } - for _, spec := range gd.Specs { - ts, ok := spec.(*ast.TypeSpec) - if !ok { - continue - } - it, ok := ts.Type.(*ast.InterfaceType) - if !ok { - continue - } - - ch <- namedInterface{ts.Name, it} - } - } - close(ch) - }() - return ch -} - -// isVariadic returns whether the function is variadic. -func isVariadic(f *ast.FuncType) bool { - nargs := len(f.Params.List) - if nargs == 0 { - return false - } - _, ok := f.Params.List[nargs-1].Type.(*ast.Ellipsis) - return ok -} - -// packageNameOfDir get package import path via dir -func packageNameOfDir(srcDir string) (string, error) { - files, err := ioutil.ReadDir(srcDir) - if err != nil { - log.Fatal(err) - } - - var goFilePath string - for _, file := range files { - if !file.IsDir() && strings.HasSuffix(file.Name(), ".go") { - goFilePath = file.Name() - break - } - } - if goFilePath == "" { - return "", fmt.Errorf("go source file not found %s", srcDir) - } - - packageImport, err := parsePackageImport(srcDir) - if err != nil { - return "", err - } - return packageImport, nil -} - -var errOutsideGoPath = errors.New("source directory is outside GOPATH") diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/reflect.go b/stembuild/vendor/github.com/golang/mock/mockgen/reflect.go deleted file mode 100644 index e24efce0b..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/reflect.go +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -// This file contains the model construction by reflection. - -import ( - "bytes" - "encoding/gob" - "flag" - "fmt" - "go/build" - "io" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "text/template" - - "github.com/golang/mock/mockgen/model" -) - -var ( - progOnly = flag.Bool("prog_only", false, "(reflect mode) Only generate the reflection program; write it to stdout and exit.") - execOnly = flag.String("exec_only", "", "(reflect mode) If set, execute this reflection program.") - buildFlags = flag.String("build_flags", "", "(reflect mode) Additional flags for go build.") -) - -// reflectMode generates mocks via reflection on an interface. -func reflectMode(importPath string, symbols []string) (*model.Package, error) { - if *execOnly != "" { - return run(*execOnly) - } - - program, err := writeProgram(importPath, symbols) - if err != nil { - return nil, err - } - - if *progOnly { - if _, err := os.Stdout.Write(program); err != nil { - return nil, err - } - os.Exit(0) - } - - wd, _ := os.Getwd() - - // Try to run the reflection program in the current working directory. - if p, err := runInDir(program, wd); err == nil { - return p, nil - } - - // Try to run the program in the same directory as the input package. - if p, err := build.Import(importPath, wd, build.FindOnly); err == nil { - dir := p.Dir - if p, err := runInDir(program, dir); err == nil { - return p, nil - } - } - - // Try to run it in a standard temp directory. - return runInDir(program, "") -} - -func writeProgram(importPath string, symbols []string) ([]byte, error) { - var program bytes.Buffer - data := reflectData{ - ImportPath: importPath, - Symbols: symbols, - } - if err := reflectProgram.Execute(&program, &data); err != nil { - return nil, err - } - return program.Bytes(), nil -} - -// run the given program and parse the output as a model.Package. -func run(program string) (*model.Package, error) { - f, err := ioutil.TempFile("", "") - if err != nil { - return nil, err - } - - filename := f.Name() - defer os.Remove(filename) - if err := f.Close(); err != nil { - return nil, err - } - - // Run the program. - cmd := exec.Command(program, "-output", filename) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - if err := cmd.Run(); err != nil { - return nil, err - } - - f, err = os.Open(filename) - if err != nil { - return nil, err - } - - // Process output. - var pkg model.Package - if err := gob.NewDecoder(f).Decode(&pkg); err != nil { - return nil, err - } - - if err := f.Close(); err != nil { - return nil, err - } - - return &pkg, nil -} - -// runInDir writes the given program into the given dir, runs it there, and -// parses the output as a model.Package. -func runInDir(program []byte, dir string) (*model.Package, error) { - // We use TempDir instead of TempFile so we can control the filename. - tmpDir, err := ioutil.TempDir(dir, "gomock_reflect_") - if err != nil { - return nil, err - } - defer func() { - if err := os.RemoveAll(tmpDir); err != nil { - log.Printf("failed to remove temp directory: %s", err) - } - }() - const progSource = "prog.go" - var progBinary = "prog.bin" - if runtime.GOOS == "windows" { - // Windows won't execute a program unless it has a ".exe" suffix. - progBinary += ".exe" - } - - if err := ioutil.WriteFile(filepath.Join(tmpDir, progSource), program, 0600); err != nil { - return nil, err - } - - cmdArgs := []string{} - cmdArgs = append(cmdArgs, "build") - if *buildFlags != "" { - cmdArgs = append(cmdArgs, strings.Split(*buildFlags, " ")...) - } - cmdArgs = append(cmdArgs, "-o", progBinary, progSource) - - // Build the program. - buf := bytes.NewBuffer(nil) - cmd := exec.Command("go", cmdArgs...) - cmd.Dir = tmpDir - cmd.Stdout = os.Stdout - cmd.Stderr = io.MultiWriter(os.Stderr, buf) - if err := cmd.Run(); err != nil { - sErr := buf.String() - if strings.Contains(sErr, `cannot find package "."`) && - strings.Contains(sErr, "github.com/golang/mock/mockgen/model") { - fmt.Fprint(os.Stderr, "Please reference the steps in the README to fix this error:\n\thttps://github.com/golang/mock#reflect-vendoring-error.") - return nil, err - } - return nil, err - } - - return run(filepath.Join(tmpDir, progBinary)) -} - -type reflectData struct { - ImportPath string - Symbols []string -} - -// This program reflects on an interface value, and prints the -// gob encoding of a model.Package to standard output. -// JSON doesn't work because of the model.Type interface. -var reflectProgram = template.Must(template.New("program").Parse(` -package main - -import ( - "encoding/gob" - "flag" - "fmt" - "os" - "path" - "reflect" - - "github.com/golang/mock/mockgen/model" - - pkg_ {{printf "%q" .ImportPath}} -) - -var output = flag.String("output", "", "The output file name, or empty to use stdout.") - -func main() { - flag.Parse() - - its := []struct{ - sym string - typ reflect.Type - }{ - {{range .Symbols}} - { {{printf "%q" .}}, reflect.TypeOf((*pkg_.{{.}})(nil)).Elem()}, - {{end}} - } - pkg := &model.Package{ - // NOTE: This behaves contrary to documented behaviour if the - // package name is not the final component of the import path. - // The reflect package doesn't expose the package name, though. - Name: path.Base({{printf "%q" .ImportPath}}), - } - - for _, it := range its { - intf, err := model.InterfaceFromInterfaceType(it.typ) - if err != nil { - fmt.Fprintf(os.Stderr, "Reflection: %v\n", err) - os.Exit(1) - } - intf.Name = it.sym - pkg.Interfaces = append(pkg.Interfaces, intf) - } - - outfile := os.Stdout - if len(*output) != 0 { - var err error - outfile, err = os.Create(*output) - if err != nil { - fmt.Fprintf(os.Stderr, "failed to open output file %q", *output) - } - defer func() { - if err := outfile.Close(); err != nil { - fmt.Fprintf(os.Stderr, "failed to close output file %q", *output) - os.Exit(1) - } - }() - } - - if err := gob.NewEncoder(outfile).Encode(pkg); err != nil { - fmt.Fprintf(os.Stderr, "gob encode: %v\n", err) - os.Exit(1) - } -} -`)) diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/version.1.11.go b/stembuild/vendor/github.com/golang/mock/mockgen/version.1.11.go deleted file mode 100644 index e6b25db23..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/version.1.11.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !go1.12 - -package main - -import ( - "log" -) - -func printModuleVersion() { - log.Printf("No version information is available for Mockgen compiled with " + - "version 1.11") -} diff --git a/stembuild/vendor/github.com/golang/mock/mockgen/version.1.12.go b/stembuild/vendor/github.com/golang/mock/mockgen/version.1.12.go deleted file mode 100644 index ad121ae63..000000000 --- a/stembuild/vendor/github.com/golang/mock/mockgen/version.1.12.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// +build go1.12 - -package main - -import ( - "fmt" - "log" - "runtime/debug" -) - -func printModuleVersion() { - if bi, exists := debug.ReadBuildInfo(); exists { - fmt.Println(bi.Main.Version) - } else { - log.Printf("No version information found. Make sure to use " + - "GO111MODULE=on when running 'go get' in order to use specific " + - "version of the binary.") - } - -} diff --git a/stembuild/vendor/golang.org/x/mod/modfile/print.go b/stembuild/vendor/golang.org/x/mod/modfile/print.go deleted file mode 100644 index 2a0123d4b..000000000 --- a/stembuild/vendor/golang.org/x/mod/modfile/print.go +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Module file printer. - -package modfile - -import ( - "bytes" - "fmt" - "strings" -) - -// Format returns a go.mod file as a byte slice, formatted in standard style. -func Format(f *FileSyntax) []byte { - pr := &printer{} - pr.file(f) - - // remove trailing blank lines - b := pr.Bytes() - for len(b) > 0 && b[len(b)-1] == '\n' && (len(b) == 1 || b[len(b)-2] == '\n') { - b = b[:len(b)-1] - } - return b -} - -// A printer collects the state during printing of a file or expression. -type printer struct { - bytes.Buffer // output buffer - comment []Comment // pending end-of-line comments - margin int // left margin (indent), a number of tabs -} - -// printf prints to the buffer. -func (p *printer) printf(format string, args ...interface{}) { - fmt.Fprintf(p, format, args...) -} - -// indent returns the position on the current line, in bytes, 0-indexed. -func (p *printer) indent() int { - b := p.Bytes() - n := 0 - for n < len(b) && b[len(b)-1-n] != '\n' { - n++ - } - return n -} - -// newline ends the current line, flushing end-of-line comments. -func (p *printer) newline() { - if len(p.comment) > 0 { - p.printf(" ") - for i, com := range p.comment { - if i > 0 { - p.trim() - p.printf("\n") - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - } - p.printf("%s", strings.TrimSpace(com.Token)) - } - p.comment = p.comment[:0] - } - - p.trim() - if b := p.Bytes(); len(b) == 0 || (len(b) >= 2 && b[len(b)-1] == '\n' && b[len(b)-2] == '\n') { - // skip the blank line at top of file or after a blank line - } else { - p.printf("\n") - } - for i := 0; i < p.margin; i++ { - p.printf("\t") - } -} - -// trim removes trailing spaces and tabs from the current line. -func (p *printer) trim() { - // Remove trailing spaces and tabs from line we're about to end. - b := p.Bytes() - n := len(b) - for n > 0 && (b[n-1] == '\t' || b[n-1] == ' ') { - n-- - } - p.Truncate(n) -} - -// file formats the given file into the print buffer. -func (p *printer) file(f *FileSyntax) { - for _, com := range f.Before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - for i, stmt := range f.Stmt { - switch x := stmt.(type) { - case *CommentBlock: - // comments already handled - p.expr(x) - - default: - p.expr(x) - p.newline() - } - - for _, com := range stmt.Comment().After { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - if i+1 < len(f.Stmt) { - p.newline() - } - } -} - -func (p *printer) expr(x Expr) { - // Emit line-comments preceding this expression. - if before := x.Comment().Before; len(before) > 0 { - // Want to print a line comment. - // Line comments must be at the current margin. - p.trim() - if p.indent() > 0 { - // There's other text on the line. Start a new line. - p.printf("\n") - } - // Re-indent to margin. - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - for _, com := range before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - } - - switch x := x.(type) { - default: - panic(fmt.Errorf("printer: unexpected type %T", x)) - - case *CommentBlock: - // done - - case *LParen: - p.printf("(") - case *RParen: - p.printf(")") - - case *Line: - p.tokens(x.Token) - - case *LineBlock: - p.tokens(x.Token) - p.printf(" ") - p.expr(&x.LParen) - p.margin++ - for _, l := range x.Line { - p.newline() - p.expr(l) - } - p.margin-- - p.newline() - p.expr(&x.RParen) - } - - // Queue end-of-line comments for printing when we - // reach the end of the line. - p.comment = append(p.comment, x.Comment().Suffix...) -} - -func (p *printer) tokens(tokens []string) { - sep := "" - for _, t := range tokens { - if t == "," || t == ")" || t == "]" || t == "}" { - sep = "" - } - p.printf("%s%s", sep, t) - sep = " " - if t == "(" || t == "[" || t == "{" { - sep = "" - } - } -} diff --git a/stembuild/vendor/golang.org/x/mod/modfile/read.go b/stembuild/vendor/golang.org/x/mod/modfile/read.go deleted file mode 100644 index 2d7486804..000000000 --- a/stembuild/vendor/golang.org/x/mod/modfile/read.go +++ /dev/null @@ -1,964 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "bytes" - "errors" - "fmt" - "os" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// A Position describes an arbitrary source position in a file, including the -// file, line, column, and byte offset. -type Position struct { - Line int // line in input (starting at 1) - LineRune int // rune in line (starting at 1) - Byte int // byte in input (starting at 0) -} - -// add returns the position at the end of s, assuming it starts at p. -func (p Position) add(s string) Position { - p.Byte += len(s) - if n := strings.Count(s, "\n"); n > 0 { - p.Line += n - s = s[strings.LastIndex(s, "\n")+1:] - p.LineRune = 1 - } - p.LineRune += utf8.RuneCountInString(s) - return p -} - -// An Expr represents an input element. -type Expr interface { - // Span returns the start and end position of the expression, - // excluding leading or trailing comments. - Span() (start, end Position) - - // Comment returns the comments attached to the expression. - // This method would normally be named 'Comments' but that - // would interfere with embedding a type of the same name. - Comment() *Comments -} - -// A Comment represents a single // comment. -type Comment struct { - Start Position - Token string // without trailing newline - Suffix bool // an end of line (not whole line) comment -} - -// Comments collects the comments associated with an expression. -type Comments struct { - Before []Comment // whole-line comments before this expression - Suffix []Comment // end-of-line comments after this expression - - // For top-level expressions only, After lists whole-line - // comments following the expression. - After []Comment -} - -// Comment returns the receiver. This isn't useful by itself, but -// a [Comments] struct is embedded into all the expression -// implementation types, and this gives each of those a Comment -// method to satisfy the Expr interface. -func (c *Comments) Comment() *Comments { - return c -} - -// A FileSyntax represents an entire go.mod file. -type FileSyntax struct { - Name string // file path - Comments - Stmt []Expr -} - -func (x *FileSyntax) Span() (start, end Position) { - if len(x.Stmt) == 0 { - return - } - start, _ = x.Stmt[0].Span() - _, end = x.Stmt[len(x.Stmt)-1].Span() - return start, end -} - -// addLine adds a line containing the given tokens to the file. -// -// If the first token of the hint matches the first token of the -// line, the new line is added at the end of the block containing hint, -// extracting hint into a new block if it is not yet in one. -// -// If the hint is non-nil buts its first token does not match, -// the new line is added after the block containing hint -// (or hint itself, if not in a block). -// -// If no hint is provided, addLine appends the line to the end of -// the last block with a matching first token, -// or to the end of the file if no such block exists. -func (x *FileSyntax) addLine(hint Expr, tokens ...string) *Line { - if hint == nil { - // If no hint given, add to the last statement of the given type. - Loop: - for i := len(x.Stmt) - 1; i >= 0; i-- { - stmt := x.Stmt[i] - switch stmt := stmt.(type) { - case *Line: - if stmt.Token != nil && stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - case *LineBlock: - if stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - } - } - } - - newLineAfter := func(i int) *Line { - new := &Line{Token: tokens} - if i == len(x.Stmt) { - x.Stmt = append(x.Stmt, new) - } else { - x.Stmt = append(x.Stmt, nil) - copy(x.Stmt[i+2:], x.Stmt[i+1:]) - x.Stmt[i+1] = new - } - return new - } - - if hint != nil { - for i, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt == hint { - if stmt.Token == nil || stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Convert line to line block. - stmt.InBlock = true - block := &LineBlock{Token: stmt.Token[:1], Line: []*Line{stmt}} - stmt.Token = stmt.Token[1:] - x.Stmt[i] = block - new := &Line{Token: tokens[1:], InBlock: true} - block.Line = append(block.Line, new) - return new - } - - case *LineBlock: - if stmt == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line = append(stmt.Line, new) - return new - } - - for j, line := range stmt.Line { - if line == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Add new line after hint within the block. - stmt.Line = append(stmt.Line, nil) - copy(stmt.Line[j+2:], stmt.Line[j+1:]) - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line[j+1] = new - return new - } - } - } - } - } - - new := &Line{Token: tokens} - x.Stmt = append(x.Stmt, new) - return new -} - -func (x *FileSyntax) updateLine(line *Line, tokens ...string) { - if line.InBlock { - tokens = tokens[1:] - } - line.Token = tokens -} - -// markRemoved modifies line so that it (and its end-of-line comment, if any) -// will be dropped by (*FileSyntax).Cleanup. -func (line *Line) markRemoved() { - line.Token = nil - line.Comments.Suffix = nil -} - -// Cleanup cleans up the file syntax x after any edit operations. -// To avoid quadratic behavior, (*Line).markRemoved marks the line as dead -// by setting line.Token = nil but does not remove it from the slice -// in which it appears. After edits have all been indicated, -// calling Cleanup cleans out the dead lines. -func (x *FileSyntax) Cleanup() { - w := 0 - for _, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt.Token == nil { - continue - } - case *LineBlock: - ww := 0 - for _, line := range stmt.Line { - if line.Token != nil { - stmt.Line[ww] = line - ww++ - } - } - if ww == 0 { - continue - } - if ww == 1 && len(stmt.RParen.Comments.Before) == 0 { - // Collapse block into single line but keep the Line reference used by the - // parsed File structure. - *stmt.Line[0] = Line{ - Comments: Comments{ - Before: commentsAdd(stmt.Before, stmt.Line[0].Before), - Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix), - After: commentsAdd(stmt.Line[0].After, stmt.After), - }, - Token: stringsAdd(stmt.Token, stmt.Line[0].Token), - } - x.Stmt[w] = stmt.Line[0] - w++ - continue - } - stmt.Line = stmt.Line[:ww] - } - x.Stmt[w] = stmt - w++ - } - x.Stmt = x.Stmt[:w] -} - -func commentsAdd(x, y []Comment) []Comment { - return append(x[:len(x):len(x)], y...) -} - -func stringsAdd(x, y []string) []string { - return append(x[:len(x):len(x)], y...) -} - -// A CommentBlock represents a top-level block of comments separate -// from any rule. -type CommentBlock struct { - Comments - Start Position -} - -func (x *CommentBlock) Span() (start, end Position) { - return x.Start, x.Start -} - -// A Line is a single line of tokens. -type Line struct { - Comments - Start Position - Token []string - InBlock bool - End Position -} - -func (x *Line) Span() (start, end Position) { - return x.Start, x.End -} - -// A LineBlock is a factored block of lines, like -// -// require ( -// "x" -// "y" -// ) -type LineBlock struct { - Comments - Start Position - LParen LParen - Token []string - Line []*Line - RParen RParen -} - -func (x *LineBlock) Span() (start, end Position) { - return x.Start, x.RParen.Pos.add(")") -} - -// An LParen represents the beginning of a parenthesized line block. -// It is a place to store suffix comments. -type LParen struct { - Comments - Pos Position -} - -func (x *LParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An RParen represents the end of a parenthesized line block. -// It is a place to store whole-line (before) comments. -type RParen struct { - Comments - Pos Position -} - -func (x *RParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An input represents a single input file being parsed. -type input struct { - // Lexing state. - filename string // name of input file, for errors - complete []byte // entire input - remaining []byte // remaining input - tokenStart []byte // token being scanned to end of input - token token // next token to be returned by lex, peek - pos Position // current input position - comments []Comment // accumulated comments - - // Parser state. - file *FileSyntax // returned top-level syntax tree - parseErrors ErrorList // errors encountered during parsing - - // Comment assignment state. - pre []Expr // all expressions, in preorder traversal - post []Expr // all expressions, in postorder traversal -} - -func newInput(filename string, data []byte) *input { - return &input{ - filename: filename, - complete: data, - remaining: data, - pos: Position{Line: 1, LineRune: 1, Byte: 0}, - } -} - -// parse parses the input file. -func parse(file string, data []byte) (f *FileSyntax, err error) { - // The parser panics for both routine errors like syntax errors - // and for programmer bugs like array index errors. - // Turn both into error returns. Catching bug panics is - // especially important when processing many files. - in := newInput(file, data) - defer func() { - if e := recover(); e != nil && e != &in.parseErrors { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: fmt.Errorf("internal error: %v", e), - }) - } - if err == nil && len(in.parseErrors) > 0 { - err = in.parseErrors - } - }() - - // Prime the lexer by reading in the first token. It will be available - // in the next peek() or lex() call. - in.readToken() - - // Invoke the parser. - in.parseFile() - if len(in.parseErrors) > 0 { - return nil, in.parseErrors - } - in.file.Name = in.filename - - // Assign comments to nearby syntax. - in.assignComments() - - return in.file, nil -} - -// Error is called to report an error. -// Error does not return: it panics. -func (in *input) Error(s string) { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: errors.New(s), - }) - panic(&in.parseErrors) -} - -// eof reports whether the input has reached end of file. -func (in *input) eof() bool { - return len(in.remaining) == 0 -} - -// peekRune returns the next rune in the input without consuming it. -func (in *input) peekRune() int { - if len(in.remaining) == 0 { - return 0 - } - r, _ := utf8.DecodeRune(in.remaining) - return int(r) -} - -// peekPrefix reports whether the remaining input begins with the given prefix. -func (in *input) peekPrefix(prefix string) bool { - // This is like bytes.HasPrefix(in.remaining, []byte(prefix)) - // but without the allocation of the []byte copy of prefix. - for i := 0; i < len(prefix); i++ { - if i >= len(in.remaining) || in.remaining[i] != prefix[i] { - return false - } - } - return true -} - -// readRune consumes and returns the next rune in the input. -func (in *input) readRune() int { - if len(in.remaining) == 0 { - in.Error("internal lexer error: readRune at EOF") - } - r, size := utf8.DecodeRune(in.remaining) - in.remaining = in.remaining[size:] - if r == '\n' { - in.pos.Line++ - in.pos.LineRune = 1 - } else { - in.pos.LineRune++ - } - in.pos.Byte += size - return int(r) -} - -type token struct { - kind tokenKind - pos Position - endPos Position - text string -} - -type tokenKind int - -const ( - _EOF tokenKind = -(iota + 1) - _EOLCOMMENT - _IDENT - _STRING - _COMMENT - - // newlines and punctuation tokens are allowed as ASCII codes. -) - -func (k tokenKind) isComment() bool { - return k == _COMMENT || k == _EOLCOMMENT -} - -// isEOL returns whether a token terminates a line. -func (k tokenKind) isEOL() bool { - return k == _EOF || k == _EOLCOMMENT || k == '\n' -} - -// startToken marks the beginning of the next input token. -// It must be followed by a call to endToken, once the token's text has -// been consumed using readRune. -func (in *input) startToken() { - in.tokenStart = in.remaining - in.token.text = "" - in.token.pos = in.pos -} - -// endToken marks the end of an input token. -// It records the actual token string in tok.text. -// A single trailing newline (LF or CRLF) will be removed from comment tokens. -func (in *input) endToken(kind tokenKind) { - in.token.kind = kind - text := string(in.tokenStart[:len(in.tokenStart)-len(in.remaining)]) - if kind.isComment() { - if strings.HasSuffix(text, "\r\n") { - text = text[:len(text)-2] - } else { - text = strings.TrimSuffix(text, "\n") - } - } - in.token.text = text - in.token.endPos = in.pos -} - -// peek returns the kind of the next token returned by lex. -func (in *input) peek() tokenKind { - return in.token.kind -} - -// lex is called from the parser to obtain the next input token. -func (in *input) lex() token { - tok := in.token - in.readToken() - return tok -} - -// readToken lexes the next token from the text and stores it in in.token. -func (in *input) readToken() { - // Skip past spaces, stopping at non-space or EOF. - for !in.eof() { - c := in.peekRune() - if c == ' ' || c == '\t' || c == '\r' { - in.readRune() - continue - } - - // Comment runs to end of line. - if in.peekPrefix("//") { - in.startToken() - - // Is this comment the only thing on its line? - // Find the last \n before this // and see if it's all - // spaces from there to here. - i := bytes.LastIndex(in.complete[:in.pos.Byte], []byte("\n")) - suffix := len(bytes.TrimSpace(in.complete[i+1:in.pos.Byte])) > 0 - in.readRune() - in.readRune() - - // Consume comment. - for len(in.remaining) > 0 && in.readRune() != '\n' { - } - - // If we are at top level (not in a statement), hand the comment to - // the parser as a _COMMENT token. The grammar is written - // to handle top-level comments itself. - if !suffix { - in.endToken(_COMMENT) - return - } - - // Otherwise, save comment for later attachment to syntax tree. - in.endToken(_EOLCOMMENT) - in.comments = append(in.comments, Comment{in.token.pos, in.token.text, suffix}) - return - } - - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - - // Found non-space non-comment. - break - } - - // Found the beginning of the next token. - in.startToken() - - // End of file. - if in.eof() { - in.endToken(_EOF) - return - } - - // Punctuation tokens. - switch c := in.peekRune(); c { - case '\n', '(', ')', '[', ']', '{', '}', ',': - in.readRune() - in.endToken(tokenKind(c)) - return - - case '"', '`': // quoted string - quote := c - in.readRune() - for { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - if in.peekRune() == '\n' { - in.Error("unexpected newline in string") - } - c := in.readRune() - if c == quote { - break - } - if c == '\\' && quote != '`' { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - in.readRune() - } - } - in.endToken(_STRING) - return - } - - // Checked all punctuation. Must be identifier token. - if c := in.peekRune(); !isIdent(c) { - in.Error(fmt.Sprintf("unexpected input character %#q", c)) - } - - // Scan over identifier. - for isIdent(in.peekRune()) { - if in.peekPrefix("//") { - break - } - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - in.readRune() - } - in.endToken(_IDENT) -} - -// isIdent reports whether c is an identifier rune. -// We treat most printable runes as identifier runes, except for a handful of -// ASCII punctuation characters. -func isIdent(c int) bool { - switch r := rune(c); r { - case ' ', '(', ')', '[', ']', '{', '}', ',': - return false - default: - return !unicode.IsSpace(r) && unicode.IsPrint(r) - } -} - -// Comment assignment. -// We build two lists of all subexpressions, preorder and postorder. -// The preorder list is ordered by start location, with outer expressions first. -// The postorder list is ordered by end location, with outer expressions last. -// We use the preorder list to assign each whole-line comment to the syntax -// immediately following it, and we use the postorder list to assign each -// end-of-line comment to the syntax immediately preceding it. - -// order walks the expression adding it and its subexpressions to the -// preorder and postorder lists. -func (in *input) order(x Expr) { - if x != nil { - in.pre = append(in.pre, x) - } - switch x := x.(type) { - default: - panic(fmt.Errorf("order: unexpected type %T", x)) - case nil: - // nothing - case *LParen, *RParen: - // nothing - case *CommentBlock: - // nothing - case *Line: - // nothing - case *FileSyntax: - for _, stmt := range x.Stmt { - in.order(stmt) - } - case *LineBlock: - in.order(&x.LParen) - for _, l := range x.Line { - in.order(l) - } - in.order(&x.RParen) - } - if x != nil { - in.post = append(in.post, x) - } -} - -// assignComments attaches comments to nearby syntax. -func (in *input) assignComments() { - const debug = false - - // Generate preorder and postorder lists. - in.order(in.file) - - // Split into whole-line comments and suffix comments. - var line, suffix []Comment - for _, com := range in.comments { - if com.Suffix { - suffix = append(suffix, com) - } else { - line = append(line, com) - } - } - - if debug { - for _, c := range line { - fmt.Fprintf(os.Stderr, "LINE %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign line comments to syntax immediately following. - for _, x := range in.pre { - start, _ := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "pre %T :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte) - } - xcom := x.Comment() - for len(line) > 0 && start.Byte >= line[0].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN LINE %q #%d\n", line[0].Token, line[0].Start.Byte) - } - xcom.Before = append(xcom.Before, line[0]) - line = line[1:] - } - } - - // Remaining line comments go at end of file. - in.file.After = append(in.file.After, line...) - - if debug { - for _, c := range suffix { - fmt.Fprintf(os.Stderr, "SUFFIX %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign suffix comments to syntax immediately before. - for i := len(in.post) - 1; i >= 0; i-- { - x := in.post[i] - - start, end := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "post %T :%d:%d #%d :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte, end.Line, end.LineRune, end.Byte) - } - - // Do not assign suffix comments to end of line block or whole file. - // Instead assign them to the last element inside. - switch x.(type) { - case *FileSyntax: - continue - } - - // Do not assign suffix comments to something that starts - // on an earlier line, so that in - // - // x ( y - // z ) // comment - // - // we assign the comment to z and not to x ( ... ). - if start.Line != end.Line { - continue - } - xcom := x.Comment() - for len(suffix) > 0 && end.Byte <= suffix[len(suffix)-1].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN SUFFIX %q #%d\n", suffix[len(suffix)-1].Token, suffix[len(suffix)-1].Start.Byte) - } - xcom.Suffix = append(xcom.Suffix, suffix[len(suffix)-1]) - suffix = suffix[:len(suffix)-1] - } - } - - // We assigned suffix comments in reverse. - // If multiple suffix comments were appended to the same - // expression node, they are now in reverse. Fix that. - for _, x := range in.post { - reverseComments(x.Comment().Suffix) - } - - // Remaining suffix comments go at beginning of file. - in.file.Before = append(in.file.Before, suffix...) -} - -// reverseComments reverses the []Comment list. -func reverseComments(list []Comment) { - for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 { - list[i], list[j] = list[j], list[i] - } -} - -func (in *input) parseFile() { - in.file = new(FileSyntax) - var cb *CommentBlock - for { - switch in.peek() { - case '\n': - in.lex() - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - cb = nil - } - case _COMMENT: - tok := in.lex() - if cb == nil { - cb = &CommentBlock{Start: tok.pos} - } - com := cb.Comment() - com.Before = append(com.Before, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - } - return - default: - in.parseStmt() - if cb != nil { - in.file.Stmt[len(in.file.Stmt)-1].Comment().Before = cb.Before - cb = nil - } - } - } -} - -func (in *input) parseStmt() { - tok := in.lex() - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - switch { - case tok.kind.isEOL(): - in.file.Stmt = append(in.file.Stmt, &Line{ - Start: start, - Token: tokens, - End: end, - }) - return - - case tok.kind == '(': - if next := in.peek(); next.isEOL() { - // Start of block: no more tokens on this line. - in.file.Stmt = append(in.file.Stmt, in.parseLineBlock(start, tokens, tok)) - return - } else if next == ')' { - rparen := in.lex() - if in.peek().isEOL() { - // Empty block. - in.lex() - in.file.Stmt = append(in.file.Stmt, &LineBlock{ - Start: start, - Token: tokens, - LParen: LParen{Pos: tok.pos}, - RParen: RParen{Pos: rparen.pos}, - }) - return - } - // '( )' in the middle of the line, not a block. - tokens = append(tokens, tok.text, rparen.text) - } else { - // '(' in the middle of the line, not a block. - tokens = append(tokens, tok.text) - } - - default: - tokens = append(tokens, tok.text) - end = tok.endPos - } - } -} - -func (in *input) parseLineBlock(start Position, token []string, lparen token) *LineBlock { - x := &LineBlock{ - Start: start, - Token: token, - LParen: LParen{Pos: lparen.pos}, - } - var comments []Comment - for { - switch in.peek() { - case _EOLCOMMENT: - // Suffix comment, will be attached later by assignComments. - in.lex() - case '\n': - // Blank line. Add an empty comment to preserve it. - in.lex() - if len(comments) == 0 && len(x.Line) > 0 || len(comments) > 0 && comments[len(comments)-1].Token != "" { - comments = append(comments, Comment{}) - } - case _COMMENT: - tok := in.lex() - comments = append(comments, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - in.Error(fmt.Sprintf("syntax error (unterminated block started at %s:%d:%d)", in.filename, x.Start.Line, x.Start.LineRune)) - case ')': - rparen := in.lex() - // Don't preserve blank lines (denoted by a single empty comment, added above) - // at the end of the block. - if len(comments) == 1 && comments[0] == (Comment{}) { - comments = nil - } - x.RParen.Before = comments - x.RParen.Pos = rparen.pos - if !in.peek().isEOL() { - in.Error("syntax error (expected newline after closing paren)") - } - in.lex() - return x - default: - l := in.parseLine() - x.Line = append(x.Line, l) - l.Comment().Before = comments - comments = nil - } - } -} - -func (in *input) parseLine() *Line { - tok := in.lex() - if tok.kind.isEOL() { - in.Error("internal parse error: parseLine at end of line") - } - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - if tok.kind.isEOL() { - return &Line{ - Start: start, - Token: tokens, - End: end, - InBlock: true, - } - } - tokens = append(tokens, tok.text) - end = tok.endPos - } -} - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// ModulePath returns the module path from the gomod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -func ModulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} diff --git a/stembuild/vendor/golang.org/x/mod/modfile/rule.go b/stembuild/vendor/golang.org/x/mod/modfile/rule.go deleted file mode 100644 index a86ee4fd8..000000000 --- a/stembuild/vendor/golang.org/x/mod/modfile/rule.go +++ /dev/null @@ -1,1904 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package modfile implements a parser and formatter for go.mod files. -// -// The go.mod syntax is described in -// https://pkg.go.dev/cmd/go/#hdr-The_go_mod_file. -// -// The [Parse] and [ParseLax] functions both parse a go.mod file and return an -// abstract syntax tree. ParseLax ignores unknown statements and may be used to -// parse go.mod files that may have been developed with newer versions of Go. -// -// The [File] struct returned by Parse and ParseLax represent an abstract -// go.mod file. File has several methods like [File.AddNewRequire] and -// [File.DropReplace] that can be used to programmatically edit a file. -// -// The [Format] function formats a File back to a byte slice which can be -// written to a file. -package modfile - -import ( - "cmp" - "errors" - "fmt" - "path/filepath" - "slices" - "strconv" - "strings" - "unicode" - - "golang.org/x/mod/internal/lazyregexp" - "golang.org/x/mod/module" - "golang.org/x/mod/semver" -) - -// A File is the parsed, interpreted form of a go.mod file. -type File struct { - Module *Module - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Require []*Require - Exclude []*Exclude - Replace []*Replace - Retract []*Retract - Tool []*Tool - Ignore []*Ignore - - Syntax *FileSyntax -} - -// A Module is the module statement. -type Module struct { - Mod module.Version - Deprecated string - Syntax *Line -} - -// A Go is the go statement. -type Go struct { - Version string // "1.23" - Syntax *Line -} - -// A Toolchain is the toolchain statement. -type Toolchain struct { - Name string // "go1.21rc1" - Syntax *Line -} - -// A Godebug is a single godebug key=value statement. -type Godebug struct { - Key string - Value string - Syntax *Line -} - -// An Exclude is a single exclude statement. -type Exclude struct { - Mod module.Version - Syntax *Line -} - -// A Replace is a single replace statement. -type Replace struct { - Old module.Version - New module.Version - Syntax *Line -} - -// A Retract is a single retract statement. -type Retract struct { - VersionInterval - Rationale string - Syntax *Line -} - -// A Tool is a single tool statement. -type Tool struct { - Path string - Syntax *Line -} - -// An Ignore is a single ignore statement. -type Ignore struct { - Path string - Syntax *Line -} - -// A VersionInterval represents a range of versions with upper and lower bounds. -// Intervals are closed: both bounds are included. When Low is equal to High, -// the interval may refer to a single version ('v1.2.3') or an interval -// ('[v1.2.3, v1.2.3]'); both have the same representation. -type VersionInterval struct { - Low, High string -} - -// A Require is a single require statement. -type Require struct { - Mod module.Version - Indirect bool // has "// indirect" comment - Syntax *Line -} - -func (r *Require) markRemoved() { - r.Syntax.markRemoved() - *r = Require{} -} - -func (r *Require) setVersion(v string) { - r.Mod.Version = v - - if line := r.Syntax; len(line.Token) > 0 { - if line.InBlock { - // If the line is preceded by an empty line, remove it; see - // https://golang.org/issue/33779. - if len(line.Comments.Before) == 1 && len(line.Comments.Before[0].Token) == 0 { - line.Comments.Before = line.Comments.Before[:0] - } - if len(line.Token) >= 2 { // example.com v1.2.3 - line.Token[1] = v - } - } else { - if len(line.Token) >= 3 { // require example.com v1.2.3 - line.Token[2] = v - } - } - } -} - -// setIndirect sets line to have (or not have) a "// indirect" comment. -func (r *Require) setIndirect(indirect bool) { - r.Indirect = indirect - line := r.Syntax - if isIndirect(line) == indirect { - return - } - if indirect { - // Adding comment. - if len(line.Suffix) == 0 { - // New comment. - line.Suffix = []Comment{{Token: "// indirect", Suffix: true}} - return - } - - com := &line.Suffix[0] - text := strings.TrimSpace(strings.TrimPrefix(com.Token, string(slashSlash))) - if text == "" { - // Empty comment. - com.Token = "// indirect" - return - } - - // Insert at beginning of existing comment. - com.Token = "// indirect; " + text - return - } - - // Removing comment. - f := strings.TrimSpace(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - if f == "indirect" { - // Remove whole comment. - line.Suffix = nil - return - } - - // Remove comment prefix. - com := &line.Suffix[0] - i := strings.Index(com.Token, "indirect;") - com.Token = "//" + com.Token[i+len("indirect;"):] -} - -// isIndirect reports whether line has a "// indirect" comment, -// meaning it is in go.mod only for its effect on indirect dependencies, -// so that it can be dropped entirely once the effective version of the -// indirect dependency reaches the given minimum version. -func isIndirect(line *Line) bool { - if len(line.Suffix) == 0 { - return false - } - f := strings.Fields(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - return (len(f) == 1 && f[0] == "indirect" || len(f) > 1 && f[0] == "indirect;") -} - -func (f *File) AddModuleStmt(path string) error { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - if f.Module == nil { - f.Module = &Module{ - Mod: module.Version{Path: path}, - Syntax: f.Syntax.addLine(nil, "module", AutoQuote(path)), - } - } else { - f.Module.Mod.Path = path - f.Syntax.updateLine(f.Module.Syntax, "module", AutoQuote(path)) - } - return nil -} - -func (f *File) AddComment(text string) { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Syntax.Stmt = append(f.Syntax.Stmt, &CommentBlock{ - Comments: Comments{ - Before: []Comment{ - { - Token: text, - }, - }, - }, - }) -} - -type VersionFixer func(path, version string) (string, error) - -// errDontFix is returned by a VersionFixer to indicate the version should be -// left alone, even if it's not canonical. -var dontFixRetract VersionFixer = func(_, vers string) (string, error) { - return vers, nil -} - -// Parse parses and returns a go.mod file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func Parse(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, true) -} - -// ParseLax is like Parse but ignores unknown statements. -// It is used when parsing go.mod files other than the main module, -// under the theory that most statement types we add in the future will -// only apply in the main module, like exclude and replace, -// and so we get better gradual deployments if old go commands -// simply ignore those statements when found in go.mod files -// in dependencies. -func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, false) -} - -func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parsed *File, err error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &File{ - Syntax: fs, - } - var errs ErrorList - - // fix versions in retract directives after the file is parsed. - // We need the module path to fix versions, and it might be at the end. - defer func() { - oldLen := len(errs) - f.fixRetract(fix, &errs) - if len(errs) > oldLen { - parsed, err = nil, errs - } - }() - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, nil, x, x.Token[0], x.Token[1:], fix, strict) - - case *LineBlock: - if len(x.Token) > 1 { - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - } - switch x.Token[0] { - default: - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - case "module", "godebug", "require", "exclude", "replace", "retract", "tool", "ignore": - for _, l := range x.Line { - f.add(&errs, x, l, x.Token[0], l.Token, fix, strict) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))?([a-z]+[0-9]+)?$`) -var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9].*)$`) - -// Toolchains must be named beginning with `go1`, -// like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted. -// Note that this regexp is a much looser condition than go/version.IsValid, -// for forward compatibility. -// (This code has to be work to identify new toolchains even if we tweak the syntax in the future.) -var ToolchainRE = lazyregexp.New(`^default$|^go1($|\.)`) - -func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, args []string, fix VersionFixer, strict bool) { - // If strict is false, this module is a dependency. - // We ignore all unknown directives as well as main-module-only - // directives like replace and exclude. It will work better for - // forward compatibility if we can depend on modules that have unknown - // statements (presumed relevant only when acting as the main module) - // and simply ignore those statements. - if !strict { - switch verb { - case "go", "module", "retract", "require", "ignore": - // want these even for dependency go.mods - default: - return - } - } - - wrapModPathError := func(modPath string, err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - }) - } - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...interface{}) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - fixed := false - if !strict { - if m := laxGoVersionRE.FindStringSubmatch(args[0]); m != nil { - args[0] = m[1] - fixed = true - } - } - if !fixed { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "module": - if f.Module != nil { - errorf("repeated module statement") - return - } - deprecated := parseDeprecation(block, line) - f.Module = &Module{ - Syntax: line, - Deprecated: deprecated, - } - if len(args) != 1 { - errorf("usage: module module/path") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Module.Mod = module.Version{Path: s} - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "require", "exclude": - if len(args) != 2 { - errorf("usage: %s module/path v1.2.3", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - v, err := parseVersion(verb, s, &args[1], fix) - if err != nil { - wrapError(err) - return - } - pathMajor, err := modulePathMajor(s) - if err != nil { - wrapError(err) - return - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - wrapModPathError(s, err) - return - } - if verb == "require" { - f.Require = append(f.Require, &Require{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - Indirect: isIndirect(line), - }) - } else { - f.Exclude = append(f.Exclude, &Exclude{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - }) - } - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - - case "retract": - rationale := parseDirectiveComment(block, line) - vi, err := parseVersionInterval(verb, "", &args, dontFixRetract) - if err != nil { - if strict { - wrapError(err) - return - } else { - // Only report errors parsing intervals in the main module. We may - // support additional syntax in the future, such as open and half-open - // intervals. Those can't be supported now, because they break the - // go.mod parser, even in lax mode. - return - } - } - if len(args) > 0 && strict { - // In the future, there may be additional information after the version. - errorf("unexpected token after version: %q", args[0]) - return - } - retract := &Retract{ - VersionInterval: vi, - Rationale: rationale, - Syntax: line, - } - f.Retract = append(f.Retract, retract) - - case "tool": - if len(args) != 1 { - errorf("tool directive expects exactly one argument") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Tool = append(f.Tool, &Tool{ - Path: s, - Syntax: line, - }) - - case "ignore": - if len(args) != 1 { - errorf("ignore directive expects exactly one argument") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Ignore = append(f.Ignore, &Ignore{ - Path: s, - Syntax: line, - }) - } -} - -func parseReplace(filename string, line *Line, verb string, args []string, fix VersionFixer) (*Replace, *Error) { - wrapModPathError := func(modPath string, err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - } - } - wrapError := func(err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - Err: err, - } - } - errorf := func(format string, args ...interface{}) *Error { - return wrapError(fmt.Errorf(format, args...)) - } - - arrow := 2 - if len(args) >= 2 && args[1] == "=>" { - arrow = 1 - } - if len(args) < arrow+2 || len(args) > arrow+3 || args[arrow] != "=>" { - return nil, errorf("usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory", verb, verb) - } - s, err := parseString(&args[0]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - pathMajor, err := modulePathMajor(s) - if err != nil { - return nil, wrapModPathError(s, err) - - } - var v string - if arrow == 2 { - v, err = parseVersion(verb, s, &args[1], fix) - if err != nil { - return nil, wrapError(err) - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - return nil, wrapModPathError(s, err) - } - } - ns, err := parseString(&args[arrow+1]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - nv := "" - if len(args) == arrow+2 { - if !IsDirectoryPath(ns) { - if strings.Contains(ns, "@") { - return nil, errorf("replacement module must match format 'path version', not 'path@version'") - } - return nil, errorf("replacement module without version must be directory path (rooted or starting with . or ..)") - } - if filepath.Separator == '/' && strings.Contains(ns, `\`) { - return nil, errorf("replacement directory appears to be Windows path (on a non-windows system)") - } - } - if len(args) == arrow+3 { - nv, err = parseVersion(verb, ns, &args[arrow+2], fix) - if err != nil { - return nil, wrapError(err) - } - if IsDirectoryPath(ns) { - return nil, errorf("replacement module directory path %q cannot have version", ns) - } - } - return &Replace{ - Old: module.Version{Path: s, Version: v}, - New: module.Version{Path: ns, Version: nv}, - Syntax: line, - }, nil -} - -// fixRetract applies fix to each retract directive in f, appending any errors -// to errs. -// -// Most versions are fixed as we parse the file, but for retract directives, -// the relevant module path is the one specified with the module directive, -// and that might appear at the end of the file (or not at all). -func (f *File) fixRetract(fix VersionFixer, errs *ErrorList) { - if fix == nil { - return - } - path := "" - if f.Module != nil { - path = f.Module.Mod.Path - } - var r *Retract - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: r.Syntax.Start, - Err: err, - }) - } - - for _, r = range f.Retract { - if path == "" { - wrapError(errors.New("no module directive found, so retract cannot be used")) - return // only print the first one of these - } - - args := r.Syntax.Token - if args[0] == "retract" { - args = args[1:] - } - vi, err := parseVersionInterval("retract", path, &args, fix) - if err != nil { - wrapError(err) - } - r.VersionInterval = vi - } -} - -func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, fix VersionFixer) { - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...interface{}) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "use": - if len(args) != 1 { - errorf("usage: %s local/dir", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Use = append(f.Use, &Use{ - Path: s, - Syntax: line, - }) - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - } -} - -// IsDirectoryPath reports whether the given path should be interpreted as a directory path. -// Just like on the go command line, relative paths starting with a '.' or '..' path component -// and rooted paths are directory paths; the rest are module paths. -func IsDirectoryPath(ns string) bool { - // Because go.mod files can move from one system to another, - // we check all known path syntaxes, both Unix and Windows. - return ns == "." || strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, `.\`) || - ns == ".." || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, `..\`) || - strings.HasPrefix(ns, "/") || strings.HasPrefix(ns, `\`) || - len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':' -} - -// MustQuote reports whether s must be quoted in order to appear as -// a single token in a go.mod line. -func MustQuote(s string) bool { - for _, r := range s { - switch r { - case ' ', '"', '\'', '`': - return true - - case '(', ')', '[', ']', '{', '}', ',': - if len(s) > 1 { - return true - } - - default: - if !unicode.IsPrint(r) { - return true - } - } - } - return s == "" || strings.Contains(s, "//") || strings.Contains(s, "/*") -} - -// AutoQuote returns s or, if quoting is required for s to appear in a go.mod, -// the quotation of s. -func AutoQuote(s string) string { - if MustQuote(s) { - return strconv.Quote(s) - } - return s -} - -func parseVersionInterval(verb string, path string, args *[]string, fix VersionFixer) (VersionInterval, error) { - toks := *args - if len(toks) == 0 || toks[0] == "(" { - return VersionInterval{}, fmt.Errorf("expected '[' or version") - } - if toks[0] != "[" { - v, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - *args = toks[1:] - return VersionInterval{Low: v, High: v}, nil - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after '['") - } - low, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "," { - return VersionInterval{}, fmt.Errorf("expected ',' after version") - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after ','") - } - high, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "]" { - return VersionInterval{}, fmt.Errorf("expected ']' after version") - } - toks = toks[1:] - - *args = toks - return VersionInterval{Low: low, High: high}, nil -} - -func parseString(s *string) (string, error) { - t := *s - if strings.HasPrefix(t, `"`) { - var err error - if t, err = strconv.Unquote(t); err != nil { - return "", err - } - } else if strings.ContainsAny(t, "\"'`") { - // Other quotes are reserved both for possible future expansion - // and to avoid confusion. For example if someone types 'x' - // we want that to be a syntax error and not a literal x in literal quotation marks. - return "", fmt.Errorf("unquoted string cannot contain quote") - } - *s = AutoQuote(t) - return t, nil -} - -var deprecatedRE = lazyregexp.New(`(?s)(?:^|\n\n)Deprecated: *(.*?)(?:$|\n\n)`) - -// parseDeprecation extracts the text of comments on a "module" directive and -// extracts a deprecation message from that. -// -// A deprecation message is contained in a paragraph within a block of comments -// that starts with "Deprecated:" (case sensitive). The message runs until the -// end of the paragraph and does not include the "Deprecated:" prefix. If the -// comment block has multiple paragraphs that start with "Deprecated:", -// parseDeprecation returns the message from the first. -func parseDeprecation(block *LineBlock, line *Line) string { - text := parseDirectiveComment(block, line) - m := deprecatedRE.FindStringSubmatch(text) - if m == nil { - return "" - } - return m[1] -} - -// parseDirectiveComment extracts the text of comments on a directive. -// If the directive's line does not have comments and is part of a block that -// does have comments, the block's comments are used. -func parseDirectiveComment(block *LineBlock, line *Line) string { - comments := line.Comment() - if block != nil && len(comments.Before) == 0 && len(comments.Suffix) == 0 { - comments = block.Comment() - } - groups := [][]Comment{comments.Before, comments.Suffix} - var lines []string - for _, g := range groups { - for _, c := range g { - if !strings.HasPrefix(c.Token, "//") { - continue // blank line - } - lines = append(lines, strings.TrimSpace(strings.TrimPrefix(c.Token, "//"))) - } - } - return strings.Join(lines, "\n") -} - -type ErrorList []Error - -func (e ErrorList) Error() string { - errStrs := make([]string, len(e)) - for i, err := range e { - errStrs[i] = err.Error() - } - return strings.Join(errStrs, "\n") -} - -type Error struct { - Filename string - Pos Position - Verb string - ModPath string - Err error -} - -func (e *Error) Error() string { - var pos string - if e.Pos.LineRune > 1 { - // Don't print LineRune if it's 1 (beginning of line). - // It's always 1 except in scanner errors, which are rare. - pos = fmt.Sprintf("%s:%d:%d: ", e.Filename, e.Pos.Line, e.Pos.LineRune) - } else if e.Pos.Line > 0 { - pos = fmt.Sprintf("%s:%d: ", e.Filename, e.Pos.Line) - } else if e.Filename != "" { - pos = fmt.Sprintf("%s: ", e.Filename) - } - - var directive string - if e.ModPath != "" { - directive = fmt.Sprintf("%s %s: ", e.Verb, e.ModPath) - } else if e.Verb != "" { - directive = fmt.Sprintf("%s: ", e.Verb) - } - - return pos + directive + e.Err.Error() -} - -func (e *Error) Unwrap() error { return e.Err } - -func parseVersion(verb string, path string, s *string, fix VersionFixer) (string, error) { - t, err := parseString(s) - if err != nil { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: *s, - Err: err, - }, - } - } - if fix != nil { - fixed, err := fix(path, t) - if err != nil { - if err, ok := err.(*module.ModuleError); ok { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: err.Err, - } - } - return "", err - } - t = fixed - } else { - cv := module.CanonicalVersion(t) - if cv == "" { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: t, - Err: errors.New("must be of the form v1.2.3"), - }, - } - } - t = cv - } - *s = t - return *s, nil -} - -func modulePathMajor(path string) (string, error) { - _, major, ok := module.SplitPathVersion(path) - if !ok { - return "", fmt.Errorf("invalid module path") - } - return major, nil -} - -func (f *File) Format() ([]byte, error) { - return Format(f.Syntax), nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [File.DropRequire] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *File) Cleanup() { - w := 0 - for _, g := range f.Godebug { - if g.Key != "" { - f.Godebug[w] = g - w++ - } - } - f.Godebug = f.Godebug[:w] - - w = 0 - for _, r := range f.Require { - if r.Mod.Path != "" { - f.Require[w] = r - w++ - } - } - f.Require = f.Require[:w] - - w = 0 - for _, x := range f.Exclude { - if x.Mod.Path != "" { - f.Exclude[w] = x - w++ - } - } - f.Exclude = f.Exclude[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - w = 0 - for _, r := range f.Retract { - if r.Low != "" || r.High != "" { - f.Retract[w] = r - w++ - } - } - f.Retract = f.Retract[:w] - - f.Syntax.Cleanup() -} - -func (f *File) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - var hint Expr - if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } else if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Go = &Go{ - Version: version, - Syntax: f.Syntax.addLine(hint, "go", version), - } - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *File) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *File) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -func (f *File) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - var hint Expr - if f.Go != nil && f.Go.Syntax != nil { - hint = f.Go.Syntax - } else if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } - f.Toolchain = &Toolchain{ - Name: name, - Syntax: f.Syntax.addLine(hint, "toolchain", name), - } - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *File) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *File) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -// AddRequire sets the first require line for path to version vers, -// preserving any existing comments for that line and removing all -// other lines for path. -// -// If no line currently exists for path, AddRequire adds a new line -// at the end of the last require block. -func (f *File) AddRequire(path, vers string) error { - need := true - for _, r := range f.Require { - if r.Mod.Path == path { - if need { - r.Mod.Version = vers - f.Syntax.updateLine(r.Syntax, "require", AutoQuote(path), vers) - need = false - } else { - r.Syntax.markRemoved() - *r = Require{} - } - } - } - - if need { - f.AddNewRequire(path, vers, false) - } - return nil -} - -// AddNewRequire adds a new require line for path at version vers at the end of -// the last require block, regardless of any existing require lines for path. -func (f *File) AddNewRequire(path, vers string, indirect bool) { - line := f.Syntax.addLine(nil, "require", AutoQuote(path), vers) - r := &Require{ - Mod: module.Version{Path: path, Version: vers}, - Syntax: line, - } - r.setIndirect(indirect) - f.Require = append(f.Require, r) -} - -// SetRequire updates the requirements of f to contain exactly req, preserving -// the existing block structure and line comment contents (except for 'indirect' -// markings) for the first requirement on each named module path. -// -// The Syntax field is ignored for the requirements in req. -// -// Any requirements not already present in the file are added to the block -// containing the last require line. -// -// The requirements in req must specify at most one distinct version for each -// module path. -// -// If any existing requirements may be removed, the caller should call -// [File.Cleanup] after all edits are complete. -func (f *File) SetRequire(req []*Require) { - type elem struct { - version string - indirect bool - } - need := make(map[string]elem) - for _, r := range req { - if prev, dup := need[r.Mod.Path]; dup && prev.version != r.Mod.Version { - panic(fmt.Errorf("SetRequire called with conflicting versions for path %s (%s and %s)", r.Mod.Path, prev.version, r.Mod.Version)) - } - need[r.Mod.Path] = elem{r.Mod.Version, r.Indirect} - } - - // Update or delete the existing Require entries to preserve - // only the first for each module path in req. - for _, r := range f.Require { - e, ok := need[r.Mod.Path] - if ok { - r.setVersion(e.version) - r.setIndirect(e.indirect) - } else { - r.markRemoved() - } - delete(need, r.Mod.Path) - } - - // Add new entries in the last block of the file for any paths that weren't - // already present. - // - // This step is nondeterministic, but the final result will be deterministic - // because we will sort the block. - for path, e := range need { - f.AddNewRequire(path, e.version, e.indirect) - } - - f.SortBlocks() -} - -// SetRequireSeparateIndirect updates the requirements of f to contain the given -// requirements. Comment contents (except for 'indirect' markings) are retained -// from the first existing requirement for each module path. Like SetRequire, -// SetRequireSeparateIndirect adds requirements for new paths in req, -// updates the version and "// indirect" comment on existing requirements, -// and deletes requirements on paths not in req. Existing duplicate requirements -// are deleted. -// -// As its name suggests, SetRequireSeparateIndirect puts direct and indirect -// requirements into two separate blocks, one containing only direct -// requirements, and the other containing only indirect requirements. -// SetRequireSeparateIndirect may move requirements between these two blocks -// when their indirect markings change. However, SetRequireSeparateIndirect -// won't move requirements from other blocks, especially blocks with comments. -// -// If the file initially has one uncommented block of requirements, -// SetRequireSeparateIndirect will split it into a direct-only and indirect-only -// block. This aids in the transition to separate blocks. -func (f *File) SetRequireSeparateIndirect(req []*Require) { - // hasComments returns whether a line or block has comments - // other than "indirect". - hasComments := func(c Comments) bool { - return len(c.Before) > 0 || len(c.After) > 0 || len(c.Suffix) > 1 || - (len(c.Suffix) == 1 && - strings.TrimSpace(strings.TrimPrefix(c.Suffix[0].Token, string(slashSlash))) != "indirect") - } - - // moveReq adds r to block. If r was in another block, moveReq deletes - // it from that block and transfers its comments. - moveReq := func(r *Require, block *LineBlock) { - var line *Line - if r.Syntax == nil { - line = &Line{Token: []string{AutoQuote(r.Mod.Path), r.Mod.Version}} - r.Syntax = line - if r.Indirect { - r.setIndirect(true) - } - } else { - line = new(Line) - *line = *r.Syntax - if !line.InBlock && len(line.Token) > 0 && line.Token[0] == "require" { - line.Token = line.Token[1:] - } - r.Syntax.Token = nil // Cleanup will delete the old line. - r.Syntax = line - } - line.InBlock = true - block.Line = append(block.Line, line) - } - - // Examine existing require lines and blocks. - var ( - // We may insert new requirements into the last uncommented - // direct-only and indirect-only blocks. We may also move requirements - // to the opposite block if their indirect markings change. - lastDirectIndex = -1 - lastIndirectIndex = -1 - - // If there are no direct-only or indirect-only blocks, a new block may - // be inserted after the last require line or block. - lastRequireIndex = -1 - - // If there's only one require line or block, and it's uncommented, - // we'll move its requirements to the direct-only or indirect-only blocks. - requireLineOrBlockCount = 0 - - // Track the block each requirement belongs to (if any) so we can - // move them later. - lineToBlock = make(map[*Line]*LineBlock) - ) - for i, stmt := range f.Syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - if !hasComments(stmt.Comments) { - if isIndirect(stmt) { - lastIndirectIndex = i - } else { - lastDirectIndex = i - } - } - - case *LineBlock: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - allDirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - allIndirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - for _, line := range stmt.Line { - lineToBlock[line] = stmt - if hasComments(line.Comments) { - allDirect = false - allIndirect = false - } else if isIndirect(line) { - allDirect = false - } else { - allIndirect = false - } - } - if allDirect { - lastDirectIndex = i - } - if allIndirect { - lastIndirectIndex = i - } - } - } - - oneFlatUncommentedBlock := requireLineOrBlockCount == 1 && - !hasComments(*f.Syntax.Stmt[lastRequireIndex].Comment()) - - // Create direct and indirect blocks if needed. Convert lines into blocks - // if needed. If we end up with an empty block or a one-line block, - // Cleanup will delete it or convert it to a line later. - insertBlock := func(i int) *LineBlock { - block := &LineBlock{Token: []string{"require"}} - f.Syntax.Stmt = append(f.Syntax.Stmt, nil) - copy(f.Syntax.Stmt[i+1:], f.Syntax.Stmt[i:]) - f.Syntax.Stmt[i] = block - return block - } - - ensureBlock := func(i int) *LineBlock { - switch stmt := f.Syntax.Stmt[i].(type) { - case *LineBlock: - return stmt - case *Line: - block := &LineBlock{ - Token: []string{"require"}, - Line: []*Line{stmt}, - } - stmt.Token = stmt.Token[1:] // remove "require" - stmt.InBlock = true - f.Syntax.Stmt[i] = block - return block - default: - panic(fmt.Sprintf("unexpected statement: %v", stmt)) - } - } - - var lastDirectBlock *LineBlock - if lastDirectIndex < 0 { - if lastIndirectIndex >= 0 { - lastDirectIndex = lastIndirectIndex - lastIndirectIndex++ - } else if lastRequireIndex >= 0 { - lastDirectIndex = lastRequireIndex + 1 - } else { - lastDirectIndex = len(f.Syntax.Stmt) - } - lastDirectBlock = insertBlock(lastDirectIndex) - } else { - lastDirectBlock = ensureBlock(lastDirectIndex) - } - - var lastIndirectBlock *LineBlock - if lastIndirectIndex < 0 { - lastIndirectIndex = lastDirectIndex + 1 - lastIndirectBlock = insertBlock(lastIndirectIndex) - } else { - lastIndirectBlock = ensureBlock(lastIndirectIndex) - } - - // Delete requirements we don't want anymore. - // Update versions and indirect comments on requirements we want to keep. - // If a requirement is in last{Direct,Indirect}Block with the wrong - // indirect marking after this, or if the requirement is in an single - // uncommented mixed block (oneFlatUncommentedBlock), move it to the - // correct block. - // - // Some blocks may be empty after this. Cleanup will remove them. - need := make(map[string]*Require) - for _, r := range req { - need[r.Mod.Path] = r - } - have := make(map[string]*Require) - for _, r := range f.Require { - path := r.Mod.Path - if need[path] == nil || have[path] != nil { - // Requirement not needed, or duplicate requirement. Delete. - r.markRemoved() - continue - } - have[r.Mod.Path] = r - r.setVersion(need[path].Mod.Version) - r.setIndirect(need[path].Indirect) - if need[path].Indirect && - (oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastDirectBlock) { - moveReq(r, lastIndirectBlock) - } else if !need[path].Indirect && - (oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastIndirectBlock) { - moveReq(r, lastDirectBlock) - } - } - - // Add new requirements. - for path, r := range need { - if have[path] == nil { - if r.Indirect { - moveReq(r, lastIndirectBlock) - } else { - moveReq(r, lastDirectBlock) - } - f.Require = append(f.Require, r) - } - } - - f.SortBlocks() -} - -func (f *File) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *File) DropRequire(path string) error { - for _, r := range f.Require { - if r.Mod.Path == path { - r.Syntax.markRemoved() - *r = Require{} - } - } - return nil -} - -// AddExclude adds a exclude statement to the mod file. Errors if the provided -// version is not a canonical version string -func (f *File) AddExclude(path, vers string) error { - if err := checkCanonicalVersion(path, vers); err != nil { - return err - } - - var hint *Line - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - return nil - } - if x.Mod.Path == path { - hint = x.Syntax - } - } - - f.Exclude = append(f.Exclude, &Exclude{Mod: module.Version{Path: path, Version: vers}, Syntax: f.Syntax.addLine(hint, "exclude", AutoQuote(path), vers)}) - return nil -} - -func (f *File) DropExclude(path, vers string) error { - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - x.Syntax.markRemoved() - *x = Exclude{} - } - } - return nil -} - -func (f *File) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func addReplace(syntax *FileSyntax, replace *[]*Replace, oldPath, oldVers, newPath, newVers string) error { - need := true - old := module.Version{Path: oldPath, Version: oldVers} - new := module.Version{Path: newPath, Version: newVers} - tokens := []string{"replace", AutoQuote(oldPath)} - if oldVers != "" { - tokens = append(tokens, oldVers) - } - tokens = append(tokens, "=>", AutoQuote(newPath)) - if newVers != "" { - tokens = append(tokens, newVers) - } - - var hint *Line - for _, r := range *replace { - if r.Old.Path == oldPath && (oldVers == "" || r.Old.Version == oldVers) { - if need { - // Found replacement for old; update to use new. - r.New = new - syntax.updateLine(r.Syntax, tokens...) - need = false - continue - } - // Already added; delete other replacements for same. - r.Syntax.markRemoved() - *r = Replace{} - } - if r.Old.Path == oldPath { - hint = r.Syntax - } - } - if need { - *replace = append(*replace, &Replace{Old: old, New: new, Syntax: syntax.addLine(hint, tokens...)}) - } - return nil -} - -func (f *File) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -// AddRetract adds a retract statement to the mod file. Errors if the provided -// version interval does not consist of canonical version strings -func (f *File) AddRetract(vi VersionInterval, rationale string) error { - var path string - if f.Module != nil { - path = f.Module.Mod.Path - } - if err := checkCanonicalVersion(path, vi.High); err != nil { - return err - } - if err := checkCanonicalVersion(path, vi.Low); err != nil { - return err - } - - r := &Retract{ - VersionInterval: vi, - } - if vi.Low == vi.High { - r.Syntax = f.Syntax.addLine(nil, "retract", AutoQuote(vi.Low)) - } else { - r.Syntax = f.Syntax.addLine(nil, "retract", "[", AutoQuote(vi.Low), ",", AutoQuote(vi.High), "]") - } - if rationale != "" { - for _, line := range strings.Split(rationale, "\n") { - com := Comment{Token: "// " + line} - r.Syntax.Comment().Before = append(r.Syntax.Comment().Before, com) - } - } - return nil -} - -func (f *File) DropRetract(vi VersionInterval) error { - for _, r := range f.Retract { - if r.VersionInterval == vi { - r.Syntax.markRemoved() - *r = Retract{} - } - } - return nil -} - -// AddTool adds a new tool directive with the given path. -// It does nothing if the tool line already exists. -func (f *File) AddTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - return nil - } - } - - f.Tool = append(f.Tool, &Tool{ - Path: path, - Syntax: f.Syntax.addLine(nil, "tool", path), - }) - - f.SortBlocks() - return nil -} - -// RemoveTool removes a tool directive with the given path. -// It does nothing if no such tool directive exists. -func (f *File) DropTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - t.Syntax.markRemoved() - *t = Tool{} - } - } - return nil -} - -// AddIgnore adds a new ignore directive with the given path. -// It does nothing if the ignore line already exists. -func (f *File) AddIgnore(path string) error { - for _, t := range f.Ignore { - if t.Path == path { - return nil - } - } - - f.Ignore = append(f.Ignore, &Ignore{ - Path: path, - Syntax: f.Syntax.addLine(nil, "ignore", path), - }) - - f.SortBlocks() - return nil -} - -// DropIgnore removes a ignore directive with the given path. -// It does nothing if no such ignore directive exists. -func (f *File) DropIgnore(path string) error { - for _, t := range f.Ignore { - if t.Path == path { - t.Syntax.markRemoved() - *t = Ignore{} - } - } - return nil -} - -func (f *File) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - // semanticSortForExcludeVersionV is the Go version (plus leading "v") at which - // lines in exclude blocks start to use semantic sort instead of lexicographic sort. - // See go.dev/issue/60028. - const semanticSortForExcludeVersionV = "v1.21" - useSemanticSortForExclude := f.Go != nil && semver.Compare("v"+f.Go.Version, semanticSortForExcludeVersionV) >= 0 - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - less := compareLine - if block.Token[0] == "exclude" && useSemanticSortForExclude { - less = compareLineExclude - } else if block.Token[0] == "retract" { - less = compareLineRetract - } - slices.SortStableFunc(block.Line, less) - } -} - -// removeDups removes duplicate exclude, replace and tool directives. -// -// Earlier exclude and tool directives take priority. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *File) removeDups() { - removeDups(f.Syntax, &f.Exclude, &f.Replace, &f.Tool, &f.Ignore) -} - -func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace, tool *[]*Tool, ignore *[]*Ignore) { - kill := make(map[*Line]bool) - - // Remove duplicate excludes. - if exclude != nil { - haveExclude := make(map[module.Version]bool) - for _, x := range *exclude { - if haveExclude[x.Mod] { - kill[x.Syntax] = true - continue - } - haveExclude[x.Mod] = true - } - var excl []*Exclude - for _, x := range *exclude { - if !kill[x.Syntax] { - excl = append(excl, x) - } - } - *exclude = excl - } - - // Remove duplicate replacements. - // Later replacements take priority over earlier ones. - haveReplace := make(map[module.Version]bool) - for i := len(*replace) - 1; i >= 0; i-- { - x := (*replace)[i] - if haveReplace[x.Old] { - kill[x.Syntax] = true - continue - } - haveReplace[x.Old] = true - } - var repl []*Replace - for _, x := range *replace { - if !kill[x.Syntax] { - repl = append(repl, x) - } - } - *replace = repl - - if tool != nil { - haveTool := make(map[string]bool) - for _, t := range *tool { - if haveTool[t.Path] { - kill[t.Syntax] = true - continue - } - haveTool[t.Path] = true - } - var newTool []*Tool - for _, t := range *tool { - if !kill[t.Syntax] { - newTool = append(newTool, t) - } - } - *tool = newTool - } - - if ignore != nil { - haveIgnore := make(map[string]bool) - for _, i := range *ignore { - if haveIgnore[i.Path] { - kill[i.Syntax] = true - continue - } - haveIgnore[i.Path] = true - } - var newIgnore []*Ignore - for _, i := range *ignore { - if !kill[i.Syntax] { - newIgnore = append(newIgnore, i) - } - } - *ignore = newIgnore - } - - // Duplicate require and retract directives are not removed. - - // Drop killed statements from the syntax tree. - var stmts []Expr - for _, stmt := range syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if kill[stmt] { - continue - } - case *LineBlock: - var lines []*Line - for _, line := range stmt.Line { - if !kill[line] { - lines = append(lines, line) - } - } - stmt.Line = lines - if len(lines) == 0 { - continue - } - } - stmts = append(stmts, stmt) - } - syntax.Stmt = stmts -} - -// compareLine compares li and lj. It sorts lexicographically without assigning -// any special meaning to tokens. -func compareLine(li, lj *Line) int { - for k := 0; k < len(li.Token) && k < len(lj.Token); k++ { - if li.Token[k] != lj.Token[k] { - return cmp.Compare(li.Token[k], lj.Token[k]) - } - } - return cmp.Compare(len(li.Token), len(lj.Token)) -} - -// compareLineExclude compares li and lj for lines in an "exclude" block. -func compareLineExclude(li, lj *Line) int { - if len(li.Token) != 2 || len(lj.Token) != 2 { - // Not a known exclude specification. - // Fall back to sorting lexicographically. - return compareLine(li, lj) - } - // An exclude specification has two tokens: ModulePath and Version. - // Compare module path by string order and version by semver rules. - if pi, pj := li.Token[0], lj.Token[0]; pi != pj { - return cmp.Compare(pi, pj) - } - return semver.Compare(li.Token[1], lj.Token[1]) -} - -// compareLineRetract compares li and lj for lines in a "retract" block. -// It treats each line as a version interval. Single versions are compared as -// if they were intervals with the same low and high version. -// Intervals are sorted in descending order, first by low version, then by -// high version, using [semver.Compare]. -func compareLineRetract(li, lj *Line) int { - interval := func(l *Line) VersionInterval { - if len(l.Token) == 1 { - return VersionInterval{Low: l.Token[0], High: l.Token[0]} - } else if len(l.Token) == 5 && l.Token[0] == "[" && l.Token[2] == "," && l.Token[4] == "]" { - return VersionInterval{Low: l.Token[1], High: l.Token[3]} - } else { - // Line in unknown format. Treat as an invalid version. - return VersionInterval{} - } - } - vii := interval(li) - vij := interval(lj) - if cmp := semver.Compare(vii.Low, vij.Low); cmp != 0 { - return -cmp - } - return -semver.Compare(vii.High, vij.High) -} - -// checkCanonicalVersion returns a non-nil error if vers is not a canonical -// version string or does not match the major version of path. -// -// If path is non-empty, the error text suggests a format with a major version -// corresponding to the path. -func checkCanonicalVersion(path, vers string) error { - _, pathMajor, pathMajorOk := module.SplitPathVersion(path) - - if vers == "" || vers != module.CanonicalVersion(vers) { - if pathMajor == "" { - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form v1.2.3"), - } - } - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form %s.2.3", module.PathMajorPrefix(pathMajor)), - } - } - - if pathMajorOk { - if err := module.CheckPathMajor(vers, pathMajor); err != nil { - if pathMajor == "" { - // In this context, the user probably wrote "v2.3.4" when they meant - // "v2.3.4+incompatible". Suggest that instead of "v0 or v1". - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("should be %s+incompatible (or module %s/%v)", vers, path, semver.Major(vers)), - } - } - return err - } - } - - return nil -} diff --git a/stembuild/vendor/golang.org/x/mod/modfile/work.go b/stembuild/vendor/golang.org/x/mod/modfile/work.go deleted file mode 100644 index 09df5ea3c..000000000 --- a/stembuild/vendor/golang.org/x/mod/modfile/work.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "fmt" - "slices" - "strings" -) - -// A WorkFile is the parsed, interpreted form of a go.work file. -type WorkFile struct { - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Use []*Use - Replace []*Replace - - Syntax *FileSyntax -} - -// A Use is a single directory statement. -type Use struct { - Path string // Use path of module. - ModulePath string // Module path in the comment. - Syntax *Line -} - -// ParseWork parses and returns a go.work file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &WorkFile{ - Syntax: fs, - } - var errs ErrorList - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, x, x.Token[0], x.Token[1:], fix) - - case *LineBlock: - if len(x.Token) > 1 { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - } - switch x.Token[0] { - default: - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - case "godebug", "use", "replace": - for _, l := range x.Line { - f.add(&errs, l, x.Token[0], l.Token, fix) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [WorkFile.DropRequire] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *WorkFile) Cleanup() { - w := 0 - for _, r := range f.Use { - if r.Path != "" { - f.Use[w] = r - w++ - } - } - f.Use = f.Use[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - f.Syntax.Cleanup() -} - -func (f *WorkFile) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - stmt := &Line{Token: []string{"go", version}} - f.Go = &Go{ - Version: version, - Syntax: stmt, - } - // Find the first non-comment-only block and add - // the go statement before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -func (f *WorkFile) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - stmt := &Line{Token: []string{"toolchain", name}} - f.Toolchain = &Toolchain{ - Name: name, - Syntax: stmt, - } - // Find the go line and add the toolchain line after it. - // Or else find the first non-comment-only block and add - // the toolchain line before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if line, ok := f.Syntax.Stmt[i].(*Line); ok && len(line.Token) > 0 && line.Token[0] == "go" { - i++ - goto Found - } - } - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - Found: - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *WorkFile) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *WorkFile) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *WorkFile) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *WorkFile) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -func (f *WorkFile) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *WorkFile) AddUse(diskPath, modulePath string) error { - need := true - for _, d := range f.Use { - if d.Path == diskPath { - if need { - d.ModulePath = modulePath - f.Syntax.updateLine(d.Syntax, "use", AutoQuote(diskPath)) - need = false - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - } - - if need { - f.AddNewUse(diskPath, modulePath) - } - return nil -} - -func (f *WorkFile) AddNewUse(diskPath, modulePath string) { - line := f.Syntax.addLine(nil, "use", AutoQuote(diskPath)) - f.Use = append(f.Use, &Use{Path: diskPath, ModulePath: modulePath, Syntax: line}) -} - -func (f *WorkFile) SetUse(dirs []*Use) { - need := make(map[string]string) - for _, d := range dirs { - need[d.Path] = d.ModulePath - } - - for _, d := range f.Use { - if modulePath, ok := need[d.Path]; ok { - d.ModulePath = modulePath - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - - // TODO(#45713): Add module path to comment. - - for diskPath, modulePath := range need { - f.AddNewUse(diskPath, modulePath) - } - f.SortBlocks() -} - -func (f *WorkFile) DropUse(path string) error { - for _, d := range f.Use { - if d.Path == path { - d.Syntax.markRemoved() - *d = Use{} - } - } - return nil -} - -func (f *WorkFile) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func (f *WorkFile) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -func (f *WorkFile) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - slices.SortStableFunc(block.Line, compareLine) - } -} - -// removeDups removes duplicate replace directives. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *WorkFile) removeDups() { - removeDups(f.Syntax, nil, &f.Replace, nil, nil) -} diff --git a/stembuild/vendor/modules.txt b/stembuild/vendor/modules.txt index 75cc3389a..c400d41cb 100644 --- a/stembuild/vendor/modules.txt +++ b/stembuild/vendor/modules.txt @@ -46,11 +46,6 @@ github.com/go-task/slim-sprig/v3 # github.com/gofrs/uuid v4.4.0+incompatible ## explicit github.com/gofrs/uuid -# github.com/golang/mock v1.6.0 -## explicit; go 1.11 -github.com/golang/mock/gomock -github.com/golang/mock/mockgen -github.com/golang/mock/mockgen/model # github.com/google/go-cmp v0.7.0 ## explicit; go 1.21 github.com/google/go-cmp/cmp @@ -265,7 +260,6 @@ golang.org/x/crypto/pbkdf2 # golang.org/x/mod v0.27.0 ## explicit; go 1.23.0 golang.org/x/mod/internal/lazyregexp -golang.org/x/mod/modfile golang.org/x/mod/module golang.org/x/mod/semver # golang.org/x/net v0.43.0 From c55e61c7636a3c0e41c5e884a79fb8c4800a7b56 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 5 Aug 2025 17:37:50 -0700 Subject: [PATCH 09/21] stembuild: remove ginkgo from tools package as of Ginkgo v2 it is no longer needed to be able to `go run` ginkgo --- stembuild/tools/tools.go | 1 - 1 file changed, 1 deletion(-) diff --git a/stembuild/tools/tools.go b/stembuild/tools/tools.go index 3a7dab915..96e1b9b12 100644 --- a/stembuild/tools/tools.go +++ b/stembuild/tools/tools.go @@ -5,5 +5,4 @@ package tools import ( _ "github.com/maxbrunsfeld/counterfeiter/v6" - _ "github.com/onsi/ginkgo/v2/ginkgo" ) From 19a735ce2c50a100c94db51801ca9d8a0d23a14c Mon Sep 17 00:00:00 2001 From: aram price Date: Wed, 6 Aug 2025 17:51:17 -0700 Subject: [PATCH 10/21] stembuild: file name matches package name --- stembuild/colorlogger/{colorLogger.go => colorlogger.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename stembuild/colorlogger/{colorLogger.go => colorlogger.go} (100%) diff --git a/stembuild/colorlogger/colorLogger.go b/stembuild/colorlogger/colorlogger.go similarity index 100% rename from stembuild/colorlogger/colorLogger.go rename to stembuild/colorlogger/colorlogger.go From f886d1179b994d0899cc659692ca4a487fe2ce97 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 5 Aug 2025 14:12:48 -0700 Subject: [PATCH 11/21] stembuild: simplify `version` package --- stembuild/Makefile | 4 +- stembuild/commandparser/help.go | 2 +- stembuild/commandparser/help_test.go | 4 +- stembuild/construct/factory.go | 2 +- stembuild/main.go | 4 +- stembuild/version/get_versions.go | 46 ------------------- stembuild/version/version.go | 38 +++++++++++++++ .../{get_version_test.go => version_test.go} | 14 ++---- 8 files changed, 49 insertions(+), 65 deletions(-) delete mode 100644 stembuild/version/get_versions.go create mode 100644 stembuild/version/version.go rename stembuild/version/{get_version_test.go => version_test.go} (70%) diff --git a/stembuild/Makefile b/stembuild/Makefile index 9d7630864..3e45d5850 100644 --- a/stembuild/Makefile +++ b/stembuild/Makefile @@ -1,6 +1,6 @@ GOSRC = $(shell find . -name "*.go" ! -name "*test.go" ! -name "*fake*" ! -path "./integration/*") STEMCELL_VERSION = $(shell echo "$${STEMBUILD_VERSION}") -LD_FLAGS = "-w -s -X github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/version.Version=${STEMCELL_VERSION}" +LD_FLAGS = "-w -s -X github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/version.Current=${STEMCELL_VERSION}" ifeq ($(OS),Windows_NT) COMMAND = out/stembuild.exe @@ -31,7 +31,7 @@ out/stembuild.exe : assets $(GOSRC) GOOS=windows CGO_ENABLED=0 go build -o out/stembuild.exe -ldflags $(LD_FLAGS) . clean : - rm -rf version/version.go assets/StemcellAutomation.zip out/* + rm -rf assets/StemcellAutomation.zip out/* units : stubbed-stemcell-automation-zip go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --skip-package integration,iaas_cli diff --git a/stembuild/commandparser/help.go b/stembuild/commandparser/help.go index f06b5fff8..c88d9654b 100644 --- a/stembuild/commandparser/help.go +++ b/stembuild/commandparser/help.go @@ -63,7 +63,7 @@ func (h *stembuildHelp) Execute(c context.Context, f *flag.FlagSet, args ...inte func (h *stembuildHelp) Explain(w io.Writer) { - fmt.Fprintf(w, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Version) //nolint:errcheck + fmt.Fprintf(w, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Current) //nolint:errcheck fmt.Fprintf(w, "Usage: %s \n\n", path.Base(os.Args[0])) //nolint:errcheck fmt.Fprint(w, "Commands:\n") //nolint:errcheck diff --git a/stembuild/commandparser/help_test.go b/stembuild/commandparser/help_test.go index ed3e9949d..82256519a 100644 --- a/stembuild/commandparser/help_test.go +++ b/stembuild/commandparser/help_test.go @@ -21,7 +21,7 @@ var _ = Describe("help", func() { // struct variables. This adds a bit of protection when renaming flag parameters. Describe("Explain", func() { It("shows the correct version", func() { - version.Version = "1.56" + version.Current = "1.56" buf := bytes.Buffer{} fs := flag.NewFlagSet(path.Base(os.Args[0]), flag.ExitOnError) commands := make([]subcommands.Command, 0) @@ -29,7 +29,7 @@ var _ = Describe("help", func() { sb.Explain(&buf) - expectedString := fmt.Sprintf("%s version %s, Windows Stemcell Building Tool", path.Base(os.Args[0]), version.Version) + expectedString := fmt.Sprintf("%s version %s, Windows Stemcell Building Tool", path.Base(os.Args[0]), version.Current) Expect(buf.String()).To(ContainSubstring(expectedString)) }) }) diff --git a/stembuild/construct/factory.go b/stembuild/construct/factory.go index f5598de52..e56c1fcb3 100644 --- a/stembuild/construct/factory.go +++ b/stembuild/construct/factory.go @@ -47,7 +47,7 @@ func (f *Factory) New(config config.SourceConfig, vCenterManager commandparser.V GuestManager: guestManager, Unarchiver: &archive.Zip{}, } - versionGetter := version.NewVersionGetter() + versionGetter := version.New() winRmClientFactory := remotemanager.NewWinRmClientFactory(config.GuestVmIp, config.GuestVMUsername, config.GuestVMPassword) remoteManager := remotemanager.NewWinRM(config.GuestVmIp, config.GuestVMUsername, config.GuestVMPassword, winRmClientFactory) diff --git a/stembuild/main.go b/stembuild/main.go index 19e853777..de4d51257 100644 --- a/stembuild/main.go +++ b/stembuild/main.go @@ -35,7 +35,7 @@ func main() { } var gf commandparser.GlobalFlags - packageCmd := commandparser.NewPackageCommand(version.NewVersionGetter(), &packager.Factory{}, &commandparser.PackageMessenger{Output: os.Stderr}) + packageCmd := commandparser.NewPackageCommand(version.New(), &packager.Factory{}, &commandparser.PackageMessenger{Output: os.Stderr}) packageCmd.GlobalFlags = &gf constructCmd := commandparser.NewConstructCmd(context.Background(), &construct.Factory{}, &vcenter_manager.ManagerFactory{}, &commandparser.ConstructValidator{}, &commandparser.ConstructCmdMessenger{OutputChannel: os.Stderr}) constructCmd.GlobalFlags = &gf @@ -65,7 +65,7 @@ func main() { fs.Parse(os.Args[1:]) //nolint:errcheck if gf.ShowVersion { - fmt.Fprintf(os.Stdout, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Version) //nolint:errcheck + fmt.Fprintf(os.Stdout, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Current) //nolint:errcheck os.Remove(s) //nolint:errcheck os.Exit(0) } diff --git a/stembuild/version/get_versions.go b/stembuild/version/get_versions.go deleted file mode 100644 index baabf9de0..000000000 --- a/stembuild/version/get_versions.go +++ /dev/null @@ -1,46 +0,0 @@ -package version - -import ( - "fmt" - "strings" -) - -type VersionGetterModifier interface { - Modify(*VersionGetter) -} - -func NewVersionGetter(modifiers ...VersionGetterModifier) *VersionGetter { - v := &VersionGetter{ - Version: Version, - } - - for _, modifier := range modifiers { - modifier.Modify(v) - } - - return v -} - -type VersionGetter struct { - Version string -} - -func (v *VersionGetter) GetVersion() string { - stringArr := strings.Split(v.Version, ".") - stringArr = stringArr[0:2] - - return strings.Join(stringArr, ".") -} - -func (v *VersionGetter) GetVersionWithPatchNumber(patchNumber string) string { - return fmt.Sprintf("%s.%s", v.GetVersion(), patchNumber) -} - -func (v *VersionGetter) GetOs() string { - stringArr := strings.Split(v.Version, ".") - os := stringArr[0] - - return os -} - -var Version = "dev" diff --git a/stembuild/version/version.go b/stembuild/version/version.go new file mode 100644 index 000000000..b3381e15d --- /dev/null +++ b/stembuild/version/version.go @@ -0,0 +1,38 @@ +package version + +import ( + "fmt" + "strings" +) + +var Current = "dev" + +func New() *Getter { + return &Getter{ + Version: Current, + } +} + +type Getter struct { + Version string +} + +func (g *Getter) GetVersion() string { + majorMinor := g.versionArray()[0:2] + + return strings.Join(majorMinor, ".") +} + +func (g *Getter) GetVersionWithPatchNumber(patchNumber string) string { + return fmt.Sprintf("%s.%s", g.GetVersion(), patchNumber) +} + +func (g *Getter) GetOs() string { + osIdentifier := g.versionArray()[0] + + return osIdentifier +} + +func (g *Getter) versionArray() []string { + return strings.Split(g.Version, ".") +} diff --git a/stembuild/version/get_version_test.go b/stembuild/version/version_test.go similarity index 70% rename from stembuild/version/get_version_test.go rename to stembuild/version/version_test.go index c33256be4..2080eb9a6 100644 --- a/stembuild/version/get_version_test.go +++ b/stembuild/version/version_test.go @@ -7,18 +7,10 @@ import ( . "github.com/onsi/gomega" ) -type VModifier struct { - newVersionNumber string -} - -func (m *VModifier) Modify(v *version.VersionGetter) { - v.Version = m.newVersionNumber -} - var _ = Describe("Version Utilities", func() { Describe("GetVersion", func() { It("should return a properly formatted version number", func() { - versionGetter := version.NewVersionGetter(&VModifier{"2019.123.13"}) + versionGetter := version.Getter{Version: "2019.123.13"} stemcellVersion := versionGetter.GetVersion() Expect(stemcellVersion).To(Equal("2019.123")) @@ -27,7 +19,7 @@ var _ = Describe("Version Utilities", func() { Describe("GetVersionWithPatchNumber", func() { It("returns a version number with a patch number when provided", func() { - versionGetter := version.NewVersionGetter(&VModifier{"2019.5.13"}) + versionGetter := version.Getter{Version: "2019.5.13"} stemcellVersion := versionGetter.GetVersionWithPatchNumber("2") Expect(stemcellVersion).To(Equal("2019.5.2")) @@ -36,7 +28,7 @@ var _ = Describe("Version Utilities", func() { Describe("GetOs", func() { It("should returns the first part of a '.' separated string", func() { - versionGetter := version.NewVersionGetter(&VModifier{"111.222.333"}) + versionGetter := version.Getter{Version: "111.222.333"} os := versionGetter.GetOs() Expect(os).To(Equal("111")) From a3274874cab5f04b61d8b86d11febf699155338c Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 5 Aug 2025 14:11:25 -0700 Subject: [PATCH 12/21] stembuild: cleanup vmconstruct_test Fixes spacing and variable scoping --- stembuild/construct/vmconstruct_test.go | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/stembuild/construct/vmconstruct_test.go b/stembuild/construct/vmconstruct_test.go index 98157f079..21ce0d023 100644 --- a/stembuild/construct/vmconstruct_test.go +++ b/stembuild/construct/vmconstruct_test.go @@ -32,7 +32,7 @@ var _ = Describe("construct_helpers", func() { fakeScriptExecutor *constructfakes.FakeScriptExecutorI fakeSetupFlags []string ) - const rawLogoffCommand = `&{If([string]::IsNullOrEmpty($(Get-WmiObject win32_computersystem).username)) {Write-Host "No users logged in." } Else {Write-Host "Logging out user."; $(Get-WmiObject win32_operatingsystem).Win32Shutdown(0) 1> $null}}` + BeforeEach(func() { fakeRemoteManager = &remotemanagerfakes.FakeRemoteManager{} fakeVcenterClient = &constructfakes.FakeIaasClient{} @@ -73,12 +73,10 @@ var _ = Describe("construct_helpers", func() { fakeGuestManager.DownloadFileInGuestReturns(versionBuffer, 3, nil) fakeGuestManager.StartProgramInGuestReturns(0, nil) - }) Describe("ScriptExecutor", func() { It("executes setup script with correct arguments", func() { - e := construct.NewScriptExecutor(fakeRemoteManager) version := "11.11.11" err := e.ExecuteSetupScript(version, fakeSetupFlags) @@ -128,7 +126,6 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("winrm connection event")) }) - }) Describe("PrepareVM", func() { @@ -178,7 +175,6 @@ var _ = Describe("construct_helpers", func() { }) Describe("connect to VM", func() { - It("checks for WinRM connectivity after WinRM enabled", func() { var calls []string @@ -233,7 +229,6 @@ var _ = Describe("construct_helpers", func() { Expect(fakeMessenger.UploadFileSucceededCallCount()).To(Equal(2)) }) - }) Context("Fails to upload one or more artifacts", func() { @@ -255,7 +250,6 @@ var _ = Describe("construct_helpers", func() { }) It("fails when it cannot upload Stemcell Automation scripts", func() { - uploadError := errors.New("failed to upload stemcell automation") fakeVcenterClient.UploadArtifactReturnsOnCall(0, nil) fakeVcenterClient.UploadArtifactReturnsOnCall(1, uploadError) @@ -278,6 +272,8 @@ var _ = Describe("construct_helpers", func() { }) Describe("logs out users", func() { + var rawLogoffCommand = `&{If([string]::IsNullOrEmpty($(Get-WmiObject win32_computersystem).username)) {Write-Host "No users logged in." } Else {Write-Host "Logging out user."; $(Get-WmiObject win32_operatingsystem).Win32Shutdown(0) 1> $null}}` + It("returns success when active user is logged out", func() { fakeRemoteManager.ExecuteCommandReturnsOnCall(0, 0, nil) @@ -292,8 +288,9 @@ var _ = Describe("construct_helpers", func() { Expect(fakeMessenger.LogOutUsersStartedCallCount()).To(Equal(1)) Expect(fakeMessenger.LogOutUsersSucceededCallCount()).To(Equal(1)) }) + It("returns failure when it fails to execute a logout", func() { - errorMessage := "Unable to execute command" + errorMessage := "unable to execute command" fakeRemoteManager.ExecuteCommandReturnsOnCall(0, 1, errors.New(errorMessage)) err := vmConstruct.PrepareVM() @@ -332,7 +329,6 @@ var _ = Describe("construct_helpers", func() { Expect(fakeMessenger.ExtractArtifactsStartedCallCount()).To(Equal(1)) Expect(fakeMessenger.ExtractArtifactsSucceededCallCount()).To(Equal(1)) }) - }) Describe("can execute setup scripts", func() { @@ -365,8 +361,8 @@ var _ = Describe("construct_helpers", func() { Expect(fakeMessenger.ExecuteSetupScriptStartedCallCount()).To(Equal(1)) Expect(fakeMessenger.ExecuteSetupScriptSucceededCallCount()).To(Equal(1)) }) - }) + Describe("can check if vm is rebooting", func() { It("waits for reboot finished after the setup script has been executed", func() { var calls []string @@ -444,7 +440,6 @@ var _ = Describe("construct_helpers", func() { }) It("runs post-reboot command", func() { - err := vmConstruct.PrepareVM() Expect(err).NotTo(HaveOccurred()) @@ -463,8 +458,8 @@ var _ = Describe("construct_helpers", func() { Expect(err.Error()).To(ContainSubstring(postRebootError.Error())) Expect(fakeMessenger.ExecutePostRebootScriptStartedCallCount()).To(Equal(1)) Expect(fakeMessenger.ExecutePostRebootScriptSucceededCallCount()).To(Equal(0)) - }) + It("logs but does not error on winrm, non-powershell errors", func() { winrmError := errors.New("winrm connection event: some EOF error") @@ -480,7 +475,6 @@ var _ = Describe("construct_helpers", func() { Expect(fakeMessenger.ExecutePostRebootWarningArgsForCall(0)). To(ContainSubstring(winrmError.Error())) }) - }) Describe("can check that the VM is powered off", func() { From e907a2d8bc00dd8a776fdf7ccdf28e072d2b92d3 Mon Sep 17 00:00:00 2001 From: aram price Date: Mon, 4 Aug 2025 18:33:39 -0700 Subject: [PATCH 13/21] stembuild: replace custom messangers - extract constants - capture error from Write() and panic if present - message used fantasy (2035) version instead of actual (2019) - extract common `write` func - extract messenger from main() - remove references to pivotal email - packagers use Messenger not STDOUT/STDERR Use base messenger methods and spy on output rather than fake messengers with specific output funcs that are mocked. --- .../fake_construct_messenger.go | 167 ---- .../fake_packager_factory.go | 19 +- .../fake_packager_messenger.go | 222 ------ .../fake_vmpreparer_factory.go | 19 +- stembuild/commandparser/construct.go | 35 +- .../commandparser/construct_messenger.go | 30 - .../commandparser/construct_messenger_test.go | 53 -- stembuild/commandparser/construct_test.go | 42 +- stembuild/commandparser/package_messenger.go | 31 - .../commandparser/package_messenger_test.go | 54 -- stembuild/commandparser/package_stemcell.go | 42 +- .../commandparser/package_stemcell_test.go | 96 +-- .../fake_construct_messenger.go | 727 ------------------ stembuild/construct/factory.go | 6 +- stembuild/construct/factory_test.go | 9 +- stembuild/construct/messenger.go | 135 ---- stembuild/construct/messenger_test.go | 290 ------- stembuild/construct/vmconstruct.go | 87 +-- stembuild/construct/vmconstruct_test.go | 117 ++- stembuild/main.go | 59 +- stembuild/messenger/messenger.go | 21 + stembuild/messenger/messenger_suite_test.go | 13 + stembuild/messenger/stembuild_messenger.go | 35 + .../messenger/stembuild_messenger_test.go | 78 ++ .../package_stemcell/packager/factory.go | 10 +- .../package_stemcell/packager/factory_test.go | 19 +- .../packager/vcenter_packager.go | 6 +- .../packager/vcenter_packager_test.go | 66 +- .../packager/vmdk_packager.go | 13 +- .../packager/vmdk_packager_test.go | 2 + 30 files changed, 476 insertions(+), 2027 deletions(-) delete mode 100644 stembuild/commandparser/commandparserfakes/fake_construct_messenger.go delete mode 100644 stembuild/commandparser/commandparserfakes/fake_packager_messenger.go delete mode 100644 stembuild/commandparser/construct_messenger.go delete mode 100644 stembuild/commandparser/construct_messenger_test.go delete mode 100644 stembuild/commandparser/package_messenger.go delete mode 100644 stembuild/commandparser/package_messenger_test.go delete mode 100644 stembuild/construct/constructfakes/fake_construct_messenger.go delete mode 100644 stembuild/construct/messenger.go delete mode 100644 stembuild/construct/messenger_test.go create mode 100644 stembuild/messenger/messenger.go create mode 100644 stembuild/messenger/messenger_suite_test.go create mode 100644 stembuild/messenger/stembuild_messenger.go create mode 100644 stembuild/messenger/stembuild_messenger_test.go diff --git a/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go b/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go deleted file mode 100644 index ff0475ca5..000000000 --- a/stembuild/commandparser/commandparserfakes/fake_construct_messenger.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by counterfeiter. DO NOT EDIT. -package commandparserfakes - -import ( - "sync" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" -) - -type FakeConstructMessenger struct { - ArgumentsNotProvidedStub func() - argumentsNotProvidedMutex sync.RWMutex - argumentsNotProvidedArgsForCall []struct { - } - CannotConnectToVMStub func(error) - cannotConnectToVMMutex sync.RWMutex - cannotConnectToVMArgsForCall []struct { - arg1 error - } - CannotPrepareVMStub func(error) - cannotPrepareVMMutex sync.RWMutex - cannotPrepareVMArgsForCall []struct { - arg1 error - } - LGPONotFoundStub func() - lGPONotFoundMutex sync.RWMutex - lGPONotFoundArgsForCall []struct { - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *FakeConstructMessenger) ArgumentsNotProvided() { - fake.argumentsNotProvidedMutex.Lock() - fake.argumentsNotProvidedArgsForCall = append(fake.argumentsNotProvidedArgsForCall, struct { - }{}) - stub := fake.ArgumentsNotProvidedStub - fake.recordInvocation("ArgumentsNotProvided", []interface{}{}) - fake.argumentsNotProvidedMutex.Unlock() - if stub != nil { - fake.ArgumentsNotProvidedStub() - } -} - -func (fake *FakeConstructMessenger) ArgumentsNotProvidedCallCount() int { - fake.argumentsNotProvidedMutex.RLock() - defer fake.argumentsNotProvidedMutex.RUnlock() - return len(fake.argumentsNotProvidedArgsForCall) -} - -func (fake *FakeConstructMessenger) ArgumentsNotProvidedCalls(stub func()) { - fake.argumentsNotProvidedMutex.Lock() - defer fake.argumentsNotProvidedMutex.Unlock() - fake.ArgumentsNotProvidedStub = stub -} - -func (fake *FakeConstructMessenger) CannotConnectToVM(arg1 error) { - fake.cannotConnectToVMMutex.Lock() - fake.cannotConnectToVMArgsForCall = append(fake.cannotConnectToVMArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.CannotConnectToVMStub - fake.recordInvocation("CannotConnectToVM", []interface{}{arg1}) - fake.cannotConnectToVMMutex.Unlock() - if stub != nil { - fake.CannotConnectToVMStub(arg1) - } -} - -func (fake *FakeConstructMessenger) CannotConnectToVMCallCount() int { - fake.cannotConnectToVMMutex.RLock() - defer fake.cannotConnectToVMMutex.RUnlock() - return len(fake.cannotConnectToVMArgsForCall) -} - -func (fake *FakeConstructMessenger) CannotConnectToVMCalls(stub func(error)) { - fake.cannotConnectToVMMutex.Lock() - defer fake.cannotConnectToVMMutex.Unlock() - fake.CannotConnectToVMStub = stub -} - -func (fake *FakeConstructMessenger) CannotConnectToVMArgsForCall(i int) error { - fake.cannotConnectToVMMutex.RLock() - defer fake.cannotConnectToVMMutex.RUnlock() - argsForCall := fake.cannotConnectToVMArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakeConstructMessenger) CannotPrepareVM(arg1 error) { - fake.cannotPrepareVMMutex.Lock() - fake.cannotPrepareVMArgsForCall = append(fake.cannotPrepareVMArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.CannotPrepareVMStub - fake.recordInvocation("CannotPrepareVM", []interface{}{arg1}) - fake.cannotPrepareVMMutex.Unlock() - if stub != nil { - fake.CannotPrepareVMStub(arg1) - } -} - -func (fake *FakeConstructMessenger) CannotPrepareVMCallCount() int { - fake.cannotPrepareVMMutex.RLock() - defer fake.cannotPrepareVMMutex.RUnlock() - return len(fake.cannotPrepareVMArgsForCall) -} - -func (fake *FakeConstructMessenger) CannotPrepareVMCalls(stub func(error)) { - fake.cannotPrepareVMMutex.Lock() - defer fake.cannotPrepareVMMutex.Unlock() - fake.CannotPrepareVMStub = stub -} - -func (fake *FakeConstructMessenger) CannotPrepareVMArgsForCall(i int) error { - fake.cannotPrepareVMMutex.RLock() - defer fake.cannotPrepareVMMutex.RUnlock() - argsForCall := fake.cannotPrepareVMArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakeConstructMessenger) LGPONotFound() { - fake.lGPONotFoundMutex.Lock() - fake.lGPONotFoundArgsForCall = append(fake.lGPONotFoundArgsForCall, struct { - }{}) - stub := fake.LGPONotFoundStub - fake.recordInvocation("LGPONotFound", []interface{}{}) - fake.lGPONotFoundMutex.Unlock() - if stub != nil { - fake.LGPONotFoundStub() - } -} - -func (fake *FakeConstructMessenger) LGPONotFoundCallCount() int { - fake.lGPONotFoundMutex.RLock() - defer fake.lGPONotFoundMutex.RUnlock() - return len(fake.lGPONotFoundArgsForCall) -} - -func (fake *FakeConstructMessenger) LGPONotFoundCalls(stub func()) { - fake.lGPONotFoundMutex.Lock() - defer fake.lGPONotFoundMutex.Unlock() - fake.LGPONotFoundStub = stub -} - -func (fake *FakeConstructMessenger) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - copiedInvocations := map[string][][]interface{}{} - for key, value := range fake.invocations { - copiedInvocations[key] = value - } - return copiedInvocations -} - -func (fake *FakeConstructMessenger) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} - -var _ commandparser.ConstructMessenger = new(FakeConstructMessenger) diff --git a/stembuild/commandparser/commandparserfakes/fake_packager_factory.go b/stembuild/commandparser/commandparserfakes/fake_packager_factory.go index 53cf5c1f2..fa97b316e 100644 --- a/stembuild/commandparser/commandparserfakes/fake_packager_factory.go +++ b/stembuild/commandparser/commandparserfakes/fake_packager_factory.go @@ -6,16 +6,18 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" ) type FakePackagerFactory struct { - NewPackagerStub func(config.SourceConfig, config.OutputConfig, colorlogger.Logger) (commandparser.Packager, error) + NewPackagerStub func(config.SourceConfig, config.OutputConfig, colorlogger.Logger, messenger.Messenger) (commandparser.Packager, error) newPackagerMutex sync.RWMutex newPackagerArgsForCall []struct { arg1 config.SourceConfig arg2 config.OutputConfig arg3 colorlogger.Logger + arg4 messenger.Messenger } newPackagerReturns struct { result1 commandparser.Packager @@ -29,20 +31,21 @@ type FakePackagerFactory struct { invocationsMutex sync.RWMutex } -func (fake *FakePackagerFactory) NewPackager(arg1 config.SourceConfig, arg2 config.OutputConfig, arg3 colorlogger.Logger) (commandparser.Packager, error) { +func (fake *FakePackagerFactory) NewPackager(arg1 config.SourceConfig, arg2 config.OutputConfig, arg3 colorlogger.Logger, arg4 messenger.Messenger) (commandparser.Packager, error) { fake.newPackagerMutex.Lock() ret, specificReturn := fake.newPackagerReturnsOnCall[len(fake.newPackagerArgsForCall)] fake.newPackagerArgsForCall = append(fake.newPackagerArgsForCall, struct { arg1 config.SourceConfig arg2 config.OutputConfig arg3 colorlogger.Logger - }{arg1, arg2, arg3}) + arg4 messenger.Messenger + }{arg1, arg2, arg3, arg4}) stub := fake.NewPackagerStub fakeReturns := fake.newPackagerReturns - fake.recordInvocation("NewPackager", []interface{}{arg1, arg2, arg3}) + fake.recordInvocation("NewPackager", []interface{}{arg1, arg2, arg3, arg4}) fake.newPackagerMutex.Unlock() if stub != nil { - return stub(arg1, arg2, arg3) + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 @@ -56,17 +59,17 @@ func (fake *FakePackagerFactory) NewPackagerCallCount() int { return len(fake.newPackagerArgsForCall) } -func (fake *FakePackagerFactory) NewPackagerCalls(stub func(config.SourceConfig, config.OutputConfig, colorlogger.Logger) (commandparser.Packager, error)) { +func (fake *FakePackagerFactory) NewPackagerCalls(stub func(config.SourceConfig, config.OutputConfig, colorlogger.Logger, messenger.Messenger) (commandparser.Packager, error)) { fake.newPackagerMutex.Lock() defer fake.newPackagerMutex.Unlock() fake.NewPackagerStub = stub } -func (fake *FakePackagerFactory) NewPackagerArgsForCall(i int) (config.SourceConfig, config.OutputConfig, colorlogger.Logger) { +func (fake *FakePackagerFactory) NewPackagerArgsForCall(i int) (config.SourceConfig, config.OutputConfig, colorlogger.Logger, messenger.Messenger) { fake.newPackagerMutex.RLock() defer fake.newPackagerMutex.RUnlock() argsForCall := fake.newPackagerArgsForCall[i] - return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 + return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 } func (fake *FakePackagerFactory) NewPackagerReturns(result1 commandparser.Packager, result2 error) { diff --git a/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go b/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go deleted file mode 100644 index 45adc4208..000000000 --- a/stembuild/commandparser/commandparserfakes/fake_packager_messenger.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by counterfeiter. DO NOT EDIT. -package commandparserfakes - -import ( - "sync" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" -) - -type FakePackagerMessenger struct { - CannotCreatePackagerStub func(error) - cannotCreatePackagerMutex sync.RWMutex - cannotCreatePackagerArgsForCall []struct { - arg1 error - } - DoesNotHaveEnoughSpaceStub func(error) - doesNotHaveEnoughSpaceMutex sync.RWMutex - doesNotHaveEnoughSpaceArgsForCall []struct { - arg1 error - } - InvalidOutputConfigStub func(error) - invalidOutputConfigMutex sync.RWMutex - invalidOutputConfigArgsForCall []struct { - arg1 error - } - PackageFailedStub func(error) - packageFailedMutex sync.RWMutex - packageFailedArgsForCall []struct { - arg1 error - } - SourceParametersAreInvalidStub func(error) - sourceParametersAreInvalidMutex sync.RWMutex - sourceParametersAreInvalidArgsForCall []struct { - arg1 error - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *FakePackagerMessenger) CannotCreatePackager(arg1 error) { - fake.cannotCreatePackagerMutex.Lock() - fake.cannotCreatePackagerArgsForCall = append(fake.cannotCreatePackagerArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.CannotCreatePackagerStub - fake.recordInvocation("CannotCreatePackager", []interface{}{arg1}) - fake.cannotCreatePackagerMutex.Unlock() - if stub != nil { - fake.CannotCreatePackagerStub(arg1) - } -} - -func (fake *FakePackagerMessenger) CannotCreatePackagerCallCount() int { - fake.cannotCreatePackagerMutex.RLock() - defer fake.cannotCreatePackagerMutex.RUnlock() - return len(fake.cannotCreatePackagerArgsForCall) -} - -func (fake *FakePackagerMessenger) CannotCreatePackagerCalls(stub func(error)) { - fake.cannotCreatePackagerMutex.Lock() - defer fake.cannotCreatePackagerMutex.Unlock() - fake.CannotCreatePackagerStub = stub -} - -func (fake *FakePackagerMessenger) CannotCreatePackagerArgsForCall(i int) error { - fake.cannotCreatePackagerMutex.RLock() - defer fake.cannotCreatePackagerMutex.RUnlock() - argsForCall := fake.cannotCreatePackagerArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakePackagerMessenger) DoesNotHaveEnoughSpace(arg1 error) { - fake.doesNotHaveEnoughSpaceMutex.Lock() - fake.doesNotHaveEnoughSpaceArgsForCall = append(fake.doesNotHaveEnoughSpaceArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.DoesNotHaveEnoughSpaceStub - fake.recordInvocation("DoesNotHaveEnoughSpace", []interface{}{arg1}) - fake.doesNotHaveEnoughSpaceMutex.Unlock() - if stub != nil { - fake.DoesNotHaveEnoughSpaceStub(arg1) - } -} - -func (fake *FakePackagerMessenger) DoesNotHaveEnoughSpaceCallCount() int { - fake.doesNotHaveEnoughSpaceMutex.RLock() - defer fake.doesNotHaveEnoughSpaceMutex.RUnlock() - return len(fake.doesNotHaveEnoughSpaceArgsForCall) -} - -func (fake *FakePackagerMessenger) DoesNotHaveEnoughSpaceCalls(stub func(error)) { - fake.doesNotHaveEnoughSpaceMutex.Lock() - defer fake.doesNotHaveEnoughSpaceMutex.Unlock() - fake.DoesNotHaveEnoughSpaceStub = stub -} - -func (fake *FakePackagerMessenger) DoesNotHaveEnoughSpaceArgsForCall(i int) error { - fake.doesNotHaveEnoughSpaceMutex.RLock() - defer fake.doesNotHaveEnoughSpaceMutex.RUnlock() - argsForCall := fake.doesNotHaveEnoughSpaceArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakePackagerMessenger) InvalidOutputConfig(arg1 error) { - fake.invalidOutputConfigMutex.Lock() - fake.invalidOutputConfigArgsForCall = append(fake.invalidOutputConfigArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.InvalidOutputConfigStub - fake.recordInvocation("InvalidOutputConfig", []interface{}{arg1}) - fake.invalidOutputConfigMutex.Unlock() - if stub != nil { - fake.InvalidOutputConfigStub(arg1) - } -} - -func (fake *FakePackagerMessenger) InvalidOutputConfigCallCount() int { - fake.invalidOutputConfigMutex.RLock() - defer fake.invalidOutputConfigMutex.RUnlock() - return len(fake.invalidOutputConfigArgsForCall) -} - -func (fake *FakePackagerMessenger) InvalidOutputConfigCalls(stub func(error)) { - fake.invalidOutputConfigMutex.Lock() - defer fake.invalidOutputConfigMutex.Unlock() - fake.InvalidOutputConfigStub = stub -} - -func (fake *FakePackagerMessenger) InvalidOutputConfigArgsForCall(i int) error { - fake.invalidOutputConfigMutex.RLock() - defer fake.invalidOutputConfigMutex.RUnlock() - argsForCall := fake.invalidOutputConfigArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakePackagerMessenger) PackageFailed(arg1 error) { - fake.packageFailedMutex.Lock() - fake.packageFailedArgsForCall = append(fake.packageFailedArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.PackageFailedStub - fake.recordInvocation("PackageFailed", []interface{}{arg1}) - fake.packageFailedMutex.Unlock() - if stub != nil { - fake.PackageFailedStub(arg1) - } -} - -func (fake *FakePackagerMessenger) PackageFailedCallCount() int { - fake.packageFailedMutex.RLock() - defer fake.packageFailedMutex.RUnlock() - return len(fake.packageFailedArgsForCall) -} - -func (fake *FakePackagerMessenger) PackageFailedCalls(stub func(error)) { - fake.packageFailedMutex.Lock() - defer fake.packageFailedMutex.Unlock() - fake.PackageFailedStub = stub -} - -func (fake *FakePackagerMessenger) PackageFailedArgsForCall(i int) error { - fake.packageFailedMutex.RLock() - defer fake.packageFailedMutex.RUnlock() - argsForCall := fake.packageFailedArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakePackagerMessenger) SourceParametersAreInvalid(arg1 error) { - fake.sourceParametersAreInvalidMutex.Lock() - fake.sourceParametersAreInvalidArgsForCall = append(fake.sourceParametersAreInvalidArgsForCall, struct { - arg1 error - }{arg1}) - stub := fake.SourceParametersAreInvalidStub - fake.recordInvocation("SourceParametersAreInvalid", []interface{}{arg1}) - fake.sourceParametersAreInvalidMutex.Unlock() - if stub != nil { - fake.SourceParametersAreInvalidStub(arg1) - } -} - -func (fake *FakePackagerMessenger) SourceParametersAreInvalidCallCount() int { - fake.sourceParametersAreInvalidMutex.RLock() - defer fake.sourceParametersAreInvalidMutex.RUnlock() - return len(fake.sourceParametersAreInvalidArgsForCall) -} - -func (fake *FakePackagerMessenger) SourceParametersAreInvalidCalls(stub func(error)) { - fake.sourceParametersAreInvalidMutex.Lock() - defer fake.sourceParametersAreInvalidMutex.Unlock() - fake.SourceParametersAreInvalidStub = stub -} - -func (fake *FakePackagerMessenger) SourceParametersAreInvalidArgsForCall(i int) error { - fake.sourceParametersAreInvalidMutex.RLock() - defer fake.sourceParametersAreInvalidMutex.RUnlock() - argsForCall := fake.sourceParametersAreInvalidArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakePackagerMessenger) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - copiedInvocations := map[string][][]interface{}{} - for key, value := range fake.invocations { - copiedInvocations[key] = value - } - return copiedInvocations -} - -func (fake *FakePackagerMessenger) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} - -var _ commandparser.PackagerMessenger = new(FakePackagerMessenger) diff --git a/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go b/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go index eb84ef0d7..7c17f89a7 100644 --- a/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go +++ b/stembuild/commandparser/commandparserfakes/fake_vmpreparer_factory.go @@ -6,14 +6,16 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct/config" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" ) type FakeVMPreparerFactory struct { - NewStub func(config.SourceConfig, commandparser.VCenterManager) (commandparser.VmConstruct, error) + NewStub func(config.SourceConfig, commandparser.VCenterManager, messenger.Messenger) (commandparser.VmConstruct, error) newMutex sync.RWMutex newArgsForCall []struct { arg1 config.SourceConfig arg2 commandparser.VCenterManager + arg3 messenger.Messenger } newReturns struct { result1 commandparser.VmConstruct @@ -27,19 +29,20 @@ type FakeVMPreparerFactory struct { invocationsMutex sync.RWMutex } -func (fake *FakeVMPreparerFactory) New(arg1 config.SourceConfig, arg2 commandparser.VCenterManager) (commandparser.VmConstruct, error) { +func (fake *FakeVMPreparerFactory) New(arg1 config.SourceConfig, arg2 commandparser.VCenterManager, arg3 messenger.Messenger) (commandparser.VmConstruct, error) { fake.newMutex.Lock() ret, specificReturn := fake.newReturnsOnCall[len(fake.newArgsForCall)] fake.newArgsForCall = append(fake.newArgsForCall, struct { arg1 config.SourceConfig arg2 commandparser.VCenterManager - }{arg1, arg2}) + arg3 messenger.Messenger + }{arg1, arg2, arg3}) stub := fake.NewStub fakeReturns := fake.newReturns - fake.recordInvocation("New", []interface{}{arg1, arg2}) + fake.recordInvocation("New", []interface{}{arg1, arg2, arg3}) fake.newMutex.Unlock() if stub != nil { - return stub(arg1, arg2) + return stub(arg1, arg2, arg3) } if specificReturn { return ret.result1, ret.result2 @@ -53,17 +56,17 @@ func (fake *FakeVMPreparerFactory) NewCallCount() int { return len(fake.newArgsForCall) } -func (fake *FakeVMPreparerFactory) NewCalls(stub func(config.SourceConfig, commandparser.VCenterManager) (commandparser.VmConstruct, error)) { +func (fake *FakeVMPreparerFactory) NewCalls(stub func(config.SourceConfig, commandparser.VCenterManager, messenger.Messenger) (commandparser.VmConstruct, error)) { fake.newMutex.Lock() defer fake.newMutex.Unlock() fake.NewStub = stub } -func (fake *FakeVMPreparerFactory) NewArgsForCall(i int) (config.SourceConfig, commandparser.VCenterManager) { +func (fake *FakeVMPreparerFactory) NewArgsForCall(i int) (config.SourceConfig, commandparser.VCenterManager, messenger.Messenger) { fake.newMutex.RLock() defer fake.newMutex.RUnlock() argsForCall := fake.newArgsForCall[i] - return argsForCall.arg1, argsForCall.arg2 + return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } func (fake *FakeVMPreparerFactory) NewReturns(result1 commandparser.VmConstruct, result2 error) { diff --git a/stembuild/commandparser/construct.go b/stembuild/commandparser/construct.go index 24ba6061c..e353c4f05 100644 --- a/stembuild/commandparser/construct.go +++ b/stembuild/commandparser/construct.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strings" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/google/subcommands" "github.com/vmware/govmomi/guest" "github.com/vmware/govmomi/object" @@ -34,7 +35,7 @@ type VCenterManager interface { //counterfeiter:generate . VMPreparerFactory type VMPreparerFactory interface { - New(config config.SourceConfig, vCenterManager VCenterManager) (VmConstruct, error) + New(config config.SourceConfig, vCenterManager VCenterManager, messenger messenger.Messenger) (VmConstruct, error) } //counterfeiter:generate . ManagerFactory @@ -49,21 +50,13 @@ type ConstructCmdValidator interface { LGPOInDirectory() bool } -//counterfeiter:generate . ConstructMessenger -type ConstructMessenger interface { - ArgumentsNotProvided() - LGPONotFound() - CannotConnectToVM(err error) - CannotPrepareVM(err error) -} - type ConstructCmd struct { ctx context.Context sourceConfig config.SourceConfig prepFactory VMPreparerFactory managerFactory ManagerFactory validator ConstructCmdValidator - messenger ConstructMessenger + messenger messenger.Messenger GlobalFlags *GlobalFlags } @@ -84,8 +77,14 @@ func (v setupFlagsValue) Set(s string) error { return nil } -func NewConstructCmd(ctx context.Context, prepFactory VMPreparerFactory, managerFactory ManagerFactory, validator ConstructCmdValidator, messenger ConstructMessenger) *ConstructCmd { - return &ConstructCmd{ctx: ctx, prepFactory: prepFactory, managerFactory: managerFactory, validator: validator, messenger: messenger} +func NewConstructCmd(ctx context.Context, prepFactory VMPreparerFactory, managerFactory ManagerFactory, validator ConstructCmdValidator, messenger messenger.Messenger) *ConstructCmd { + return &ConstructCmd{ + ctx: ctx, + prepFactory: prepFactory, + managerFactory: managerFactory, + validator: validator, + messenger: messenger, + } } func (*ConstructCmd) Name() string { return "construct" } @@ -130,11 +129,11 @@ func (p *ConstructCmd) SetFlags(f *flag.FlagSet) { func (p *ConstructCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { c := p.sourceConfig if !p.validator.PopulatedArgs(c.GuestVmIp, c.GuestVMUsername, c.GuestVMPassword, c.VCenterUrl, c.VCenterUsername, c.VCenterPassword, c.VmInventoryPath) { - p.messenger.ArgumentsNotProvided() + p.messenger.PrintErr("Not all required parameters were provided. See stembuild --help for more details") return subcommands.ExitFailure } if !p.validator.LGPOInDirectory() { - p.messenger.LGPONotFound() + p.messenger.PrintErr("Could not find LGPO.zip in the current directory") return subcommands.ExitFailure } @@ -149,19 +148,19 @@ func (p *ConstructCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interfac vCenterManager, err := p.managerFactory.VCenterManager(p.ctx) if err != nil { - p.messenger.CannotPrepareVM(err) + p.messenger.PrintErr(fmt.Sprintf("Cannot connect to VM: %s", err)) return subcommands.ExitFailure } - vmConstruct, err := p.prepFactory.New(p.sourceConfig, vCenterManager) + vmConstruct, err := p.prepFactory.New(p.sourceConfig, vCenterManager, p.messenger) if err != nil { - p.messenger.CannotPrepareVM(err) + p.messenger.PrintErr(fmt.Sprintf("Could not prepare VM: %s", err)) return subcommands.ExitFailure } err = vmConstruct.PrepareVM() if err != nil { - p.messenger.CannotPrepareVM(err) + p.messenger.PrintErr(fmt.Sprintf("Could not prepare VM: %s", err)) return subcommands.ExitFailure } diff --git a/stembuild/commandparser/construct_messenger.go b/stembuild/commandparser/construct_messenger.go deleted file mode 100644 index 9fa802823..000000000 --- a/stembuild/commandparser/construct_messenger.go +++ /dev/null @@ -1,30 +0,0 @@ -package commandparser - -import ( - "fmt" - "io" -) - -type ConstructCmdMessenger struct { - OutputChannel io.Writer -} - -func (m *ConstructCmdMessenger) printMessage(message string) { - fmt.Fprintln(m.OutputChannel, message) //nolint:errcheck -} - -func (m *ConstructCmdMessenger) ArgumentsNotProvided() { - m.printMessage("Not all required parameters were provided. See stembuild --help for more details") -} - -func (m *ConstructCmdMessenger) LGPONotFound() { - m.printMessage("Could not find LGPO.zip in the current directory") -} - -func (m *ConstructCmdMessenger) CannotConnectToVM(err error) { - m.printMessage(fmt.Sprintf("Cannot connect to VM: %s", err)) -} - -func (m *ConstructCmdMessenger) CannotPrepareVM(err error) { - m.printMessage(fmt.Sprintf("Could not prepare VM: %s", err)) -} diff --git a/stembuild/commandparser/construct_messenger_test.go b/stembuild/commandparser/construct_messenger_test.go deleted file mode 100644 index 53b6ff884..000000000 --- a/stembuild/commandparser/construct_messenger_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package commandparser_test - -import ( - "errors" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gbytes" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" -) - -var _ = Describe("ConstructMessenger", func() { - var ( - cm commandparser.ConstructCmdMessenger - g *Buffer - ) - - BeforeEach(func() { - g = NewBuffer() - cm = commandparser.ConstructCmdMessenger{OutputChannel: g} - }) - - Describe("ArgumentsNotProvided", func() { - It("should output an appropriate error", func() { - cm.ArgumentsNotProvided() - Eventually(g).Should(Say("Not all required parameters were provided. See stembuild --help for more details")) - }) - }) - - Describe("LGPONotFound", func() { - It("should output an appropriate error", func() { - cm.LGPONotFound() - Eventually(g).Should(Say("Could not find LGPO.zip in the current directory")) - }) - }) - - Describe("CannotConnectToVM", func() { - It("should output an appropriate error", func() { - connectionError := errors.New("some connection error") - cm.CannotConnectToVM(connectionError) - Eventually(g).Should(Say("Cannot connect to VM: %s", connectionError)) - }) - }) - - Describe("CannotPrepareVM", func() { - It("should output an appropriate error", func() { - preparationError := errors.New("PrepareVM failed") - cm.CannotPrepareVM(preparationError) - Eventually(g).Should(Say("Could not prepare VM: %s", preparationError)) - }) - }) -}) diff --git a/stembuild/commandparser/construct_test.go b/stembuild/commandparser/construct_test.go index 908faea2b..fbc599481 100644 --- a/stembuild/commandparser/construct_test.go +++ b/stembuild/commandparser/construct_test.go @@ -4,10 +4,13 @@ import ( "context" "errors" "flag" + "fmt" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/google/subcommands" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gbytes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser/commandparserfakes" @@ -137,16 +140,21 @@ var _ = Describe("construct", func() { Describe("Execute", func() { - var f *flag.FlagSet - var gf *commandparser.GlobalFlags - var ConstrCmd *commandparser.ConstructCmd - var emptyContext context.Context + var ( + f *flag.FlagSet + gf *commandparser.GlobalFlags + + ConstrCmd *commandparser.ConstructCmd + emptyContext context.Context - var fakeFactory *commandparserfakes.FakeVMPreparerFactory - var fakeVmConstruct *commandparserfakes.FakeVmConstruct - var fakeValidator *commandparserfakes.FakeConstructCmdValidator - var fakeMessenger *commandparserfakes.FakeConstructMessenger - var fakeManagerFactory *commandparserfakes.FakeManagerFactory + outBuf *Buffer + errBuf *Buffer + + fakeFactory *commandparserfakes.FakeVMPreparerFactory + fakeVmConstruct *commandparserfakes.FakeVmConstruct + fakeValidator *commandparserfakes.FakeConstructCmdValidator + fakeManagerFactory *commandparserfakes.FakeManagerFactory + ) BeforeEach(func() { f = flag.NewFlagSet("test", flag.ExitOnError) @@ -155,11 +163,14 @@ var _ = Describe("construct", func() { fakeFactory = &commandparserfakes.FakeVMPreparerFactory{} fakeVmConstruct = &commandparserfakes.FakeVmConstruct{} fakeValidator = &commandparserfakes.FakeConstructCmdValidator{} - fakeMessenger = &commandparserfakes.FakeConstructMessenger{} fakeManagerFactory = &commandparserfakes.FakeManagerFactory{} fakeFactory.NewReturns(fakeVmConstruct, nil) - ConstrCmd = commandparser.NewConstructCmd(context.Background(), fakeFactory, fakeManagerFactory, fakeValidator, fakeMessenger) + outBuf = NewBuffer() + errBuf = NewBuffer() + stembuildMessenger := messenger.NewStembuildMessenger(outBuf, errBuf) + + ConstrCmd = commandparser.NewConstructCmd(context.Background(), fakeFactory, fakeManagerFactory, fakeValidator, stembuildMessenger) ConstrCmd.SetFlags(f) ConstrCmd.GlobalFlags = gf emptyContext = context.Background() @@ -185,7 +196,7 @@ var _ = Describe("construct", func() { exitStatus := ConstrCmd.Execute(emptyContext, f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) - Expect(fakeMessenger.ArgumentsNotProvidedCallCount()).To(Equal(1)) + Eventually(errBuf).Should(Say("Not all required parameters were provided. See stembuild --help for more details")) }) }) @@ -197,7 +208,7 @@ var _ = Describe("construct", func() { exitStatus := ConstrCmd.Execute(emptyContext, f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) - Expect(fakeMessenger.LGPONotFoundCallCount()).To(Equal(1)) + Eventually(errBuf).Should(Say("Could not find LGPO.zip in the current directory")) }) }) @@ -205,12 +216,13 @@ var _ = Describe("construct", func() { It("should return an error", func() { fakeValidator.PopulatedArgsReturns(true) fakeValidator.LGPOInDirectoryReturns(true) - fakeVmConstruct.PrepareVMReturns(errors.New("some error")) + prepareVmErr := errors.New("fake-prepare-error") + fakeVmConstruct.PrepareVMReturns(prepareVmErr) exitStatus := ConstrCmd.Execute(emptyContext, f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) - Expect(fakeMessenger.CannotPrepareVMCallCount()).To(Equal(1)) + Eventually(errBuf).Should(Say(fmt.Sprintf("Could not prepare VM: %s", prepareVmErr))) }) }) }) diff --git a/stembuild/commandparser/package_messenger.go b/stembuild/commandparser/package_messenger.go deleted file mode 100644 index 1f10251ae..000000000 --- a/stembuild/commandparser/package_messenger.go +++ /dev/null @@ -1,31 +0,0 @@ -package commandparser - -import ( - "fmt" - "io" -) - -type PackageMessenger struct { - Output io.Writer -} - -func (m *PackageMessenger) InvalidOutputConfig(e error) { - fmt.Fprintln(m.Output, e) //nolint:errcheck -} - -func (m *PackageMessenger) CannotCreatePackager(e error) { - fmt.Fprintln(m.Output, e) //nolint:errcheck -} - -func (m *PackageMessenger) DoesNotHaveEnoughSpace(e error) { - fmt.Fprintln(m.Output, e) //nolint:errcheck -} - -func (m *PackageMessenger) SourceParametersAreInvalid(e error) { - fmt.Fprintln(m.Output, e) //nolint:errcheck -} - -func (m *PackageMessenger) PackageFailed(e error) { - fmt.Fprintln(m.Output, e) //nolint:errcheck - fmt.Fprintln(m.Output, "Please provide the error logs to bosh-windows-eng@pivotal.io") //nolint:errcheck -} diff --git a/stembuild/commandparser/package_messenger_test.go b/stembuild/commandparser/package_messenger_test.go deleted file mode 100644 index df52ac452..000000000 --- a/stembuild/commandparser/package_messenger_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package commandparser_test - -import ( - "errors" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gbytes" -) - -var _ = Describe("PackageMessenger", func() { - var ( - buf *Buffer - messenger *commandparser.PackageMessenger - ) - - BeforeEach(func() { - buf = NewBuffer() - messenger = &commandparser.PackageMessenger{Output: buf} - }) - - It("writes the error message to the write when InvalidOutputConfig is called", func() { - message := "the output config is invalid" - messenger.InvalidOutputConfig(errors.New(message)) - Eventually(buf).Should(Say(message)) - }) - - It("writes the error message to the writer when CannotCreatePackager is called", func() { - message := "there was a problem creating a packager" - messenger.CannotCreatePackager(errors.New(message)) - Eventually(buf).Should(Say(message)) - }) - - It("writes the error message to the writer when DoesNotHaveEnoughSpace is called", func() { - message := "not enough space to create package" - messenger.DoesNotHaveEnoughSpace(errors.New(message)) - Eventually(buf).Should(Say(message)) - }) - - It("writes the error message to the writer when SourceParametersAreInvalid is called", func() { - message := "source parameters invalid" - messenger.SourceParametersAreInvalid(errors.New(message)) - Eventually(buf).Should(Say(message)) - }) - - It("writes the error messages to the writer when PackageFailed is called", func() { - message := "package failed" - messenger.PackageFailed(errors.New(message)) - Eventually(buf).Should(Say(message)) - Eventually(buf).Should(Say("Please provide the error logs to bosh-windows-eng@pivotal.io")) - }) -}) diff --git a/stembuild/commandparser/package_stemcell.go b/stembuild/commandparser/package_stemcell.go index 271177a23..ae5497bed 100644 --- a/stembuild/commandparser/package_stemcell.go +++ b/stembuild/commandparser/package_stemcell.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/google/subcommands" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" @@ -23,7 +24,7 @@ type OSAndVersionGetter interface { //counterfeiter:generate . PackagerFactory type PackagerFactory interface { - NewPackager(sourceConfig config.SourceConfig, outputConfig config.OutputConfig, logger colorlogger.Logger) (Packager, error) + NewPackager(sourceConfig config.SourceConfig, outputConfig config.OutputConfig, logger colorlogger.Logger, messenger messenger.Messenger) (Packager, error) } //counterfeiter:generate . Packager @@ -33,29 +34,22 @@ type Packager interface { ValidateSourceParameters() error } -//counterfeiter:generate . PackagerMessenger -type PackagerMessenger interface { - InvalidOutputConfig(error) - CannotCreatePackager(error) - DoesNotHaveEnoughSpace(error) - SourceParametersAreInvalid(error) - PackageFailed(error) -} - type PackageCmd struct { GlobalFlags *GlobalFlags sourceConfig config.SourceConfig outputConfig config.OutputConfig osAndVersionGetter OSAndVersionGetter packagerFactory PackagerFactory - packagerMessenger PackagerMessenger + logger colorlogger.Logger + messenger messenger.Messenger } -func NewPackageCommand(o OSAndVersionGetter, p PackagerFactory, m PackagerMessenger) *PackageCmd { +func NewPackageCommand(o OSAndVersionGetter, p PackagerFactory, logger colorlogger.Logger, messenger messenger.Messenger) *PackageCmd { return &PackageCmd{ osAndVersionGetter: o, packagerFactory: p, - packagerMessenger: m, + logger: logger, + messenger: messenger, } } @@ -115,41 +109,35 @@ func (p *PackageCmd) SetFlags(f *flag.FlagSet) { } func (p *PackageCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - - logLevel := colorlogger.NONE - if p.GlobalFlags.Debug { - logLevel = colorlogger.DEBUG - } - p.setOSandStemcellVersions() err := p.outputConfig.ValidateConfig() if err != nil { - p.packagerMessenger.InvalidOutputConfig(err) + p.messenger.PrintErr(err.Error()) return subcommands.ExitFailure } - logger := colorlogger.New(logLevel, p.GlobalFlags.Color, os.Stderr) - packager, err := p.packagerFactory.NewPackager(p.sourceConfig, p.outputConfig, logger) + packager, err := p.packagerFactory.NewPackager(p.sourceConfig, p.outputConfig, p.logger, p.messenger) if err != nil { - p.packagerMessenger.CannotCreatePackager(err) + p.messenger.PrintErr(err.Error()) return subcommands.ExitFailure } err = packager.ValidateFreeSpaceForPackage(&filesystem.OSFileSystem{}) if err != nil { - p.packagerMessenger.DoesNotHaveEnoughSpace(err) + p.messenger.PrintErr(err.Error()) return subcommands.ExitFailure } err = packager.ValidateSourceParameters() if err != nil { - p.packagerMessenger.SourceParametersAreInvalid(err) + p.messenger.PrintErr(err.Error()) return subcommands.ExitFailure } - if err := packager.Package(); err != nil { - p.packagerMessenger.PackageFailed(err) + err = packager.Package() + if err != nil { + p.messenger.PrintErr(err.Error()) return subcommands.ExitFailure } diff --git a/stembuild/commandparser/package_stemcell_test.go b/stembuild/commandparser/package_stemcell_test.go index a370b3ef8..8babbd7dc 100644 --- a/stembuild/commandparser/package_stemcell_test.go +++ b/stembuild/commandparser/package_stemcell_test.go @@ -4,13 +4,17 @@ import ( "context" "errors" "flag" + "fmt" "github.com/google/subcommands" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gbytes" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser/commandparserfakes" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" ) var _ = Describe("package_stemcell", func() { @@ -20,31 +24,37 @@ var _ = Describe("package_stemcell", func() { Describe("SetFlags", func() { var ( - f *flag.FlagSet - PkgCmd *commandparser.PackageCmd + f *flag.FlagSet + packageCmd *commandparser.PackageCmd + + outBuf *Buffer + errBuf *Buffer oSAndVersionGetter *commandparserfakes.FakeOSAndVersionGetter packagerFactory *commandparserfakes.FakePackagerFactory packager *commandparserfakes.FakePackager - packagerMessenger *commandparserfakes.FakePackagerMessenger ) BeforeEach(func() { f = flag.NewFlagSet("test", flag.ContinueOnError) - oSAndVersionGetter = new(commandparserfakes.FakeOSAndVersionGetter) - packagerFactory = new(commandparserfakes.FakePackagerFactory) + outBuf = NewBuffer() + errBuf = NewBuffer() + packager = new(commandparserfakes.FakePackager) - packagerMessenger = new(commandparserfakes.FakePackagerMessenger) + oSAndVersionGetter = new(commandparserfakes.FakeOSAndVersionGetter) + packagerFactory = new(commandparserfakes.FakePackagerFactory) packagerFactory.NewPackagerReturns(packager, nil) + logger := colorlogger.New(0, false, GinkgoWriter) + stembuildMessenger := messenger.NewStembuildMessenger(outBuf, errBuf) - PkgCmd = commandparser.NewPackageCommand(oSAndVersionGetter, packagerFactory, packagerMessenger) - PkgCmd.SetFlags(f) - PkgCmd.GlobalFlags = &commandparser.GlobalFlags{} + packageCmd = commandparser.NewPackageCommand(oSAndVersionGetter, packagerFactory, logger, stembuildMessenger) + packageCmd.SetFlags(f) + packageCmd.GlobalFlags = &commandparser.GlobalFlags{} }) - var defaultArgs = []string{} + var defaultArgs []string Describe("Execute", func() { BeforeEach(func() { @@ -58,11 +68,11 @@ var _ = Describe("package_stemcell", func() { err := f.Parse(vmdkArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitSuccess)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) - actualSourceConfig, _, _ := packagerFactory.NewPackagerArgsForCall(0) + actualSourceConfig, _, _, _ := packagerFactory.NewPackagerArgsForCall(0) Expect(actualSourceConfig.Vmdk).To(Equal("some_vmdk_file")) }) @@ -78,11 +88,11 @@ var _ = Describe("package_stemcell", func() { err := f.Parse(vcenterArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitSuccess)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) - actualSourceConfig, _, _ := packagerFactory.NewPackagerArgsForCall(0) + actualSourceConfig, _, _, _ := packagerFactory.NewPackagerArgsForCall(0) Expect(actualSourceConfig.URL).To(Equal("https://vcenter.test")) Expect(actualSourceConfig.Username).To(Equal("test-user")) Expect(actualSourceConfig.Password).To(Equal("verysecure")) @@ -96,11 +106,11 @@ var _ = Describe("package_stemcell", func() { err := f.Parse(longformOutputDirArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitSuccess)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) - _, actualOutputConfig, _ := packagerFactory.NewPackagerArgsForCall(0) + _, actualOutputConfig, _, _ := packagerFactory.NewPackagerArgsForCall(0) Expect(actualOutputConfig.OutputDir).To(Equal("some_output_dir")) }) @@ -110,11 +120,11 @@ var _ = Describe("package_stemcell", func() { err := f.Parse(shortformOutputDirArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitSuccess)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) - _, actualOutputConfig, _ := packagerFactory.NewPackagerArgsForCall(0) + _, actualOutputConfig, _, _ := packagerFactory.NewPackagerArgsForCall(0) Expect(actualOutputConfig.OutputDir).To(Equal("some_output_dir")) Expect(actualOutputConfig.StemcellVersion).To(Equal("2019.2")) Expect(actualOutputConfig.Os).To(Equal("2019")) @@ -128,11 +138,11 @@ var _ = Describe("package_stemcell", func() { err := f.Parse(args) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitSuccess)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) - _, actualOutputConfig, _ := packagerFactory.NewPackagerArgsForCall(0) + _, actualOutputConfig, _, _ := packagerFactory.NewPackagerArgsForCall(0) Expect(actualOutputConfig.StemcellVersion).To(Equal("1803.27.36")) Expect(oSAndVersionGetter.GetVersionWithPatchNumberCallCount()).To(Equal(1)) @@ -141,86 +151,82 @@ var _ = Describe("package_stemcell", func() { }) It("package is not called if the OS is invalid", func() { - oSAndVersionGetter.GetOsReturns("2017") + getOsReturnValue := "2017" + oSAndVersionGetter.GetOsReturns(getOsReturnValue) err := f.Parse(defaultArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) Expect(packager.PackageCallCount()).To(Equal(0)) - Expect(packagerMessenger.InvalidOutputConfigCallCount()).To(Equal(1)) - receivedError := packagerMessenger.InvalidOutputConfigArgsForCall(0) - Expect(receivedError.Error()).To(MatchRegexp("2017")) + expectedMessage := fmt.Sprintf("versioning error; parsed os version is: %s", getOsReturnValue) + Eventually(errBuf).Should(Say(expectedMessage)) }) It("package is not called if the packager factory returns an error", func() { - packagerFactory.NewPackagerReturns(nil, errors.New("Couldn't make a packager!")) + newPackagerErr := errors.New("fake-new-packager-error") + packagerFactory.NewPackagerReturns(nil, newPackagerErr) err := f.Parse(defaultArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) Expect(packagerFactory.NewPackagerCallCount()).To(Equal(1)) Expect(packager.PackageCallCount()).To(Equal(0)) - Expect(packagerMessenger.CannotCreatePackagerCallCount()).To(Equal(1)) - receivedError := packagerMessenger.CannotCreatePackagerArgsForCall(0) - Expect(receivedError).To(MatchError("Couldn't make a packager!")) + Eventually(errBuf).Should(Say(newPackagerErr.Error())) }) It("package is not called if there is no free space", func() { - packager.ValidateFreeSpaceForPackageReturns(errors.New("No space!")) + validateFreeSpaceErr := errors.New("fake-validate-free-space-error") + packager.ValidateFreeSpaceForPackageReturns(validateFreeSpaceErr) err := f.Parse(defaultArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) Expect(packager.ValidateFreeSpaceForPackageCallCount()).To(Equal(1)) Expect(packager.PackageCallCount()).To(Equal(0)) - Expect(packagerMessenger.DoesNotHaveEnoughSpaceCallCount()).To(Equal(1)) - receivedError := packagerMessenger.DoesNotHaveEnoughSpaceArgsForCall(0) - Expect(receivedError).To(MatchError("No space!")) + Eventually(errBuf).Should(Say(validateFreeSpaceErr.Error())) }) It("package is not called if source parameters are not valid", func() { - packager.ValidateSourceParametersReturns(errors.New("invalid source parameters")) + validateSourceParamsErr := errors.New("fake-invalid-source-params-error") + packager.ValidateSourceParametersReturns(validateSourceParamsErr) err := f.Parse(defaultArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) Expect(packager.ValidateSourceParametersCallCount()).To(Equal(1)) Expect(packager.PackageCallCount()).To(Equal(0)) - Expect(packagerMessenger.SourceParametersAreInvalidCallCount()).To(Equal(1)) - receivedError := packagerMessenger.SourceParametersAreInvalidArgsForCall(0) - Expect(receivedError).To(MatchError("invalid source parameters")) + Eventually(errBuf).Should(Say(validateSourceParamsErr.Error())) }) It("exits with failure if package returns an error", func() { - packager.PackageReturns(errors.New("Didn't make it")) + packageErr := errors.New("fake-package-error") + packager.PackageReturns(packageErr) err := f.Parse(defaultArgs) Expect(err).ToNot(HaveOccurred()) - exitStatus := PkgCmd.Execute(context.Background(), f) + exitStatus := packageCmd.Execute(context.Background(), f) Expect(exitStatus).To(Equal(subcommands.ExitFailure)) Expect(packager.PackageCallCount()).To(Equal(1)) - Expect(packagerMessenger.PackageFailedCallCount()).To(Equal(1)) - receivedError := packagerMessenger.PackageFailedArgsForCall(0) - Expect(receivedError).To(MatchError("Didn't make it")) + Eventually(errBuf).Should(Say(packageErr.Error())) }) }) }) diff --git a/stembuild/construct/constructfakes/fake_construct_messenger.go b/stembuild/construct/constructfakes/fake_construct_messenger.go deleted file mode 100644 index 437b2f376..000000000 --- a/stembuild/construct/constructfakes/fake_construct_messenger.go +++ /dev/null @@ -1,727 +0,0 @@ -// Code generated by counterfeiter. DO NOT EDIT. -package constructfakes - -import ( - "sync" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" -) - -type FakeConstructMessenger struct { - CreateProvisionDirStartedStub func() - createProvisionDirStartedMutex sync.RWMutex - createProvisionDirStartedArgsForCall []struct { - } - CreateProvisionDirSucceededStub func() - createProvisionDirSucceededMutex sync.RWMutex - createProvisionDirSucceededArgsForCall []struct { - } - EnableWinRMStartedStub func() - enableWinRMStartedMutex sync.RWMutex - enableWinRMStartedArgsForCall []struct { - } - EnableWinRMSucceededStub func() - enableWinRMSucceededMutex sync.RWMutex - enableWinRMSucceededArgsForCall []struct { - } - ExecutePostRebootScriptStartedStub func() - executePostRebootScriptStartedMutex sync.RWMutex - executePostRebootScriptStartedArgsForCall []struct { - } - ExecutePostRebootScriptSucceededStub func() - executePostRebootScriptSucceededMutex sync.RWMutex - executePostRebootScriptSucceededArgsForCall []struct { - } - ExecutePostRebootWarningStub func(string) - executePostRebootWarningMutex sync.RWMutex - executePostRebootWarningArgsForCall []struct { - arg1 string - } - ExecuteSetupScriptStartedStub func() - executeSetupScriptStartedMutex sync.RWMutex - executeSetupScriptStartedArgsForCall []struct { - } - ExecuteSetupScriptSucceededStub func() - executeSetupScriptSucceededMutex sync.RWMutex - executeSetupScriptSucceededArgsForCall []struct { - } - ExtractArtifactsStartedStub func() - extractArtifactsStartedMutex sync.RWMutex - extractArtifactsStartedArgsForCall []struct { - } - ExtractArtifactsSucceededStub func() - extractArtifactsSucceededMutex sync.RWMutex - extractArtifactsSucceededArgsForCall []struct { - } - LogOutUsersStartedStub func() - logOutUsersStartedMutex sync.RWMutex - logOutUsersStartedArgsForCall []struct { - } - LogOutUsersSucceededStub func() - logOutUsersSucceededMutex sync.RWMutex - logOutUsersSucceededArgsForCall []struct { - } - RebootHasFinishedStub func() - rebootHasFinishedMutex sync.RWMutex - rebootHasFinishedArgsForCall []struct { - } - RebootHasStartedStub func() - rebootHasStartedMutex sync.RWMutex - rebootHasStartedArgsForCall []struct { - } - ShutdownCompletedStub func() - shutdownCompletedMutex sync.RWMutex - shutdownCompletedArgsForCall []struct { - } - UploadArtifactsStartedStub func() - uploadArtifactsStartedMutex sync.RWMutex - uploadArtifactsStartedArgsForCall []struct { - } - UploadArtifactsSucceededStub func() - uploadArtifactsSucceededMutex sync.RWMutex - uploadArtifactsSucceededArgsForCall []struct { - } - UploadFileStartedStub func(string) - uploadFileStartedMutex sync.RWMutex - uploadFileStartedArgsForCall []struct { - arg1 string - } - UploadFileSucceededStub func() - uploadFileSucceededMutex sync.RWMutex - uploadFileSucceededArgsForCall []struct { - } - ValidateVMConnectionStartedStub func() - validateVMConnectionStartedMutex sync.RWMutex - validateVMConnectionStartedArgsForCall []struct { - } - ValidateVMConnectionSucceededStub func() - validateVMConnectionSucceededMutex sync.RWMutex - validateVMConnectionSucceededArgsForCall []struct { - } - WaitingForShutdownStub func() - waitingForShutdownMutex sync.RWMutex - waitingForShutdownArgsForCall []struct { - } - WinRMDisconnectedForRebootStub func() - winRMDisconnectedForRebootMutex sync.RWMutex - winRMDisconnectedForRebootArgsForCall []struct { - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *FakeConstructMessenger) CreateProvisionDirStarted() { - fake.createProvisionDirStartedMutex.Lock() - fake.createProvisionDirStartedArgsForCall = append(fake.createProvisionDirStartedArgsForCall, struct { - }{}) - stub := fake.CreateProvisionDirStartedStub - fake.recordInvocation("CreateProvisionDirStarted", []interface{}{}) - fake.createProvisionDirStartedMutex.Unlock() - if stub != nil { - fake.CreateProvisionDirStartedStub() - } -} - -func (fake *FakeConstructMessenger) CreateProvisionDirStartedCallCount() int { - fake.createProvisionDirStartedMutex.RLock() - defer fake.createProvisionDirStartedMutex.RUnlock() - return len(fake.createProvisionDirStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) CreateProvisionDirStartedCalls(stub func()) { - fake.createProvisionDirStartedMutex.Lock() - defer fake.createProvisionDirStartedMutex.Unlock() - fake.CreateProvisionDirStartedStub = stub -} - -func (fake *FakeConstructMessenger) CreateProvisionDirSucceeded() { - fake.createProvisionDirSucceededMutex.Lock() - fake.createProvisionDirSucceededArgsForCall = append(fake.createProvisionDirSucceededArgsForCall, struct { - }{}) - stub := fake.CreateProvisionDirSucceededStub - fake.recordInvocation("CreateProvisionDirSucceeded", []interface{}{}) - fake.createProvisionDirSucceededMutex.Unlock() - if stub != nil { - fake.CreateProvisionDirSucceededStub() - } -} - -func (fake *FakeConstructMessenger) CreateProvisionDirSucceededCallCount() int { - fake.createProvisionDirSucceededMutex.RLock() - defer fake.createProvisionDirSucceededMutex.RUnlock() - return len(fake.createProvisionDirSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) CreateProvisionDirSucceededCalls(stub func()) { - fake.createProvisionDirSucceededMutex.Lock() - defer fake.createProvisionDirSucceededMutex.Unlock() - fake.CreateProvisionDirSucceededStub = stub -} - -func (fake *FakeConstructMessenger) EnableWinRMStarted() { - fake.enableWinRMStartedMutex.Lock() - fake.enableWinRMStartedArgsForCall = append(fake.enableWinRMStartedArgsForCall, struct { - }{}) - stub := fake.EnableWinRMStartedStub - fake.recordInvocation("EnableWinRMStarted", []interface{}{}) - fake.enableWinRMStartedMutex.Unlock() - if stub != nil { - fake.EnableWinRMStartedStub() - } -} - -func (fake *FakeConstructMessenger) EnableWinRMStartedCallCount() int { - fake.enableWinRMStartedMutex.RLock() - defer fake.enableWinRMStartedMutex.RUnlock() - return len(fake.enableWinRMStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) EnableWinRMStartedCalls(stub func()) { - fake.enableWinRMStartedMutex.Lock() - defer fake.enableWinRMStartedMutex.Unlock() - fake.EnableWinRMStartedStub = stub -} - -func (fake *FakeConstructMessenger) EnableWinRMSucceeded() { - fake.enableWinRMSucceededMutex.Lock() - fake.enableWinRMSucceededArgsForCall = append(fake.enableWinRMSucceededArgsForCall, struct { - }{}) - stub := fake.EnableWinRMSucceededStub - fake.recordInvocation("EnableWinRMSucceeded", []interface{}{}) - fake.enableWinRMSucceededMutex.Unlock() - if stub != nil { - fake.EnableWinRMSucceededStub() - } -} - -func (fake *FakeConstructMessenger) EnableWinRMSucceededCallCount() int { - fake.enableWinRMSucceededMutex.RLock() - defer fake.enableWinRMSucceededMutex.RUnlock() - return len(fake.enableWinRMSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) EnableWinRMSucceededCalls(stub func()) { - fake.enableWinRMSucceededMutex.Lock() - defer fake.enableWinRMSucceededMutex.Unlock() - fake.EnableWinRMSucceededStub = stub -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptStarted() { - fake.executePostRebootScriptStartedMutex.Lock() - fake.executePostRebootScriptStartedArgsForCall = append(fake.executePostRebootScriptStartedArgsForCall, struct { - }{}) - stub := fake.ExecutePostRebootScriptStartedStub - fake.recordInvocation("ExecutePostRebootScriptStarted", []interface{}{}) - fake.executePostRebootScriptStartedMutex.Unlock() - if stub != nil { - fake.ExecutePostRebootScriptStartedStub() - } -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptStartedCallCount() int { - fake.executePostRebootScriptStartedMutex.RLock() - defer fake.executePostRebootScriptStartedMutex.RUnlock() - return len(fake.executePostRebootScriptStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptStartedCalls(stub func()) { - fake.executePostRebootScriptStartedMutex.Lock() - defer fake.executePostRebootScriptStartedMutex.Unlock() - fake.ExecutePostRebootScriptStartedStub = stub -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptSucceeded() { - fake.executePostRebootScriptSucceededMutex.Lock() - fake.executePostRebootScriptSucceededArgsForCall = append(fake.executePostRebootScriptSucceededArgsForCall, struct { - }{}) - stub := fake.ExecutePostRebootScriptSucceededStub - fake.recordInvocation("ExecutePostRebootScriptSucceeded", []interface{}{}) - fake.executePostRebootScriptSucceededMutex.Unlock() - if stub != nil { - fake.ExecutePostRebootScriptSucceededStub() - } -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptSucceededCallCount() int { - fake.executePostRebootScriptSucceededMutex.RLock() - defer fake.executePostRebootScriptSucceededMutex.RUnlock() - return len(fake.executePostRebootScriptSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) ExecutePostRebootScriptSucceededCalls(stub func()) { - fake.executePostRebootScriptSucceededMutex.Lock() - defer fake.executePostRebootScriptSucceededMutex.Unlock() - fake.ExecutePostRebootScriptSucceededStub = stub -} - -func (fake *FakeConstructMessenger) ExecutePostRebootWarning(arg1 string) { - fake.executePostRebootWarningMutex.Lock() - fake.executePostRebootWarningArgsForCall = append(fake.executePostRebootWarningArgsForCall, struct { - arg1 string - }{arg1}) - stub := fake.ExecutePostRebootWarningStub - fake.recordInvocation("ExecutePostRebootWarning", []interface{}{arg1}) - fake.executePostRebootWarningMutex.Unlock() - if stub != nil { - fake.ExecutePostRebootWarningStub(arg1) - } -} - -func (fake *FakeConstructMessenger) ExecutePostRebootWarningCallCount() int { - fake.executePostRebootWarningMutex.RLock() - defer fake.executePostRebootWarningMutex.RUnlock() - return len(fake.executePostRebootWarningArgsForCall) -} - -func (fake *FakeConstructMessenger) ExecutePostRebootWarningCalls(stub func(string)) { - fake.executePostRebootWarningMutex.Lock() - defer fake.executePostRebootWarningMutex.Unlock() - fake.ExecutePostRebootWarningStub = stub -} - -func (fake *FakeConstructMessenger) ExecutePostRebootWarningArgsForCall(i int) string { - fake.executePostRebootWarningMutex.RLock() - defer fake.executePostRebootWarningMutex.RUnlock() - argsForCall := fake.executePostRebootWarningArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptStarted() { - fake.executeSetupScriptStartedMutex.Lock() - fake.executeSetupScriptStartedArgsForCall = append(fake.executeSetupScriptStartedArgsForCall, struct { - }{}) - stub := fake.ExecuteSetupScriptStartedStub - fake.recordInvocation("ExecuteSetupScriptStarted", []interface{}{}) - fake.executeSetupScriptStartedMutex.Unlock() - if stub != nil { - fake.ExecuteSetupScriptStartedStub() - } -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptStartedCallCount() int { - fake.executeSetupScriptStartedMutex.RLock() - defer fake.executeSetupScriptStartedMutex.RUnlock() - return len(fake.executeSetupScriptStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptStartedCalls(stub func()) { - fake.executeSetupScriptStartedMutex.Lock() - defer fake.executeSetupScriptStartedMutex.Unlock() - fake.ExecuteSetupScriptStartedStub = stub -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptSucceeded() { - fake.executeSetupScriptSucceededMutex.Lock() - fake.executeSetupScriptSucceededArgsForCall = append(fake.executeSetupScriptSucceededArgsForCall, struct { - }{}) - stub := fake.ExecuteSetupScriptSucceededStub - fake.recordInvocation("ExecuteSetupScriptSucceeded", []interface{}{}) - fake.executeSetupScriptSucceededMutex.Unlock() - if stub != nil { - fake.ExecuteSetupScriptSucceededStub() - } -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptSucceededCallCount() int { - fake.executeSetupScriptSucceededMutex.RLock() - defer fake.executeSetupScriptSucceededMutex.RUnlock() - return len(fake.executeSetupScriptSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) ExecuteSetupScriptSucceededCalls(stub func()) { - fake.executeSetupScriptSucceededMutex.Lock() - defer fake.executeSetupScriptSucceededMutex.Unlock() - fake.ExecuteSetupScriptSucceededStub = stub -} - -func (fake *FakeConstructMessenger) ExtractArtifactsStarted() { - fake.extractArtifactsStartedMutex.Lock() - fake.extractArtifactsStartedArgsForCall = append(fake.extractArtifactsStartedArgsForCall, struct { - }{}) - stub := fake.ExtractArtifactsStartedStub - fake.recordInvocation("ExtractArtifactsStarted", []interface{}{}) - fake.extractArtifactsStartedMutex.Unlock() - if stub != nil { - fake.ExtractArtifactsStartedStub() - } -} - -func (fake *FakeConstructMessenger) ExtractArtifactsStartedCallCount() int { - fake.extractArtifactsStartedMutex.RLock() - defer fake.extractArtifactsStartedMutex.RUnlock() - return len(fake.extractArtifactsStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) ExtractArtifactsStartedCalls(stub func()) { - fake.extractArtifactsStartedMutex.Lock() - defer fake.extractArtifactsStartedMutex.Unlock() - fake.ExtractArtifactsStartedStub = stub -} - -func (fake *FakeConstructMessenger) ExtractArtifactsSucceeded() { - fake.extractArtifactsSucceededMutex.Lock() - fake.extractArtifactsSucceededArgsForCall = append(fake.extractArtifactsSucceededArgsForCall, struct { - }{}) - stub := fake.ExtractArtifactsSucceededStub - fake.recordInvocation("ExtractArtifactsSucceeded", []interface{}{}) - fake.extractArtifactsSucceededMutex.Unlock() - if stub != nil { - fake.ExtractArtifactsSucceededStub() - } -} - -func (fake *FakeConstructMessenger) ExtractArtifactsSucceededCallCount() int { - fake.extractArtifactsSucceededMutex.RLock() - defer fake.extractArtifactsSucceededMutex.RUnlock() - return len(fake.extractArtifactsSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) ExtractArtifactsSucceededCalls(stub func()) { - fake.extractArtifactsSucceededMutex.Lock() - defer fake.extractArtifactsSucceededMutex.Unlock() - fake.ExtractArtifactsSucceededStub = stub -} - -func (fake *FakeConstructMessenger) LogOutUsersStarted() { - fake.logOutUsersStartedMutex.Lock() - fake.logOutUsersStartedArgsForCall = append(fake.logOutUsersStartedArgsForCall, struct { - }{}) - stub := fake.LogOutUsersStartedStub - fake.recordInvocation("LogOutUsersStarted", []interface{}{}) - fake.logOutUsersStartedMutex.Unlock() - if stub != nil { - fake.LogOutUsersStartedStub() - } -} - -func (fake *FakeConstructMessenger) LogOutUsersStartedCallCount() int { - fake.logOutUsersStartedMutex.RLock() - defer fake.logOutUsersStartedMutex.RUnlock() - return len(fake.logOutUsersStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) LogOutUsersStartedCalls(stub func()) { - fake.logOutUsersStartedMutex.Lock() - defer fake.logOutUsersStartedMutex.Unlock() - fake.LogOutUsersStartedStub = stub -} - -func (fake *FakeConstructMessenger) LogOutUsersSucceeded() { - fake.logOutUsersSucceededMutex.Lock() - fake.logOutUsersSucceededArgsForCall = append(fake.logOutUsersSucceededArgsForCall, struct { - }{}) - stub := fake.LogOutUsersSucceededStub - fake.recordInvocation("LogOutUsersSucceeded", []interface{}{}) - fake.logOutUsersSucceededMutex.Unlock() - if stub != nil { - fake.LogOutUsersSucceededStub() - } -} - -func (fake *FakeConstructMessenger) LogOutUsersSucceededCallCount() int { - fake.logOutUsersSucceededMutex.RLock() - defer fake.logOutUsersSucceededMutex.RUnlock() - return len(fake.logOutUsersSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) LogOutUsersSucceededCalls(stub func()) { - fake.logOutUsersSucceededMutex.Lock() - defer fake.logOutUsersSucceededMutex.Unlock() - fake.LogOutUsersSucceededStub = stub -} - -func (fake *FakeConstructMessenger) RebootHasFinished() { - fake.rebootHasFinishedMutex.Lock() - fake.rebootHasFinishedArgsForCall = append(fake.rebootHasFinishedArgsForCall, struct { - }{}) - stub := fake.RebootHasFinishedStub - fake.recordInvocation("RebootHasFinished", []interface{}{}) - fake.rebootHasFinishedMutex.Unlock() - if stub != nil { - fake.RebootHasFinishedStub() - } -} - -func (fake *FakeConstructMessenger) RebootHasFinishedCallCount() int { - fake.rebootHasFinishedMutex.RLock() - defer fake.rebootHasFinishedMutex.RUnlock() - return len(fake.rebootHasFinishedArgsForCall) -} - -func (fake *FakeConstructMessenger) RebootHasFinishedCalls(stub func()) { - fake.rebootHasFinishedMutex.Lock() - defer fake.rebootHasFinishedMutex.Unlock() - fake.RebootHasFinishedStub = stub -} - -func (fake *FakeConstructMessenger) RebootHasStarted() { - fake.rebootHasStartedMutex.Lock() - fake.rebootHasStartedArgsForCall = append(fake.rebootHasStartedArgsForCall, struct { - }{}) - stub := fake.RebootHasStartedStub - fake.recordInvocation("RebootHasStarted", []interface{}{}) - fake.rebootHasStartedMutex.Unlock() - if stub != nil { - fake.RebootHasStartedStub() - } -} - -func (fake *FakeConstructMessenger) RebootHasStartedCallCount() int { - fake.rebootHasStartedMutex.RLock() - defer fake.rebootHasStartedMutex.RUnlock() - return len(fake.rebootHasStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) RebootHasStartedCalls(stub func()) { - fake.rebootHasStartedMutex.Lock() - defer fake.rebootHasStartedMutex.Unlock() - fake.RebootHasStartedStub = stub -} - -func (fake *FakeConstructMessenger) ShutdownCompleted() { - fake.shutdownCompletedMutex.Lock() - fake.shutdownCompletedArgsForCall = append(fake.shutdownCompletedArgsForCall, struct { - }{}) - stub := fake.ShutdownCompletedStub - fake.recordInvocation("ShutdownCompleted", []interface{}{}) - fake.shutdownCompletedMutex.Unlock() - if stub != nil { - fake.ShutdownCompletedStub() - } -} - -func (fake *FakeConstructMessenger) ShutdownCompletedCallCount() int { - fake.shutdownCompletedMutex.RLock() - defer fake.shutdownCompletedMutex.RUnlock() - return len(fake.shutdownCompletedArgsForCall) -} - -func (fake *FakeConstructMessenger) ShutdownCompletedCalls(stub func()) { - fake.shutdownCompletedMutex.Lock() - defer fake.shutdownCompletedMutex.Unlock() - fake.ShutdownCompletedStub = stub -} - -func (fake *FakeConstructMessenger) UploadArtifactsStarted() { - fake.uploadArtifactsStartedMutex.Lock() - fake.uploadArtifactsStartedArgsForCall = append(fake.uploadArtifactsStartedArgsForCall, struct { - }{}) - stub := fake.UploadArtifactsStartedStub - fake.recordInvocation("UploadArtifactsStarted", []interface{}{}) - fake.uploadArtifactsStartedMutex.Unlock() - if stub != nil { - fake.UploadArtifactsStartedStub() - } -} - -func (fake *FakeConstructMessenger) UploadArtifactsStartedCallCount() int { - fake.uploadArtifactsStartedMutex.RLock() - defer fake.uploadArtifactsStartedMutex.RUnlock() - return len(fake.uploadArtifactsStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) UploadArtifactsStartedCalls(stub func()) { - fake.uploadArtifactsStartedMutex.Lock() - defer fake.uploadArtifactsStartedMutex.Unlock() - fake.UploadArtifactsStartedStub = stub -} - -func (fake *FakeConstructMessenger) UploadArtifactsSucceeded() { - fake.uploadArtifactsSucceededMutex.Lock() - fake.uploadArtifactsSucceededArgsForCall = append(fake.uploadArtifactsSucceededArgsForCall, struct { - }{}) - stub := fake.UploadArtifactsSucceededStub - fake.recordInvocation("UploadArtifactsSucceeded", []interface{}{}) - fake.uploadArtifactsSucceededMutex.Unlock() - if stub != nil { - fake.UploadArtifactsSucceededStub() - } -} - -func (fake *FakeConstructMessenger) UploadArtifactsSucceededCallCount() int { - fake.uploadArtifactsSucceededMutex.RLock() - defer fake.uploadArtifactsSucceededMutex.RUnlock() - return len(fake.uploadArtifactsSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) UploadArtifactsSucceededCalls(stub func()) { - fake.uploadArtifactsSucceededMutex.Lock() - defer fake.uploadArtifactsSucceededMutex.Unlock() - fake.UploadArtifactsSucceededStub = stub -} - -func (fake *FakeConstructMessenger) UploadFileStarted(arg1 string) { - fake.uploadFileStartedMutex.Lock() - fake.uploadFileStartedArgsForCall = append(fake.uploadFileStartedArgsForCall, struct { - arg1 string - }{arg1}) - stub := fake.UploadFileStartedStub - fake.recordInvocation("UploadFileStarted", []interface{}{arg1}) - fake.uploadFileStartedMutex.Unlock() - if stub != nil { - fake.UploadFileStartedStub(arg1) - } -} - -func (fake *FakeConstructMessenger) UploadFileStartedCallCount() int { - fake.uploadFileStartedMutex.RLock() - defer fake.uploadFileStartedMutex.RUnlock() - return len(fake.uploadFileStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) UploadFileStartedCalls(stub func(string)) { - fake.uploadFileStartedMutex.Lock() - defer fake.uploadFileStartedMutex.Unlock() - fake.UploadFileStartedStub = stub -} - -func (fake *FakeConstructMessenger) UploadFileStartedArgsForCall(i int) string { - fake.uploadFileStartedMutex.RLock() - defer fake.uploadFileStartedMutex.RUnlock() - argsForCall := fake.uploadFileStartedArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *FakeConstructMessenger) UploadFileSucceeded() { - fake.uploadFileSucceededMutex.Lock() - fake.uploadFileSucceededArgsForCall = append(fake.uploadFileSucceededArgsForCall, struct { - }{}) - stub := fake.UploadFileSucceededStub - fake.recordInvocation("UploadFileSucceeded", []interface{}{}) - fake.uploadFileSucceededMutex.Unlock() - if stub != nil { - fake.UploadFileSucceededStub() - } -} - -func (fake *FakeConstructMessenger) UploadFileSucceededCallCount() int { - fake.uploadFileSucceededMutex.RLock() - defer fake.uploadFileSucceededMutex.RUnlock() - return len(fake.uploadFileSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) UploadFileSucceededCalls(stub func()) { - fake.uploadFileSucceededMutex.Lock() - defer fake.uploadFileSucceededMutex.Unlock() - fake.UploadFileSucceededStub = stub -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionStarted() { - fake.validateVMConnectionStartedMutex.Lock() - fake.validateVMConnectionStartedArgsForCall = append(fake.validateVMConnectionStartedArgsForCall, struct { - }{}) - stub := fake.ValidateVMConnectionStartedStub - fake.recordInvocation("ValidateVMConnectionStarted", []interface{}{}) - fake.validateVMConnectionStartedMutex.Unlock() - if stub != nil { - fake.ValidateVMConnectionStartedStub() - } -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionStartedCallCount() int { - fake.validateVMConnectionStartedMutex.RLock() - defer fake.validateVMConnectionStartedMutex.RUnlock() - return len(fake.validateVMConnectionStartedArgsForCall) -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionStartedCalls(stub func()) { - fake.validateVMConnectionStartedMutex.Lock() - defer fake.validateVMConnectionStartedMutex.Unlock() - fake.ValidateVMConnectionStartedStub = stub -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionSucceeded() { - fake.validateVMConnectionSucceededMutex.Lock() - fake.validateVMConnectionSucceededArgsForCall = append(fake.validateVMConnectionSucceededArgsForCall, struct { - }{}) - stub := fake.ValidateVMConnectionSucceededStub - fake.recordInvocation("ValidateVMConnectionSucceeded", []interface{}{}) - fake.validateVMConnectionSucceededMutex.Unlock() - if stub != nil { - fake.ValidateVMConnectionSucceededStub() - } -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionSucceededCallCount() int { - fake.validateVMConnectionSucceededMutex.RLock() - defer fake.validateVMConnectionSucceededMutex.RUnlock() - return len(fake.validateVMConnectionSucceededArgsForCall) -} - -func (fake *FakeConstructMessenger) ValidateVMConnectionSucceededCalls(stub func()) { - fake.validateVMConnectionSucceededMutex.Lock() - defer fake.validateVMConnectionSucceededMutex.Unlock() - fake.ValidateVMConnectionSucceededStub = stub -} - -func (fake *FakeConstructMessenger) WaitingForShutdown() { - fake.waitingForShutdownMutex.Lock() - fake.waitingForShutdownArgsForCall = append(fake.waitingForShutdownArgsForCall, struct { - }{}) - stub := fake.WaitingForShutdownStub - fake.recordInvocation("WaitingForShutdown", []interface{}{}) - fake.waitingForShutdownMutex.Unlock() - if stub != nil { - fake.WaitingForShutdownStub() - } -} - -func (fake *FakeConstructMessenger) WaitingForShutdownCallCount() int { - fake.waitingForShutdownMutex.RLock() - defer fake.waitingForShutdownMutex.RUnlock() - return len(fake.waitingForShutdownArgsForCall) -} - -func (fake *FakeConstructMessenger) WaitingForShutdownCalls(stub func()) { - fake.waitingForShutdownMutex.Lock() - defer fake.waitingForShutdownMutex.Unlock() - fake.WaitingForShutdownStub = stub -} - -func (fake *FakeConstructMessenger) WinRMDisconnectedForReboot() { - fake.winRMDisconnectedForRebootMutex.Lock() - fake.winRMDisconnectedForRebootArgsForCall = append(fake.winRMDisconnectedForRebootArgsForCall, struct { - }{}) - stub := fake.WinRMDisconnectedForRebootStub - fake.recordInvocation("WinRMDisconnectedForReboot", []interface{}{}) - fake.winRMDisconnectedForRebootMutex.Unlock() - if stub != nil { - fake.WinRMDisconnectedForRebootStub() - } -} - -func (fake *FakeConstructMessenger) WinRMDisconnectedForRebootCallCount() int { - fake.winRMDisconnectedForRebootMutex.RLock() - defer fake.winRMDisconnectedForRebootMutex.RUnlock() - return len(fake.winRMDisconnectedForRebootArgsForCall) -} - -func (fake *FakeConstructMessenger) WinRMDisconnectedForRebootCalls(stub func()) { - fake.winRMDisconnectedForRebootMutex.Lock() - defer fake.winRMDisconnectedForRebootMutex.Unlock() - fake.WinRMDisconnectedForRebootStub = stub -} - -func (fake *FakeConstructMessenger) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - copiedInvocations := map[string][][]interface{}{} - for key, value := range fake.invocations { - copiedInvocations[key] = value - } - return copiedInvocations -} - -func (fake *FakeConstructMessenger) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} - -var _ construct.ConstructMessenger = new(FakeConstructMessenger) diff --git a/stembuild/construct/factory.go b/stembuild/construct/factory.go index e56c1fcb3..b6b727df4 100644 --- a/stembuild/construct/factory.go +++ b/stembuild/construct/factory.go @@ -2,7 +2,6 @@ package construct import ( "context" - "os" "github.com/pkg/errors" @@ -11,6 +10,7 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct/config" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/version" @@ -19,12 +19,10 @@ import ( type Factory struct { } -func (f *Factory) New(config config.SourceConfig, vCenterManager commandparser.VCenterManager) (commandparser.VmConstruct, error) { +func (f *Factory) New(config config.SourceConfig, vCenterManager commandparser.VCenterManager, messenger messenger.Messenger) (commandparser.VmConstruct, error) { runner := &iaas_cli.GovcRunner{} client := iaas_clients.NewVcenterClient(config.VCenterUsername, config.VCenterPassword, config.VCenterUrl, config.CaCertFile, runner) - messenger := NewMessenger(os.Stdout) - ctx := context.Background() err := vCenterManager.Login(ctx) if err != nil { diff --git a/stembuild/construct/factory_test.go b/stembuild/construct/factory_test.go index 40009b274..b47e8300e 100644 --- a/stembuild/construct/factory_test.go +++ b/stembuild/construct/factory_test.go @@ -1,6 +1,7 @@ package construct_test import ( + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" @@ -13,11 +14,13 @@ import ( var _ = Describe("Factory", func() { Describe("GetVMPreparer", func() { var ( - factory *construct.Factory + factory *construct.Factory + stembuildMessenger messenger.Messenger ) BeforeEach(func() { factory = &construct.Factory{} + stembuildMessenger = messenger.NewStembuildMessenger(GinkgoWriter, GinkgoWriter) }) It("should return a New", func() { @@ -33,7 +36,7 @@ var _ = Describe("Factory", func() { VmInventoryPath: "some-vm-inventory-path", } - vmPreparer, err := factory.New(sourceConfig, fakeVCenterManager) + vmPreparer, err := factory.New(sourceConfig, fakeVCenterManager, stembuildMessenger) Expect(err).ToNot(HaveOccurred()) Expect(vmPreparer).To(BeAssignableToTypeOf(&construct.VMConstruct{})) }) @@ -45,7 +48,7 @@ var _ = Describe("Factory", func() { fakeVCenterManager.LoginReturns(loginFailure) sourceConfig := config.SourceConfig{} - vmPreparer, err := factory.New(sourceConfig, fakeVCenterManager) + vmPreparer, err := factory.New(sourceConfig, fakeVCenterManager, stembuildMessenger) Expect(vmPreparer).To(BeNil()) Expect(err).To(HaveOccurred()) diff --git a/stembuild/construct/messenger.go b/stembuild/construct/messenger.go deleted file mode 100644 index f22a269d1..000000000 --- a/stembuild/construct/messenger.go +++ /dev/null @@ -1,135 +0,0 @@ -package construct - -import ( - "fmt" - "io" - "time" -) - -type Messenger struct { - out io.Writer -} - -func NewMessenger(out io.Writer) *Messenger { - return &Messenger{out} -} - -func (m *Messenger) EnableWinRMStarted() { - m.out.Write([]byte("\nAttempting to enable WinRM on the guest vm...")) //nolint:errcheck//nolint:errcheck -} - -func (m *Messenger) EnableWinRMSucceeded() { - m.out.Write([]byte("WinRm enabled on the guest VM\n")) //nolint:errcheck -} - -func (m *Messenger) ValidateVMConnectionStarted() { - m.out.Write([]byte("\nValidating connection to vm...")) //nolint:errcheck -} - -func (m *Messenger) ValidateVMConnectionSucceeded() { - m.out.Write([]byte("succeeded.\n")) //nolint:errcheck -} - -func (m *Messenger) CreateProvisionDirStarted() { - m.out.Write([]byte("\nCreating provision dir on target VM...")) //nolint:errcheck -} - -func (m *Messenger) CreateProvisionDirSucceeded() { - m.out.Write([]byte("succeeded.\n")) //nolint:errcheck -} - -func (m *Messenger) UploadArtifactsStarted() { - m.out.Write([]byte("\nTransferring ~20 MB to the Windows VM. Depending on your connection, the transfer may take 15-45 minutes\n")) //nolint:errcheck -} - -func (m *Messenger) UploadArtifactsSucceeded() { - m.out.Write([]byte("\nAll files have been uploaded.\n")) //nolint:errcheck -} - -func (m *Messenger) ExtractArtifactsStarted() { - m.out.Write([]byte("\nExtracting artifacts...")) //nolint:errcheck -} - -func (m *Messenger) ExtractArtifactsSucceeded() { - m.out.Write([]byte("succeeded.\n")) //nolint:errcheck -} - -func (m *Messenger) ExecuteSetupScriptStarted() { - m.out.Write([]byte("\nExecuting setup script 1 of 2...\n")) //nolint:errcheck -} - -func (m *Messenger) ExecuteSetupScriptSucceeded() { - m.out.Write([]byte("\nFinished executing setup script 1 of 2.\n")) //nolint:errcheck -} - -func (m *Messenger) RebootHasStarted() { - m.out.Write([]byte("\nThe reboot has started...\n")) //nolint:errcheck -} - -func (m *Messenger) RebootHasFinished() { - m.out.Write([]byte("\nThe reboot has finished.\n")) //nolint:errcheck -} - -func (m *Messenger) ExecutePostRebootScriptStarted() { - m.out.Write([]byte("\nExecuting setup script 2 of 2...\n")) //nolint:errcheck -} - -func (m *Messenger) ExecutePostRebootScriptSucceeded() { - m.out.Write([]byte("\nFinished executing setup script 2 of 2.\n")) //nolint:errcheck - -} - -func (m *Messenger) ExecutePostRebootWarning(warning string) { - m.out.Write([]byte("\n")) //nolint:errcheck - m.out.Write([]byte(warning)) //nolint:errcheck - m.out.Write([]byte("\n")) //nolint:errcheck -} - -func (m *Messenger) UploadFileStarted(artifact string) { - m.out.Write([]byte(fmt.Sprintf("\tUploading %s to target VM...", artifact))) //nolint:errcheck,staticcheck -} - -func (m *Messenger) UploadFileSucceeded() { - m.out.Write([]byte("succeeded.\n")) //nolint:errcheck -} - -func (m *Messenger) LogOutUsersStarted() { - m.out.Write([]byte("\nAttempting to logout any remote users...\n")) //nolint:errcheck -} - -func (m *Messenger) LogOutUsersSucceeded() { - m.out.Write([]byte("\nLogged out remote users\n")) //nolint:errcheck -} - -func (m *Messenger) OSVersionFileCreationFailed(errorMessage string) { - m.logValidateOSWarning("OS Version file creation failed", errorMessage) -} - -func (m *Messenger) ExitCodeRetrievalFailed(errorMessage string) { - m.logValidateOSWarning("Failed to retrieve exit code for process to create OS Version file", errorMessage) -} - -func (m *Messenger) DownloadFileFailed(errorMessage string) { - m.logValidateOSWarning("Failed to download OS Version file", errorMessage) -} - -func (m *Messenger) logValidateOSWarning(log string, errorMessage string) { - matchingVersionWarning := "Ensure the version of the stemcell you're trying to build matches the corresponding base ISO you're using.\n" + - "For example: If you're building 2019.x, then you should be using 'Windows Server 2019' only" - m.out.Write([]byte(fmt.Sprintf("Warning: %s:\n%s\n%s", log, matchingVersionWarning, errorMessage))) //nolint:errcheck,staticcheck -} - -func (m *Messenger) WaitingForShutdown() { - t := time.Now() - timeStampFormat := "2006-01-02T15:04:05.999999-07:00" - m.out.Write([]byte(fmt.Sprintf("%s Still preparing VM...\n", t.Format(timeStampFormat)))) //nolint:errcheck,staticcheck -} - -func (m *Messenger) ShutdownCompleted() { - m.out.Write([]byte("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) //nolint:errcheck -} - -func (m *Messenger) WinRMDisconnectedForReboot() { - m.out.Write([]byte("\nWinRM has been disconnected so the VM can reboot.\n")) //nolint:errcheck - -} diff --git a/stembuild/construct/messenger_test.go b/stembuild/construct/messenger_test.go deleted file mode 100644 index 584f34435..000000000 --- a/stembuild/construct/messenger_test.go +++ /dev/null @@ -1,290 +0,0 @@ -package construct_test - -import ( - "fmt" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gbytes" -) - -var _ = Describe("Messenger", func() { - var buf *Buffer - - BeforeEach(func() { - buf = NewBuffer() - }) - - Describe("Enable WinRM messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.EnableWinRMStarted() - - Expect(buf).To(Say("\nAttempting to enable WinRM on the guest vm...")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.EnableWinRMSucceeded() - - Expect(buf).To(Say("WinRm enabled on the guest VM\n")) - }) - - It("writes both WinRM messages on one line", func() { - m := construct.NewMessenger(buf) - m.EnableWinRMStarted() - m.EnableWinRMSucceeded() - - Expect(buf).To(Say("Attempting to enable WinRM on the guest vm...WinRm enabled on the guest VM")) - }) - }) - - Describe("Validate VM connection messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.ValidateVMConnectionStarted() - - Expect(buf).To(Say("\nValidating connection to vm...")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.ValidateVMConnectionSucceeded() - - Expect(buf).To(Say("succeeded.\n")) - }) - - It("writes both validate vm connection messages on one line", func() { - m := construct.NewMessenger(buf) - m.ValidateVMConnectionStarted() - m.ValidateVMConnectionSucceeded() - - Expect(buf).To(Say("Validating connection to vm...succeeded.")) - }) - }) - - Describe("Create provision directory messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.CreateProvisionDirStarted() - - Expect(buf).To(Say("\nCreating provision dir on target VM...")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.CreateProvisionDirSucceeded() - - Expect(buf).To(Say("succeeded.\n")) - }) - - It("writes both messages on one line", func() { - m := construct.NewMessenger(buf) - m.CreateProvisionDirStarted() - m.CreateProvisionDirSucceeded() - - Expect(buf).To(Say("\nCreating provision dir on target VM...succeeded.\n")) - }) - }) - - Describe("Upload artifacts messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.UploadArtifactsStarted() - - Expect(buf).To(Say("\nTransferring ~20 MB to the Windows VM. Depending on your connection, the transfer may take 15-45 minutes\n")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.UploadArtifactsSucceeded() - - Expect(buf).To(Say("\nAll files have been uploaded.\n")) - }) - }) - - Describe("Extract artifact messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExtractArtifactsStarted() - - Expect(buf).To(Say("\nExtracting artifacts...")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExtractArtifactsSucceeded() - - Expect(buf).To(Say("succeeded.\n")) - }) - - It("writes both messages on one line", func() { - m := construct.NewMessenger(buf) - m.ExtractArtifactsStarted() - m.ExtractArtifactsSucceeded() - - Expect(buf).To(Say("\nExtracting artifacts...succeeded.\n")) - }) - }) - - Describe("Log out users successfully", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.LogOutUsersStarted() - - Expect(buf).To(Say("\nAttempting to logout any remote users...\n")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.LogOutUsersSucceeded() - - Expect(buf).To(Say("\nLogged out remote users\n")) - }) - - }) - - Describe("Execute setup script messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExecuteSetupScriptStarted() - - Expect(buf).To(Say("\nExecuting setup script 1 of 2...\n")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExecuteSetupScriptSucceeded() - - Expect(buf).To(Say("\nFinished executing setup script 1 of 2.\n")) - }) - - }) - - Describe("Wait for the reboot to have finished", func() { - It("writes the rebooting message to the writer", func() { - m := construct.NewMessenger(buf) - m.WinRMDisconnectedForReboot() - - Expect(buf).To(Say("WinRM has been disconnected so the VM can reboot.\n")) - - }) - - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.RebootHasStarted() - - Expect(buf).To(Say("\nThe reboot has started...\n")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.RebootHasFinished() - - Expect(buf).To(Say("\nThe reboot has finished.\n")) - }) - }) - - Describe("Execute post-reboot script messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExecutePostRebootScriptStarted() - - Expect(buf).To(Say("\nExecuting setup script 2 of 2...\n")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.ExecutePostRebootScriptSucceeded() - - Expect(buf).To(Say("\nFinished executing setup script 2 of 2.\n")) - }) - - It("writes the warning message to the writer", func() { - m := construct.NewMessenger(buf) - - warning := "winrm was sad" - - m.ExecutePostRebootWarning(warning) - - expectedMessage := "\n" + warning + "\n" - Expect(buf).To(Say(expectedMessage)) - }) - - }) - - Describe("Upload file messages", func() { - It("writes the started message to the writer", func() { - m := construct.NewMessenger(buf) - m.UploadFileStarted("some artifact") - - Expect(buf).To(Say("\tUploading some artifact to target VM...")) - }) - - It("writes the succeeded message to the writer", func() { - m := construct.NewMessenger(buf) - m.UploadFileSucceeded() - - Expect(buf).To(Say("succeeded.\n")) - }) - - It("writes both messages on one line", func() { - m := construct.NewMessenger(buf) - m.UploadFileStarted("some third artifact") - m.UploadFileSucceeded() - - Expect(buf).To(Say("Uploading some third artifact to target VM...succeed.")) - }) - }) - - Describe("validate OS", func() { - var matchingVersionWarning = "Ensure the version of the stemcell you're trying to build matches the corresponding base ISO you're using.\n" + - "For example: If you're building 2019.x, then you should be using 'Windows Server 2019' only" - It("writes the OS version file creation failed message to the writer", func() { - errorMessage := "some error message" - m := construct.NewMessenger(buf) - m.OSVersionFileCreationFailed(errorMessage) - Expect(buf).To(Say(fmt.Sprintf("Warning: OS Version file creation failed:\n%s\n%s", matchingVersionWarning, errorMessage))) - }) - - It("writes the exit code retrieval failed message to the writer", func() { - errorMessage := "some error message" - m := construct.NewMessenger(buf) - m.ExitCodeRetrievalFailed(errorMessage) - Expect(buf).To(Say(fmt.Sprintf("Warning: Failed to retrieve exit code for process to create OS Version file:\n%s\n%s", matchingVersionWarning, errorMessage))) - }) - - It("writes the download file failed message to the writer", func() { - errorMessage := "some error message" - m := construct.NewMessenger(buf) - m.DownloadFileFailed(errorMessage) - Expect(buf).To(Say(fmt.Sprintf("Warning: Failed to download OS Version file:\n%s\n%s", matchingVersionWarning, errorMessage))) - }) - }) - - Describe("Power state messages", func() { - It("writes still running message with timestamp", func() { - m := construct.NewMessenger(buf) - m.WaitingForShutdown() - // to match timestamp format 2006-01-02T15:04:05.99999-07:00 - // should also match 2006-01-02T15:04:05.1+07:00 - dateTimeRegex := "\\d{4}\\-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d*(\\-|\\+)\\d{2}:\\d{2}" - - messageString := "Still preparing VM...\n" - logLineRegex := fmt.Sprintf("%s\\s*%s", dateTimeRegex, messageString) - - Expect(buf).To(Say(logLineRegex)) - }) - - It("writes the shutdown message to the writer", func() { - m := construct.NewMessenger(buf) - m.ShutdownCompleted() - - Expect(buf).To(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) - }) - - }) - -}) diff --git a/stembuild/construct/vmconstruct.go b/stembuild/construct/vmconstruct.go index e4d45cb73..05e475b61 100644 --- a/stembuild/construct/vmconstruct.go +++ b/stembuild/construct/vmconstruct.go @@ -11,6 +11,7 @@ import ( "time" "unicode/utf16" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" ) @@ -32,7 +33,7 @@ type VMConstruct struct { vmPassword string winRMEnabler WinRMEnabler vmConnectionValidator VMConnectionValidator - messenger ConstructMessenger + messenger messenger.Messenger poller poller.PollerI versionGetter VersionGetter rebootWaiter RebootWaiterI @@ -61,7 +62,7 @@ func NewVMConstruct( guestManager GuestManager, winRMEnabler WinRMEnabler, vmConnectionValidator VMConnectionValidator, - messenger ConstructMessenger, + messenger messenger.Messenger, poller poller.PollerI, versionGetter VersionGetter, rebootWaiter RebootWaiterI, @@ -126,34 +127,6 @@ type VMConnectionValidator interface { Validate() error } -//counterfeiter:generate . ConstructMessenger -type ConstructMessenger interface { - CreateProvisionDirStarted() - CreateProvisionDirSucceeded() - UploadArtifactsStarted() - UploadArtifactsSucceeded() - EnableWinRMStarted() - EnableWinRMSucceeded() - ValidateVMConnectionStarted() - ValidateVMConnectionSucceeded() - ExtractArtifactsStarted() - ExtractArtifactsSucceeded() - ExecuteSetupScriptStarted() - ExecuteSetupScriptSucceeded() - RebootHasStarted() - RebootHasFinished() - ExecutePostRebootScriptStarted() - ExecutePostRebootScriptSucceeded() - ExecutePostRebootWarning(warning string) - UploadFileStarted(artifact string) - UploadFileSucceeded() - WaitingForShutdown() - ShutdownCompleted() - WinRMDisconnectedForReboot() - LogOutUsersStarted() - LogOutUsersSucceeded() -} - func (c *VMConstruct) PrepareVM() error { stembuildVersion := c.versionGetter.GetVersion() @@ -161,102 +134,101 @@ func (c *VMConstruct) PrepareVM() error { if err != nil { return err } - c.messenger.UploadArtifactsStarted() + c.messenger.PrintOut("\nTransferring ~20 MB to the Windows VM. Depending on your connection, the transfer may take 15-45 minutes\n") err = c.uploadArtifacts() if err != nil { return err } - c.messenger.UploadArtifactsSucceeded() + c.messenger.PrintOut("\nAll files have been uploaded.\n") - c.messenger.EnableWinRMStarted() + c.messenger.PrintOut("\nAttempting to enable WinRM on the guest vm...") err = c.winRMEnabler.Enable() if err != nil { return err } - c.messenger.EnableWinRMSucceeded() + c.messenger.PrintOut("WinRm enabled on the guest VM\n") - c.messenger.ValidateVMConnectionStarted() + c.messenger.PrintOut("\nValidating connection to vm...") err = c.vmConnectionValidator.Validate() if err != nil { return err } - c.messenger.ValidateVMConnectionSucceeded() + c.messenger.PrintOut("succeeded.\n") - c.messenger.ExtractArtifactsStarted() + c.messenger.PrintOut("\nExtracting artifacts...") err = c.extractArchive() if err != nil { return err } - c.messenger.ExtractArtifactsSucceeded() + c.messenger.PrintOut("succeeded.\n") - c.messenger.LogOutUsersStarted() + c.messenger.PrintOut("\nAttempting to logout any remote users...\n") err = c.logOutUsers() if err != nil { return err } - c.messenger.LogOutUsersSucceeded() + c.messenger.PrintOut("\nLogged out remote users\n") - c.messenger.ExecuteSetupScriptStarted() + c.messenger.PrintOut("\nExecuting setup script 1 of 2...\n") err = c.scriptExecutor.ExecuteSetupScript(stembuildVersion, c.SetupFlags) if err != nil { return err } - c.messenger.ExecuteSetupScriptSucceeded() - c.messenger.WinRMDisconnectedForReboot() + c.messenger.PrintOut("\nFinished executing setup script 1 of 2.\n") + c.messenger.PrintOut("\nWinRM has been disconnected so the VM can reboot.\n") - c.messenger.RebootHasStarted() + c.messenger.PrintOut("\nThe reboot has started...\n") time.Sleep(c.RebootWaitTime) err = c.rebootWaiter.WaitForRebootFinished() if err != nil { return err } - c.messenger.RebootHasFinished() + c.messenger.PrintOut("\nThe reboot has finished.\n") - c.messenger.ExecutePostRebootScriptStarted() + c.messenger.PrintOut("\nExecuting setup script 2 of 2...\n") err = c.scriptExecutor.ExecutePostRebootScript(24 * time.Hour) if err != nil { if strings.Contains(err.Error(), "winrm connection event") { - c.messenger.ExecutePostRebootWarning(err.Error()) + c.messenger.PrintOut(fmt.Sprintf("\n%s\n", err.Error())) } else { return fmt.Errorf("failure in post-reboot script: %s", err) } } - - c.messenger.ExecutePostRebootScriptSucceeded() + c.messenger.PrintOut("\nFinished executing setup script 2 of 2.\n") err = c.isPoweredOff(time.Minute) if err != nil { return err } - c.messenger.ShutdownCompleted() + c.messenger.PrintOut("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n") return nil } func (c *VMConstruct) createProvisionDirectory() error { - c.messenger.CreateProvisionDirStarted() + c.messenger.PrintOut("\nCreating provision dir on target VM...") err := c.Client.MakeDirectory(c.vmInventoryPath, provisionDir, c.vmUsername, c.vmPassword) if err != nil { return err } - c.messenger.CreateProvisionDirSucceeded() + c.messenger.PrintOut("succeeded.\n") return nil } func (c *VMConstruct) uploadArtifacts() error { - c.messenger.UploadFileStarted("LGPO") + c.messenger.PrintOut(fmt.Sprintf("\tUploading %s to target VM...", "LGPO")) err := c.Client.UploadArtifact(c.vmInventoryPath, "./LGPO.zip", lgpoDest, c.vmUsername, c.vmPassword) if err != nil { return err } - c.messenger.UploadFileSucceeded() + c.messenger.PrintOut("succeeded.\n") - c.messenger.UploadFileStarted("stemcell preparation artifacts") + c.messenger.PrintOut(fmt.Sprintf("\tUploading %s to target VM...", "stemcell preparation artifacts")) err = c.Client.UploadArtifact(c.vmInventoryPath, fmt.Sprintf("./%s", stemcellAutomationName), stemcellAutomationDest, c.vmUsername, c.vmPassword) if err != nil { return err } - c.messenger.UploadFileSucceeded() + c.messenger.PrintOut("succeeded.\n") return nil } @@ -319,6 +291,7 @@ func (e *ScriptExecutor) ExecutePostRebootScript(timeout time.Duration) error { } func (c *VMConstruct) isPoweredOff(duration time.Duration) error { + const timeStampFormat = "2006-01-02T15:04:05.999999-07:00" err := c.poller.Poll(duration, func() (bool, error) { isPoweredOff, err := c.Client.IsPoweredOff(c.vmInventoryPath) @@ -326,7 +299,7 @@ func (c *VMConstruct) isPoweredOff(duration time.Duration) error { return false, err } - c.messenger.WaitingForShutdown() + c.messenger.PrintOut(fmt.Sprintf("%s Still preparing VM...\n", time.Now().Format(timeStampFormat))) return isPoweredOff, nil }) diff --git a/stembuild/construct/vmconstruct_test.go b/stembuild/construct/vmconstruct_test.go index 21ce0d023..6d39e4bea 100644 --- a/stembuild/construct/vmconstruct_test.go +++ b/stembuild/construct/vmconstruct_test.go @@ -6,15 +6,16 @@ import ( "fmt" "time" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gbytes" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct/constructfakes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller/pollerfakes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager/remotemanagerfakes" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gbytes" ) var _ = Describe("construct_helpers", func() { @@ -24,13 +25,15 @@ var _ = Describe("construct_helpers", func() { fakeVcenterClient *constructfakes.FakeIaasClient fakeGuestManager *constructfakes.FakeGuestManager fakeWinRMEnabler *constructfakes.FakeWinRMEnabler - fakeMessenger *constructfakes.FakeConstructMessenger fakePoller *pollerfakes.FakePollerI fakeVersionGetter *constructfakes.FakeVersionGetter fakeVMConnectionValidator *constructfakes.FakeVMConnectionValidator fakeRebootWaiter *constructfakes.FakeRebootWaiterI fakeScriptExecutor *constructfakes.FakeScriptExecutorI fakeSetupFlags []string + + outBuf *Buffer + errBuf *Buffer ) BeforeEach(func() { @@ -38,7 +41,6 @@ var _ = Describe("construct_helpers", func() { fakeVcenterClient = &constructfakes.FakeIaasClient{} fakeGuestManager = &constructfakes.FakeGuestManager{} fakeWinRMEnabler = &constructfakes.FakeWinRMEnabler{} - fakeMessenger = &constructfakes.FakeConstructMessenger{} fakePoller = &pollerfakes.FakePollerI{} fakeVersionGetter = &constructfakes.FakeVersionGetter{} fakeVMConnectionValidator = &constructfakes.FakeVMConnectionValidator{} @@ -46,6 +48,10 @@ var _ = Describe("construct_helpers", func() { fakeScriptExecutor = &constructfakes.FakeScriptExecutorI{} fakeSetupFlags = []string{"SomeFlag SomeValue", "OtherFlag OtherValue"} + outBuf = NewBuffer() + errBuf = NewBuffer() + stembuildMessenger := messenger.NewStembuildMessenger(outBuf, errBuf) + vmConstruct = construct.NewVMConstruct( context.TODO(), fakeRemoteManager, @@ -56,7 +62,7 @@ var _ = Describe("construct_helpers", func() { fakeGuestManager, fakeWinRMEnabler, fakeVMConnectionValidator, - fakeMessenger, + stembuildMessenger, fakePoller, fakeVersionGetter, fakeRebootWaiter, @@ -135,8 +141,7 @@ var _ = Describe("construct_helpers", func() { Expect(err).ToNot(HaveOccurred()) Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) - Expect(fakeMessenger.CreateProvisionDirStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.CreateProvisionDirSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nCreating provision dir on target VM...succeeded.\n")) }) It("fails when the provision dir cannot be created", func() { @@ -148,8 +153,7 @@ var _ = Describe("construct_helpers", func() { Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("failed to create dir")) - Expect(fakeMessenger.CreateProvisionDirStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.CreateProvisionDirSucceededCallCount()).To(Equal(0)) + Eventually(outBuf).ShouldNot(Say("\nCreating provision dir on target VM...succeeded.\n")) }) }) @@ -169,8 +173,7 @@ var _ = Describe("construct_helpers", func() { err := vmConstruct.PrepareVM() Expect(err).NotTo(HaveOccurred()) - Expect(fakeMessenger.EnableWinRMStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.EnableWinRMSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nAttempting to enable WinRM on the guest vm...WinRm enabled on the guest VM\n")) }) }) @@ -199,8 +202,7 @@ var _ = Describe("construct_helpers", func() { err := vmConstruct.PrepareVM() Expect(err).NotTo(HaveOccurred()) - Expect(fakeMessenger.ValidateVMConnectionStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ValidateVMConnectionSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nValidating connection to vm...succeeded.\n")) }) }) @@ -218,22 +220,17 @@ var _ = Describe("construct_helpers", func() { Expect(user).To(Equal("fakeUser")) Expect(pass).To(Equal("fakePass")) Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) - Expect(fakeMessenger.UploadArtifactsStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.UploadArtifactsSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nTransferring ~20 MB to the Windows VM. Depending on your connection, the transfer may take 15-45 minutes\n")) - Expect(fakeMessenger.UploadFileStartedCallCount()).To(Equal(2)) - artifact = fakeMessenger.UploadFileStartedArgsForCall(0) - Expect(artifact).To(Equal("LGPO")) - artifact = fakeMessenger.UploadFileStartedArgsForCall(1) - Expect(artifact).To(Equal("stemcell preparation artifacts")) + Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "LGPO"))) + Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "stemcell preparation artifacts"))) - Expect(fakeMessenger.UploadFileSucceededCallCount()).To(Equal(2)) + Eventually(outBuf).Should(Say("\nAll files have been uploaded.\n")) }) }) Context("Fails to upload one or more artifacts", func() { It("fails when it cannot upload LGPO", func() { - uploadError := errors.New("failed to upload LGPO") fakeVcenterClient.UploadArtifactReturns(uploadError) @@ -245,8 +242,8 @@ var _ = Describe("construct_helpers", func() { Expect(artifact).To(Equal("./LGPO.zip")) Expect(vmPath).To(Equal("fakeVmPath")) Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(1)) - Expect(fakeMessenger.UploadArtifactsStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.UploadArtifactsSucceededCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...", "LGPO"))) + Eventually(outBuf).ShouldNot(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "LGPO"))) }) It("fails when it cannot upload Stemcell Automation scripts", func() { @@ -265,8 +262,9 @@ var _ = Describe("construct_helpers", func() { Expect(artifact).To(Equal("./StemcellAutomation.zip")) Expect(vmPath).To(Equal("fakeVmPath")) Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) - Expect(fakeMessenger.UploadArtifactsStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.UploadArtifactsSucceededCallCount()).To(Equal(0)) + + Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...", "stemcell preparation artifacts"))) + Eventually(outBuf).ShouldNot(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "stemcell preparation artifacts"))) }) }) }) @@ -285,8 +283,7 @@ var _ = Describe("construct_helpers", func() { Expect(command).To(ContainSubstring(encodedCommand)) Expect(command).To(ContainSubstring("powershell.exe -EncodedCommand ")) - Expect(fakeMessenger.LogOutUsersStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.LogOutUsersSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) }) It("returns failure when it fails to execute a logout", func() { @@ -298,8 +295,8 @@ var _ = Describe("construct_helpers", func() { Expect(err.Error()).To(ContainSubstring(errorMessage)) Expect(err.Error()).To(ContainSubstring("log out remote user failed with exit code 1")) - Expect(fakeMessenger.LogOutUsersStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.LogOutUsersSucceededCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n")) + Eventually(outBuf).ShouldNot(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) }) }) @@ -312,8 +309,8 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(HaveOccurred()) Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) Expect(err.Error()).To(Equal("failed to extract archive")) - Expect(fakeMessenger.ExtractArtifactsStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExtractArtifactsSucceededCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say("\nExtracting artifacts...")) + Eventually(outBuf).ShouldNot(Say("\nExtracting artifacts...succeeded.\n")) }) It("returns success when it properly extracts archive", func() { @@ -326,8 +323,7 @@ var _ = Describe("construct_helpers", func() { Expect(source).To(Equal("C:\\provision\\StemcellAutomation.zip")) Expect(destination).To(Equal("C:\\provision\\")) - Expect(fakeMessenger.ExtractArtifactsStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExtractArtifactsSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nExtracting artifacts...succeeded.\n")) }) }) @@ -341,8 +337,9 @@ var _ = Describe("construct_helpers", func() { Expect(err.Error()).To(Equal("failed to execute setup script")) Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecuteSetupScriptStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecuteSetupScriptSucceededCallCount()).To(Equal(0)) + + Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n")) + Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n")) }) It("returns success when it properly executes the setup script", func() { @@ -358,8 +355,7 @@ var _ = Describe("construct_helpers", func() { Expect(version).To(Equal(stembuildVersion)) Expect(setupFlags).To(Equal(fakeSetupFlags)) - Expect(fakeMessenger.ExecuteSetupScriptStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecuteSetupScriptSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n")) }) }) @@ -383,8 +379,7 @@ var _ = Describe("construct_helpers", func() { Expect(calls[0]).To(Equal("executeSetupScriptCalls")) Expect(calls[1]).To(Equal("waitForRebootFinishedCall")) - Expect(fakeMessenger.RebootHasStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.RebootHasFinishedCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) }) It("returns failure when it cannot determine if VM is rebooting", func() { @@ -394,8 +389,8 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("polling is hard")) - Expect(fakeMessenger.RebootHasStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.RebootHasFinishedCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say("\nThe reboot has started...\n")) + Eventually(outBuf).ShouldNot(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) }) }) @@ -435,8 +430,8 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(MatchError(rebootWaitError)) - Expect(fakeMessenger.RebootHasStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.RebootHasFinishedCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say("\nThe reboot has started...\n")) + Eventually(outBuf).ShouldNot(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) }) It("runs post-reboot command", func() { @@ -445,8 +440,7 @@ var _ = Describe("construct_helpers", func() { Expect(err).NotTo(HaveOccurred()) Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecutePostRebootScriptStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecutePostRebootScriptSucceededCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) }) It("returns error if running post-reboot command fails", func() { @@ -456,8 +450,8 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring(postRebootError.Error())) - Expect(fakeMessenger.ExecutePostRebootScriptStartedCallCount()).To(Equal(1)) - Expect(fakeMessenger.ExecutePostRebootScriptSucceededCallCount()).To(Equal(0)) + Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n")) + Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) }) It("logs but does not error on winrm, non-powershell errors", func() { @@ -465,15 +459,10 @@ var _ = Describe("construct_helpers", func() { fakeScriptExecutor.ExecutePostRebootScriptReturnsOnCall(0, winrmError) err := vmConstruct.PrepareVM() - Expect(err).NotTo(HaveOccurred()) - Expect(fakeMessenger.ExecutePostRebootScriptSucceededCallCount()). - To(BeNumerically(">", 0)) - Expect(fakeMessenger.ExecutePostRebootWarningCallCount()). - To(BeNumerically(">", 0)) - Expect(fakeMessenger.ExecutePostRebootWarningArgsForCall(0)). - To(ContainSubstring(winrmError.Error())) + Eventually(outBuf).Should(Say(fmt.Sprintf("\n%s\n", winrmError))) + Eventually(outBuf).ShouldNot(Say("\nFinished executing setup script 2 of 2.\n")) }) }) @@ -487,7 +476,7 @@ var _ = Describe("construct_helpers", func() { err := vmConstruct.PrepareVM() Expect(err).ToNot(HaveOccurred()) - Expect(fakeMessenger.ShutdownCompletedCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) Expect(fakePoller.PollCallCount()).To(Equal(1)) pollDuration, pollFunc := fakePoller.PollArgsForCall(0) @@ -495,21 +484,21 @@ var _ = Describe("construct_helpers", func() { Expect(pollDuration).To(Equal(1 * time.Minute)) Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(0)) - Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(0)) + Eventually(outBuf).ShouldNot(Say(" Still preparing VM...\n")) isPoweredOff, err := pollFunc() Expect(isPoweredOff).To(BeFalse()) Expect(err).NotTo(HaveOccurred()) - Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say(" Still preparing VM...\n")) isPoweredOff, err = pollFunc() Expect(isPoweredOff).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) - Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) + //Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) - isPoweredOff, err = pollFunc() //nolint:ineffassign,staticcheck + _, err = pollFunc() Expect(err).To(MatchError("checking for powered off is hard")) - Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) + //Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(3)) }) @@ -522,7 +511,7 @@ var _ = Describe("construct_helpers", func() { Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(errorString)) - Expect(fakeMessenger.ShutdownCompletedCallCount()).To(Equal(0)) + Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) }) }) }) diff --git a/stembuild/main.go b/stembuild/main.go index de4d51257..b9e13ce59 100644 --- a/stembuild/main.go +++ b/stembuild/main.go @@ -3,70 +3,75 @@ package main import ( "context" "flag" - "fmt" "os" "path" "strings" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/google/subcommands" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/assets" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/packager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/version" ) func main() { + var gf commandparser.GlobalFlags + fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError) + fs.BoolVar(&gf.Debug, "debug", false, "Print lots of debugging information") + fs.BoolVar(&gf.Color, "color", false, "Colorize debug output") + fs.BoolVar(&gf.ShowVersion, "version", false, "Show Stembuild version") + fs.BoolVar(&gf.ShowVersion, "v", false, "Stembuild version (shorthand)") + commander := subcommands.NewCommander(fs, path.Base(os.Args[0])) + + stembuildMessenger := messenger.NewStembuildMessenger(commander.Output, commander.Error) + logLevel := colorlogger.NONE + if gf.Debug { + logLevel = colorlogger.DEBUG + } + logger := colorlogger.New(logLevel, gf.Color, commander.Error) + envs := os.Environ() for _, env := range envs { envName := strings.Split(env, "=")[0] if strings.HasPrefix(envName, "GOVC_") || strings.HasPrefix(envName, "GOVMOMI_") { - fmt.Fprintf(os.Stderr, "Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envName) //nolint:errcheck + stembuildMessenger.EnvironmentVariableWarning(envName) } } s := "./StemcellAutomation.zip" err := os.WriteFile(s, assets.StemcellAutomation, 0644) if err != nil { - fmt.Fprintln(os.Stderr, "Unable to write StemcellAutomation.zip") //nolint:errcheck + stembuildMessenger.StemcellAutomationWarning() os.Exit(1) } - var gf commandparser.GlobalFlags - packageCmd := commandparser.NewPackageCommand(version.New(), &packager.Factory{}, &commandparser.PackageMessenger{Output: os.Stderr}) - packageCmd.GlobalFlags = &gf - constructCmd := commandparser.NewConstructCmd(context.Background(), &construct.Factory{}, &vcenter_manager.ManagerFactory{}, &commandparser.ConstructValidator{}, &commandparser.ConstructCmdMessenger{OutputChannel: os.Stderr}) - constructCmd.GlobalFlags = &gf - - var commands = make([]subcommands.Command, 0) - - fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError) - fs.BoolVar(&gf.Debug, "debug", false, "Print lots of debugging information") - fs.BoolVar(&gf.Color, "color", false, "Colorize debug output") - fs.BoolVar(&gf.ShowVersion, "version", false, "Show Stembuild version") - fs.BoolVar(&gf.ShowVersion, "v", false, "Stembuild version (shorthand)") - - commander := subcommands.NewCommander(fs, path.Base(os.Args[0])) - - sh := commandparser.NewStembuildHelp(commander, fs, &commands) - commander.Register(sh, "") - commands = append(commands, sh) + var commands []subcommands.Command + helpCmd := commandparser.NewStembuildHelp(commander, fs, &commands) + commander.Register(helpCmd, "") + commands = append(commands, helpCmd) + packageCmd := commandparser.NewPackageCommand(version.New(), &packager.Factory{}, logger, stembuildMessenger) + packageCmd.GlobalFlags = &gf commander.Register(packageCmd, "") - commander.Register(constructCmd, "") - commands = append(commands, packageCmd) + + constructCmd := commandparser.NewConstructCmd(context.Background(), &construct.Factory{}, &vcenter_manager.ManagerFactory{}, &commandparser.ConstructValidator{}, stembuildMessenger) + constructCmd.GlobalFlags = &gf + commander.Register(constructCmd, "") commands = append(commands, constructCmd) // Override the default usage text of Google's Subcommand with our own - fs.Usage = func() { sh.Explain(commander.Error) } + fs.Usage = func() { helpCmd.Explain(commander.Error) } fs.Parse(os.Args[1:]) //nolint:errcheck if gf.ShowVersion { - fmt.Fprintf(os.Stdout, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Current) //nolint:errcheck - os.Remove(s) //nolint:errcheck + stembuildMessenger.VersionInfo(path.Base(os.Args[0]), version.Current) + os.Remove(s) //nolint:errcheck os.Exit(0) } diff --git a/stembuild/messenger/messenger.go b/stembuild/messenger/messenger.go new file mode 100644 index 000000000..05f53ee69 --- /dev/null +++ b/stembuild/messenger/messenger.go @@ -0,0 +1,21 @@ +package messenger + +import ( + "fmt" + "io" + + "github.com/pkg/errors" +) + +type Messenger interface { + PrintOut(string) + PrintErr(string) +} + +func write(writer io.Writer, message string) { + _, err := writer.Write([]byte(message)) + if err != nil { + err = errors.Wrap(err, fmt.Sprintf("Unable to Write(): '%s'", message)) + panic(err) + } +} diff --git a/stembuild/messenger/messenger_suite_test.go b/stembuild/messenger/messenger_suite_test.go new file mode 100644 index 000000000..724faa538 --- /dev/null +++ b/stembuild/messenger/messenger_suite_test.go @@ -0,0 +1,13 @@ +package messenger_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestCommandParser(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "VmConstructMessenger Suite") +} diff --git a/stembuild/messenger/stembuild_messenger.go b/stembuild/messenger/stembuild_messenger.go new file mode 100644 index 000000000..7743e1a48 --- /dev/null +++ b/stembuild/messenger/stembuild_messenger.go @@ -0,0 +1,35 @@ +package messenger + +import ( + "fmt" + "io" +) + +func NewStembuildMessenger(stdout io.Writer, stderr io.Writer) *StembuildMessenger { + return &StembuildMessenger{stdout: stdout, stderr: stderr} +} + +type StembuildMessenger struct { + stdout io.Writer + stderr io.Writer +} + +func (m *StembuildMessenger) PrintOut(message string) { + write(m.stdout, message) +} + +func (m *StembuildMessenger) PrintErr(message string) { + write(m.stderr, message) +} + +func (m *StembuildMessenger) VersionInfo(executable string, version string) { + write(m.stdout, fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version)) +} + +func (m *StembuildMessenger) EnvironmentVariableWarning(envVarName string) { + write(m.stderr, fmt.Sprintf("Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envVarName)) +} + +func (m *StembuildMessenger) StemcellAutomationWarning() { + write(m.stderr, "Unable to write StemcellAutomation.zip") +} diff --git a/stembuild/messenger/stembuild_messenger_test.go b/stembuild/messenger/stembuild_messenger_test.go new file mode 100644 index 000000000..7383184db --- /dev/null +++ b/stembuild/messenger/stembuild_messenger_test.go @@ -0,0 +1,78 @@ +package messenger_test + +import ( + "fmt" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gbytes" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" +) + +var _ = Describe("StembuildMessenger", func() { + var ( + outBuf *Buffer + errBuf *Buffer + m *messenger.StembuildMessenger + ) + + BeforeEach(func() { + outBuf = NewBuffer() + errBuf = NewBuffer() + m = messenger.NewStembuildMessenger(outBuf, errBuf) + }) + + Describe("PrintOut", func() { + It("outputs the expected warning to stdout", func() { + message := "something went right" + m.PrintOut(message) + + Eventually(outBuf).Should(Say(message)) + }) + }) + + Describe("PrintErr", func() { + It("outputs the expected warning to stderr", func() { + message := "something went wrong" + m.PrintErr(message) + + Eventually(errBuf).Should(Say(message)) + }) + }) + + Describe("EnvironmentVariableWarning", func() { + It("outputs the expected warning to stderr", func() { + envVar := "SOME_VAR" + m.EnvironmentVariableWarning(envVar) + + Eventually(errBuf).Should(Say(fmt.Sprintf("Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envVar))) + }) + }) + + Describe("StemcellAutomationWarning", func() { + It("outputs the expected warning to stderr", func() { + m.StemcellAutomationWarning() + + Eventually(errBuf).Should(Say("Unable to write StemcellAutomation.zip")) + }) + }) + + Describe("StemcellAutomationWarning", func() { + It("outputs the expected warning to stderr", func() { + m.StemcellAutomationWarning() + + Eventually(errBuf).Should(Say("Unable to write StemcellAutomation.zip")) + }) + }) + + Describe("PrintVersionInfo", func() { + It("outputs the expected value to stdout", func() { + executable := "custom-stembuild" + version := "my.custom.version" + m.VersionInfo(executable, version) + + Eventually(outBuf).Should(Say(fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version))) + }) + }) +}) diff --git a/stembuild/package_stemcell/packager/factory.go b/stembuild/package_stemcell/packager/factory.go index ed487a962..718366556 100644 --- a/stembuild/package_stemcell/packager/factory.go +++ b/stembuild/package_stemcell/packager/factory.go @@ -8,12 +8,18 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/commandparser" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" ) type Factory struct{} -func (f *Factory) NewPackager(sourceConfig config.SourceConfig, outputConfig config.OutputConfig, logger colorlogger.Logger) (commandparser.Packager, error) { +func (f *Factory) NewPackager( + sourceConfig config.SourceConfig, + outputConfig config.OutputConfig, + logger colorlogger.Logger, + messenger messenger.Messenger, +) (commandparser.Packager, error) { source, err := sourceConfig.GetSource() if err != nil { return nil, err @@ -35,6 +41,7 @@ func (f *Factory) NewPackager(sourceConfig config.SourceConfig, outputConfig con OutputConfig: outputConfig, Client: client, Logger: logger, + Messenger: messenger, }, nil case config.VMDK: options := @@ -49,6 +56,7 @@ func (f *Factory) NewPackager(sourceConfig config.SourceConfig, outputConfig con Stop: make(chan struct{}), BuildOptions: options, Logger: logger, + Messenger: messenger, }, nil default: return nil, errors.New("unable to determine packager") diff --git a/stembuild/package_stemcell/packager/factory_test.go b/stembuild/package_stemcell/packager/factory_test.go index cad72382b..96819a8a2 100644 --- a/stembuild/package_stemcell/packager/factory_test.go +++ b/stembuild/package_stemcell/packager/factory_test.go @@ -1,6 +1,7 @@ package packager_test import ( + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -17,12 +18,16 @@ var _ = Describe("Factory", func() { OutputDir: "/tmp/outputDir", } - var packagerFactory *packager.Factory - var logger colorlogger.Logger + var ( + packagerFactory *packager.Factory + logger colorlogger.Logger + stembuildMessenger messenger.Messenger + ) BeforeEach(func() { packagerFactory = &packager.Factory{} logger = colorlogger.New(0, false, GinkgoWriter) + stembuildMessenger = messenger.NewStembuildMessenger(GinkgoWriter, GinkgoWriter) }) Describe("GetPackager", func() { @@ -32,7 +37,7 @@ var _ = Describe("Factory", func() { Vmdk: "path/to/a/vmdk", } - actualPackager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger) + actualPackager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger, stembuildMessenger) Expect(err).NotTo(HaveOccurred()) Expect(actualPackager).To(BeAssignableToTypeOf(&packager.VmdkPackager{})) @@ -49,7 +54,7 @@ var _ = Describe("Factory", func() { VmInventoryPath: "some-vm-inventory-path", } - actualPackager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger) + actualPackager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger, stembuildMessenger) Expect(err).NotTo(HaveOccurred()) Expect(actualPackager).To(BeAssignableToTypeOf(&packager.VCenterPackager{})) @@ -64,7 +69,7 @@ var _ = Describe("Factory", func() { VmInventoryPath: "some-vm", } - packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger) + packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger, stembuildMessenger) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("configuration provided for VMDK & vCenter sources")) Expect(packager).To(BeNil()) @@ -79,7 +84,7 @@ var _ = Describe("Factory", func() { URL: "some-url", } - packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger) + packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger, stembuildMessenger) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("missing vCenter configurations")) Expect(packager).To(BeNil()) @@ -90,7 +95,7 @@ var _ = Describe("Factory", func() { It("returns an error", func() { sourceConfig := config.SourceConfig{} - packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger) + packager, err := packagerFactory.NewPackager(sourceConfig, outputConfig, logger, stembuildMessenger) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("no configuration was provided")) Expect(packager).To(BeNil()) diff --git a/stembuild/package_stemcell/packager/vcenter_packager.go b/stembuild/package_stemcell/packager/vcenter_packager.go index 025991fe6..1b770ce9f 100644 --- a/stembuild/package_stemcell/packager/vcenter_packager.go +++ b/stembuild/package_stemcell/packager/vcenter_packager.go @@ -10,6 +10,7 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" ) @@ -29,6 +30,7 @@ type VCenterPackager struct { OutputConfig config.OutputConfig Client IaasClient Logger colorlogger.Logger + Messenger messenger.Messenger } func (v VCenterPackager) Package() error { @@ -57,7 +59,7 @@ func (v VCenterPackager) Package() error { return errors.New("failed to export the prepared VM") } - fmt.Println("Converting VMDK into stemcell") + v.Messenger.PrintOut("Converting VMDK into stemcell") vmName := path.Base(v.SourceConfig.VmInventoryPath) shaSum, err := TarGenerator(filepath.Join(stemcellDir, "image"), filepath.Join(workingDir, vmName)) //nolint:ineffassign,staticcheck manifestContents := CreateManifest(v.OutputConfig.Os, v.OutputConfig.StemcellVersion, shaSum) @@ -70,7 +72,7 @@ func (v VCenterPackager) Package() error { stemcellFilename := StemcellFilename(v.OutputConfig.StemcellVersion, v.OutputConfig.Os) _, err = TarGenerator(filepath.Join(v.OutputConfig.OutputDir, stemcellFilename), stemcellDir) //nolint:ineffassign,staticcheck - fmt.Printf("Stemcell successfully created: %s\n", stemcellFilename) + v.Messenger.PrintOut(fmt.Sprintf("Stemcell successfully created: %s\n", stemcellFilename)) return nil } diff --git a/stembuild/package_stemcell/packager/vcenter_packager_test.go b/stembuild/package_stemcell/packager/vcenter_packager_test.go index 9fc925e3d..5f29dfc5d 100644 --- a/stembuild/package_stemcell/packager/vcenter_packager_test.go +++ b/stembuild/package_stemcell/packager/vcenter_packager_test.go @@ -12,7 +12,9 @@ import ( "path" "path/filepath" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/packager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/packager/packagerfakes" @@ -22,11 +24,13 @@ import ( ) var _ = Describe("VcenterPackager", func() { - - var outputDir string - var sourceConfig config.SourceConfig - var outputConfig config.OutputConfig - var fakeVcenterClient *packagerfakes.FakeIaasClient + var ( + outputDir string + sourceConfig config.SourceConfig + outputConfig config.OutputConfig + fakeVcenterClient *packagerfakes.FakeIaasClient + vcenterPackager *packager.VCenterPackager + ) BeforeEach(func() { // Revert to manual cleanup which fails non-catastrophically on windows @@ -36,6 +40,16 @@ var _ = Describe("VcenterPackager", func() { sourceConfig = config.SourceConfig{Password: "password", URL: "url", Username: "username", VmInventoryPath: "path/valid-vm-name"} outputConfig = config.OutputConfig{Os: "2019", StemcellVersion: "2019.00", OutputDir: outputDir} fakeVcenterClient = &packagerfakes.FakeIaasClient{} + logger := colorlogger.New(0, false, GinkgoWriter) + stembuildMessenger := messenger.NewStembuildMessenger(GinkgoWriter, GinkgoWriter) + + vcenterPackager = &packager.VCenterPackager{ + SourceConfig: sourceConfig, + OutputConfig: outputConfig, + Client: fakeVcenterClient, + Logger: logger, + Messenger: stembuildMessenger, + } }) AfterEach(func() { @@ -49,20 +63,19 @@ var _ = Describe("VcenterPackager", func() { Context("ValidateSourceParameters", func() { It("returns an error if the vCenter url is invalid", func() { fakeVcenterClient.ValidateUrlReturns(errors.New("vcenter client url error")) - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - err := packager.ValidateSourceParameters() + err := vcenterPackager.ValidateSourceParameters() Expect(err).To(HaveOccurred()) Expect(fakeVcenterClient.ValidateUrlCallCount()).To(Equal(1)) Expect(err.Error()).To(Equal("vcenter client url error")) }) + It("returns an error if the vCenter credentials are not valid", func() { fakeVcenterClient.ValidateCredentialsReturns(errors.New("vcenter client credential error")) - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - err := packager.ValidateSourceParameters() + err := vcenterPackager.ValidateSourceParameters() Expect(err).To(HaveOccurred()) Expect(fakeVcenterClient.ValidateCredentialsCallCount()).To(Equal(1)) @@ -71,42 +84,44 @@ var _ = Describe("VcenterPackager", func() { It("returns an error if VM given does not exist ", func() { fakeVcenterClient.FindVMReturns(errors.New("vcenter client vm error")) - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - err := packager.ValidateSourceParameters() + err := vcenterPackager.ValidateSourceParameters() Expect(err).To(HaveOccurred()) Expect(fakeVcenterClient.FindVMCallCount()).To(Equal(1)) Expect(err.Error()).To(Equal("vcenter client vm error")) }) - It("returns no error if all source parameters are valid", func() { - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - err := packager.ValidateSourceParameters() + It("returns no error if all source parameters are valid", func() { + err := vcenterPackager.ValidateSourceParameters() Expect(err).NotTo(HaveOccurred()) }) }) + Context("ValidateFreeSpace", func() { It("is a NOOP", func() { - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - err := packager.ValidateFreeSpaceForPackage(&filesystem.OSFileSystem{}) + err := vcenterPackager.ValidateFreeSpaceForPackage(&filesystem.OSFileSystem{}) Expect(err).To(Not(HaveOccurred())) }) }) Describe("Package", func() { - var vcenterPackager *packager.VCenterPackager - AfterEach(func() { - os.RemoveAll("./valid-vm-name") //nolint:errcheck - os.RemoveAll("image") //nolint:errcheck + ovfName := "./valid-vm-name" + err := os.RemoveAll(ovfName) + if err != nil { + By(fmt.Sprintf("removing '%s' failed: %s", ovfName, err)) + } + imageFile := "image" + err = os.RemoveAll(imageFile) + if err != nil { + By(fmt.Sprintf("removing '%s' failed: %s", imageFile, err)) + } }) BeforeEach(func() { - vcenterPackager = &packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} - fakeVcenterClient.ExportVMStub = func(vmInventoryPath string, destination string) error { vmName := path.Base(vmInventoryPath) os.Mkdir(filepath.Join(destination, vmName), 0777) //nolint:errcheck @@ -125,8 +140,8 @@ var _ = Describe("VcenterPackager", func() { stemcellFilename := packager.StemcellFilename(vcenterPackager.OutputConfig.StemcellVersion, vcenterPackager.OutputConfig.Os) stemcellFile := filepath.Join(vcenterPackager.OutputConfig.OutputDir, stemcellFilename) _, err = os.Stat(stemcellFile) - Expect(err).NotTo(HaveOccurred()) + var actualStemcellManifestContent string expectedManifestContent := `--- name: bosh-vsphere-esxi-windows2019-go_agent @@ -145,6 +160,7 @@ stemcell_formats: gzr, err := gzip.NewReader(fileReader) Expect(err).ToNot(HaveOccurred()) defer gzr.Close() //nolint:errcheck + tarfileReader := tar.NewReader(gzr) count := 0 @@ -173,7 +189,6 @@ stemcell_formats: expectedManifestContent = fmt.Sprintf(expectedManifestContent, actualSha1.Sum(nil)) default: - Fail(fmt.Sprintf("Found unknown file: %s", filepath.Base(header.Name))) } } @@ -229,9 +244,8 @@ stemcell_formats: }) It("Returns a error message if exporting the VM fails", func() { - packager := packager.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: fakeVcenterClient} fakeVcenterClient.ExportVMReturns(errors.New("some client error")) - err := packager.Package() + err := vcenterPackager.Package() Expect(fakeVcenterClient.ExportVMCallCount()).To(Equal(1)) vmPath, _ := fakeVcenterClient.ExportVMArgsForCall(0) diff --git a/stembuild/package_stemcell/packager/vmdk_packager.go b/stembuild/package_stemcell/packager/vmdk_packager.go index bbe17fcbc..cb745ae9d 100644 --- a/stembuild/package_stemcell/packager/vmdk_packager.go +++ b/stembuild/package_stemcell/packager/vmdk_packager.go @@ -16,6 +16,7 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/colorlogger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/filesystem" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/config" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/ovftool" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/templates" @@ -32,6 +33,7 @@ type VmdkPackager struct { Stop chan struct{} BuildOptions config.VmdkOptions Logger colorlogger.Logger + Messenger messenger.Messenger } var ErrInterrupt = errors.New("interrupt") @@ -332,26 +334,25 @@ func (c *VmdkPackager) catchInterruptSignal() { for sig := range ch { c.Logger.Printf("received signal: %s", sig) if stopping { - fmt.Fprintf(os.Stderr, "received second (%s) signal - exiting now\n", sig) //nolint:errcheck - c.Cleanup() // remove temp dir + c.Messenger.PrintErr(fmt.Sprintf("received second (%s) signal - exiting now\n", sig)) + c.Cleanup() os.Exit(1) } stopping = true - fmt.Fprintf(os.Stderr, "received (%s) signal cleaning up\n", sig) //nolint:errcheck + c.Messenger.PrintErr(fmt.Sprintf("received (%s) signal cleaning up\n", sig)) c.StopConfig() } } func (c *VmdkPackager) Package() error { - go c.catchInterruptSignal() start := time.Now() stemcellPath, err := c.ConvertVMDK() if err != nil { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) //nolint:errcheck - c.Cleanup() // remove temp dir + c.Messenger.PrintErr(fmt.Sprintf("Error: %s\n", err)) + c.Cleanup() return err } diff --git a/stembuild/package_stemcell/packager/vmdk_packager_test.go b/stembuild/package_stemcell/packager/vmdk_packager_test.go index d8d696284..765936b05 100644 --- a/stembuild/package_stemcell/packager/vmdk_packager_test.go +++ b/stembuild/package_stemcell/packager/vmdk_packager_test.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -32,6 +33,7 @@ var _ = Describe("VmdkPackager", func() { Stop: make(chan struct{}), BuildOptions: stembuildConfig, Logger: colorlogger.New(0, false, GinkgoWriter), + Messenger: messenger.NewStembuildMessenger(GinkgoWriter, GinkgoWriter), } }) From ef5d7f144d13a90644fef4b897ffb433168f4284 Mon Sep 17 00:00:00 2001 From: aram price Date: Wed, 6 Aug 2025 11:49:06 -0700 Subject: [PATCH 14/21] stembuild: messenger for HelpCommand --- stembuild/commandparser/help.go | 30 ++---- stembuild/messenger/help_messenger.go | 43 ++++++++ stembuild/messenger/help_messenger_test.go | 115 +++++++++++++++++++++ 3 files changed, 169 insertions(+), 19 deletions(-) create mode 100644 stembuild/messenger/help_messenger.go create mode 100644 stembuild/messenger/help_messenger_test.go diff --git a/stembuild/commandparser/help.go b/stembuild/commandparser/help.go index c88d9654b..94563f408 100644 --- a/stembuild/commandparser/help.go +++ b/stembuild/commandparser/help.go @@ -3,13 +3,13 @@ package commandparser import ( "context" "flag" - "fmt" "io" "os" "path" "github.com/google/subcommands" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/version" ) @@ -50,37 +50,29 @@ func (h *stembuildHelp) Usage() string { return h.commander.HelpCommand().Usage() } -func (h *stembuildHelp) Execute(c context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus { - switch f.NArg() { +func (h *stembuildHelp) Execute(ctx context.Context, flagSet *flag.FlagSet, args ...interface{}) subcommands.ExitStatus { + switch flagSet.NArg() { case 0: h.Explain(h.commander.Output) return subcommands.ExitSuccess default: - return h.commander.HelpCommand().Execute(c, f, args) + return h.commander.HelpCommand().Execute(ctx, flagSet, args) } } -func (h *stembuildHelp) Explain(w io.Writer) { +func (h *stembuildHelp) Explain(output io.Writer) { + helpMessenger := messenger.NewHelpMessenger(output) - fmt.Fprintf(w, "%s version %s, Windows Stemcell Building Tool\n\n", path.Base(os.Args[0]), version.Current) //nolint:errcheck - fmt.Fprintf(w, "Usage: %s \n\n", path.Base(os.Args[0])) //nolint:errcheck + helpMessenger.UsagePreamble(path.Base(os.Args[0]), version.Current) - fmt.Fprint(w, "Commands:\n") //nolint:errcheck + helpMessenger.PrintCommandPreamble() for _, command := range *h.commands { - if len(command.Name()) < 5 { // This help align the synopses when the commands are of different lengths - fmt.Fprintf(w, " %s\t\t%s\n", command.Name(), command.Synopsis()) //nolint:errcheck - } else { - fmt.Fprintf(w, " %s\t%s\n", command.Name(), command.Synopsis()) //nolint:errcheck - } + helpMessenger.PrintCommand(command.Name(), command.Synopsis()) } - fmt.Fprint(w, "\nGlobal Options:\n") //nolint:errcheck + helpMessenger.PrintGlobalFlagPreamble() h.topLevelFlags.VisitAll(func(f *flag.Flag) { - if len(f.Name) > 1 { - fmt.Fprintf(w, " -%s\t%s\n", f.Name, f.Usage) //nolint:errcheck - } else { - fmt.Fprintf(w, " -%s\t\t%s\n", f.Name, f.Usage) //nolint:errcheck - } + helpMessenger.PrintGlobalFlag(f.Name, f.Usage) }) } diff --git a/stembuild/messenger/help_messenger.go b/stembuild/messenger/help_messenger.go new file mode 100644 index 000000000..07ad0af58 --- /dev/null +++ b/stembuild/messenger/help_messenger.go @@ -0,0 +1,43 @@ +package messenger + +import ( + "fmt" + "io" +) + +func NewHelpMessenger(output io.Writer) *HelpMessenger { + return &HelpMessenger{output: output} +} + +type HelpMessenger struct { + output io.Writer +} + +func (m *HelpMessenger) UsagePreamble(executable string, version string) { + write(m.output, fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version)) + write(m.output, fmt.Sprintf("Usage: %s \n\n", executable)) +} + +func (m *HelpMessenger) PrintCommandPreamble() { + write(m.output, "Commands:\n") +} + +func (m *HelpMessenger) PrintCommand(command string, description string) { + if len(command) < 5 { // This help align the synopses when the commands are of different lengths + write(m.output, fmt.Sprintf(" %s\t\t%s\n", command, description)) + } else { + write(m.output, fmt.Sprintf(" %s\t%s\n", command, description)) + } +} + +func (m *HelpMessenger) PrintGlobalFlagPreamble() { + write(m.output, "\nGlobal Options:\n") +} + +func (m *HelpMessenger) PrintGlobalFlag(flag string, usage string) { + if len(flag) > 1 { + write(m.output, fmt.Sprintf(" -%s\t%s\n", flag, usage)) + } else { + write(m.output, fmt.Sprintf(" -%s\t\t%s\n", flag, usage)) + } +} diff --git a/stembuild/messenger/help_messenger_test.go b/stembuild/messenger/help_messenger_test.go new file mode 100644 index 000000000..e6a904fe7 --- /dev/null +++ b/stembuild/messenger/help_messenger_test.go @@ -0,0 +1,115 @@ +package messenger_test + +import ( + "fmt" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gbytes" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" +) + +var _ = Describe("HelpMessenger", func() { + var ( + buf *Buffer + m *messenger.HelpMessenger + ) + + BeforeEach(func() { + buf = NewBuffer() + m = messenger.NewHelpMessenger(buf) + }) + + Describe("UsagePreamble", func() { + It("outputs the expected text", func() { + executable := "STEMBUILD_EXECUTABLE" + version := "STEMBUILD_VERSION" + m.UsagePreamble(executable, version) + + expectedText := + fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version) + + fmt.Sprintf("Usage: %s \n\n", executable) + + Eventually(buf).Should(Say(expectedText)) + }) + }) + + Describe("PrintCommandPreamble", func() { + It("outputs the expected text", func() { + m.PrintCommandPreamble() + + Eventually(buf).Should(Say("Commands:\n")) + }) + }) + + Describe("PrintCommand", func() { + var ( + command string + description = "COMMAND DESCRIPTION" + ) + + Context("when the command name is shorter than 5 characters", func() { + BeforeEach(func() { + command = "CMD" + }) + + It("outputs the expected text", func() { + m.PrintCommand(command, description) + + Eventually(buf).Should(Say(fmt.Sprintf(" %s\t\t%s\n", command, description))) + }) + }) + + Context("when the command name is longer than 5 characters", func() { + BeforeEach(func() { + command = "LONG_CMD" + }) + + It("outputs the expected text", func() { + m.PrintCommand(command, description) + + Eventually(buf).Should(Say(fmt.Sprintf(" %s\t%s\n", command, description))) + }) + }) + }) + + Describe("PrintGlobalFlagPreamble", func() { + It("outputs the expected text", func() { + m.PrintGlobalFlagPreamble() + + Eventually(buf).Should(Say("\nGlobal Options:\n")) + }) + }) + + Describe("PrintGlobalFlag", func() { + var ( + flag string + usage = "FLAG USAGE" + ) + + Context("when the flag is longer than 1 character", func() { + BeforeEach(func() { + flag = "long-flag" + }) + + It("outputs the expected text", func() { + m.PrintGlobalFlag(flag, usage) + + Eventually(buf).Should(Say(fmt.Sprintf(" -%s\t%s\n", flag, usage))) + }) + }) + + Context("when the flag is shorter than 1 character", func() { + BeforeEach(func() { + flag = "f" + }) + + It("outputs the expected text", func() { + m.PrintGlobalFlag(flag, usage) + + Eventually(buf).Should(Say(fmt.Sprintf(" -%s\t\t%s\n", flag, usage))) + }) + }) + }) +}) From faf33cfffdf182fb92bb024b3413d7d58eea7edb Mon Sep 17 00:00:00 2001 From: aram price Date: Wed, 6 Aug 2025 17:40:24 -0700 Subject: [PATCH 15/21] stembuild: simplify main() - parse args early - print error if arg parsing fails - print version info early if requested - simplify Messenger struct - use one context.Background() - use defer to remove stemcell automation artifact As part of this the environment_variable_warnings_test is updated because the output of `stembuild version` is printed before the ENV vars are validated. --- .../environment_variable_warnings_test.go | 12 +++--- stembuild/main.go | 40 ++++++++++++------- stembuild/messenger/stembuild_messenger.go | 13 ------ .../messenger/stembuild_messenger_test.go | 37 ----------------- 4 files changed, 30 insertions(+), 72 deletions(-) diff --git a/stembuild/integration/environment_variable_warnings_test.go b/stembuild/integration/environment_variable_warnings_test.go index 9667c6df0..faffa3ac5 100644 --- a/stembuild/integration/environment_variable_warnings_test.go +++ b/stembuild/integration/environment_variable_warnings_test.go @@ -10,9 +10,6 @@ import ( ) var _ = Describe("Environment Variables Warning", func() { - var ( - stembuildExecutable string - ) BeforeEach(func() { var err error stembuildExecutable, err = helpers.BuildStembuild("0.0.0") @@ -21,17 +18,18 @@ var _ = Describe("Environment Variables Warning", func() { When("Environment variables starting with GOVC_* or GOVMOMI_* are set", func() { It("should print a warning for each GOVC_* environment variable", func() { - session := helpers.StembuildWithEnv(map[string]string{"GOVC_BANANA": "I AM A BANANA", "GOVMOMI_POTATO": "THIS IS A POTATO"}, stembuildExecutable, "--version") + session := helpers.StembuildWithEnv(map[string]string{"GOVC_BANANA": "I AM A BANANA", "GOVMOMI_POTATO": "THIS IS A POTATO"}, stembuildExecutable, "package") Eventually(session.Err).Should(Say("Warning: The following environment variable is set and might override flags provided to stembuild: GOVC_BANANA\n")) Consistently(session.Err).ShouldNot(Say("I AM A BANANA")) - Eventually(session).Should(Exit(0)) + Eventually(session).Should(Exit(1)) }) It("should print a warning for each GOVMOMI_* environment variable", func() { - session := helpers.StembuildWithEnv(map[string]string{"GOVC_BANANA": "I AM A BANANA", "GOVMOMI_POTATO": "THIS IS A POTATO"}, stembuildExecutable, "--version") + session := helpers.StembuildWithEnv(map[string]string{"GOVC_BANANA": "I AM A BANANA", "GOVMOMI_POTATO": "THIS IS A POTATO"}, stembuildExecutable, "package") + Eventually(session.Err).Should(Say("Warning: The following environment variable is set and might override flags provided to stembuild: GOVMOMI_POTATO\n")) Consistently(session.Err).ShouldNot(Say("THIS IS A POTATO")) - Eventually(session).Should(Exit(0)) + Eventually(session).Should(Exit(1)) }) }) }) diff --git a/stembuild/main.go b/stembuild/main.go index b9e13ce59..00b566c5a 100644 --- a/stembuild/main.go +++ b/stembuild/main.go @@ -3,6 +3,7 @@ package main import ( "context" "flag" + "fmt" "os" "path" "strings" @@ -26,9 +27,25 @@ func main() { fs.BoolVar(&gf.Color, "color", false, "Colorize debug output") fs.BoolVar(&gf.ShowVersion, "version", false, "Show Stembuild version") fs.BoolVar(&gf.ShowVersion, "v", false, "Stembuild version (shorthand)") + commander := subcommands.NewCommander(fs, path.Base(os.Args[0])) stembuildMessenger := messenger.NewStembuildMessenger(commander.Output, commander.Error) + + stembuildExecutable := path.Base(os.Args[0]) + stembuildArgs := os.Args[1:] + + err := fs.Parse(stembuildArgs) + if err != nil { + stembuildMessenger.PrintErr(fmt.Sprintf("Unable to parse args: %v", stembuildArgs)) + os.Exit(1) + } + + if gf.ShowVersion { + stembuildMessenger.PrintOut(fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", stembuildExecutable, version.Current)) + os.Exit(0) + } + logLevel := colorlogger.NONE if gf.Debug { logLevel = colorlogger.DEBUG @@ -39,16 +56,19 @@ func main() { for _, env := range envs { envName := strings.Split(env, "=")[0] if strings.HasPrefix(envName, "GOVC_") || strings.HasPrefix(envName, "GOVMOMI_") { - stembuildMessenger.EnvironmentVariableWarning(envName) + stembuildMessenger.PrintErr(fmt.Sprintf("Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envName)) } } s := "./StemcellAutomation.zip" - err := os.WriteFile(s, assets.StemcellAutomation, 0644) + err = os.WriteFile(s, assets.StemcellAutomation, 0644) if err != nil { - stembuildMessenger.StemcellAutomationWarning() + stembuildMessenger.PrintErr("Unable to write StemcellAutomation.zip") os.Exit(1) } + defer os.Remove(s) //nolint:errcheck + + ctx := context.Background() var commands []subcommands.Command helpCmd := commandparser.NewStembuildHelp(commander, fs, &commands) @@ -60,7 +80,7 @@ func main() { commander.Register(packageCmd, "") commands = append(commands, packageCmd) - constructCmd := commandparser.NewConstructCmd(context.Background(), &construct.Factory{}, &vcenter_manager.ManagerFactory{}, &commandparser.ConstructValidator{}, stembuildMessenger) + constructCmd := commandparser.NewConstructCmd(ctx, &construct.Factory{}, &vcenter_manager.ManagerFactory{}, &commandparser.ConstructValidator{}, stembuildMessenger) constructCmd.GlobalFlags = &gf commander.Register(constructCmd, "") commands = append(commands, constructCmd) @@ -68,15 +88,5 @@ func main() { // Override the default usage text of Google's Subcommand with our own fs.Usage = func() { helpCmd.Explain(commander.Error) } - fs.Parse(os.Args[1:]) //nolint:errcheck - if gf.ShowVersion { - stembuildMessenger.VersionInfo(path.Base(os.Args[0]), version.Current) - os.Remove(s) //nolint:errcheck - os.Exit(0) - } - - ctx := context.Background() - i := int(commander.Execute(ctx)) - os.Remove(s) //nolint:errcheck - os.Exit(i) + os.Exit(int(commander.Execute(ctx))) } diff --git a/stembuild/messenger/stembuild_messenger.go b/stembuild/messenger/stembuild_messenger.go index 7743e1a48..9a976797f 100644 --- a/stembuild/messenger/stembuild_messenger.go +++ b/stembuild/messenger/stembuild_messenger.go @@ -1,7 +1,6 @@ package messenger import ( - "fmt" "io" ) @@ -21,15 +20,3 @@ func (m *StembuildMessenger) PrintOut(message string) { func (m *StembuildMessenger) PrintErr(message string) { write(m.stderr, message) } - -func (m *StembuildMessenger) VersionInfo(executable string, version string) { - write(m.stdout, fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version)) -} - -func (m *StembuildMessenger) EnvironmentVariableWarning(envVarName string) { - write(m.stderr, fmt.Sprintf("Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envVarName)) -} - -func (m *StembuildMessenger) StemcellAutomationWarning() { - write(m.stderr, "Unable to write StemcellAutomation.zip") -} diff --git a/stembuild/messenger/stembuild_messenger_test.go b/stembuild/messenger/stembuild_messenger_test.go index 7383184db..59ee9b9fc 100644 --- a/stembuild/messenger/stembuild_messenger_test.go +++ b/stembuild/messenger/stembuild_messenger_test.go @@ -1,8 +1,6 @@ package messenger_test import ( - "fmt" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" @@ -40,39 +38,4 @@ var _ = Describe("StembuildMessenger", func() { Eventually(errBuf).Should(Say(message)) }) }) - - Describe("EnvironmentVariableWarning", func() { - It("outputs the expected warning to stderr", func() { - envVar := "SOME_VAR" - m.EnvironmentVariableWarning(envVar) - - Eventually(errBuf).Should(Say(fmt.Sprintf("Warning: The following environment variable is set and might override flags provided to stembuild: %s\n", envVar))) - }) - }) - - Describe("StemcellAutomationWarning", func() { - It("outputs the expected warning to stderr", func() { - m.StemcellAutomationWarning() - - Eventually(errBuf).Should(Say("Unable to write StemcellAutomation.zip")) - }) - }) - - Describe("StemcellAutomationWarning", func() { - It("outputs the expected warning to stderr", func() { - m.StemcellAutomationWarning() - - Eventually(errBuf).Should(Say("Unable to write StemcellAutomation.zip")) - }) - }) - - Describe("PrintVersionInfo", func() { - It("outputs the expected value to stdout", func() { - executable := "custom-stembuild" - version := "my.custom.version" - m.VersionInfo(executable, version) - - Eventually(outBuf).Should(Say(fmt.Sprintf("%s version %s, Windows Stemcell Building Tool\n\n", executable, version))) - }) - }) }) From a91192a79b9de22f9fe06279ee299b122c8c18cf Mon Sep 17 00:00:00 2001 From: aram price Date: Fri, 8 Aug 2025 13:57:34 -0700 Subject: [PATCH 16/21] stembuild: vmconstruct tests assert on behavior Originally these tests relied on spying on "Messenger" structs, this commit changes the specs to also assert on the invocation (or not) of collaborator code instead of relying mostly on log output to test behavior. --- stembuild/construct/vmconstruct_test.go | 911 +++++++++++++++++------- 1 file changed, 641 insertions(+), 270 deletions(-) diff --git a/stembuild/construct/vmconstruct_test.go b/stembuild/construct/vmconstruct_test.go index 6d39e4bea..922fa46cc 100644 --- a/stembuild/construct/vmconstruct_test.go +++ b/stembuild/construct/vmconstruct_test.go @@ -6,21 +6,46 @@ import ( "fmt" "time" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct/constructfakes" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller/pollerfakes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager/remotemanagerfakes" ) +type nonWaitingPoller struct{} + +func (p *nonWaitingPoller) Poll(_ time.Duration, loopFunc func() (bool, error)) error { + poll := true + for poll { + out, err := loopFunc() + if err != nil { + return err + } + poll = !out + } + return nil +} + var _ = Describe("construct_helpers", func() { var ( + outBuf *Buffer + errBuf *Buffer + + testPoller poller.PollerI + useNonWaitingPoller bool + + ctx context.Context fakeRemoteManager *remotemanagerfakes.FakeRemoteManager + vmUsername string + vmPassword string + vmInventoryPath string vmConstruct *construct.VMConstruct fakeVcenterClient *constructfakes.FakeIaasClient fakeGuestManager *constructfakes.FakeGuestManager @@ -28,57 +53,59 @@ var _ = Describe("construct_helpers", func() { fakePoller *pollerfakes.FakePollerI fakeVersionGetter *constructfakes.FakeVersionGetter fakeVMConnectionValidator *constructfakes.FakeVMConnectionValidator + stembuildMessenger messenger.Messenger fakeRebootWaiter *constructfakes.FakeRebootWaiterI fakeScriptExecutor *constructfakes.FakeScriptExecutorI fakeSetupFlags []string - - outBuf *Buffer - errBuf *Buffer ) BeforeEach(func() { + outBuf = NewBuffer() + errBuf = NewBuffer() + + ctx = context.TODO() fakeRemoteManager = &remotemanagerfakes.FakeRemoteManager{} + vmUsername = "fakeUser" + vmPassword = "fakePass" + vmInventoryPath = "fakeVmPath" fakeVcenterClient = &constructfakes.FakeIaasClient{} fakeGuestManager = &constructfakes.FakeGuestManager{} fakeWinRMEnabler = &constructfakes.FakeWinRMEnabler{} fakePoller = &pollerfakes.FakePollerI{} fakeVersionGetter = &constructfakes.FakeVersionGetter{} fakeVMConnectionValidator = &constructfakes.FakeVMConnectionValidator{} + stembuildMessenger = messenger.NewStembuildMessenger(outBuf, errBuf) fakeRebootWaiter = &constructfakes.FakeRebootWaiterI{} fakeScriptExecutor = &constructfakes.FakeScriptExecutorI{} fakeSetupFlags = []string{"SomeFlag SomeValue", "OtherFlag OtherValue"} - outBuf = NewBuffer() - errBuf = NewBuffer() - stembuildMessenger := messenger.NewStembuildMessenger(outBuf, errBuf) + useNonWaitingPoller = false + }) + + JustBeforeEach(func() { + testPoller = fakePoller + if useNonWaitingPoller { + testPoller = &nonWaitingPoller{} + } vmConstruct = construct.NewVMConstruct( - context.TODO(), + ctx, fakeRemoteManager, - "fakeUser", - "fakePass", - "fakeVmPath", + vmUsername, + vmPassword, + vmInventoryPath, fakeVcenterClient, fakeGuestManager, fakeWinRMEnabler, fakeVMConnectionValidator, stembuildMessenger, - fakePoller, + testPoller, fakeVersionGetter, fakeRebootWaiter, fakeScriptExecutor, fakeSetupFlags, ) vmConstruct.RebootWaitTime = 0 - - fakeGuestManager.StartProgramInGuestReturnsOnCall(0, 0, nil) - fakeGuestManager.ExitCodeForProgramInGuestReturnsOnCall(0, 0, nil) - versionBuffer := NewBuffer() - _, err := versionBuffer.Write([]byte("dev")) - Expect(err).NotTo(HaveOccurred()) - - fakeGuestManager.DownloadFileInGuestReturns(versionBuffer, 3, nil) - fakeGuestManager.StartProgramInGuestReturns(0, nil) }) Describe("ScriptExecutor", func() { @@ -135,383 +162,727 @@ var _ = Describe("construct_helpers", func() { }) Describe("PrepareVM", func() { - Describe("can create provision directory", func() { - It("creates it successfully", func() { - err := vmConstruct.PrepareVM() + Describe("creates provision directory", func() { + Context("when it fails", func() { + var makeDirectoryErr error + BeforeEach(func() { + makeDirectoryErr = errors.New("fake-make-directory-error") + fakeVcenterClient.MakeDirectoryReturns(makeDirectoryErr) + }) + + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(Equal(makeDirectoryErr)) + }) - Expect(err).ToNot(HaveOccurred()) - Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) - Eventually(outBuf).Should(Say("\nCreating provision dir on target VM...succeeded.\n")) + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(0)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\nCreating provision dir on target VM...")) + Eventually(outBuf).ShouldNot(Say("\nCreating provision dir on target VM...succeeded.\n")) + }) }) - It("fails when the provision dir cannot be created", func() { - mkDirError := errors.New("failed to create dir") - fakeVcenterClient.MakeDirectoryReturns(mkDirError) + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + }) - err := vmConstruct.PrepareVM() + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to create dir")) - Eventually(outBuf).ShouldNot(Say("\nCreating provision dir on target VM...succeeded.\n")) + Eventually(outBuf).Should(Say("\nCreating provision dir on target VM...succeeded.\n")) + }) }) }) - Describe("enable WinRM", func() { - It("returns failure when it fails to enable winrm", func() { - execError := errors.New("failed to enable winRM") - fakeWinRMEnabler.EnableReturns(execError) + Describe("uploads LGPO.zip", func() { + It("invokes the artifact uploader as expected", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to enable winRM")) + actualVmInventoryPath, actualArtifact, actualDestination, actualVmUsername, actualVmPassword := + fakeVcenterClient.UploadArtifactArgsForCall(0) - Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(actualVmInventoryPath).To(Equal(vmInventoryPath)) + Expect(actualArtifact).To(Equal("./LGPO.zip")) + Expect(actualDestination).To(Equal(`C:\provision\LGPO.zip`)) + Expect(actualVmUsername).To(Equal(vmUsername)) + Expect(actualVmPassword).To(Equal(vmPassword)) }) - It("logs that winrm was successfully enabled", func() { - err := vmConstruct.PrepareVM() + Context("when it fails", func() { + var uploadLgpoErr error - Expect(err).NotTo(HaveOccurred()) - Eventually(outBuf).Should(Say("\nAttempting to enable WinRM on the guest vm...WinRm enabled on the guest VM\n")) - }) - }) + BeforeEach(func() { + uploadLgpoErr = errors.New("fake-upload-lgpo-error") + fakeVcenterClient.UploadArtifactReturnsOnCall(0, uploadLgpoErr) + }) - Describe("connect to VM", func() { - It("checks for WinRM connectivity after WinRM enabled", func() { - var calls []string + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(Equal(uploadLgpoErr)) + }) - fakeWinRMEnabler.EnableCalls(func() error { - calls = append(calls, "enableWinRMCall") - return nil + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(1)) }) - fakeVMConnectionValidator.ValidateCalls(func() error { - calls = append(calls, "validateVMConnCall") - return nil + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\tUploading LGPO to target VM...")) + Eventually(outBuf).ShouldNot(Say("\tUploading LGPO to target VM...succeeded.\n")) + }) + }) + + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) }) - err := vmConstruct.PrepareVM() - Expect(err).NotTo(HaveOccurred()) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Expect(calls[0]).To(Equal("enableWinRMCall")) - Expect(calls[1]).To(Equal("validateVMConnCall")) + Eventually(outBuf).Should(Say("\tUploading LGPO to target VM...succeeded.\n")) + }) }) + }) + + Describe("uploads StemcellAutomation.zip", func() { + It("invokes the artifact uploader as expected", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - It("logs that it successfully validated the vm connection", func() { - err := vmConstruct.PrepareVM() + actualVmInventoryPath, actualArtifact, actualDestination, actualVmUsername, actualVmPassword := + fakeVcenterClient.UploadArtifactArgsForCall(1) - Expect(err).NotTo(HaveOccurred()) - Eventually(outBuf).Should(Say("\nValidating connection to vm...succeeded.\n")) + Expect(actualVmInventoryPath).To(Equal(vmInventoryPath)) + Expect(actualArtifact).To(Equal("./StemcellAutomation.zip")) + Expect(actualDestination).To(Equal(`C:\provision\StemcellAutomation.zip`)) + Expect(actualVmUsername).To(Equal(vmUsername)) + Expect(actualVmPassword).To(Equal(vmPassword)) }) - }) + Context("when it fails", func() { + var uploadStemcellAutomationErr error + + BeforeEach(func() { + uploadStemcellAutomationErr = errors.New("fake-upload-stemcell-automation-error") - Describe("can upload artifacts", func() { - Context("Upload all artifacts correctly", func() { - It("passes successfully", func() { + fakeVcenterClient.UploadArtifactReturnsOnCall(0, nil) + fakeVcenterClient.UploadArtifactReturnsOnCall(1, uploadStemcellAutomationErr) + }) + It("returns the error", func() { err := vmConstruct.PrepareVM() - Expect(err).ToNot(HaveOccurred()) - vmPath, artifact, dest, user, pass := fakeVcenterClient.UploadArtifactArgsForCall(0) - Expect(artifact).To(Equal("./LGPO.zip")) - Expect(vmPath).To(Equal("fakeVmPath")) - Expect(dest).To(Equal("C:\\provision\\LGPO.zip")) - Expect(user).To(Equal("fakeUser")) - Expect(pass).To(Equal("fakePass")) + Expect(err).To(Equal(uploadStemcellAutomationErr)) + }) + + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\tUploading stemcell preparation artifacts to target VM...")) + Eventually(outBuf).ShouldNot(Say("\tUploading stemcell preparation artifacts to target VM...succeeded.\n")) + }) + }) + + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) - Eventually(outBuf).Should(Say("\nTransferring ~20 MB to the Windows VM. Depending on your connection, the transfer may take 15-45 minutes\n")) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + }) - Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "LGPO"))) - Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "stemcell preparation artifacts"))) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Eventually(outBuf).Should(Say("\nAll files have been uploaded.\n")) + Eventually(outBuf).Should(Say("\tUploading stemcell preparation artifacts to target VM...succeeded.\n")) }) }) + }) - Context("Fails to upload one or more artifacts", func() { - It("fails when it cannot upload LGPO", func() { - uploadError := errors.New("failed to upload LGPO") - fakeVcenterClient.UploadArtifactReturns(uploadError) + Describe("enables WinRM", func() { + Context("when it fails", func() { + var enableErr error + BeforeEach(func() { + enableErr = errors.New("fake-enable-winrm-error") + fakeWinRMEnabler.EnableReturns(enableErr) + }) + It("returns the error", func() { err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to upload LGPO")) + Expect(err).To(Equal(enableErr)) + }) - vmPath, artifact, _, _, _ := fakeVcenterClient.UploadArtifactArgsForCall(0) - Expect(artifact).To(Equal("./LGPO.zip")) - Expect(vmPath).To(Equal("fakeVmPath")) - Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(1)) - Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...", "LGPO"))) - Eventually(outBuf).ShouldNot(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "LGPO"))) + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(0)) }) - It("fails when it cannot upload Stemcell Automation scripts", func() { - uploadError := errors.New("failed to upload stemcell automation") - fakeVcenterClient.UploadArtifactReturnsOnCall(0, nil) - fakeVcenterClient.UploadArtifactReturnsOnCall(1, uploadError) + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\nAttempting to enable WinRM on the guest vm...")) + Eventually(outBuf).ShouldNot(Say("WinRm enabled on the guest VM\n")) + }) + }) + + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + }) + + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).Should(Say("WinRm enabled on the guest VM\n")) + }) + }) + }) + Describe("validates VM connection", func() { + Context("when it fails", func() { + var validateErr error + BeforeEach(func() { + validateErr = errors.New("fake-validate-connection-error") + fakeVMConnectionValidator.ValidateReturns(validateErr) + }) + + It("returns the error", func() { err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to upload stemcell automation")) - - vmPath, artifact, _, _, _ := fakeVcenterClient.UploadArtifactArgsForCall(0) - Expect(artifact).To(Equal("./LGPO.zip")) - Expect(vmPath).To(Equal("fakeVmPath")) - vmPath, artifact, _, _, _ = fakeVcenterClient.UploadArtifactArgsForCall(1) - Expect(artifact).To(Equal("./StemcellAutomation.zip")) - Expect(vmPath).To(Equal("fakeVmPath")) + Expect(err).To(Equal(validateErr)) + }) + + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(0)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\nValidating connection to vm...")) + Eventually(outBuf).ShouldNot(Say("\nValidating connection to vm...succeeded.\n")) + }) + }) + + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + }) - Eventually(outBuf).Should(Say(fmt.Sprintf("\tUploading %s to target VM...", "stemcell preparation artifacts"))) - Eventually(outBuf).ShouldNot(Say(fmt.Sprintf("\tUploading %s to target VM...succeeded.\n", "stemcell preparation artifacts"))) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).Should(Say("\nValidating connection to vm...succeeded.\n")) }) }) }) - Describe("logs out users", func() { - var rawLogoffCommand = `&{If([string]::IsNullOrEmpty($(Get-WmiObject win32_computersystem).username)) {Write-Host "No users logged in." } Else {Write-Host "Logging out user."; $(Get-WmiObject win32_operatingsystem).Win32Shutdown(0) 1> $null}}` + Describe("extracts artifacts", func() { + Context("when it fails", func() { + var extractErr error + BeforeEach(func() { + extractErr = errors.New("fake-extract-error") + fakeRemoteManager.ExtractArchiveReturns(extractErr) + }) - It("returns success when active user is logged out", func() { - fakeRemoteManager.ExecuteCommandReturnsOnCall(0, 0, nil) + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(Equal(extractErr)) + }) - err := vmConstruct.PrepareVM() - Expect(err).ToNot(HaveOccurred()) - command := fakeRemoteManager.ExecuteCommandArgsForCall(0) + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - encodedCommand := construct.EncodePowershellCommand([]byte(rawLogoffCommand)) - Expect(command).To(ContainSubstring(encodedCommand)) - Expect(command).To(ContainSubstring("powershell.exe -EncodedCommand ")) + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(0)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) + Eventually(outBuf).Should(Say("\nExtracting artifacts...")) + Eventually(outBuf).ShouldNot(Say("\nExtracting artifacts...succeeded.\n")) + }) }) - It("returns failure when it fails to execute a logout", func() { - errorMessage := "unable to execute command" - fakeRemoteManager.ExecuteCommandReturnsOnCall(0, 1, errors.New(errorMessage)) + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + }) - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring(errorMessage)) - Expect(err.Error()).To(ContainSubstring("log out remote user failed with exit code 1")) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n")) - Eventually(outBuf).ShouldNot(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) + Eventually(outBuf).Should(Say("\nExtracting artifacts...succeeded.\n")) + }) }) }) - Describe("can extract archives", func() { - It("returns failure when it fails to extract archive", func() { - extractError := errors.New("failed to extract archive") - fakeRemoteManager.ExtractArchiveReturns(extractError) - - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) - Expect(err.Error()).To(Equal("failed to extract archive")) - Eventually(outBuf).Should(Say("\nExtracting artifacts...")) - Eventually(outBuf).ShouldNot(Say("\nExtracting artifacts...succeeded.\n")) + Describe("logs out users", func() { + It("constructs the expected powershell command", func() { + rawLogoffCommand := `&{If([string]::IsNullOrEmpty($(Get-WmiObject win32_computersystem).username)) {Write-Host "No users logged in." } Else {Write-Host "Logging out user."; $(Get-WmiObject win32_operatingsystem).Win32Shutdown(0) 1> $null}}` + encodedCommand := construct.EncodePowershellCommand([]byte(rawLogoffCommand)) + + expectedCommand := fmt.Sprintf("powershell.exe -EncodedCommand %s", encodedCommand) + + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + executeCommandArg := fakeRemoteManager.ExecuteCommandArgsForCall(0) + Expect(executeCommandArg).To(Equal(expectedCommand)) }) - It("returns success when it properly extracts archive", func() { - fakeRemoteManager.ExtractArchiveReturns(nil) + Context("when it fails", func() { + var executePowershellCommandErr error + var executePowershellCommandExitCode int + BeforeEach(func() { + executePowershellCommandErr = errors.New("fake-execute-powershell-command-error") + executePowershellCommandExitCode = 90210 + fakeRemoteManager.ExecuteCommandReturns(executePowershellCommandExitCode, executePowershellCommandErr) + }) - err := vmConstruct.PrepareVM() - Expect(err).ToNot(HaveOccurred()) - Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) - source, destination := fakeRemoteManager.ExtractArchiveArgsForCall(0) - Expect(source).To(Equal("C:\\provision\\StemcellAutomation.zip")) - Expect(destination).To(Equal("C:\\provision\\")) + It("returns an error wrapping the original that includes the exit code", func() { + err := vmConstruct.PrepareVM() - Eventually(outBuf).Should(Say("\nExtracting artifacts...succeeded.\n")) + Expect(err.Error()).To(ContainSubstring(executePowershellCommandErr.Error())) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("log out remote user failed with exit code %d", executePowershellCommandExitCode))) + }) + + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(0)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n")) + Eventually(outBuf).ShouldNot(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) + }) }) - }) - Describe("can execute setup scripts", func() { - It("returns failure when it fails to execute setup script", func() { - execError := errors.New("failed to execute setup script") - fakeScriptExecutor.ExecuteSetupScriptReturnsOnCall(0, execError) + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to execute setup script")) + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + }) - Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n")) - Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n")) + Eventually(outBuf).Should(Say("\nAttempting to logout any remote users...\n\nLogged out remote users\n")) + }) }) + }) - It("returns success when it properly executes the setup script", func() { + Describe("executing setup script 1 of 2", func() { + It("invokes the script with the expected args", func() { stembuildVersion := "2019.123.456" fakeVersionGetter.GetVersionReturns(stembuildVersion) - err := vmConstruct.PrepareVM() - Expect(err).ToNot(HaveOccurred()) - - Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(vmConstruct.PrepareVM()).To(Succeed()) version, setupFlags := fakeScriptExecutor.ExecuteSetupScriptArgsForCall(0) Expect(version).To(Equal(stembuildVersion)) Expect(setupFlags).To(Equal(fakeSetupFlags)) - - Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n")) }) - }) - - Describe("can check if vm is rebooting", func() { - It("waits for reboot finished after the setup script has been executed", func() { - var calls []string - fakeRebootWaiter.WaitForRebootFinishedCalls(func() error { - calls = append(calls, "waitForRebootFinishedCall") - return nil + Context("when it fails", func() { + var executeSetupScriptErr error + BeforeEach(func() { + executeSetupScriptErr = errors.New("fake-execute-setup-script-error") + fakeScriptExecutor.ExecuteSetupScriptReturns(executeSetupScriptErr) }) - fakeScriptExecutor.ExecuteSetupScriptCalls(func(version string, setupFlags []string) error { - calls = append(calls, "executeSetupScriptCalls") - return nil + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(Equal(executeSetupScriptErr)) }) - err := vmConstruct.PrepareVM() - Expect(err).NotTo(HaveOccurred()) + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(0)) + }) - Expect(calls[0]).To(Equal("executeSetupScriptCalls")) - Expect(calls[1]).To(Equal("waitForRebootFinishedCall")) + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - Eventually(outBuf).Should(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) + Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n")) + Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n\nWinRM has been disconnected so the VM can reboot.\n")) + }) }) - It("returns failure when it cannot determine if VM is rebooting", func() { - fakeRebootWaiter.WaitForRebootFinishedReturnsOnCall(0, errors.New("polling is hard")) + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + }) - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("polling is hard")) + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Eventually(outBuf).Should(Say("\nThe reboot has started...\n")) - Eventually(outBuf).ShouldNot(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) + Eventually(outBuf).Should(Say("\nExecuting setup script 1 of 2...\n\nFinished executing setup script 1 of 2.\n\nWinRM has been disconnected so the VM can reboot.\n")) + }) }) - }) - Describe("can execute post-reboot script", func() { - It("checks that the reboot has completed before the post reboot script is executed", func() { - var calls []string + Describe("waiting for vm to reboot", func() { + Context("when it fails", func() { + var waitForRebootFinishedErr error + BeforeEach(func() { + waitForRebootFinishedErr = errors.New("fake-wait-for-reboot-finished-error") + fakeRebootWaiter.WaitForRebootFinishedReturns(waitForRebootFinishedErr) + }) - fakeRebootWaiter.WaitForRebootFinishedCalls(func() error { - calls = append(calls, "waitForRebootFinishedCall") - return nil + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(Equal(waitForRebootFinishedErr)) }) - fakeScriptExecutor.ExecutePostRebootScriptCalls(func(duration time.Duration) error { - calls = append(calls, "executePostRebootScriptCalls") - return nil + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(0)) }) - err := vmConstruct.PrepareVM() - Expect(err).NotTo(HaveOccurred()) + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - Expect(calls[0]).To(Equal("waitForRebootFinishedCall")) - Expect(calls[1]).To(Equal("executePostRebootScriptCalls")) + Eventually(outBuf).Should(Say("\nThe reboot has started...\n")) + Eventually(outBuf).ShouldNot(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) + }) }) - It("waits for reboot", func() { - err := vmConstruct.PrepareVM() + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) + }) + + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Expect(err).NotTo(HaveOccurred()) - Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Eventually(outBuf).Should(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) + }) }) + }) - It("returns error if waiting for reboot fails", func() { - rebootWaitError := errors.New("reboot waiting failed :(") - fakeRebootWaiter.WaitForRebootFinishedReturns(rebootWaitError) - err := vmConstruct.PrepareVM() + Describe("executing setup script 2 of 2", func() { + BeforeEach(func() { + fakePoller.PollStub = func(duration time.Duration, pollFunc func() (bool, error)) error { + _, err := pollFunc() + Expect(err).NotTo(HaveOccurred()) + return nil + } + }) - Expect(err).To(MatchError(rebootWaitError)) + Context("script execution returns an error", func() { + var executePostRebootScriptErr error + + Context("and the error contains 'winrm connection event'", func() { + BeforeEach(func() { + executePostRebootScriptErr = errors.New("winrm connection event: nothing-here-matters") + fakeScriptExecutor.ExecutePostRebootScriptReturns(executePostRebootScriptErr) + }) + + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(1)) + }) + + It("logs but does not error on winrm, non-powershell errors", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).Should(Say(fmt.Sprintf("\n%s\n", executePostRebootScriptErr))) + }) + }) - Eventually(outBuf).Should(Say("\nThe reboot has started...\n")) - Eventually(outBuf).ShouldNot(Say("\nThe reboot has started...\n\nThe reboot has finished.\n")) + Context("and the error DOES NOT contain 'winrm connection event'", func() { + BeforeEach(func() { + executePostRebootScriptErr = errors.New("fake-execute-post-reboot-script-error") + fakeScriptExecutor.ExecutePostRebootScriptReturns(executePostRebootScriptErr) + }) + + It("returns an error wrapping the original", func() { + err := vmConstruct.PrepareVM() + + Expect(err.Error()).To(Equal(fmt.Sprintf("failure in post-reboot script: %s", executePostRebootScriptErr))) + }) + + It("does not execute the next step", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(0)) + }) + + It("it logs the attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) + + Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n")) + Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) + }) + }) }) - It("runs post-reboot command", func() { - err := vmConstruct.PrepareVM() + Context("when it succeeds", func() { + It("executes the next step", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Expect(err).NotTo(HaveOccurred()) - Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.MakeDirectoryCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.UploadArtifactCallCount()).To(Equal(2)) + Expect(fakeWinRMEnabler.EnableCallCount()).To(Equal(1)) + Expect(fakeVMConnectionValidator.ValidateCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExtractArchiveCallCount()).To(Equal(1)) + Expect(fakeRemoteManager.ExecuteCommandCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecuteSetupScriptCallCount()).To(Equal(1)) + Expect(fakeRebootWaiter.WaitForRebootFinishedCallCount()).To(Equal(1)) + Expect(fakeScriptExecutor.ExecutePostRebootScriptCallCount()).To(Equal(1)) + Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(1)) + }) + + It("it logs success", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) + Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) + }) }) + }) + + Describe("polls the VM's powered off state", func() { + Describe("poller invocation", func() { + It("invokes the poller with the expected args", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + Eventually(outBuf).Should(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) - It("returns error if running post-reboot command fails", func() { - postRebootError := errors.New("failed to execute command") - fakeScriptExecutor.ExecutePostRebootScriptReturnsOnCall(0, postRebootError) - err := vmConstruct.PrepareVM() + Expect(fakePoller.PollCallCount()).To(Equal(1)) + pollDuration, _ := fakePoller.PollArgsForCall(0) - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring(postRebootError.Error())) - Eventually(outBuf).Should(Say("\nExecuting setup script 2 of 2...\n")) - Eventually(outBuf).ShouldNot(Say("\nExecuting setup script 2 of 2...\n\nFinished executing setup script 2 of 2.\n")) + Expect(pollDuration).To(Equal(time.Minute)) + }) }) - It("logs but does not error on winrm, non-powershell errors", func() { - winrmError := errors.New("winrm connection event: some EOF error") + Describe("polled function", func() { + BeforeEach(func() { + useNonWaitingPoller = true + }) - fakeScriptExecutor.ExecutePostRebootScriptReturnsOnCall(0, winrmError) - err := vmConstruct.PrepareVM() - Expect(err).NotTo(HaveOccurred()) + Context("when the VM fails to power off", func() { + var isPoweredOffErr error - Eventually(outBuf).Should(Say(fmt.Sprintf("\n%s\n", winrmError))) - Eventually(outBuf).ShouldNot(Say("\nFinished executing setup script 2 of 2.\n")) - }) - }) + BeforeEach(func() { + isPoweredOffErr = errors.New("power-off-failed") + }) - Describe("can check that the VM is powered off", func() { - It("runs every minute and returns successfully if polling succeeds", func() { - fakePoller.PollReturns(nil) + Context("on the first attempt", func() { + BeforeEach(func() { + fakeVcenterClient.IsPoweredOffReturns(false, isPoweredOffErr) + }) - fakeVcenterClient.IsPoweredOffReturnsOnCall(0, false, nil) - fakeVcenterClient.IsPoweredOffReturnsOnCall(1, true, nil) - fakeVcenterClient.IsPoweredOffReturnsOnCall(2, false, errors.New("checking for powered off is hard")) + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(MatchError(isPoweredOffErr)) + }) - err := vmConstruct.PrepareVM() - Expect(err).ToNot(HaveOccurred()) - Eventually(outBuf).Should(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + It("does not print subsequent logs", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - Expect(fakePoller.PollCallCount()).To(Equal(1)) - pollDuration, pollFunc := fakePoller.PollArgsForCall(0) + Eventually(outBuf).ShouldNot(Say("Still preparing VM...\n")) + Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + }) + }) - Expect(pollDuration).To(Equal(1 * time.Minute)) + Context("on a subsequent attempt", func() { + BeforeEach(func() { + fakeVcenterClient.IsPoweredOffReturnsOnCall(0, false, nil) + fakeVcenterClient.IsPoweredOffReturnsOnCall(1, false, isPoweredOffErr) + }) - Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(0)) - Eventually(outBuf).ShouldNot(Say(" Still preparing VM...\n")) + It("returns the error", func() { + err := vmConstruct.PrepareVM() + Expect(err).To(MatchError(isPoweredOffErr)) + }) - isPoweredOff, err := pollFunc() - Expect(isPoweredOff).To(BeFalse()) - Expect(err).NotTo(HaveOccurred()) - Eventually(outBuf).Should(Say(" Still preparing VM...\n")) + It("logs a polling attempt", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - isPoweredOff, err = pollFunc() - Expect(isPoweredOff).To(BeTrue()) - Expect(err).NotTo(HaveOccurred()) - //Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) + Eventually(outBuf).Should(Say("Still preparing VM...\n")) + }) - _, err = pollFunc() - Expect(err).To(MatchError("checking for powered off is hard")) - //Expect(fakeMessenger.WaitingForShutdownCallCount()).To(Equal(2)) + It("does not print subsequent logs", func() { + Expect(vmConstruct.PrepareVM()).NotTo(Succeed()) - Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(3)) - }) + Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + }) + }) + }) + + Context("when the VM successfully powers off", func() { + Context("on the first attempt", func() { + BeforeEach(func() { + fakeVcenterClient.IsPoweredOffReturnsOnCall(0, true, nil) + }) - It("returns failure when it cannot determine VM power state", func() { - errorString := "cannot determine VM state" - fakePoller.PollReturnsOnCall(0, errors.New(errorString)) + It("executes the is-powered-off func once", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) - err := vmConstruct.PrepareVM() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal(errorString)) + Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(1)) + }) - Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + It("does not log a polling attempt", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).Should(Say("Still preparing VM...\n")) + }) + + It("prints subsequent logs", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + }) + }) + + Context("on a subsequent attempt", func() { + BeforeEach(func() { + fakeVcenterClient.IsPoweredOffReturnsOnCall(0, false, nil) + fakeVcenterClient.IsPoweredOffReturnsOnCall(1, true, nil) + }) + + It("executes the is-powered-off func twice", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Expect(fakeVcenterClient.IsPoweredOffCallCount()).To(Equal(2)) + }) + + It("logs a polling attempt", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).Should(Say("Still preparing VM...\n")) + }) + + It("prints subsequent logs", func() { + Expect(vmConstruct.PrepareVM()).To(Succeed()) + + Eventually(outBuf).ShouldNot(Say("VM has now been shutdown. Run `stembuild package` to finish building the stemcell.\n")) + }) + }) + }) }) }) }) From 5e9f4911db6fefaea489c94a66fb4a87e60f0e05 Mon Sep 17 00:00:00 2001 From: aram price Date: Fri, 8 Aug 2025 14:28:01 -0700 Subject: [PATCH 17/21] stembuild: vmconstruct extract ScriptExecutor --- stembuild/construct/script_executor.go | 47 ++++++++ stembuild/construct/script_executor_test.go | 114 ++++++++++++++++++++ stembuild/construct/vmconstruct.go | 38 ------- stembuild/construct/vmconstruct_test.go | 54 ---------- 4 files changed, 161 insertions(+), 92 deletions(-) create mode 100644 stembuild/construct/script_executor.go create mode 100644 stembuild/construct/script_executor_test.go diff --git a/stembuild/construct/script_executor.go b/stembuild/construct/script_executor.go new file mode 100644 index 000000000..01dc01e65 --- /dev/null +++ b/stembuild/construct/script_executor.go @@ -0,0 +1,47 @@ +package construct + +import ( + "fmt" + "strings" + "time" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" +) + +type ScriptExecutor struct { + remoteManager remotemanager.RemoteManager +} + +func NewScriptExecutor(remoteManager remotemanager.RemoteManager) *ScriptExecutor { + return &ScriptExecutor{ + remoteManager, + } +} + +func (e *ScriptExecutor) ExecuteSetupScript(stembuildVersion string, setupFlags []string) error { + var automationSetupScriptArgs []string + automationSetupScriptArgs = append(automationSetupScriptArgs, fmt.Sprintf("-Version %s", stembuildVersion)) + + for _, arg := range setupFlags { + automationSetupScriptArgs = append(automationSetupScriptArgs, fmt.Sprintf("-%s", arg)) + } + + powershellCommand := fmt.Sprintf("powershell.exe %s %s", stemcellAutomationSetupScript, strings.Join(automationSetupScriptArgs, " ")) + _, err := e.remoteManager.ExecuteCommand(powershellCommand) + return err +} + +func (e *ScriptExecutor) ExecutePostRebootScript(timeout time.Duration) error { + _, err := e.remoteManager.ExecuteCommandWithTimeout("powershell.exe "+stemcellAutomationPostRebootScript, timeout) + + if err != nil && strings.Contains(err.Error(), remotemanager.PowershellExecutionErrorMessage) { + return err + } + + if err != nil { + return fmt.Errorf("winrm connection event: %s", err) + } + + return nil + +} diff --git a/stembuild/construct/script_executor_test.go b/stembuild/construct/script_executor_test.go new file mode 100644 index 000000000..3c5887bcb --- /dev/null +++ b/stembuild/construct/script_executor_test.go @@ -0,0 +1,114 @@ +package construct_test + +import ( + "errors" + "fmt" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager/remotemanagerfakes" +) + +var _ = Describe("NewScriptExecutor", func() { + var ( + fakeRemoteManager *remotemanagerfakes.FakeRemoteManager + + scriptExecutor *construct.ScriptExecutor + ) + + BeforeEach(func() { + fakeRemoteManager = &remotemanagerfakes.FakeRemoteManager{} + + scriptExecutor = construct.NewScriptExecutor(fakeRemoteManager) + }) + + Describe("ScriptExecutor", func() { + Describe("ExecuteSetupScript", func() { + It("executes setup script with correct arguments", func() { + version := "11.11.11" + setupFlags := []string{"SomeFlag SomeValue", "OtherFlag OtherValue"} + expectedCommandInvocation := + fmt.Sprintf( + "powershell.exe %s -Version %s %s", + `C:\provision\Setup.ps1`, + version, + "-SomeFlag SomeValue -OtherFlag OtherValue", + ) + + err := scriptExecutor.ExecuteSetupScript(version, setupFlags) + Expect(err).NotTo(HaveOccurred()) + + executeCommandCallArg := fakeRemoteManager.ExecuteCommandArgsForCall(0) + + Expect(executeCommandCallArg).To(Equal(expectedCommandInvocation)) + }) + }) + + Describe("ExecutePostRebootScript", func() { + var expectedTimeout time.Duration + + BeforeEach(func() { + expectedTimeout = 24 * time.Hour + }) + + It("executes post-reboot script with correct arguments", func() { + expectedCommandInvocation := + fmt.Sprintf( + "powershell.exe %s", + `C:\provision\PostReboot.ps1`, + ) + + err := scriptExecutor.ExecutePostRebootScript(expectedTimeout) + Expect(err).NotTo(HaveOccurred()) + + executeCommandWithTimeoutCallArg, actualTimeout := fakeRemoteManager.ExecuteCommandWithTimeoutArgsForCall(0) + + Expect(executeCommandWithTimeoutCallArg).To(Equal(expectedCommandInvocation)) + Expect(expectedTimeout).To(Equal(actualTimeout)) + }) + + Context("when there is an error", func() { + var commandExecutionErrorCode int + var commandExecutionErr error + + BeforeEach(func() { + commandExecutionErrorCode = 999 + }) + + Context("when the error is a powershell execution error", func() { + BeforeEach(func() { + powershellErrorPrefix := errors.New(remotemanager.PowershellExecutionErrorMessage) + commandExecutionErr = fmt.Errorf("%s: %s", powershellErrorPrefix, "a command failed to run") + + fakeRemoteManager.ExecuteCommandWithTimeoutReturns(commandExecutionErrorCode, commandExecutionErr) + }) + + It("returns the error", func() { + err := scriptExecutor.ExecutePostRebootScript(expectedTimeout) + + Expect(err).To(MatchError(commandExecutionErr)) + }) + }) + + Context("when the error is a NOT powershell execution error", func() { + BeforeEach(func() { + commandExecutionErr = errors.New("fake-non-powershell-execution-error") + }) + + It("wraps a non-powershell execution error", func() { + fakeRemoteManager.ExecuteCommandWithTimeoutReturns(1, commandExecutionErr) + + err := scriptExecutor.ExecutePostRebootScript(expectedTimeout) + + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(Equal(fmt.Sprintf("winrm connection event: %s", commandExecutionErr.Error()))) + }) + }) + }) + }) + }) +}) diff --git a/stembuild/construct/vmconstruct.go b/stembuild/construct/vmconstruct.go index 05e475b61..869fca721 100644 --- a/stembuild/construct/vmconstruct.go +++ b/stembuild/construct/vmconstruct.go @@ -252,44 +252,6 @@ func (c *VMConstruct) logOutUsers() error { return nil } -type ScriptExecutor struct { - remoteManager remotemanager.RemoteManager -} - -func NewScriptExecutor(remoteManager remotemanager.RemoteManager) *ScriptExecutor { - return &ScriptExecutor{ - remoteManager, - } -} - -func (e *ScriptExecutor) ExecuteSetupScript(stembuildVersion string, setupFlags []string) error { - var automationSetupScriptArgs []string - automationSetupScriptArgs = append(automationSetupScriptArgs, fmt.Sprintf("-Version %s", stembuildVersion)) - - for _, arg := range setupFlags { - automationSetupScriptArgs = append(automationSetupScriptArgs, fmt.Sprintf("-%s", arg)) - } - - powershellCommand := fmt.Sprintf("powershell.exe %s %s", stemcellAutomationSetupScript, strings.Join(automationSetupScriptArgs, " ")) - _, err := e.remoteManager.ExecuteCommand(powershellCommand) - return err -} - -func (e *ScriptExecutor) ExecutePostRebootScript(timeout time.Duration) error { - _, err := e.remoteManager.ExecuteCommandWithTimeout("powershell.exe "+stemcellAutomationPostRebootScript, timeout) - - if err != nil && strings.Contains(err.Error(), remotemanager.PowershellExecutionErrorMessage) { - return err - } - - if err != nil { - return fmt.Errorf("winrm connection event: %s", err) - } - - return nil - -} - func (c *VMConstruct) isPoweredOff(duration time.Duration) error { const timeStampFormat = "2006-01-02T15:04:05.999999-07:00" err := c.poller.Poll(duration, func() (bool, error) { diff --git a/stembuild/construct/vmconstruct_test.go b/stembuild/construct/vmconstruct_test.go index 922fa46cc..f9c77f6fa 100644 --- a/stembuild/construct/vmconstruct_test.go +++ b/stembuild/construct/vmconstruct_test.go @@ -15,7 +15,6 @@ import ( "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/construct/constructfakes" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/messenger" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/poller/pollerfakes" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/remotemanager/remotemanagerfakes" ) @@ -108,59 +107,6 @@ var _ = Describe("construct_helpers", func() { vmConstruct.RebootWaitTime = 0 }) - Describe("ScriptExecutor", func() { - It("executes setup script with correct arguments", func() { - e := construct.NewScriptExecutor(fakeRemoteManager) - version := "11.11.11" - err := e.ExecuteSetupScript(version, fakeSetupFlags) - executeCommandCallArg := fakeRemoteManager.ExecuteCommandArgsForCall(0) - - Expect(err).NotTo(HaveOccurred()) - Expect(executeCommandCallArg).To(ContainSubstring("powershell")) - Expect(executeCommandCallArg).To(ContainSubstring("Setup.ps1")) - Expect(executeCommandCallArg).To(ContainSubstring(" -Version " + version)) - Expect(executeCommandCallArg).To(ContainSubstring(" -SomeFlag SomeValue")) - Expect(executeCommandCallArg).To(ContainSubstring(" -OtherFlag OtherValue")) - }) - - It("executes post-reboot script with correct arguments", func() { - e := construct.NewScriptExecutor(fakeRemoteManager) - superLongTimeout := 24 * time.Hour - err := e.ExecutePostRebootScript(superLongTimeout) - executeCommandCallArg, timeout := fakeRemoteManager.ExecuteCommandWithTimeoutArgsForCall(0) - - Expect(err).NotTo(HaveOccurred()) - Expect(executeCommandCallArg).To(ContainSubstring("powershell")) - Expect(executeCommandCallArg).To(ContainSubstring("PostReboot.ps1")) - Expect(timeout).To(Equal(superLongTimeout)) - }) - - It("returns an error when there is a powershell script execution error", func() { - e := construct.NewScriptExecutor(fakeRemoteManager) - superLongTimeout := 24 * time.Hour - powershellErrorPrefix := errors.New(remotemanager.PowershellExecutionErrorMessage) - powershellErr := fmt.Errorf("%s: %s", powershellErrorPrefix, "a command failed to run") - fakeRemoteManager.ExecuteCommandWithTimeoutReturns(2, powershellErr) - - err := e.ExecutePostRebootScript(superLongTimeout) - - Expect(err).To(MatchError(powershellErr)) - }) - - It("wraps a non-powershell execution error", func() { - e := construct.NewScriptExecutor(fakeRemoteManager) - superLongTimeout := 24 * time.Hour - winRMError := errors.New("some EOF thing") - - fakeRemoteManager.ExecuteCommandWithTimeoutReturns(1, winRMError) - - err := e.ExecutePostRebootScript(superLongTimeout) - - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("winrm connection event")) - }) - }) - Describe("PrepareVM", func() { Describe("creates provision directory", func() { Context("when it fails", func() { From afb13003c2d192520affa8c5fd3e1a701c0b54d9 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 12 Aug 2025 16:06:07 -0700 Subject: [PATCH 18/21] stembuild: vmconstruct code cleanup - rename constant for clarity - use backtick to elimiate string escaping --- stembuild/construct/vmconstruct.go | 6 ++++-- stembuild/construct/winrm.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stembuild/construct/vmconstruct.go b/stembuild/construct/vmconstruct.go index 869fca721..dba4cc83c 100644 --- a/stembuild/construct/vmconstruct.go +++ b/stembuild/construct/vmconstruct.go @@ -42,13 +42,15 @@ type VMConstruct struct { SetupFlags []string } -const provisionDir = "C:\\provision\\" +const powershellExePath = `C:\Windows\System32\WindowsPowerShell\V1.0\powershell.exe` + +const provisionDir = `C:\provision\` const stemcellAutomationName = "StemcellAutomation.zip" const stemcellAutomationDest = provisionDir + stemcellAutomationName const lgpoDest = provisionDir + "LGPO.zip" const stemcellAutomationSetupScript = provisionDir + "Setup.ps1" const stemcellAutomationPostRebootScript = provisionDir + "PostReboot.ps1" -const powershell = "C:\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe" + const boshPsModules = "bosh-psmodules.zip" const winRMPsScript = "BOSH.WinRM.psm1" diff --git a/stembuild/construct/winrm.go b/stembuild/construct/winrm.go index 2e3da03a4..901b02d0a 100644 --- a/stembuild/construct/winrm.go +++ b/stembuild/construct/winrm.go @@ -35,7 +35,7 @@ func (w *WinRMManager) Enable() error { base64WinRM := EncodePowershellCommand(rawWinRMwtCmd) - pid, err := w.GuestManager.StartProgramInGuest(context.Background(), powershell, fmt.Sprintf("-EncodedCommand %s", base64WinRM)) + pid, err := w.GuestManager.StartProgramInGuest(context.Background(), powershellExePath, fmt.Sprintf("-EncodedCommand %s", base64WinRM)) if err != nil { return fmt.Errorf(failureString, err) } From 5bc8d2cd669b1715b6561916d290d0fd7fc51bd4 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 12 Aug 2025 14:02:56 -0700 Subject: [PATCH 19/21] stembuild: reorganize VcenterClient - extract method to build VM auth parameter `-l ...` - rename internal struct for clarity - normalize spacing - move private members to end of file --- .../iaas_cli/iaas_clients/vcenter_client.go | 79 +- .../iaas_clients/vcenter_client_test.go | 780 +++++++++--------- 2 files changed, 448 insertions(+), 411 deletions(-) diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_client.go b/stembuild/iaas_cli/iaas_clients/vcenter_client.go index c84a0c2c3..a84b108f7 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_client.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_client.go @@ -93,6 +93,7 @@ func (c *VcenterClient) ListDevices(vmInventoryPath string) ([]string, error) { return devices, nil } + func (c *VcenterClient) RemoveDevice(vmInventoryPath string, deviceName string) error { args := c.buildGovcCommand("device.remove", "-vm", vmInventoryPath, deviceName) errCode := c.Runner.Run(args) @@ -128,8 +129,7 @@ func (c *VcenterClient) ExportVM(vmInventoryPath string, destination string) err } func (c *VcenterClient) UploadArtifact(vmInventoryPath, artifact, destination, username, password string) error { - vmCredentials := fmt.Sprintf("%s:%s", username, password) - args := c.buildGovcCommand("guest.upload", "-f", "-l", vmCredentials, "-vm", vmInventoryPath, artifact, destination) + args := c.buildGovcCommand("guest.upload", "-f", "-l", vmCredentials(username, password), "-vm", vmInventoryPath, artifact, destination) errCode := c.Runner.Run(args) if errCode != 0 { return fmt.Errorf("vcenter_client - %s could not be uploaded", artifact) @@ -139,9 +139,7 @@ func (c *VcenterClient) UploadArtifact(vmInventoryPath, artifact, destination, u } func (c *VcenterClient) MakeDirectory(vmInventoryPath, path, username, password string) error { - vmCredentials := fmt.Sprintf("%s:%s", username, password) - - args := c.buildGovcCommand("guest.mkdir", "-l", vmCredentials, "-vm", vmInventoryPath, "-p", path) + args := c.buildGovcCommand("guest.mkdir", "-l", vmCredentials(username, password), "-vm", vmInventoryPath, "-p", path) errCode := c.Runner.Run(args) if errCode != 0 { return fmt.Errorf("vcenter_client - directory `%s` could not be created", path) @@ -150,10 +148,26 @@ func (c *VcenterClient) MakeDirectory(vmInventoryPath, path, username, password return nil } -func (c *VcenterClient) Start(vmInventoryPath, username, password, command string, args ...string) (string, error) { - vmCredentials := fmt.Sprintf("%s:%s", username, password) +func (c *VcenterClient) IsPoweredOff(vmInventoryPath string) (bool, error) { + args := c.buildGovcCommand("vm.info", vmInventoryPath) + out, exitCode, err := c.Runner.RunWithOutput(args) + if exitCode != 0 { + return false, fmt.Errorf("vcenter_client - failed to get vm info, govc exit code: %d", exitCode) + } + + if err != nil { + return false, fmt.Errorf("vcenter_client - failed to determine vm power state: %s", err) + } + + if strings.Contains(out, "poweredOff") { + return true, nil + } - cmdArgs := c.buildGovcCommand(append([]string{"guest.start", "-l", vmCredentials, "-vm", vmInventoryPath, command}, args...)...) + return false, nil +} + +func (c *VcenterClient) Start(vmInventoryPath, username, password, command string, args ...string) (string, error) { + cmdArgs := c.buildGovcCommand(append([]string{"guest.start", "-l", vmCredentials(username, password), "-vm", vmInventoryPath, command}, args...)...) pid, exitCode, err := c.Runner.RunWithOutput(cmdArgs) if err != nil { return "", fmt.Errorf("vcenter_client - failed to run '%s': %s", command, err) @@ -165,21 +179,8 @@ func (c *VcenterClient) Start(vmInventoryPath, username, password, command strin return strings.TrimSuffix(pid, "\n"), nil // trim since govc outputs the pid with an '\n' in the output } -type govcPS struct { - ProcessInfo []struct { - Name string - Pid int - Owner string - CmdLine string - StartTime string - EndTime string - ExitCode int - } -} - func (c *VcenterClient) WaitForExit(vmInventoryPath, username, password, pid string) (int, error) { - vmCredentials := fmt.Sprintf("%s:%s", username, password) - args := c.buildGovcCommand("guest.ps", "-l", vmCredentials, "-vm", vmInventoryPath, "-p", pid, "-X", "-json") + args := c.buildGovcCommand("guest.ps", "-l", vmCredentials(username, password), "-vm", vmInventoryPath, "-p", pid, "-X", "-json") output, exitCode, err := c.Runner.RunWithOutput(args) if err != nil { return 0, fmt.Errorf("vcenter_client - failed to fetch exit code for PID %s: %s", pid, err) @@ -188,16 +189,16 @@ func (c *VcenterClient) WaitForExit(vmInventoryPath, username, password, pid str return 0, fmt.Errorf("vcenter_client - fetching PID %s returned with exit code: %d", pid, exitCode) } - ps := govcPS{} - err = json.Unmarshal([]byte(output), &ps) + var processInfos govcProcessInfos + err = json.Unmarshal([]byte(output), &processInfos) if err != nil { return 0, fmt.Errorf("vcenter_client - received bad JSON output for PID %s: %s", pid, output) } - if len(ps.ProcessInfo) != 1 { + if len(processInfos.ProcessInfo) != 1 { return 0, fmt.Errorf("vcenter_client - couldn't get exit code for PID %s", pid) } - return ps.ProcessInfo[0].ExitCode, nil + return processInfos.ProcessInfo[0].ExitCode, nil } func (c *VcenterClient) buildGovcCommand(args ...string) []string { @@ -210,20 +211,18 @@ func (c *VcenterClient) buildGovcCommand(args ...string) []string { return args } -func (c *VcenterClient) IsPoweredOff(vmInventoryPath string) (bool, error) { - args := c.buildGovcCommand("vm.info", vmInventoryPath) - out, exitCode, err := c.Runner.RunWithOutput(args) - if exitCode != 0 { - return false, fmt.Errorf("vcenter_client - failed to get vm info, govc exit code: %d", exitCode) - } - - if err != nil { - return false, fmt.Errorf("vcenter_client - failed to determine vm power state: %s", err) - } +func vmCredentials(username, password string) string { + return fmt.Sprintf("%s:%s", username, password) +} - if strings.Contains(out, "poweredOff") { - return true, nil +type govcProcessInfos struct { + ProcessInfo []struct { + Name string + Pid int + Owner string + CmdLine string + StartTime string + EndTime string + ExitCode int } - - return false, nil } diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go index 40fdc2233..075d837dc 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go @@ -1,66 +1,51 @@ -package iaas_clients +package iaas_clients_test import ( "errors" "fmt" + "net/url" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clifakes" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) +func vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl string) string { + return fmt.Sprintf("%s:%s@%s", vcenterUsername, vcenterPassword, vcenterUrl) +} + var _ = Describe("VcenterClient", func() { - var ( - runner *iaas_clifakes.FakeCliRunner - username, password, url string - vcenterClient *VcenterClient - credentialUrl string - caCertFile string - ) + var runner *iaas_clifakes.FakeCliRunner BeforeEach(func() { runner = &iaas_clifakes.FakeCliRunner{} - username, password, caCertFile, url = "username", "password", "", "url" - vcenterClient = NewVcenterClient(username, password, url, caCertFile, runner) - credentialUrl = fmt.Sprintf("%s:%s@%s", username, password, url) }) - Context("NewVcenterClient", func() { - It("url encodes credentials with special characters", func() { - client := NewVcenterClient(`special\chars!user#`, `special^chars*pass`, url, caCertFile, runner) + Describe("NewVcenterClient", func() { + var ( + vcenterUsername string + vcenterPassword string + vcenterUrl string - urlEncodedCredentials := `special%5Cchars%21user%23:special%5Echars%2Apass@url` - expectedArgs := []string{"about", "-u", urlEncodedCredentials} + encodedUsername string + encodedPassword string + ) - runner.RunReturns(0) - err := client.ValidateCredentials() - argsForRun := runner.RunArgsForCall(0) + BeforeEach(func() { + vcenterUsername = `special\chars!user#` + vcenterPassword = `special\chars!user#` + vcenterUrl = "fake-url" - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) + encodedUsername = url.QueryEscape(vcenterUsername) + encodedPassword = url.QueryEscape(vcenterPassword) }) - }) - - Context("A ca cert file is specified", func() { - It("Passes the ca cert to govc", func() { - vcenterClient = NewVcenterClient(username, password, url, "somefile.txt", runner) - expectedArgs := []string{"about", "-u", credentialUrl, "-tls-ca-certs=somefile.txt"} - runner.RunReturns(0) - err := vcenterClient.ValidateCredentials() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - }) - }) + It("url encodes credentials with special characters", func() { + vcenterClient := iaas_clients.NewVcenterClient(vcenterUsername, vcenterPassword, vcenterUrl, "", runner) - Context("ValidateCredentials", func() { - It("When the login credentials are correct, login is successful", func() { - expectedArgs := []string{"about", "-u", credentialUrl} + expectedArgs := []string{"about", "-u", vcenterAuthUrl(encodedUsername, encodedPassword, vcenterUrl)} runner.RunReturns(0) err := vcenterClient.ValidateCredentials() @@ -71,141 +56,194 @@ var _ = Describe("VcenterClient", func() { Expect(argsForRun).To(Equal(expectedArgs)) }) - It("When the login credentials are incorrect, login is a failure", func() { - expectedArgs := []string{"about", "-u", credentialUrl} - - runner.RunReturns(1) - err := vcenterClient.ValidateCredentials() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(HaveOccurred()) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - Expect(err).To(MatchError("vcenter_client - invalid credentials for: username:REDACTED@url")) - }) - }) - - Context("validateUrl", func() { - It("When the url is valid, there is no error", func() { - expectedArgs := []string{"about", "-u", url} - - runner.RunReturns(0) - err := vcenterClient.ValidateUrl() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - }) - - It("When the url is invalid, there is an error", func() { - expectedArgs := []string{"about", "-u", url} + Context("A ca cert file is specified", func() { + It("Passes the ca cert to govc", func() { + vcenterClient := iaas_clients.NewVcenterClient(vcenterUsername, vcenterPassword, vcenterUrl, "fake-cert-file.txt", runner) - runner.RunReturns(1) - err := vcenterClient.ValidateUrl() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(HaveOccurred()) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - Expect(err).To(MatchError("vcenter_client - unable to validate url: url")) - }) - - It("a validateUrl failure mentions the ca cert if one was specified", func() { - - vcenterClient = NewVcenterClient(username, password, url, "somefile.txt", runner) - expectedArgs := []string{"about", "-u", url, "-tls-ca-certs=somefile.txt"} - - runner.RunReturns(1) - err := vcenterClient.ValidateUrl() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(HaveOccurred()) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - Expect(err).To(MatchError("vcenter_client - invalid ca certs or url: url")) - }) - - It("passes the ca cert to govc when specified", func() { - - vcenterClient = NewVcenterClient(username, password, url, "somefile.txt", runner) - expectedArgs := []string{"about", "-u", url, "-tls-ca-certs=somefile.txt"} - - runner.RunReturns(0) - err := vcenterClient.ValidateUrl() - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - }) - }) + expectedArgs := []string{"about", "-u", vcenterAuthUrl(encodedUsername, encodedPassword, vcenterUrl), "-tls-ca-certs=fake-cert-file.txt"} - Context("FindVM", func() { - It("If the VM path is valid, and the VM is found", func() { - expectedArgs := []string{"find", "-u", credentialUrl, "-maxdepth=0", "validVMPath"} - runner.RunReturns(0) - err := vcenterClient.FindVM("validVMPath") - argsForRun := runner.RunArgsForCall(0) + runner.RunReturns(0) + err := vcenterClient.ValidateCredentials() + argsForRun := runner.RunArgsForCall(0) - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - }) - - It("If the VM path is invalid", func() { - expectedArgs := []string{"find", "-u", credentialUrl, "-maxdepth=0", "invalidVMPath"} - runner.RunReturns(1) - err := vcenterClient.FindVM("invalidVMPath") - argsForRun := runner.RunArgsForCall(0) - - Expect(err).To(HaveOccurred()) - Expect(runner.RunCallCount()).To(Equal(1)) - Expect(argsForRun).To(Equal(expectedArgs)) - Expect(err).To(MatchError("vcenter_client - unable to find VM: invalidVMPath. Ensure your inventory path is formatted properly and includes \"vm\" in its path, example: /my-datacenter/vm/my-folder/my-vm-name")) + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + }) }) }) - Describe("RemoveDevice", func() { - It("Removes a device from the given VM", func() { - runner.RunReturns(0) - err := vcenterClient.RemoveDevice("validVMPath", "device") - - Expect(err).To(Not(HaveOccurred())) - expectedArgs := []string{"device.remove", "-u", credentialUrl, "-vm", "validVMPath", "device"} - Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) - }) - - It("Returns an error if VCenter reports a failure removing a device", func() { - runner.RunReturns(1) - err := vcenterClient.RemoveDevice("VMPath", "deviceName") - - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - deviceName could not be removed")) - }) - }) + Describe("VcenterClient", func() { + var ( + vcenterClient *iaas_clients.VcenterClient + vcenterUsername string + vcenterPassword string + vcenterUrl string + vcenterCertificateFile string + ) - Describe("EjectCDrom", func() { - It("Ejects a cd rom from the given VM", func() { - runner.RunReturns(0) - err := vcenterClient.EjectCDRom("validVMPath", "deviceName") + BeforeEach(func() { + vcenterUsername = "fake-vcenter-username" + vcenterPassword = "fake-vcenter-password" + vcenterUrl = "example.com/fake-vcenter-url" + vcenterCertificateFile = "" + + vcenterClient = + iaas_clients.NewVcenterClient( + vcenterUsername, + vcenterPassword, + vcenterUrl, + vcenterCertificateFile, + runner, + ) + }) + + Describe("ValidateCredentials", func() { + It("When the login credentials are correct, login is successful", func() { + expectedArgs := []string{"about", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl)} + + runner.RunReturns(0) + err := vcenterClient.ValidateCredentials() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + }) + + It("When the login credentials are incorrect, login is a failure", func() { + expectedArgs := []string{"about", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl)} + + runner.RunReturns(1) + err := vcenterClient.ValidateCredentials() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(HaveOccurred()) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + Expect(err).To(MatchError(fmt.Sprintf("vcenter_client - invalid credentials for: %s:REDACTED@%s", vcenterUsername, vcenterUrl))) + }) + }) + + Describe("ValidateUrl", func() { + It("When the url is valid, there is no error", func() { + expectedArgs := []string{"about", "-u", vcenterUrl} + + runner.RunReturns(0) + err := vcenterClient.ValidateUrl() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + }) + + It("When the url is invalid, there is an error", func() { + expectedArgs := []string{"about", "-u", vcenterUrl} + + runner.RunReturns(1) + err := vcenterClient.ValidateUrl() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(HaveOccurred()) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + Expect(err).To(MatchError(fmt.Sprintf("vcenter_client - unable to validate url: %s", vcenterUrl))) + }) + + It("a validateUrl failure mentions the ca cert if one was specified", func() { + vcenterClient = iaas_clients.NewVcenterClient(vcenterUsername, vcenterPassword, vcenterUrl, "fake-cert.txt", runner) + expectedArgs := []string{"about", "-u", vcenterUrl, "-tls-ca-certs=fake-cert.txt"} + + runner.RunReturns(1) + err := vcenterClient.ValidateUrl() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(HaveOccurred()) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + Expect(err).To(MatchError(fmt.Sprintf("vcenter_client - invalid ca certs or url: %s", vcenterUrl))) + }) + + It("passes the ca cert to govc when specified", func() { + vcenterClient = iaas_clients.NewVcenterClient(vcenterUsername, vcenterPassword, vcenterUrl, "fake-cert.txt", runner) + expectedArgs := []string{"about", "-u", vcenterUrl, "-tls-ca-certs=fake-cert.txt"} + + runner.RunReturns(0) + err := vcenterClient.ValidateUrl() + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + }) + }) + + Describe("FindVM", func() { + It("If the VM path is valid, and the VM is found", func() { + expectedArgs := []string{"find", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-maxdepth=0", "validVMPath"} + runner.RunReturns(0) + err := vcenterClient.FindVM("validVMPath") + argsForRun := runner.RunArgsForCall(0) + + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + }) + + It("If the VM path is invalid", func() { + expectedArgs := []string{"find", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-maxdepth=0", "invalidVMPath"} + runner.RunReturns(1) + err := vcenterClient.FindVM("invalidVMPath") + argsForRun := runner.RunArgsForCall(0) - Expect(err).To(Not(HaveOccurred())) - expectedArgs := []string{"device.cdrom.eject", "-u", credentialUrl, "-vm", "validVMPath", "-device", "deviceName"} - Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) - }) + Expect(err).To(HaveOccurred()) + Expect(runner.RunCallCount()).To(Equal(1)) + Expect(argsForRun).To(Equal(expectedArgs)) + Expect(err).To(MatchError("vcenter_client - unable to find VM: invalidVMPath. Ensure your inventory path is formatted properly and includes \"vm\" in its path, example: /my-datacenter/vm/my-folder/my-vm-name")) + }) + }) + + Describe("RemoveDevice", func() { + It("Removes a device from the given VM", func() { + runner.RunReturns(0) + err := vcenterClient.RemoveDevice("validVMPath", "device") + + Expect(err).To(Not(HaveOccurred())) + expectedArgs := []string{"device.remove", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-vm", "validVMPath", "device"} + Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + }) - It("Returns an error if VCenter reports a failure ejecting the cd rom", func() { - runner.RunReturns(1) - err := vcenterClient.EjectCDRom("VMPath", "deviceName") + It("Returns an error if VCenter reports a failure removing a device", func() { + runner.RunReturns(1) + err := vcenterClient.RemoveDevice("VMPath", "deviceName") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - deviceName could not be ejected")) + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - deviceName could not be removed")) + }) }) - }) - Context("ListDevices", func() { - var govcListDevicesOutput = `ide-200 VirtualIDEController IDE 0 + Describe("EjectCDRom", func() { + It("Ejects a cd rom from the given VM", func() { + runner.RunReturns(0) + err := vcenterClient.EjectCDRom("validVMPath", "deviceName") + + Expect(err).To(Not(HaveOccurred())) + expectedArgs := []string{"device.cdrom.eject", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-vm", "validVMPath", "-device", "deviceName"} + Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + }) + + It("Returns an error if VCenter reports a failure ejecting the cd rom", func() { + runner.RunReturns(1) + err := vcenterClient.EjectCDRom("VMPath", "deviceName") + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - deviceName could not be ejected")) + }) + }) + + Describe("ListDevices", func() { + var govcListDevicesOutput = `ide-200 VirtualIDEController IDE 0 ide-201 VirtualIDEController IDE 1 ps2-300 VirtualPS2Controller PS2 controller 0 pci-100 VirtualPCIController PCI controller 0 @@ -214,257 +252,257 @@ floppy-8000 VirtualFloppy Remote ethernet-0 VirtualE1000e internal-network ` - It("returns a list of devices for the given VM", func() { - runner.RunWithOutputReturns(govcListDevicesOutput, 0, nil) - - devices, err := vcenterClient.ListDevices("/path/to/vm") - - Expect(err).NotTo(HaveOccurred()) - Expect(devices).To(ConsistOf( - "ide-200", "ide-201", "ps2-300", "pci-100", "sio-400", "floppy-8000", "ethernet-0", - )) - - Expect(runner.RunWithOutputArgsForCall(0)).To(Equal([]string{"device.ls", "-u", credentialUrl, "-vm", "/path/to/vm"})) - }) - - It("returns an error if govc runner returns non zero exit code", func() { - runner.RunWithOutputReturns("", 1, nil) - - _, err := vcenterClient.ListDevices("/path/to/vm") - - Expect(err).To(MatchError("vcenter_client - failed to list devices in vCenter, govc exit code 1")) - }) - - It("returns an error if RunWithOutput encounters an error", func() { - runner.RunWithOutputReturns("", 0, errors.New("some environment error")) + It("returns a list of devices for the given VM", func() { + runner.RunWithOutputReturns(govcListDevicesOutput, 0, nil) - _, err := vcenterClient.ListDevices("/path/to/vm") - - Expect(err).To(MatchError("vcenter_client - failed to parse list of devices. Err: some environment error")) - }) - - It("returns govc exit code error, when both govc exit code is non zero and RunWithOutput encounters an error", func() { - runner.RunWithOutputReturns("", 1, errors.New("some environment error")) - - _, err := vcenterClient.ListDevices("/path/to/vm") - - Expect(err).To(MatchError("vcenter_client - failed to list devices in vCenter, govc exit code 1")) - }) - }) - - Context("ExportVM", func() { - var destinationDir string - BeforeEach(func() { - destinationDir = GinkgoT().TempDir() // automatically cleaned up - }) - - It("exports the VM to local machine from vcenter using vm inventory path", func() { - expectedArgs := []string{"export.ovf", "-u", credentialUrl, "-sha", "1", "-vm", "validVMPath", destinationDir} - runner.RunReturns(0) - err := vcenterClient.ExportVM("validVMPath", destinationDir) - - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunCallCount()).To(Equal(1)) - - argsForRun := runner.RunArgsForCall(0) - Expect(argsForRun).To(Equal(expectedArgs)) - }) + devices, err := vcenterClient.ListDevices("/path/to/vm") - It("Returns an error message if ExportVM fails to export the VM", func() { - vmInventoryPath := "validVMPath" - expectedArgs := []string{"export.ovf", "-u", credentialUrl, "-sha", "1", "-vm", vmInventoryPath, destinationDir} - runner.RunReturns(1) - err := vcenterClient.ExportVM("validVMPath", destinationDir) + Expect(err).NotTo(HaveOccurred()) + Expect(devices).To(ConsistOf( + "ide-200", "ide-201", "ps2-300", "pci-100", "sio-400", "floppy-8000", "ethernet-0", + )) - expectedErrorMsg := fmt.Sprintf("vcenter_client - %s could not be exported", vmInventoryPath) - Expect(err).To(HaveOccurred()) - Expect(runner.RunCallCount()).To(Equal(1)) + Expect(runner.RunWithOutputArgsForCall(0)).To(Equal([]string{"device.ls", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-vm", "/path/to/vm"})) + }) - argsForRun := runner.RunArgsForCall(0) - Expect(argsForRun).To(Equal(expectedArgs)) - Expect(err.Error()).To(Equal(expectedErrorMsg)) - }) + It("returns an error if govc runner returns non zero exit code", func() { + runner.RunWithOutputReturns("", 1, nil) - It("prints an appropriate error message if the given directory doesn't exist", func() { - err := vcenterClient.ExportVM("validVMPath", "/FooBar/stuff") - Expect(err).To(HaveOccurred()) + _, err := vcenterClient.ListDevices("/path/to/vm") - Expect(err.Error()).To(Equal("vcenter_client - provided destination directory: /FooBar/stuff does not exist")) - }) - }) + Expect(err).To(MatchError("vcenter_client - failed to list devices in vCenter, govc exit code 1")) + }) - Describe("UploadArtifact", func() { - It("Uploads artifact to the given vm", func() { - runner.RunReturns(0) - err := vcenterClient.UploadArtifact("validVMPath", "artifact", "C:\\provision\\artifact", "user", "pass") + It("returns an error if RunWithOutput encounters an error", func() { + runner.RunWithOutputReturns("", 0, errors.New("some environment error")) - Expect(err).To(Not(HaveOccurred())) - expectedArgs := []string{"guest.upload", "-u", credentialUrl, "-f", "-l", "user:pass", "-vm", "validVMPath", "artifact", "C:\\provision\\artifact"} - Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) - }) + _, err := vcenterClient.ListDevices("/path/to/vm") - It("Returns an error if VCenter reports a failure uploading the artifact", func() { - runner.RunReturns(1) - err := vcenterClient.UploadArtifact("validVMPath", "artifact", "C:\\provision\\artifact", "user", "pass") + Expect(err).To(MatchError("vcenter_client - failed to parse list of devices. Err: some environment error")) + }) - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - artifact could not be uploaded")) - }) - }) + It("returns govc exit code error, when both govc exit code is non zero and RunWithOutput encounters an error", func() { + runner.RunWithOutputReturns("", 1, errors.New("some environment error")) - Describe("MakeDirectory", func() { - It("Creates the directory on the vm", func() { - runner.RunReturns(0) - err := vcenterClient.MakeDirectory("validVMPath", "C:\\provision", "user", "pass") + _, err := vcenterClient.ListDevices("/path/to/vm") - Expect(err).To(Not(HaveOccurred())) - expectedArgs := []string{"guest.mkdir", "-u", credentialUrl, "-l", "user:pass", "-vm", "validVMPath", "-p", "C:\\provision"} - Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + Expect(err).To(MatchError("vcenter_client - failed to list devices in vCenter, govc exit code 1")) + }) }) - It("Returns an error if VCenter reports a failure making the directory", func() { - runner.RunReturns(1) - err := vcenterClient.MakeDirectory("validVMPath", "C:\\provision", "user", "pass") + Describe("ExportVM", func() { + var destinationDir string + BeforeEach(func() { + destinationDir = GinkgoT().TempDir() // automatically cleaned up + }) - Expect(err).To(HaveOccurred()) - expectedArgs := []string{"guest.mkdir", "-u", credentialUrl, "-l", "user:pass", "-vm", "validVMPath", "-p", "C:\\provision"} - Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + It("exports the VM to local machine from vcenter using vm inventory path", func() { + expectedArgs := []string{"export.ovf", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-sha", "1", "-vm", "validVMPath", destinationDir} + runner.RunReturns(0) + err := vcenterClient.ExportVM("validVMPath", destinationDir) - Expect(err).To(MatchError("vcenter_client - directory `C:\\provision` could not be created")) - }) - }) + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunCallCount()).To(Equal(1)) - Describe("Start", func() { - It("runs the command on the vm", func() { - runner.RunWithOutputReturns("1856\n", 0, nil) // govc add '\n' to the output - pid, err := vcenterClient.Start("validVMPath", "user", "pass", "command", "arg1", "arg2", "arg3") + argsForRun := runner.RunArgsForCall(0) + Expect(argsForRun).To(Equal(expectedArgs)) + }) - Expect(err).To(Not(HaveOccurred())) - Expect(pid).To(Equal("1856")) - expectedArgs := []string{"guest.start", "-u", credentialUrl, "-l", "user:pass", "-vm", "validVMPath", "command", "arg1", "arg2", "arg3"} - Expect(runner.RunWithOutputCallCount()).To(Equal(1)) - Expect(runner.RunWithOutputArgsForCall(0)).To(Equal(expectedArgs)) - }) - It("returns an error when RunWithOutput fails", func() { - runner.RunWithOutputReturns("", 0, errors.New("error")) - _, err := vcenterClient.Start("validVMPath", "user", "pass", "command2", "arg1", "arg2", "arg3") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - failed to run 'command2': error")) + It("Returns an error message if ExportVM fails to export the VM", func() { + vmInventoryPath := "validVMPath" + expectedArgs := []string{"export.ovf", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-sha", "1", "-vm", vmInventoryPath, destinationDir} + runner.RunReturns(1) + err := vcenterClient.ExportVM("validVMPath", destinationDir) - }) - It("returns an error when RunWithOutput returns an errCode", func() { - runner.RunWithOutputReturns("", 1, nil) - _, err := vcenterClient.Start("validVMPath", "user", "pass", "command2", "arg1", "arg2", "arg3") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - 'command2' returned exit code: 1")) - }) - }) + expectedErrorMsg := fmt.Sprintf("vcenter_client - %s could not be exported", vmInventoryPath) + Expect(err).To(HaveOccurred()) + Expect(runner.RunCallCount()).To(Equal(1)) - Describe("WaitForExit", func() { - // Sample output came from running `govc guest.ps` with the JSON flag set - const sampleOutput = `{"ProcessInfo":[{"Name":"powershell.exe","Pid":1296,"Owner":"Administrator","CmdLine":"\"c:\\Windows\\System32\\WindowsPowershell\\v1.0\\powershell.exe\" dir","StartTime":"2019-03-26T18:33:31Z","EndTime":"2019-03-26T18:33:34Z","ExitCode":42}]}` - const sampleOutputPidNotFound = `{"ProcessInfo":null}` - const sampleOutputBadJson = `bad bad json format` + argsForRun := runner.RunArgsForCall(0) + Expect(argsForRun).To(Equal(expectedArgs)) + Expect(err.Error()).To(Equal(expectedErrorMsg)) + }) - It("returns the process' exit code upon success", func() { - runner.RunWithOutputReturns(sampleOutput, 0, nil) - exitCode, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") + It("prints an appropriate error message if the given directory doesn't exist", func() { + err := vcenterClient.ExportVM("validVMPath", "/FooBar/stuff") + Expect(err).To(HaveOccurred()) - Expect(err).To(Not(HaveOccurred())) - Expect(exitCode).To(Equal(42)) - expectedArgs := []string{"guest.ps", "-u", credentialUrl, "-l", "user:pass", "-vm", "validVMPath", "-p", "1296", "-X", "-json"} - Expect(runner.RunWithOutputCallCount()).To(Equal(1)) - Expect(runner.RunWithOutputArgsForCall(0)).To(Equal(expectedArgs)) + Expect(err.Error()).To(Equal("vcenter_client - provided destination directory: /FooBar/stuff does not exist")) + }) }) - It("returns an error if the process ID cannot be found", func() { - runner.RunWithOutputReturns(sampleOutputPidNotFound, 0, nil) - _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") + Describe("UploadArtifact", func() { + It("Uploads artifact to the given vm", func() { + runner.RunReturns(0) + err := vcenterClient.UploadArtifact("validVMPath", "artifact", "C:\\provision\\artifact", "user", "pass") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - couldn't get exit code for PID 1296")) - }) + Expect(err).To(Not(HaveOccurred())) + expectedArgs := []string{"guest.upload", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-f", "-l", "user:pass", "-vm", "validVMPath", "artifact", "C:\\provision\\artifact"} + Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + }) - It("returns an error if a malformed json is returned", func() { - runner.RunWithOutputReturns(sampleOutputBadJson, 0, nil) - _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") - - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - received bad JSON output for PID 1296: bad bad json format")) + It("Returns an error if VCenter reports a failure uploading the artifact", func() { + runner.RunReturns(1) + err := vcenterClient.UploadArtifact("validVMPath", "artifact", "C:\\provision\\artifact", "user", "pass") + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - artifact could not be uploaded")) + }) }) - It("returns an error when RunWithOutput fails", func() { - runner.RunWithOutputReturns(sampleOutput, 0, errors.New("bad command error")) - _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "3369") + Describe("MakeDirectory", func() { + It("Creates the directory on the vm", func() { + runner.RunReturns(0) + err := vcenterClient.MakeDirectory("validVMPath", "C:\\provision", "user", "pass") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - failed to fetch exit code for PID 3369: bad command error")) + Expect(err).To(Not(HaveOccurred())) + expectedArgs := []string{"guest.mkdir", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-l", "user:pass", "-vm", "validVMPath", "-p", "C:\\provision"} + Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) + }) - }) + It("Returns an error if VCenter reports a failure making the directory", func() { + runner.RunReturns(1) + err := vcenterClient.MakeDirectory("validVMPath", "C:\\provision", "user", "pass") - It("returns an error when RunWithOutput returns an errCode", func() { - runner.RunWithOutputReturns(sampleOutput, 20, nil) - _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "11678") + Expect(err).To(HaveOccurred()) + expectedArgs := []string{"guest.mkdir", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-l", "user:pass", "-vm", "validVMPath", "-p", "C:\\provision"} + Expect(runner.RunArgsForCall(0)).To(Equal(expectedArgs)) - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - fetching PID 11678 returned with exit code: 20")) + Expect(err).To(MatchError("vcenter_client - directory `C:\\provision` could not be created")) + }) }) - }) - Describe("IsPoweredOff", func() { - It("Uses vm.info correctly to get power state", func() { - expectedArgs := []string{"vm.info", "-u", credentialUrl, "validVMPath"} - runner.RunWithOutputReturns("some result", 0, nil) + Describe("Start", func() { + It("runs the command on the vm", func() { + runner.RunWithOutputReturns("1856\n", 0, nil) // govc add '\n' to the output + pid, err := vcenterClient.Start("validVMPath", "user", "pass", "command", "arg1", "arg2", "arg3") - _, err := vcenterClient.IsPoweredOff("validVMPath") - argsForRun := runner.RunWithOutputArgsForCall(0) + Expect(err).To(Not(HaveOccurred())) + Expect(pid).To(Equal("1856")) + expectedArgs := []string{"guest.start", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-l", "user:pass", "-vm", "validVMPath", "command", "arg1", "arg2", "arg3"} + Expect(runner.RunWithOutputCallCount()).To(Equal(1)) + Expect(runner.RunWithOutputArgsForCall(0)).To(Equal(expectedArgs)) + }) + It("returns an error when RunWithOutput fails", func() { + runner.RunWithOutputReturns("", 0, errors.New("error")) + _, err := vcenterClient.Start("validVMPath", "user", "pass", "command2", "arg1", "arg2", "arg3") + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - failed to run 'command2': error")) + + }) + It("returns an error when RunWithOutput returns an errCode", func() { + runner.RunWithOutputReturns("", 1, nil) + _, err := vcenterClient.Start("validVMPath", "user", "pass", "command2", "arg1", "arg2", "arg3") + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - 'command2' returned exit code: 1")) + }) + }) + + Describe("WaitForExit", func() { + // Sample output came from running `govc guest.ps` with the JSON flag set + const sampleOutput = `{"ProcessInfo":[{"Name":"powershell.exe","Pid":1296,"Owner":"Administrator","CmdLine":"\"c:\\Windows\\System32\\WindowsPowershell\\v1.0\\powershell.exe\" dir","StartTime":"2019-03-26T18:33:31Z","EndTime":"2019-03-26T18:33:34Z","ExitCode":42}]}` + const sampleOutputPidNotFound = `{"ProcessInfo":null}` + const sampleOutputBadJson = `bad bad json format` + + It("returns the process' exit code upon success", func() { + runner.RunWithOutputReturns(sampleOutput, 0, nil) + exitCode, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") + + Expect(err).To(Not(HaveOccurred())) + Expect(exitCode).To(Equal(42)) + expectedArgs := []string{"guest.ps", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "-l", "user:pass", "-vm", "validVMPath", "-p", "1296", "-X", "-json"} + Expect(runner.RunWithOutputCallCount()).To(Equal(1)) + Expect(runner.RunWithOutputArgsForCall(0)).To(Equal(expectedArgs)) + }) + + It("returns an error if the process ID cannot be found", func() { + runner.RunWithOutputReturns(sampleOutputPidNotFound, 0, nil) + _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - couldn't get exit code for PID 1296")) + }) - Expect(err).To(Not(HaveOccurred())) - Expect(argsForRun).To(Not(ContainElement("-vm.ipath"))) - Expect(argsForRun).To(Equal(expectedArgs)) + It("returns an error if a malformed json is returned", func() { + runner.RunWithOutputReturns(sampleOutputBadJson, 0, nil) + _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "1296") - }) - It("Gets the power state of the vm and returns false when vm is not powered off", func() { - runner.RunWithOutputReturns("Power state: poweredOn", 0, nil) - out, err := vcenterClient.IsPoweredOff("validVMPath") + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - received bad JSON output for PID 1296: bad bad json format")) - Expect(out).To(BeFalse()) - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunWithOutputCallCount()).To(Equal(1)) - }) - It("Gets the power state of the vm and returns true when the vm is powered off", func() { - runner.RunWithOutputReturns("Power state: poweredOff", 0, nil) - out, err := vcenterClient.IsPoweredOff("validVMPath") + }) + + It("returns an error when RunWithOutput fails", func() { + runner.RunWithOutputReturns(sampleOutput, 0, errors.New("bad command error")) + _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "3369") + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - failed to fetch exit code for PID 3369: bad command error")) + + }) + + It("returns an error when RunWithOutput returns an errCode", func() { + runner.RunWithOutputReturns(sampleOutput, 20, nil) + _, err := vcenterClient.WaitForExit("validVMPath", "user", "pass", "11678") + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - fetching PID 11678 returned with exit code: 20")) + }) + }) + + Describe("IsPoweredOff", func() { + It("Uses vm.info correctly to get power state", func() { + expectedArgs := []string{"vm.info", "-u", vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl), "validVMPath"} + runner.RunWithOutputReturns("some result", 0, nil) + + _, err := vcenterClient.IsPoweredOff("validVMPath") + argsForRun := runner.RunWithOutputArgsForCall(0) + + Expect(err).To(Not(HaveOccurred())) + Expect(argsForRun).To(Not(ContainElement("-vm.ipath"))) + Expect(argsForRun).To(Equal(expectedArgs)) + + }) + It("Gets the power state of the vm and returns false when vm is not powered off", func() { + runner.RunWithOutputReturns("Power state: poweredOn", 0, nil) + out, err := vcenterClient.IsPoweredOff("validVMPath") + + Expect(out).To(BeFalse()) + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunWithOutputCallCount()).To(Equal(1)) + }) + It("Gets the power state of the vm and returns true when the vm is powered off", func() { + runner.RunWithOutputReturns("Power state: poweredOff", 0, nil) + out, err := vcenterClient.IsPoweredOff("validVMPath") + + Expect(out).To(BeTrue()) + Expect(err).To(Not(HaveOccurred())) + Expect(runner.RunWithOutputCallCount()).To(Equal(1)) + }) + + It("Returns an exit code error if the runner returns a non zero exit code", func() { + runner.RunWithOutputReturns("", 1, nil) + _, err := vcenterClient.IsPoweredOff("validVMPath") + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - failed to get vm info, govc exit code: 1")) + }) - Expect(out).To(BeTrue()) - Expect(err).To(Not(HaveOccurred())) - Expect(runner.RunWithOutputCallCount()).To(Equal(1)) - }) + It("Returns an error if VCenter reports a failure getting the power state", func() { + runner.RunWithOutputReturns("", 0, errors.New("some power state issue")) + _, err := vcenterClient.IsPoweredOff("validVMPath") - It("Returns an exit code error if the runner returns a non zero exit code", func() { - runner.RunWithOutputReturns("", 1, nil) - _, err := vcenterClient.IsPoweredOff("validVMPath") - - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - failed to get vm info, govc exit code: 1")) - }) + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - failed to determine vm power state: some power state issue")) + }) - It("Returns an error if VCenter reports a failure getting the power state", func() { - runner.RunWithOutputReturns("", 0, errors.New("some power state issue")) - _, err := vcenterClient.IsPoweredOff("validVMPath") + It("Returns an exit code error if the runner returns a non zero exit code and VCenter reports a failure getting the power state", func() { + runner.RunWithOutputReturns("", 1, errors.New("some power state issue")) + _, err := vcenterClient.IsPoweredOff("validVMPath") - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - failed to determine vm power state: some power state issue")) - }) - - It("Returns an exit code error if the runner returns a non zero exit code and VCenter reports a failure getting the power state", func() { - runner.RunWithOutputReturns("", 1, errors.New("some power state issue")) - _, err := vcenterClient.IsPoweredOff("validVMPath") - - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("vcenter_client - failed to get vm info, govc exit code: 1")) + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("vcenter_client - failed to get vm info, govc exit code: 1")) + }) }) }) - }) From 958ce3f0b31ea115e70eda928731f0d86700db7e Mon Sep 17 00:00:00 2001 From: aram price Date: Sat, 9 Aug 2025 08:50:09 -0700 Subject: [PATCH 20/21] stembuild: move integration-ish iaas_cli tests to integration - some tests under iaas_cli/ can be run locally but not when mixed with specs which require access to vCenter or similar setup - moves tests which require external resources under integration/iaas_cli/ - iaas_clients tests explicitly pass the vCenter's certificate, the integration/iaas_cli/ specs previously were not run on windows and on linux they rely on test setup which adds the certificate to the container's certificate store; the specs now write the certificate to disk and pass this path to vcenterclientfactory.FactoryConfig, as the - "contract tests" use vcsim as library, instead of building from source, this should allow testing on windows - (more) test code uses "_test" package names --- ci/pipelines/stemcells-windows.yml | 35 +- ci/tasks/test-contract-stembuild-linux/run.sh | 20 - .../test-contract-stembuild-linux/task.yml | 22 - .../test-integration-stembuild-linux/run.sh | 18 +- stembuild/Makefile | 5 +- stembuild/go.mod | 2 +- stembuild/iaas_cli/iaas_cli_suite_test.go | 17 - .../iaas_clients/iaas_clients_suite_test.go | 85 +- .../vcenter_client_contract_test.go | 102 - .../iaas_clients/vcenter_client_test.go | 6 +- .../iaas_clients/vcenter_client_vcsim_test.go | 38 + .../vcenter_manager_suite_test.go | 38 - .../vcenter_manager/vcenter_manager_test.go | 52 - .../vcenter_manager_vcsim_test.go | 74 + .../iaas_cli/govc_cli_test.go | 16 +- .../iaas_cli/iaas_cli_suite_test.go | 37 + .../iaas_cli/iaas_clients/fixtures/fake-cert} | 0 .../iaas_clients/iaas_clients_suite_test.go | 101 + .../vcenter_govmomi_contract_test.go | 38 +- .../packager/packager_utility_test.go | 10 +- .../dummycert => test/helpers/vcsim-cert} | 0 .../dummykey => test/helpers/vcsim-cert.key} | 0 stembuild/test/helpers/vcsim.go | 81 + .../github.com/vmware/govmomi/crypto/doc.go | 9 + .../vmware/govmomi/crypto/manager_kmip.go | 472 + .../vmware/govmomi/simulator/alarm_manager.go | 258 + .../simulator/authorization_manager.go | 324 + .../simulator/cluster_compute_resource.go | 706 + .../vmware/govmomi/simulator/container.go | 825 + .../simulator/container_host_system.go | 341 + .../simulator/container_virtual_machine.go | 520 + .../govmomi/simulator/crypto_manager_kmip.go | 657 + .../simulator/custom_fields_manager.go | 209 + .../simulator/customization_spec_manager.go | 346 + .../vmware/govmomi/simulator/datacenter.go | 210 + .../vmware/govmomi/simulator/dataset.go | 53 + .../vmware/govmomi/simulator/datastore.go | 176 + .../simulator/datastore_namespace_manager.go | 175 + .../vmware/govmomi/simulator/doc.go | 10 + .../vmware/govmomi/simulator/dvs.go | 422 + .../vmware/govmomi/simulator/dvs_manager.go | 39 + .../vmware/govmomi/simulator/entity.go | 35 + .../govmomi/simulator/environment_browser.go | 329 + .../simulator/esx/authorization_manager.go | 93 + .../govmomi/simulator/esx/command_info.go | 663 + .../govmomi/simulator/esx/datacenter.go | 46 + .../vmware/govmomi/simulator/esx/doc.go | 8 + .../govmomi/simulator/esx/event_manager.go | 296 + .../govmomi/simulator/esx/host_capability.go | 12 + .../esx/host_config_filesystemvolume.go | 132 + .../govmomi/simulator/esx/host_config_info.go | 1107 + .../simulator/esx/host_firewall_system.go | 1413 + .../simulator/esx/host_hardware_info.go | 853 + .../simulator/esx/host_storage_device_info.go | 335 + .../govmomi/simulator/esx/host_system.go | 1790 ++ .../simulator/esx/host_vnic_manager.go | 35 + .../simulator/esx/performance_manager.go | 15060 +++++++++++ .../simulator/esx/performance_manager_data.go | 1202 + .../govmomi/simulator/esx/resource_pool.go | 154 + .../govmomi/simulator/esx/root_folder.go | 65 + .../govmomi/simulator/esx/service_content.go | 75 + .../vmware/govmomi/simulator/esx/setting.go | 28 + .../govmomi/simulator/esx/task_manager.go | 10401 ++++++++ .../vmware/govmomi/simulator/esx/type_info.go | 3412 +++ .../govmomi/simulator/esx/virtual_device.go | 231 + .../vmware/govmomi/simulator/esxcli.go | 421 + .../vmware/govmomi/simulator/event_manager.go | 430 + .../govmomi/simulator/extension_manager.go | 158 + .../vmware/govmomi/simulator/file_manager.go | 277 + .../vmware/govmomi/simulator/folder.go | 1146 + .../vmware/govmomi/simulator/guest_id.go | 10 + .../simulator/guest_operations_manager.go | 445 + .../govmomi/simulator/history_collector.go | 169 + .../simulator/host_certificate_manager.go | 99 + .../simulator/host_datastore_browser.go | 264 + .../simulator/host_datastore_system.go | 225 + .../govmomi/simulator/host_firewall_system.go | 75 + .../simulator/host_local_account_manager.go | 60 + .../govmomi/simulator/host_network_system.go | 200 + .../govmomi/simulator/host_storage_system.go | 122 + .../vmware/govmomi/simulator/host_system.go | 598 + .../govmomi/simulator/host_vnic_manager.go | 47 + .../govmomi/simulator/http_nfc_lease.go | 205 + .../govmomi/simulator/internal/object_lock.go | 90 + .../govmomi/simulator/internal/server.go | 341 + .../govmomi/simulator/internal/testcert.go | 64 + .../govmomi/simulator/internal/types.go | 62 + .../govmomi/simulator/ip_pool_manager.go | 375 + .../govmomi/simulator/license_manager.go | 286 + .../vmware/govmomi/simulator/model.go | 981 + .../vmware/govmomi/simulator/object.go | 62 + .../govmomi/simulator/option_manager.go | 126 + .../vmware/govmomi/simulator/ovf_manager.go | 357 + .../govmomi/simulator/performance_manager.go | 284 + .../vmware/govmomi/simulator/portgroup.go | 85 + .../govmomi/simulator/property_collector.go | 1080 + .../govmomi/simulator/property_filter.go | 157 + .../vmware/govmomi/simulator/registry.go | 691 + .../vmware/govmomi/simulator/resource_pool.go | 521 + .../vmware/govmomi/simulator/search_index.go | 261 + .../govmomi/simulator/service_instance.go | 86 + .../govmomi/simulator/session_manager.go | 527 + .../vmware/govmomi/simulator/simulator.go | 998 + .../vmware/govmomi/simulator/snapshot.go | 220 + .../simulator/storage_resource_manager.go | 172 + .../vmware/govmomi/simulator/task.go | 264 + .../vmware/govmomi/simulator/task_manager.go | 384 + .../govmomi/simulator/tenant_manager.go | 67 + .../govmomi/simulator/user_directory.go | 92 + .../vmware/govmomi/simulator/view_manager.go | 291 + .../govmomi/simulator/virtual_disk_manager.go | 302 + .../govmomi/simulator/virtual_machine.go | 3183 +++ .../simulator/vm_compatibility_checker.go | 176 + .../simulator/vm_provisioning_checker.go | 37 + .../govmomi/simulator/vpx/alarm_manager.go | 207 + .../vmware/govmomi/simulator/vpx/doc.go | 8 + .../simulator/vpx/performance_manager.go | 21828 ++++++++++++++++ .../simulator/vpx/performance_manager_data.go | 1862 ++ .../govmomi/simulator/vpx/root_folder.go | 52 + .../govmomi/simulator/vpx/service_content.go | 80 + .../vmware/govmomi/simulator/vpx/setting.go | 66 + .../govmomi/simulator/vpx/task_manager.go | 11121 ++++++++ .../simulator/vstorage_object_manager.go | 517 + .../vmware/govmomi/toolbox/hgfs/archive.go | 335 + .../vmware/govmomi/toolbox/hgfs/encoding.go | 61 + .../vmware/govmomi/toolbox/hgfs/hgfs_linux.go | 46 + .../vmware/govmomi/toolbox/hgfs/hgfs_other.go | 15 + .../vmware/govmomi/toolbox/hgfs/protocol.go | 835 + .../vmware/govmomi/toolbox/hgfs/server.go | 573 + .../vmware/govmomi/toolbox/process/process.go | 628 + .../vmware/govmomi/toolbox/vix/property.go | 224 + .../vmware/govmomi/toolbox/vix/protocol.go | 835 + .../vmware/govmomi/vapi/vm/dataset/dataset.go | 188 + .../govmomi/vapi/vm/internal/internal.go | 12 + stembuild/vendor/modules.txt | 10 + 135 files changed, 100994 insertions(+), 406 deletions(-) delete mode 100755 ci/tasks/test-contract-stembuild-linux/run.sh delete mode 100644 ci/tasks/test-contract-stembuild-linux/task.yml delete mode 100644 stembuild/iaas_cli/iaas_clients/vcenter_client_contract_test.go create mode 100644 stembuild/iaas_cli/iaas_clients/vcenter_client_vcsim_test.go create mode 100644 stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_vcsim_test.go rename stembuild/{ => integration}/iaas_cli/govc_cli_test.go (89%) create mode 100644 stembuild/integration/iaas_cli/iaas_cli_suite_test.go rename stembuild/{iaas_cli/iaas_clients/fixtures/fakecert => integration/iaas_cli/iaas_clients/fixtures/fake-cert} (100%) create mode 100644 stembuild/integration/iaas_cli/iaas_clients/iaas_clients_suite_test.go rename stembuild/{ => integration}/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go (81%) rename stembuild/{iaas_cli/iaas_clients/fixtures/dummycert => test/helpers/vcsim-cert} (100%) rename stembuild/{iaas_cli/iaas_clients/fixtures/dummykey => test/helpers/vcsim-cert.key} (100%) create mode 100644 stembuild/test/helpers/vcsim.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/crypto/doc.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/crypto/manager_kmip.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/alarm_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/container.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/container_host_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/crypto_manager_kmip.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/datacenter.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/dataset.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/datastore.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/datastore_namespace_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/doc.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/dvs.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/entity.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/environment_browser.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/command_info.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/doc.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_capability.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_filesystemvolume.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_vnic_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/setting.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/type_info.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/esxcli.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/event_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/extension_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/file_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/folder.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/guest_id.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/history_collector.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_certificate_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_network_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_system.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/host_vnic_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/internal/server.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/internal/types.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/license_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/model.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/object.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/option_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/performance_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/portgroup.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/property_collector.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/property_filter.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/registry.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/resource_pool.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/search_index.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/service_instance.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/session_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/simulator.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/snapshot.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/task.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/task_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/user_directory.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/view_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vm_compatibility_checker.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vm_provisioning_checker.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/alarm_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/process/process.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/property.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/vapi/vm/dataset/dataset.go create mode 100644 stembuild/vendor/github.com/vmware/govmomi/vapi/vm/internal/internal.go diff --git a/ci/pipelines/stemcells-windows.yml b/ci/pipelines/stemcells-windows.yml index 645b23dd5..3cc16d6a0 100644 --- a/ci/pipelines/stemcells-windows.yml +++ b/ci/pipelines/stemcells-windows.yml @@ -165,10 +165,6 @@ resources: type: git source: uri: https://github.com/cloudfoundry/windows-utilities-release.git -- name: govmomi - type: git - source: - uri: https://github.com/vmware/govmomi.git # type: docker-image - name: bosh-windows-stemcell-builder-ci-docker-image @@ -865,13 +861,19 @@ jobs: file: bosh-windows-stemcell-builder-ci/ci/tasks/test-integration-stembuild-windows/task.yml timeout: 3h params: - VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) + CONTRACT_TEST_VM_NAME: stembuild_base_vm_2019_ + CONTRACT_TEST_VM_PASSWORD: ((stembuild_vm_user.password)) + CONTRACT_TEST_VM_USERNAME: ((stembuild_vm_user.username)) + GOVC_DATASTORE: ((nimbus_windows-demo_ds)) GOVC_NETWORK: internal-network GOVC_RESOURCE_POOL: /dc0/host/concourse_cluster/Resources + VCENTER_ADMIN_CREDENTIAL_URL: ((nimbus_windows-demo_auth_url)) + VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) VCENTER_USERNAME: ((nimbus_windows-demo_user.username)) VCENTER_PASSWORD: ((nimbus_windows-demo_user.password)) + VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates VM_USERNAME: ((stembuild_vm_user.username)) VM_PASSWORD: ((stembuild_vm_user.password)) @@ -936,7 +938,6 @@ jobs: - get: blobstore-gcs-cli - get: windows-bsdtar - get: windows-winsw - - get: govmomi - put: version inputs: detect resource: stembuild-linux-build-number @@ -955,20 +956,6 @@ jobs: - task: unit-test file: bosh-windows-stemcell-builder-ci/ci/tasks/test-units-stembuild-linux/task.yml image: bosh-windows-stemcell-builder-ci-image - - task: contract-test - file: bosh-windows-stemcell-builder-ci/ci/tasks/test-contract-stembuild-linux/task.yml - image: bosh-windows-stemcell-builder-ci-image - tags: [windows-nimbus] - params: - VCENTER_ADMIN_CREDENTIAL_URL: ((nimbus_windows-demo_auth_url)) - VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates - PACKAGE_TEST_VM_NAME: stembuild-package-integration-tests-base-vm - VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) - VCENTER_USERNAME: ((nimbus_windows-demo_user.username)) - VCENTER_PASSWORD: ((nimbus_windows-demo_user.password)) - CONTRACT_TEST_VM_NAME: stembuild_base_vm_2019_ - CONTRACT_TEST_VM_PASSWORD: ((stembuild_vm_user.password)) - CONTRACT_TEST_VM_USERNAME: ((stembuild_vm_user.username)) - task: setup-integration-test-vm file: bosh-windows-stemcell-builder-ci/ci/tasks/setup-integration-test-vm/task.yml image: bosh-windows-stemcell-builder-ci-image @@ -994,13 +981,19 @@ jobs: tags: [windows-nimbus] timeout: 3h params: - VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) + CONTRACT_TEST_VM_NAME: stembuild_base_vm_2019_ + CONTRACT_TEST_VM_PASSWORD: ((stembuild_vm_user.password)) + CONTRACT_TEST_VM_USERNAME: ((stembuild_vm_user.username)) + GOVC_DATASTORE: ((nimbus_windows-demo_ds)) GOVC_NETWORK: internal-network GOVC_RESOURCE_POOL: /dc0/host/concourse_cluster/Resources + VCENTER_ADMIN_CREDENTIAL_URL: ((nimbus_windows-demo_auth_url)) + VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) VCENTER_USERNAME: ((nimbus_windows-demo_user.username)) VCENTER_PASSWORD: ((nimbus_windows-demo_user.password)) + VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates VM_USERNAME: ((stembuild_vm_user.username)) VM_PASSWORD: ((stembuild_vm_user.password)) diff --git a/ci/tasks/test-contract-stembuild-linux/run.sh b/ci/tasks/test-contract-stembuild-linux/run.sh deleted file mode 100755 index d68037153..000000000 --- a/ci/tasks/test-contract-stembuild-linux/run.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -eu -o pipefail - -ROOT_DIR=$(pwd) -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" - -source "${SCRIPT_DIR}/../../common-scripts/update_nimbus_urls_and_cert.sh" - -echo "***Creating GOPATH environment & structure ***" -export GOPATH=$PWD/gopath -export PATH=${GOPATH}/bin:$PATH - -# install vcsim for vCenter manager and client contract integration tests -go -C govmomi/vcsim install - -pushd "${ROOT_DIR}/stemcell-builder/stembuild" - echo ***Test Stembuild Code*** - - make iaas_cli -popd diff --git a/ci/tasks/test-contract-stembuild-linux/task.yml b/ci/tasks/test-contract-stembuild-linux/task.yml deleted file mode 100644 index ea28faad0..000000000 --- a/ci/tasks/test-contract-stembuild-linux/task.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -platform: linux - -inputs: -- name: bosh-windows-stemcell-builder-ci -- name: stemcell-builder -- name: govmomi - -run: - path: bosh-windows-stemcell-builder-ci/ci/tasks/test-contract-stembuild-linux/run.sh - -params: - GOVC_INSECURE: 1 - VCENTER_ADMIN_CREDENTIAL_URL: - VM_FOLDER: - PACKAGE_TEST_VM_NAME: - VCENTER_BASE_URL: - VCENTER_USERNAME: - VCENTER_PASSWORD: - CONTRACT_TEST_VM_NAME: - CONTRACT_TEST_VM_PASSWORD: - CONTRACT_TEST_VM_USERNAME: diff --git a/ci/tasks/test-integration-stembuild-linux/run.sh b/ci/tasks/test-integration-stembuild-linux/run.sh index 5487baf1a..ea62454be 100755 --- a/ci/tasks/test-integration-stembuild-linux/run.sh +++ b/ci/tasks/test-integration-stembuild-linux/run.sh @@ -4,24 +4,22 @@ set -x ROOT_DIR=$(pwd) +export OUTPUT_DIR="${ROOT_DIR}/output" + VERSION=$(cat version/version) -OUTPUT_DIR="${ROOT_DIR}/output" +export STEMBUILD_VERSION="${VERSION}" source "bosh-windows-stemcell-builder-ci/ci/common-scripts/update_nimbus_urls_and_cert.sh" -echo '***Installing VMWare OVF Tools***' -chmod +x ./ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle -./ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle --eulas-agreed --required +echo '---> Install VMWare OVF Tools' +chmod +x "${ROOT_DIR}/ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle" +"${ROOT_DIR}/ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle" --eulas-agreed --required -export STEMBUILD_VERSION export TARGET_VM_IP -export VM_NAME - -STEMBUILD_VERSION=$(cat version/version) TARGET_VM_IP=$(cat nimbus-ips/name) +export VM_NAME VM_NAME=$(cat integration-vm-name/name) - -echo "Using Existing VM IP/Name: ${TARGET_VM_IP}/${VM_NAME}" +echo "Using VM @ IPAddr: ${VM_NAME}@${TARGET_VM_IP}" pushd "${ROOT_DIR}/stemcell-builder/stembuild" echo '***Test Stembuild Code***' diff --git a/stembuild/Makefile b/stembuild/Makefile index 3e45d5850..d2c1f7555 100644 --- a/stembuild/Makefile +++ b/stembuild/Makefile @@ -34,10 +34,7 @@ clean : rm -rf assets/StemcellAutomation.zip out/* units : stubbed-stemcell-automation-zip - go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --skip-package integration,iaas_cli - -iaas_cli : - go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --flake-attempts 2 iaas_cli + go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --skip-package integration integration : stubbed-stemcell-automation-zip go run github.com/onsi/ginkgo/v2/ginkgo run -r --timeout 3h -vv --randomize-all --keep-going --flake-attempts 2 integration diff --git a/stembuild/go.mod b/stembuild/go.mod index 966bcb01d..e4cd7b8ce 100644 --- a/stembuild/go.mod +++ b/stembuild/go.mod @@ -5,7 +5,6 @@ go 1.23.0 require ( github.com/concourse/pool-resource v1.1.1 github.com/google/subcommands v1.2.0 - github.com/google/uuid v1.6.0 github.com/masterzen/winrm v0.0.0-20240702205601-3fad6e106085 github.com/maxbrunsfeld/counterfeiter/v6 v6.11.3 github.com/onsi/ginkgo/v2 v2.23.4 @@ -29,6 +28,7 @@ require ( github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect diff --git a/stembuild/iaas_cli/iaas_cli_suite_test.go b/stembuild/iaas_cli/iaas_cli_suite_test.go index 5ab7efcf3..13d2389be 100644 --- a/stembuild/iaas_cli/iaas_cli_suite_test.go +++ b/stembuild/iaas_cli/iaas_cli_suite_test.go @@ -1,8 +1,6 @@ package iaas_cli_test import ( - "fmt" - "os" "testing" . "github.com/onsi/ginkgo/v2" @@ -13,18 +11,3 @@ func TestIaasCli(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "IaasCli Suite") } - -var targetVMPath string -var vCenterCredentialUrl string - -var _ = BeforeSuite(func() { - vCenterCredentialUrl = os.Getenv("VCENTER_ADMIN_CREDENTIAL_URL") - Expect(vCenterCredentialUrl).NotTo(Equal(""), "VCENTER_ADMIN_CREDENTIAL_URL is required") - - vmFolder := os.Getenv("VM_FOLDER") - Expect(vmFolder).NotTo(Equal(""), "VM_FOLDER is required") - vmName := os.Getenv("PACKAGE_TEST_VM_NAME") - Expect(vmName).NotTo(Equal(""), "PACKAGE_TEST_VM_NAME is required") - - targetVMPath = fmt.Sprintf("%s/%s", vmFolder, vmName) -}) diff --git a/stembuild/iaas_cli/iaas_clients/iaas_clients_suite_test.go b/stembuild/iaas_cli/iaas_clients/iaas_clients_suite_test.go index a3574009e..86dd16c13 100644 --- a/stembuild/iaas_cli/iaas_clients/iaas_clients_suite_test.go +++ b/stembuild/iaas_cli/iaas_clients/iaas_clients_suite_test.go @@ -1,96 +1,13 @@ -package iaas_clients +package iaas_clients_test import ( - "context" - "fmt" - "os" "testing" - "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/vmware/govmomi/object" - - vcenterclientfactory "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" ) func TestIaasClients(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "IaasClients Suite") } - -const ( - VcenterUrl = "VCENTER_BASE_URL" - VcenterUsername = "VCENTER_USERNAME" - VcenterPassword = "VCENTER_PASSWORD" - VcenterCACert = "VCENTER_CA_CERT" - VmFolder = "VM_FOLDER" - TestVmName = "CONTRACT_TEST_VM_NAME" - TestVmPassword = "CONTRACT_TEST_VM_PASSWORD" - TestVmUsername = "CONTRACT_TEST_VM_USERNAME" -) - -var TestVmPath string -var VM *object.VirtualMachine -var CTX context.Context -var _ = BeforeSuite(func() { - - managerFactory := &vcenterclientfactory.ManagerFactory{Config: vcenterclientfactory.FactoryConfig{ - VCenterServer: envMustExist(VcenterUrl), - Username: envMustExist(VcenterUsername), - Password: envMustExist(VcenterPassword), - ClientCreator: &vcenterclientfactory.ClientCreator{}, - FinderCreator: &vcenterclientfactory.GovmomiFinderCreator{}, - }, - } - - CTX = context.TODO() - - vCenterManager, err := managerFactory.VCenterManager(CTX) - Expect(err).ToNot(HaveOccurred()) - - err = vCenterManager.Login(CTX) - Expect(err).ToNot(HaveOccurred()) - - vmFolder := envMustExist(VmFolder) - testVmName := envMustExist(TestVmName) - testVmPath := fmt.Sprintf("%s/%s", vmFolder, testVmName) - - vmToClone, err := vCenterManager.FindVM(CTX, testVmPath) - Expect(err).ToNot(HaveOccurred()) - - TestVmPath = fmt.Sprintf("%s-%s", testVmPath, time.Now().Format("2006-01-02T15h04s05")) - - err = vCenterManager.CloneVM(CTX, vmToClone, TestVmPath) - Expect(err).ToNot(HaveOccurred()) - - time.Sleep(30 * time.Second) - - VM, err = vCenterManager.FindVM(CTX, TestVmPath) - Expect(err).ToNot(HaveOccurred()) - -}) - -var _ = AfterSuite(func() { - - if VM != nil { - task, err := VM.PowerOff(CTX) - Expect(err).ToNot(HaveOccurred()) - err = task.WaitEx(CTX) - Expect(err).ToNot(HaveOccurred()) - - task, err = VM.Destroy(CTX) - Expect(err).ToNot(HaveOccurred()) - err = task.WaitEx(CTX) - Expect(err).ToNot(HaveOccurred()) - } -}) - -func envMustExist(variableName string) string { - result := os.Getenv(variableName) - if result == "" { - Fail(fmt.Sprintf("%s must be set", variableName)) - } - - return result -} diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_client_contract_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_client_contract_test.go deleted file mode 100644 index df799cf4b..000000000 --- a/stembuild/iaas_cli/iaas_clients/vcenter_client_contract_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package iaas_clients - -import ( - "context" - "os" - "os/exec" - "path/filepath" - "runtime" - "time" - - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" - vcenterclientfactory "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -var _ = Describe("VcenterManager", func() { - - Context("vcsim server with special character credentials", func() { - var ( - cmd *exec.Cmd - vCenterUsername string - vCenterPassword string - vCenterUrl string - certPath string - keyPath string - ) - - BeforeEach(func() { - if runtime.GOOS != "windows" { - - workingDir, err := os.Getwd() - Expect(err).NotTo(HaveOccurred()) - certPath = filepath.Join(workingDir, "fixtures", "dummycert") - keyPath = filepath.Join(workingDir, "fixtures", "dummykey") - - vcsimBinary := filepath.Join(os.Getenv("GOPATH"), "bin", "vcsim") - - vCenterUsername = `user\name!#` - vCenterPassword = `password\!#!` - vCenterUrl = "127.0.0.1:8989/sdk" - cmd = exec.Command(vcsimBinary, "-username", vCenterUsername, "-password", vCenterPassword, "-tlscert", certPath, "-tlskey", keyPath) - - err = cmd.Start() - Expect(err).ToNot(HaveOccurred()) - - time.Sleep(3 * time.Second) // the vcsim server needs a moment to come up - } - }) - - AfterEach(func() { - if runtime.GOOS != "windows" && cmd != nil { - err := cmd.Process.Kill() - Expect(err).ToNot(HaveOccurred()) - } - }) - - Context("VCenterManager.Login", func() { - It("succeeds", func() { - if runtime.GOOS == "windows" { - Skip("windows cannot run a vcsim server") - } - - factoryConfig := &vcenterclientfactory.FactoryConfig{ - VCenterServer: vCenterUrl, - Username: vCenterUsername, - Password: vCenterPassword, - ClientCreator: &vcenterclientfactory.ClientCreator{}, - FinderCreator: &vcenterclientfactory.GovmomiFinderCreator{}, - RootCACertPath: certPath, - } - - managerFactory := &vcenterclientfactory.ManagerFactory{ - Config: *factoryConfig, - } - - ctx := context.TODO() - - vCenterManager, err := managerFactory.VCenterManager(ctx) - Expect(err).ToNot(HaveOccurred()) - - err = vCenterManager.Login(ctx) - Expect(err).ToNot(HaveOccurred()) - - }) - }) - - Context("govc_cli client login", func() { - It("Succeeds", func() { - if runtime.GOOS == "windows" { - Skip("windows cannot run a vcsim server") - } - runner := &iaas_cli.GovcRunner{} - client := NewVcenterClient(vCenterUsername, vCenterPassword, vCenterUrl, certPath, runner) - - err := client.ValidateCredentials() - Expect(err).NotTo(HaveOccurred()) - }) - }) - }) -}) diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go index 075d837dc..5556fa683 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_client_test.go @@ -5,11 +5,11 @@ import ( "fmt" "net/url" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clifakes" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clifakes" ) func vcenterAuthUrl(vcenterUsername, vcenterPassword, vcenterUrl string) string { diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_client_vcsim_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_client_vcsim_test.go new file mode 100644 index 000000000..e6e53d7a8 --- /dev/null +++ b/stembuild/iaas_cli/iaas_clients/vcenter_client_vcsim_test.go @@ -0,0 +1,38 @@ +package iaas_clients_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/test/helpers" +) + +var _ = Describe("VcenterClient - using a vcsim server", func() { + var vcsimServer *helpers.VcsimServer + + BeforeEach(func() { + vcsimServer = helpers.NewVcsimServer(`user\name!#`, `password\!#!`) + vcsimServer.Start() + }) + + AfterEach(func() { + vcsimServer.Stop() + }) + + Describe("ValidateCredentials()", func() { + It("Succeeds", func() { + vcsimClient := iaas_clients.NewVcenterClient( + vcsimServer.Username, + vcsimServer.Password, + vcsimServer.Url(), + vcsimServer.CertificatePath, + &iaas_cli.GovcRunner{}, + ) + + err := vcsimClient.ValidateCredentials() + Expect(err).NotTo(HaveOccurred()) + }) + }) +}) diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_suite_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_suite_test.go index ba4421623..ad60b0315 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_suite_test.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_suite_test.go @@ -1,12 +1,7 @@ package vcenter_manager_test import ( - "os" - "os/exec" - "path/filepath" - "runtime" "testing" - "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -16,36 +11,3 @@ func TestVcenterManager(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "VcenterManager Suite") } - -var ( - CertPath string - cmd *exec.Cmd - keyPath string -) - -var _ = BeforeSuite(func() { - - if runtime.GOOS != "windows" { - workingDir, err := os.Getwd() - Expect(err).NotTo(HaveOccurred()) - CertPath = filepath.Join(workingDir, "..", "fixtures", "dummycert") - keyPath = filepath.Join(workingDir, "..", "fixtures", "dummykey") - - vcsimBinary := filepath.Join(os.Getenv("GOPATH"), "bin", "vcsim") - - cmd = exec.Command(vcsimBinary, "-tlscert", CertPath, "-tlskey", keyPath) - - err = cmd.Start() - Expect(err).ToNot(HaveOccurred()) - - time.Sleep(3 * time.Second) // the vcsim server needs a moment to come up - } - -}) - -var _ = AfterSuite(func() { - if runtime.GOOS != "windows" && cmd != nil { - err := cmd.Process.Kill() - Expect(err).ToNot(HaveOccurred()) - } -}) diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_test.go index c09648f7f..c65c44af9 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_test.go +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_test.go @@ -3,7 +3,6 @@ package vcenter_manager_test import ( "context" "errors" - "runtime" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -30,9 +29,7 @@ var _ = Describe("VcenterManager", func() { }) Context("Login", func() { - It("logs the user into vcenter", func() { - fakeGovmomiClient.LoginReturns(nil) vcManager, err := vcenter_manager.NewVCenterManager(&fakeGovmomiClient, &fakeVimClient, &fakeFinder, "user", "pass") @@ -62,9 +59,7 @@ var _ = Describe("VcenterManager", func() { }) Context("FindVM", func() { - It("searches for the specified vm", func() { - fakeVM := &object.VirtualMachine{} fakeFinder.VirtualMachineReturns(fakeVM, nil) @@ -94,9 +89,7 @@ var _ = Describe("VcenterManager", func() { }) Context("GuestManager", func() { - It("searches for the specified vm", func() { - fakeProcManager := &guest.ProcessManager{} fakeOpsManager := &vcenter_managerfakes.FakeOpsManager{} fakeOpsManager.ProcessManagerReturns(fakeProcManager, nil) @@ -111,7 +104,6 @@ var _ = Describe("VcenterManager", func() { }) It("returns an error if the finder does", func() { - guestErr := errors.New("not today, junior") fakeOpsManager := &vcenter_managerfakes.FakeOpsManager{} fakeOpsManager.ProcessManagerReturns(nil, guestErr) @@ -124,48 +116,4 @@ var _ = Describe("VcenterManager", func() { }) }) - - Context("running against vcsim server", func() { - Context("CloneVM", func() { - It("clones a vm", func() { - if runtime.GOOS == "windows" { - Skip("windows cannot run a vcsim server") - } - - inventoryPath := "/DC0/vm/DC0_H0_VM0" - clonePath := "/DC0/vm/DC0_H0_VM0_NewClone" - - factoryConfig := &vcenter_manager.FactoryConfig{ - VCenterServer: "https://user:pass@127.0.0.1:8989/sdk", - Username: "user", - Password: "pass", - ClientCreator: &vcenter_manager.ClientCreator{}, - FinderCreator: &vcenter_manager.GovmomiFinderCreator{}, - RootCACertPath: CertPath, - } - - managerFactory := &vcenter_manager.ManagerFactory{ - Config: *factoryConfig, - } - - ctx := context.TODO() - - vCenterManager, err := managerFactory.VCenterManager(ctx) - Expect(err).ToNot(HaveOccurred()) - - err = vCenterManager.Login(ctx) - Expect(err).ToNot(HaveOccurred()) - - vmToClone, err := vCenterManager.FindVM(ctx, inventoryPath) - Expect(err).ToNot(HaveOccurred()) - - err = vCenterManager.CloneVM(ctx, vmToClone, clonePath) - Expect(err).ToNot(HaveOccurred()) - - _, err = vCenterManager.FindVM(ctx, clonePath) - Expect(err).ToNot(HaveOccurred()) - - }) - }) - }) }) diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_vcsim_test.go b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_vcsim_test.go new file mode 100644 index 000000000..858c33932 --- /dev/null +++ b/stembuild/iaas_cli/iaas_clients/vcenter_manager/vcenter_manager_vcsim_test.go @@ -0,0 +1,74 @@ +package vcenter_manager_test + +import ( + "context" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/test/helpers" +) + +var _ = Describe("VcenterManager - using a vcsim server", func() { + var vcsimServer *helpers.VcsimServer + var vcsimManagerFactory *vcenter_manager.ManagerFactory + + BeforeEach(func() { + vcsimServer = helpers.NewVcsimServer(`user\name!#`, `password\!#!`) + vcsimServer.Start() + }) + + AfterEach(func() { + vcsimServer.Stop() + }) + + BeforeEach(func() { + vcsimManagerFactory = &vcenter_manager.ManagerFactory{ + Config: vcenter_manager.FactoryConfig{ + VCenterServer: vcsimServer.Url(), + Username: vcsimServer.Username, + Password: vcsimServer.Password, + RootCACertPath: vcsimServer.CertificatePath, + ClientCreator: &vcenter_manager.ClientCreator{}, + FinderCreator: &vcenter_manager.GovmomiFinderCreator{}, + }, + } + }) + + Describe("CloneVM()", func() { + It("succeeds", func() { + inventoryPath := "/DC0/vm/DC0_H0_VM0" + clonePath := "/DC0/vm/DC0_H0_VM0_NewClone" + + ctx := context.TODO() + + vCenterManager, err := vcsimManagerFactory.VCenterManager(ctx) + Expect(err).ToNot(HaveOccurred()) + + err = vCenterManager.Login(ctx) + Expect(err).ToNot(HaveOccurred()) + + vmToClone, err := vCenterManager.FindVM(ctx, inventoryPath) + Expect(err).ToNot(HaveOccurred()) + + err = vCenterManager.CloneVM(ctx, vmToClone, clonePath) + Expect(err).ToNot(HaveOccurred()) + + _, err = vCenterManager.FindVM(ctx, clonePath) + Expect(err).ToNot(HaveOccurred()) + }) + }) + + Describe("Login()", func() { + It("succeeds", func() { + ctx := context.TODO() + + vCenterManager, err := vcsimManagerFactory.VCenterManager(ctx) + Expect(err).ToNot(HaveOccurred()) + + err = vCenterManager.Login(ctx) + Expect(err).ToNot(HaveOccurred()) + }) + }) +}) diff --git a/stembuild/iaas_cli/govc_cli_test.go b/stembuild/integration/iaas_cli/govc_cli_test.go similarity index 89% rename from stembuild/iaas_cli/govc_cli_test.go rename to stembuild/integration/iaas_cli/govc_cli_test.go index c54fb65f6..f608a0ca2 100644 --- a/stembuild/iaas_cli/govc_cli_test.go +++ b/stembuild/integration/iaas_cli/govc_cli_test.go @@ -3,10 +3,10 @@ package iaas_cli_test import ( "strings" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli" ) var _ = Describe("GovcCli", func() { @@ -18,10 +18,7 @@ var _ = Describe("GovcCli", func() { }) It("lists the devices for a known VCenter VM", func() { - out, _, err := runner.RunWithOutput([]string{"device.ls", "-vm", targetVMPath, "-u", vCenterCredentialUrl}) - - Expect(err).NotTo(HaveOccurred()) - devices := strings.Split(`pci-100 VirtualPCIController PCI controller 0 + const expectedOutput = `pci-100 VirtualPCIController PCI controller 0 ide-200 VirtualIDEController IDE 0 ide-201 VirtualIDEController IDE 1 ps2-300 VirtualPS2Controller PS2 controller 0 @@ -35,9 +32,12 @@ ethernet-0 VirtualE1000e internal-network vmci-12000 VirtualMachineVMCIDevice Device on the virtual machine PCI bus that provides support for the virtual machine communication interface ahci-15000 VirtualAHCIController AHCI cdrom-16000 VirtualCdrom Remote device -`, "\n") +` + out, _, err := runner.RunWithOutput([]string{"device.ls", "-vm", targetVMPath, "-u", vCenterCredentialUrl}) + Expect(err).NotTo(HaveOccurred()) - for _, device := range devices { + expectedDeviceList := strings.Split(expectedOutput, "\n") + for _, device := range expectedDeviceList { Expect(out).Should(ContainSubstring(device)) } }) diff --git a/stembuild/integration/iaas_cli/iaas_cli_suite_test.go b/stembuild/integration/iaas_cli/iaas_cli_suite_test.go new file mode 100644 index 000000000..648a14554 --- /dev/null +++ b/stembuild/integration/iaas_cli/iaas_cli_suite_test.go @@ -0,0 +1,37 @@ +package iaas_cli_test + +import ( + "fmt" + "os" + "runtime" + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestIaasCli(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "IaasCli Suite") +} + +var ( + targetVMPath string + vCenterCredentialUrl string +) + +var _ = BeforeSuite(func() { + if runtime.GOOS == "windows" { + Skip("Skipping test on Windows") + } + + vCenterCredentialUrl = os.Getenv("VCENTER_ADMIN_CREDENTIAL_URL") + Expect(vCenterCredentialUrl).NotTo(Equal(""), "VCENTER_ADMIN_CREDENTIAL_URL is required") + + vmFolder := os.Getenv("VM_FOLDER") + Expect(vmFolder).NotTo(Equal(""), "VM_FOLDER is required") + vmName := os.Getenv("PACKAGE_TEST_VM_NAME") + Expect(vmName).NotTo(Equal(""), "PACKAGE_TEST_VM_NAME is required") + + targetVMPath = fmt.Sprintf("%s/%s", vmFolder, vmName) +}) diff --git a/stembuild/iaas_cli/iaas_clients/fixtures/fakecert b/stembuild/integration/iaas_cli/iaas_clients/fixtures/fake-cert similarity index 100% rename from stembuild/iaas_cli/iaas_clients/fixtures/fakecert rename to stembuild/integration/iaas_cli/iaas_clients/fixtures/fake-cert diff --git a/stembuild/integration/iaas_cli/iaas_clients/iaas_clients_suite_test.go b/stembuild/integration/iaas_cli/iaas_clients/iaas_clients_suite_test.go new file mode 100644 index 000000000..202a67cfb --- /dev/null +++ b/stembuild/integration/iaas_cli/iaas_clients/iaas_clients_suite_test.go @@ -0,0 +1,101 @@ +package iaas_clients_test + +import ( + "context" + "fmt" + "os" + "runtime" + "testing" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/vmware/govmomi/object" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" +) + +func TestIaasClients(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "IaasClients Suite") +} + +const ( + VcenterUrl = "VCENTER_BASE_URL" + VcenterUsername = "VCENTER_USERNAME" + VcenterPassword = "VCENTER_PASSWORD" + VmFolder = "VM_FOLDER" + TestVmName = "CONTRACT_TEST_VM_NAME" + VcenterCACert = "VCENTER_CA_CERT" + TestVmPassword = "CONTRACT_TEST_VM_PASSWORD" + TestVmUsername = "CONTRACT_TEST_VM_USERNAME" +) + +var ( + ctx = context.TODO() + + clonedVmPath string + clonedVm *object.VirtualMachine +) + +var _ = BeforeSuite(func() { + if runtime.GOOS == "windows" { + Skip("Skipping test on Windows") + } + + managerFactory := &vcenter_manager.ManagerFactory{ + Config: vcenter_manager.FactoryConfig{ + VCenterServer: envMustExist(VcenterUrl), + Username: envMustExist(VcenterUsername), + Password: envMustExist(VcenterPassword), + ClientCreator: &vcenter_manager.ClientCreator{}, + FinderCreator: &vcenter_manager.GovmomiFinderCreator{}, + }, + } + + vCenterManager, err := managerFactory.VCenterManager(ctx) + Expect(err).ToNot(HaveOccurred()) + + err = vCenterManager.Login(ctx) + Expect(err).ToNot(HaveOccurred()) + + vmFolder := envMustExist(VmFolder) + testVmName := envMustExist(TestVmName) + testVmPath := fmt.Sprintf("%s/%s", vmFolder, testVmName) + + vmToClone, err := vCenterManager.FindVM(ctx, testVmPath) + Expect(err).ToNot(HaveOccurred()) + + clonedVmPath = fmt.Sprintf("%s-%s", testVmPath, time.Now().Format("2006-01-02T15h04s05")) + + err = vCenterManager.CloneVM(ctx, vmToClone, clonedVmPath) + Expect(err).ToNot(HaveOccurred()) + + time.Sleep(30 * time.Second) + + clonedVm, err = vCenterManager.FindVM(ctx, clonedVmPath) + Expect(err).ToNot(HaveOccurred()) +}) + +var _ = AfterSuite(func() { + if clonedVm != nil { + task, err := clonedVm.PowerOff(ctx) + Expect(err).ToNot(HaveOccurred()) + err = task.WaitEx(ctx) + Expect(err).ToNot(HaveOccurred()) + + task, err = clonedVm.Destroy(ctx) + Expect(err).ToNot(HaveOccurred()) + err = task.WaitEx(ctx) + Expect(err).ToNot(HaveOccurred()) + } +}) + +func envMustExist(variableName string) string { + result := os.Getenv(variableName) + if result == "" { + Fail(fmt.Sprintf("%s must be set", variableName)) + } + + return result +} diff --git a/stembuild/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go b/stembuild/integration/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go similarity index 81% rename from stembuild/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go rename to stembuild/integration/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go index c57a36275..ca7773375 100644 --- a/stembuild/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go +++ b/stembuild/integration/iaas_cli/iaas_clients/vcenter_govmomi_contract_test.go @@ -1,37 +1,35 @@ -package iaas_clients +package iaas_clients_test import ( - "context" "fmt" "os" "path/filepath" "time" - "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/guest_manager" - vcenterclientfactory "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/guest_manager" + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/iaas_cli/iaas_clients/vcenter_manager" ) var _ = Describe("VcenterClient", func() { - const powershell = "C:\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe" + const powershell = `C:\Windows\System32\WindowsPowerShell\V1.0\powershell.exe` var ( - ctx = context.TODO() - managerFactory = &vcenterclientfactory.ManagerFactory{} - factoryConfig *vcenterclientfactory.FactoryConfig + managerFactory = &vcenter_manager.ManagerFactory{} + factoryConfig *vcenter_manager.FactoryConfig ) Describe("StartProgram", func() { BeforeEach(func() { - factoryConfig = &vcenterclientfactory.FactoryConfig{ + factoryConfig = &vcenter_manager.FactoryConfig{ VCenterServer: envMustExist(VcenterUrl), Username: envMustExist(VcenterUsername), Password: envMustExist(VcenterPassword), - ClientCreator: &vcenterclientfactory.ClientCreator{}, - FinderCreator: &vcenterclientfactory.GovmomiFinderCreator{}, + ClientCreator: &vcenter_manager.ClientCreator{}, + FinderCreator: &vcenter_manager.GovmomiFinderCreator{}, } }) @@ -42,7 +40,7 @@ var _ = Describe("VcenterClient", func() { err = vCenterManager.Login(ctx) Expect(err).ToNot(HaveOccurred()) - vm, err := vCenterManager.FindVM(ctx, TestVmPath) + vm, err := vCenterManager.FindVM(ctx, clonedVmPath) Expect(err).ToNot(HaveOccurred()) opsManager := vCenterManager.OperationsManager(ctx, vm) @@ -98,7 +96,7 @@ var _ = Describe("VcenterClient", func() { It("fails to create a vcenter manager", func() { workingDir, err := os.Getwd() Expect(err).NotTo(HaveOccurred()) - fakeCertPath := filepath.Join(workingDir, "fixtures", "fakecert") + fakeCertPath := filepath.Join(workingDir, "fixtures", "fake-cert") factoryConfig.RootCACertPath = fakeCertPath managerFactory.SetConfig(*factoryConfig) @@ -114,12 +112,12 @@ var _ = Describe("VcenterClient", func() { var guestManager *guest_manager.GuestManager BeforeEach(func() { - factoryConfig = &vcenterclientfactory.FactoryConfig{ + factoryConfig = &vcenter_manager.FactoryConfig{ VCenterServer: envMustExist(VcenterUrl), Username: envMustExist(VcenterUsername), Password: envMustExist(VcenterPassword), - ClientCreator: &vcenterclientfactory.ClientCreator{}, - FinderCreator: &vcenterclientfactory.GovmomiFinderCreator{}, + ClientCreator: &vcenter_manager.ClientCreator{}, + FinderCreator: &vcenter_manager.GovmomiFinderCreator{}, } factoryConfig.RootCACertPath = "" managerFactory.SetConfig(*factoryConfig) @@ -130,7 +128,7 @@ var _ = Describe("VcenterClient", func() { err = vCenterManager.Login(ctx) Expect(err).ToNot(HaveOccurred()) - vm, err := vCenterManager.FindVM(ctx, TestVmPath) + vm, err := vCenterManager.FindVM(ctx, clonedVmPath) Expect(err).ToNot(HaveOccurred()) opsManager := vCenterManager.OperationsManager(ctx, vm) @@ -141,7 +139,7 @@ var _ = Describe("VcenterClient", func() { }) Context("specified file exists", func() { - var fileToDownload = "C:\\Windows\\dummy.txt" + var fileToDownload = `C:\Windows\dummy.txt` var expectedContents = "infinite content" BeforeEach(func() { @@ -172,7 +170,7 @@ var _ = Describe("VcenterClient", func() { Context("specified file does not exist", func() { It("returns an error", func() { - _, _, err := guestManager.DownloadFileInGuest(ctx, "C:\\Windows\\non-existent-file.txt") + _, _, err := guestManager.DownloadFileInGuest(ctx, `C:\Windows\non-existent-file.txt`) Expect(err.Error()).To(ContainSubstring("vcenter_client - unable to download file")) }) }) diff --git a/stembuild/package_stemcell/packager/packager_utility_test.go b/stembuild/package_stemcell/packager/packager_utility_test.go index d041cb287..c12a24443 100644 --- a/stembuild/package_stemcell/packager/packager_utility_test.go +++ b/stembuild/package_stemcell/packager/packager_utility_test.go @@ -1,4 +1,4 @@ -package packager +package packager_test import ( "archive/tar" @@ -12,6 +12,8 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-windows-stemcell-builder/stembuild/package_stemcell/packager" ) var _ = Describe("Packager Utility", func() { @@ -50,7 +52,7 @@ var _ = Describe("Packager Utility", func() { tarball := filepath.Join(destinationDir, "tarball") - sha1Sum, err := TarGenerator(tarball, sourceDir) + sha1Sum, err := packager.TarGenerator(tarball, sourceDir) Expect(err).NotTo(HaveOccurred()) @@ -108,7 +110,7 @@ stemcell_formats: - vsphere-ovf - vsphere-ova ` - result := CreateManifest("1", "version", "sha1sum") + result := packager.CreateManifest("1", "version", "sha1sum") Expect(result).To(Equal(expectedManifest)) }) }) @@ -116,7 +118,7 @@ stemcell_formats: Context("StemcellFileName", func() { It("formats a file name appropriately", func() { expectedName := "bosh-stemcell-2019.00-vsphere-esxi-windows2019-go_agent.tgz" - Expect(StemcellFilename("2019.00", "2019")).To(Equal(expectedName)) + Expect(packager.StemcellFilename("2019.00", "2019")).To(Equal(expectedName)) }) }) }) diff --git a/stembuild/iaas_cli/iaas_clients/fixtures/dummycert b/stembuild/test/helpers/vcsim-cert similarity index 100% rename from stembuild/iaas_cli/iaas_clients/fixtures/dummycert rename to stembuild/test/helpers/vcsim-cert diff --git a/stembuild/iaas_cli/iaas_clients/fixtures/dummykey b/stembuild/test/helpers/vcsim-cert.key similarity index 100% rename from stembuild/iaas_cli/iaas_clients/fixtures/dummykey rename to stembuild/test/helpers/vcsim-cert.key diff --git a/stembuild/test/helpers/vcsim.go b/stembuild/test/helpers/vcsim.go new file mode 100644 index 000000000..2949d2088 --- /dev/null +++ b/stembuild/test/helpers/vcsim.go @@ -0,0 +1,81 @@ +package helpers + +import ( + "crypto/tls" + _ "embed" + "fmt" + "net/url" + "os" + "path/filepath" + + . "github.com/onsi/ginkgo/v2" //nolint:staticcheck + . "github.com/onsi/gomega" //nolint:staticcheck + "github.com/vmware/govmomi/simulator" +) + +//go:embed vcsim-cert +var vcsimCert []byte + +//go:embed vcsim-cert.key +var vcsimCertKey []byte + +type VcsimServer struct { + Username string + Password string + CertificatePath string + vcsimModel *simulator.Model + vcsimServer *simulator.Server +} + +func NewVcsimServer(username string, password string) *VcsimServer { + GinkgoHelper() + vcsimServer := &VcsimServer{ + Username: username, + Password: password, + } + + return vcsimServer +} + +func (h *VcsimServer) Url() string { + GinkgoHelper() + return fmt.Sprintf("%s/sdk", h.vcsimServer.URL.Host) +} + +func (h *VcsimServer) Start() { + certDir := GinkgoT().TempDir() + h.CertificatePath = filepath.Join(certDir, "cert") + err := os.WriteFile(h.CertificatePath, vcsimCert, 0644) + Expect(err).NotTo(HaveOccurred()) + + certKeyPath := filepath.Join(certDir, "cert.key") + err = os.WriteFile(certKeyPath, vcsimCertKey, 0644) + Expect(err).ToNot(HaveOccurred()) + + h.vcsimModel = simulator.VPX() + err = h.vcsimModel.Create() + Expect(err).ToNot(HaveOccurred()) + + h.vcsimModel.Service.RegisterEndpoints = true + h.vcsimModel.Service.Listen = &url.URL{ + User: url.UserPassword(h.Username, h.Password), + } + + serverCert, err := tls.LoadX509KeyPair(h.CertificatePath, certKeyPath) + Expect(err).ToNot(HaveOccurred()) + h.vcsimModel.Service.TLS = &tls.Config{ + Certificates: []tls.Certificate{serverCert}, + } + + h.vcsimServer = h.vcsimModel.Service.NewServer() +} + +func (h *VcsimServer) Stop() { + GinkgoHelper() + if h.vcsimServer != nil { + h.vcsimServer.Close() + } + if h.vcsimModel != nil { + h.vcsimModel.Remove() + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/crypto/doc.go b/stembuild/vendor/github.com/vmware/govmomi/crypto/doc.go new file mode 100644 index 000000000..0e0c0b4bb --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/crypto/doc.go @@ -0,0 +1,9 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +/* +Package crypto provides access to CryptoManagerKmip methods used to manage cryptographic key providers. +For creating and delete native providers, see package vapi/crypto. +*/ +package crypto diff --git a/stembuild/vendor/github.com/vmware/govmomi/crypto/manager_kmip.go b/stembuild/vendor/github.com/vmware/govmomi/crypto/manager_kmip.go new file mode 100644 index 000000000..66f32b465 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/crypto/manager_kmip.go @@ -0,0 +1,472 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package crypto + +import ( + "context" + "fmt" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +const ( + CheckKeyAvailable = int32(0x01) + CheckKeyUsedByVms = int32(0x02) + CheckKeyUsedByHosts = int32(0x04) + CheckKeyUsedByOther = int32(0x08) +) + +type ManagerKmip struct { + object.Common +} + +// GetManagerKmip wraps NewManager, returning ErrNotSupported when the client is +// not connected to a vCenter instance. +func GetManagerKmip(c *vim25.Client) (*ManagerKmip, error) { + if c.ServiceContent.CryptoManager == nil { + return nil, object.ErrNotSupported + } + return NewManagerKmip(c), nil +} + +func NewManagerKmip(c *vim25.Client) *ManagerKmip { + m := ManagerKmip{ + Common: object.NewCommon(c, *c.ServiceContent.CryptoManager), + } + return &m +} + +func (m ManagerKmip) ListKmipServers( + ctx context.Context, + limit *int32) ([]types.KmipClusterInfo, error) { + + req := types.ListKmipServers{ + This: m.Reference(), + Limit: limit, + } + res, err := methods.ListKmipServers(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + return res.Returnval, nil +} + +func (m ManagerKmip) IsDefaultProviderNative( + ctx context.Context, + entity *types.ManagedObjectReference, + defaultsToParent bool) (bool, error) { + + defaultProviderID, err := m.GetDefaultKmsClusterID( + ctx, entity, defaultsToParent) + if err != nil { + return false, err + } + if defaultProviderID == "" { + return false, nil + } + return m.IsNativeProvider(ctx, defaultProviderID) +} + +func (m ManagerKmip) IsNativeProvider( + ctx context.Context, + providerID string) (bool, error) { + + info, err := m.GetClusterStatus(ctx, providerID) + if err != nil { + return false, err + } + if info == nil { + return false, nil + } + return info.ManagementType == string( + types.KmipClusterInfoKmsManagementTypeNativeProvider), nil +} + +func (m ManagerKmip) GetDefaultKmsClusterID( + ctx context.Context, + entity *types.ManagedObjectReference, + defaultsToParent bool) (string, error) { + + req := types.GetDefaultKmsCluster{ + This: m.Reference(), + Entity: entity, + DefaultsToParent: &defaultsToParent, + } + res, err := methods.GetDefaultKmsCluster(ctx, m.Client(), &req) + if err != nil { + return "", err + } + if res.Returnval != nil { + return res.Returnval.Id, nil + } + return "", nil +} + +func (m ManagerKmip) GetStatus( + ctx context.Context, + clusters ...types.KmipClusterInfo) ([]types.CryptoManagerKmipClusterStatus, error) { + + req := types.RetrieveKmipServersStatus_Task{ + This: m.Reference(), + Clusters: clusters, + } + res, err := methods.RetrieveKmipServersStatus_Task(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + task := object.NewTask(m.Client(), res.Returnval) + taskInfo, err := task.WaitForResult(ctx) + if err != nil { + return nil, err + } + + if taskInfo.Result == nil { + return nil, nil + } + result, ok := taskInfo.Result.(types.ArrayOfCryptoManagerKmipClusterStatus) + if !ok { + return nil, nil + } + if len(result.CryptoManagerKmipClusterStatus) == 0 { + return nil, nil + } + + return result.CryptoManagerKmipClusterStatus, nil +} + +func (m ManagerKmip) GetClusterStatus( + ctx context.Context, + providerID string) (*types.CryptoManagerKmipClusterStatus, error) { + + result, err := m.GetStatus( + ctx, + types.KmipClusterInfo{ + ClusterId: types.KeyProviderId{ + Id: providerID, + }, + }) + if err != nil { + return nil, err + } + if len(result) == 0 { + return nil, fmt.Errorf("invalid cluster ID") + } + return &result[0], nil +} + +func (m ManagerKmip) GetServerStatus( + ctx context.Context, + providerID, serverName string) (*types.CryptoManagerKmipServerStatus, error) { + + result, err := m.GetStatus( + ctx, + types.KmipClusterInfo{ + ClusterId: types.KeyProviderId{ + Id: providerID, + }, + Servers: []types.KmipServerInfo{ + { + Name: serverName, + }, + }, + }) + if err != nil { + return nil, err + } + if len(result) == 0 { + return nil, fmt.Errorf("invalid cluster ID") + } + if len(result[0].Servers) == 0 { + return nil, fmt.Errorf("invalid server name") + } + return &result[0].Servers[0], nil +} + +func (m ManagerKmip) MarkDefault( + ctx context.Context, + providerID string) error { + + req := types.MarkDefault{ + This: m.Reference(), + ClusterId: types.KeyProviderId{Id: providerID}, + } + _, err := methods.MarkDefault(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) SetDefaultKmsClusterId( + ctx context.Context, + providerID string, + entity *types.ManagedObjectReference) error { + + req := types.SetDefaultKmsCluster{ + This: m.Reference(), + Entity: entity, + } + if providerID != "" { + req.ClusterId = &types.KeyProviderId{ + Id: providerID, + } + } + _, err := methods.SetDefaultKmsCluster(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) RegisterKmsCluster( + ctx context.Context, + providerID string, + managementType types.KmipClusterInfoKmsManagementType) error { + + req := types.RegisterKmsCluster{ + This: m.Reference(), + ClusterId: types.KeyProviderId{ + Id: providerID, + }, + ManagementType: string(managementType), + } + _, err := methods.RegisterKmsCluster(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) UnregisterKmsCluster( + ctx context.Context, + providerID string) error { + + req := types.UnregisterKmsCluster{ + This: m.Reference(), + ClusterId: types.KeyProviderId{ + Id: providerID, + }, + } + _, err := methods.UnregisterKmsCluster(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) RegisterKmipServer( + ctx context.Context, + server types.KmipServerSpec) error { + + req := types.RegisterKmipServer{ + This: m.Reference(), + Server: server, + } + _, err := methods.RegisterKmipServer(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) UpdateKmipServer( + ctx context.Context, + server types.KmipServerSpec) error { + + req := types.UpdateKmipServer{ + This: m.Reference(), + Server: server, + } + _, err := methods.UpdateKmipServer(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) RemoveKmipServer( + ctx context.Context, + providerID, serverName string) error { + + req := types.RemoveKmipServer{ + This: m.Reference(), + ClusterId: types.KeyProviderId{ + Id: providerID, + }, + ServerName: serverName, + } + _, err := methods.RemoveKmipServer(ctx, m.Client(), &req) + if err != nil { + return err + } + return nil +} + +func (m ManagerKmip) QueryCryptoKeyStatus( + ctx context.Context, + ids []types.CryptoKeyId, + check int32) ([]types.CryptoManagerKmipCryptoKeyStatus, error) { + + req := types.QueryCryptoKeyStatus{ + This: m.Reference(), + KeyIds: ids, + CheckKeyBitMap: check, + } + + res, err := methods.QueryCryptoKeyStatus(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + return res.Returnval, nil +} + +func (m ManagerKmip) ListKeys( + ctx context.Context, + limit *int32) ([]types.CryptoKeyId, error) { + + req := types.ListKeys{ + This: m.Reference(), + Limit: limit, + } + res, err := methods.ListKeys(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + return res.Returnval, nil +} + +const keyStateNotActiveOrEnabled = string(types.CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateNotActiveOrEnabled) + +// IsValidKey returns true if QueryCryptoKeyStatus results indicate the key is available or unavailable reason is `KeyStateNotActiveOrEnabled`. +// This method is only valid for standard providers and will always return false for native providers. +func (m ManagerKmip) IsValidKey( + ctx context.Context, + providerID, + keyID string) (bool, error) { + + id := []types.CryptoKeyId{{ + KeyId: keyID, + ProviderId: &types.KeyProviderId{ + Id: providerID, + }}, + } + + res, err := m.QueryCryptoKeyStatus(ctx, id, CheckKeyAvailable) + if err != nil { + return false, err + } + + for _, status := range res { + if status.KeyAvailable != nil && *status.KeyAvailable { + return true, nil + } + + if status.Reason == keyStateNotActiveOrEnabled { + return true, nil + } + } + + return false, nil +} + +func (m ManagerKmip) IsValidProvider( + ctx context.Context, + providerID string) (bool, error) { + + clusters, err := m.ListKmipServers(ctx, nil) + if err != nil { + return false, err + } + + for i := range clusters { + if clusters[i].ClusterId.Id == providerID { + return true, nil + } + } + + return false, nil +} + +func (m ManagerKmip) IsValidServer( + ctx context.Context, + providerID, serverName string) (bool, error) { + + clusters, err := m.ListKmipServers(ctx, nil) + if err != nil { + return false, err + } + + for i := range clusters { + if clusters[i].ClusterId.Id == providerID { + for j := range clusters[i].Servers { + if clusters[i].Servers[j].Name == serverName { + return true, nil + } + } + } + } + + return false, nil +} + +func (m ManagerKmip) GenerateKey( + ctx context.Context, + providerID string) (string, error) { + + req := types.GenerateKey{ + This: m.Reference(), + } + + if providerID != "" { + req.KeyProvider = &types.KeyProviderId{ + Id: providerID, + } + } + res, err := methods.GenerateKey(ctx, m.Client(), &req) + if err != nil { + return "", err + } + if !res.Returnval.Success { + err := generateKeyError{reason: res.Returnval.Reason} + if res.Returnval.Fault != nil { + err.LocalizedMethodFault = *res.Returnval.Fault + } + return "", err + } + return res.Returnval.KeyId.KeyId, nil +} + +func (m ManagerKmip) RemoveKeys( + ctx context.Context, + ids []types.CryptoKeyId, + force bool) error { + + req := types.RemoveKeys{ + This: m.Reference(), + Keys: ids, + Force: force, + } + + _, err := methods.RemoveKeys(ctx, m.Client(), &req) + return err +} + +type generateKeyError struct { + types.LocalizedMethodFault + reason string +} + +func (e generateKeyError) Error() string { + + return e.reason +} + +func (e generateKeyError) GetLocalizedMethodFault() *types.LocalizedMethodFault { + return &e.LocalizedMethodFault +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/alarm_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/alarm_manager.go new file mode 100644 index 000000000..1ee8aa2cc --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/alarm_manager.go @@ -0,0 +1,258 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + "time" + + "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type AlarmManager struct { + mo.AlarmManager + + types.GetAlarmResponse +} + +func (m *AlarmManager) init(r *Registry) { + if m.GetAlarmResponse.Returnval != nil { + return + } + + m.GetAlarmResponse.Returnval = make([]types.ManagedObjectReference, len(vpx.Alarm)) + for i, alarm := range vpx.Alarm { + m.GetAlarmResponse.Returnval[i] = alarm.Self + r.Put(&Alarm{Alarm: alarm}) + } +} + +func (*AlarmManager) trimPrefix(s string) string { + return strings.TrimPrefix(s, "vim.") +} + +func (*AlarmManager) key(refs ...types.ManagedObjectReference) string { + keys := make([]string, len(refs)) + for i := range refs { + s := strings.Split(refs[i].Value, "-") + keys[i] = s[len(s)-1] + } + return strings.Join(keys, ".") +} + +// only handling the common use case of EventEx for now +func (m *AlarmManager) matchAlarm(alarm *Alarm, event *types.EventEx) (*mo.Alarm, types.ManagedEntityStatus) { + id := event.EventTypeId + kind := m.trimPrefix(event.ObjectType) + + switch op := alarm.Info.Expression.(type) { + case *types.OrAlarmExpression: + for i := range op.Expression { + switch x := op.Expression[i].(type) { + case *types.EventAlarmExpression: + if x.EventTypeId == id && kind == m.trimPrefix(x.ObjectType) { + return &alarm.Alarm, x.Status + } + } + } + } + return nil, "" +} + +// update (e.g. triggeredAlarmState) and propagate up the inventory hierarchy +func (*AlarmManager) update(ctx *Context, me mo.Entity, update func(mo.Entity) *types.ManagedObjectReference) { + for { + if me == nil { + break + } + ctx.WithLock(me, func() { + parent := update(me) + if parent == nil { + me = nil + } else { + me = ctx.Map.Get(*parent).(mo.Entity) + } + }) + } +} + +// postEvent triggers Alarms based on Events +func (m *AlarmManager) postEvent(ctx *Context, base types.BaseEvent) { + event, ok := base.(*types.EventEx) + if !ok { + return + } + + entity := types.ManagedObjectReference{Type: event.ObjectType, Value: event.ObjectId} + me := ctx.Map.Get(entity).(mo.Entity) + + for _, ref := range m.GetAlarmResponse.Returnval { + alarm := ctx.Map.Get(ref).(*Alarm) + match, status := m.matchAlarm(alarm, event) + if match == nil { + continue + } + + now := time.Now() + key := m.key(match.Self, entity) + + update := func(me mo.Entity) *types.ManagedObjectReference { + obj := me.Entity() + + for i, state := range obj.TriggeredAlarmState { + if state.Key != key { + continue + } + + switch status { + case state.OverallStatus: + // no change + return nil + case types.ManagedEntityStatusGreen: + // remove + obj.TriggeredAlarmState = + append(obj.TriggeredAlarmState[:i], + obj.TriggeredAlarmState[i+1:]...) + return obj.Parent + default: + // status change (e.g. yellow -> red) + obj.TriggeredAlarmState[i].OverallStatus = status + return obj.Parent + } + } + + if status == types.ManagedEntityStatusGreen { + return nil // green only clears a triggered alarm + } + + // add + state := types.AlarmState{ + Key: key, + Entity: entity, + Alarm: match.Self, + OverallStatus: status, + Time: now, + EventKey: event.Key, + Acknowledged: types.NewBool(false), + } + + obj.TriggeredAlarmState = append(obj.TriggeredAlarmState, state) + + return obj.Parent + } + + m.update(ctx, me, update) + } +} + +func (m *AlarmManager) GetAlarm(ctx *Context, req *types.GetAlarm) soap.HasFault { + body := &methods.GetAlarmBody{ + Res: new(types.GetAlarmResponse), + } + + if req.Entity == nil || *req.Entity == ctx.Map.content().RootFolder { + body.Res.Returnval = m.GetAlarmResponse.Returnval + } // else TODO + + return body +} + +func (m *AlarmManager) CreateAlarm(ctx *Context, req *types.CreateAlarm) soap.HasFault { + body := new(methods.CreateAlarmBody) + + name := req.Spec.GetAlarmSpec().Name + + for _, alarm := range ctx.Map.AllReference("Alarm") { + if alarm.(*Alarm).Info.Name == name { + body.Fault_ = Fault("", &types.DuplicateName{Name: name}) + return body + } + } + + alarm := Alarm{ + Alarm: mo.Alarm{ + Info: types.AlarmInfo{ + AlarmSpec: *req.Spec.GetAlarmSpec(), + Entity: req.Entity, + LastModifiedTime: time.Now(), + LastModifiedUser: ctx.Session.UserName, + }, + }, + } + + ref := ctx.Map.Put(&alarm).Reference() + alarm.Info.Alarm = ref + m.GetAlarmResponse.Returnval = append(m.GetAlarmResponse.Returnval, ref) + + body.Res = &types.CreateAlarmResponse{ + Returnval: ref, + } + + return body +} + +func (m *AlarmManager) AcknowledgeAlarm(ctx *Context, req *types.AcknowledgeAlarm) soap.HasFault { + body := new(methods.AcknowledgeAlarmBody) + + now := types.NewTime(time.Now()) + key := m.key(req.Alarm, req.Entity) + me := ctx.Map.Get(req.Entity).(mo.Entity) + + update := func(me mo.Entity) *types.ManagedObjectReference { + obj := me.Entity() + + for i, state := range obj.TriggeredAlarmState { + if state.Key == key { + if *obj.TriggeredAlarmState[i].Acknowledged { + return nil // already ack-ed + } + obj.TriggeredAlarmState[i].Acknowledged = types.NewBool(true) + obj.TriggeredAlarmState[i].AcknowledgedTime = now + obj.TriggeredAlarmState[i].AcknowledgedByUser = ctx.Session.UserName + return obj.Parent + } + } + + return nil + } + + m.update(ctx, me, update) + + body.Res = new(types.AcknowledgeAlarmResponse) + + return body +} + +type Alarm struct { + mo.Alarm +} + +func (a *Alarm) ReconfigureAlarm(ctx *Context, req *types.ReconfigureAlarm) soap.HasFault { + body := new(methods.ReconfigureAlarmBody) + + // TODO: spec validation + + a.Info.AlarmSpec = *req.Spec.GetAlarmSpec() + + body.Res = new(types.ReconfigureAlarmResponse) + + return body +} + +func (a *Alarm) RemoveAlarm(ctx *Context, req *types.RemoveAlarm) soap.HasFault { + m := ctx.Map.AlarmManager() + + RemoveReference(&m.GetAlarmResponse.Returnval, req.This) + + ctx.Map.Remove(ctx, req.This) + + return &methods.RemoveAlarmBody{ + Res: new(types.RemoveAlarmResponse), + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go new file mode 100644 index 000000000..b66017172 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go @@ -0,0 +1,324 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type AuthorizationManager struct { + mo.AuthorizationManager + + permissions map[types.ManagedObjectReference][]types.Permission + privileges map[string]struct{} + system []string + nextID int32 +} + +func (m *AuthorizationManager) init(r *Registry) { + if len(m.RoleList) == 0 { + m.RoleList = make([]types.AuthorizationRole, len(esx.RoleList)) + copy(m.RoleList, esx.RoleList) + } + + m.permissions = make(map[types.ManagedObjectReference][]types.Permission) + + l := object.AuthorizationRoleList(m.RoleList) + m.system = l.ByName("ReadOnly").Privilege + admin := l.ByName("Admin") + m.privileges = make(map[string]struct{}, len(admin.Privilege)) + + for _, id := range admin.Privilege { + m.privileges[id] = struct{}{} + } + + root := r.content().RootFolder + + for _, u := range DefaultUserGroup { + m.permissions[root] = append(m.permissions[root], types.Permission{ + Entity: &root, + Principal: u.Principal, + Group: u.Group, + RoleId: admin.RoleId, + Propagate: true, + }) + } +} + +func (m *AuthorizationManager) RetrieveEntityPermissions(ctx *Context, req *types.RetrieveEntityPermissions) soap.HasFault { + e := ctx.Map.Get(req.Entity).(mo.Entity) + + p := m.permissions[e.Reference()] + + if req.Inherited { + for { + parent := e.Entity().Parent + if parent == nil { + break + } + + e = ctx.Map.Get(parent.Reference()).(mo.Entity) + + p = append(p, m.permissions[e.Reference()]...) + } + } + + return &methods.RetrieveEntityPermissionsBody{ + Res: &types.RetrieveEntityPermissionsResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) RetrieveAllPermissions(req *types.RetrieveAllPermissions) soap.HasFault { + var p []types.Permission + + for _, v := range m.permissions { + p = append(p, v...) + } + + return &methods.RetrieveAllPermissionsBody{ + Res: &types.RetrieveAllPermissionsResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) RemoveEntityPermission(req *types.RemoveEntityPermission) soap.HasFault { + var p []types.Permission + + for _, v := range m.permissions[req.Entity] { + if v.Group == req.IsGroup && v.Principal == req.User { + continue + } + p = append(p, v) + } + + m.permissions[req.Entity] = p + + return &methods.RemoveEntityPermissionBody{ + Res: &types.RemoveEntityPermissionResponse{}, + } +} + +func (m *AuthorizationManager) SetEntityPermissions(req *types.SetEntityPermissions) soap.HasFault { + m.permissions[req.Entity] = req.Permission + + return &methods.SetEntityPermissionsBody{ + Res: &types.SetEntityPermissionsResponse{}, + } +} + +func (m *AuthorizationManager) RetrieveRolePermissions(req *types.RetrieveRolePermissions) soap.HasFault { + var p []types.Permission + + for _, set := range m.permissions { + for _, v := range set { + if v.RoleId == req.RoleId { + p = append(p, v) + } + } + } + + return &methods.RetrieveRolePermissionsBody{ + Res: &types.RetrieveRolePermissionsResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) HasPrivilegeOnEntities(req *types.HasPrivilegeOnEntities) soap.HasFault { + var p []types.EntityPrivilege + + for _, e := range req.Entity { + priv := types.EntityPrivilege{Entity: e} + + for _, id := range req.PrivId { + priv.PrivAvailability = append(priv.PrivAvailability, types.PrivilegeAvailability{ + PrivId: id, + IsGranted: true, + }) + } + + p = append(p, priv) + } + + return &methods.HasPrivilegeOnEntitiesBody{ + Res: &types.HasPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) HasPrivilegeOnEntity(req *types.HasPrivilegeOnEntity) soap.HasFault { + p := make([]bool, len(req.PrivId)) + + for i := range req.PrivId { + p[i] = true + } + + return &methods.HasPrivilegeOnEntityBody{ + Res: &types.HasPrivilegeOnEntityResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) HasUserPrivilegeOnEntities(req *types.HasUserPrivilegeOnEntities) soap.HasFault { + var p []types.EntityPrivilege + + for _, e := range req.Entities { + priv := types.EntityPrivilege{Entity: e} + + for _, id := range req.PrivId { + priv.PrivAvailability = append(priv.PrivAvailability, types.PrivilegeAvailability{ + PrivId: id, + IsGranted: true, + }) + } + + p = append(p, priv) + } + + return &methods.HasUserPrivilegeOnEntitiesBody{ + Res: &types.HasUserPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) FetchUserPrivilegeOnEntities(req *types.FetchUserPrivilegeOnEntities) soap.HasFault { + admin := object.AuthorizationRoleList(m.RoleList).ByName("Admin").Privilege + + var p []types.UserPrivilegeResult + + for _, e := range req.Entities { + p = append(p, types.UserPrivilegeResult{ + Entity: e, + Privileges: admin, + }) + } + + return &methods.FetchUserPrivilegeOnEntitiesBody{ + Res: &types.FetchUserPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) AddAuthorizationRole(req *types.AddAuthorizationRole) soap.HasFault { + body := &methods.AddAuthorizationRoleBody{} + + for _, role := range m.RoleList { + if role.Name == req.Name { + body.Fault_ = Fault("", &types.AlreadyExists{}) + return body + } + } + + ids, err := m.privIDs(req.PrivIds) + if err != nil { + body.Fault_ = err + return body + } + + m.RoleList = append(m.RoleList, types.AuthorizationRole{ + Info: &types.Description{ + Label: req.Name, + Summary: req.Name, + }, + RoleId: m.nextID, + Privilege: ids, + Name: req.Name, + System: false, + }) + + m.nextID++ + + body.Res = &types.AddAuthorizationRoleResponse{} + + return body +} + +func (m *AuthorizationManager) UpdateAuthorizationRole(req *types.UpdateAuthorizationRole) soap.HasFault { + body := &methods.UpdateAuthorizationRoleBody{} + + for _, role := range m.RoleList { + if role.Name == req.NewName && role.RoleId != req.RoleId { + body.Fault_ = Fault("", &types.AlreadyExists{}) + return body + } + } + + for i, role := range m.RoleList { + if role.RoleId == req.RoleId { + if len(req.PrivIds) != 0 { + ids, err := m.privIDs(req.PrivIds) + if err != nil { + body.Fault_ = err + return body + } + m.RoleList[i].Privilege = ids + } + + m.RoleList[i].Name = req.NewName + + body.Res = &types.UpdateAuthorizationRoleResponse{} + return body + } + } + + body.Fault_ = Fault("", &types.NotFound{}) + + return body +} + +func (m *AuthorizationManager) RemoveAuthorizationRole(req *types.RemoveAuthorizationRole) soap.HasFault { + body := &methods.RemoveAuthorizationRoleBody{} + + for i, role := range m.RoleList { + if role.RoleId == req.RoleId { + m.RoleList = append(m.RoleList[:i], m.RoleList[i+1:]...) + + body.Res = &types.RemoveAuthorizationRoleResponse{} + return body + } + } + + body.Fault_ = Fault("", &types.NotFound{}) + + return body +} + +func (m *AuthorizationManager) privIDs(ids []string) ([]string, *soap.Fault) { + system := make(map[string]struct{}, len(m.system)) + + for _, id := range ids { + if _, ok := m.privileges[id]; !ok { + return nil, Fault("", &types.InvalidArgument{InvalidProperty: "privIds"}) + } + + if strings.HasPrefix(id, "System.") { + system[id] = struct{}{} + } + } + + for _, id := range m.system { + if _, ok := system[id]; ok { + continue + } + + ids = append(ids, id) + } + + return ids, nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go new file mode 100644 index 000000000..1d7e09ba1 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go @@ -0,0 +1,706 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "log" + "math/rand" + "sync/atomic" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type ClusterComputeResource struct { + mo.ClusterComputeResource + + ruleKey int32 +} + +func (c *ClusterComputeResource) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, c, req) +} + +type addHost struct { + *ClusterComputeResource + + req *types.AddHost_Task +} + +func (add *addHost) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + spec := add.req.Spec + + if spec.HostName == "" { + return nil, &types.NoHost{} + } + + cr := add.ClusterComputeResource + template := esx.HostSystem + + if h := task.ctx.Map.FindByName(spec.UserName, cr.Host); h != nil { + // "clone" an existing host from the inventory + template = h.(*HostSystem).HostSystem + template.Vm = nil + } else { + template.Network = cr.Network[:1] // VM Network + } + + host := NewHostSystem(task.ctx, template) + host.configure(task.ctx, spec, add.req.AsConnected) + + task.ctx.Map.PutEntity(cr, task.ctx.Map.NewEntity(host)) + host.Summary.Host = &host.Self + host.Config.Host = host.Self + + task.ctx.Map.WithLock(task.ctx, *cr.EnvironmentBrowser, func() { + eb := task.ctx.Map.Get(*cr.EnvironmentBrowser).(*EnvironmentBrowser) + eb.addHost(task.ctx, host.Self) + }) + + cr.Host = append(cr.Host, host.Reference()) + addComputeResource(cr.Summary.GetComputeResourceSummary(), host) + + if cr.vsanIsEnabled() { + cr.addStorageHost(task.ctx, host.Self) + } + + return host.Reference(), nil +} + +func (c *ClusterComputeResource) AddHostTask(ctx *Context, add *types.AddHost_Task) soap.HasFault { + return &methods.AddHost_TaskBody{ + Res: &types.AddHost_TaskResponse{ + Returnval: NewTask(&addHost{c, add}).Run(ctx), + }, + } +} + +func (c *ClusterComputeResource) vsanIsEnabled() bool { + if cfg := c.ConfigurationEx.(*types.ClusterConfigInfoEx).VsanConfigInfo; cfg != nil { + return isTrue(cfg.Enabled) + } + return false +} + +func (c *ClusterComputeResource) update(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + if cspec.DasConfig != nil { + if val := cspec.DasConfig.Enabled; val != nil { + cfg.DasConfig.Enabled = val + } + if val := cspec.DasConfig.AdmissionControlEnabled; val != nil { + cfg.DasConfig.AdmissionControlEnabled = val + } + } + if cspec.DrsConfig != nil { + if val := cspec.DrsConfig.Enabled; val != nil { + cfg.DrsConfig.Enabled = val + } + if val := cspec.DrsConfig.DefaultVmBehavior; val != "" { + cfg.DrsConfig.DefaultVmBehavior = val + } + } + + return nil +} + +func (c *ClusterComputeResource) updateRules(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.RulesSpec { + var i int + exists := false + + match := func(info types.BaseClusterRuleInfo) bool { + return info.GetClusterRuleInfo().Name == spec.Info.GetClusterRuleInfo().Name + } + + if spec.Operation == types.ArrayUpdateOperationRemove { + match = func(rule types.BaseClusterRuleInfo) bool { + return rule.GetClusterRuleInfo().Key == spec.ArrayUpdateSpec.RemoveKey.(int32) + } + } + + for i = range cfg.Rule { + if match(cfg.Rule[i].GetClusterRuleInfo()) { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + info := spec.Info.GetClusterRuleInfo() + info.Key = atomic.AddInt32(&c.ruleKey, 1) + info.RuleUuid = uuid.New().String() + cfg.Rule = append(cfg.Rule, spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + cfg.Rule[i] = spec.Info + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.Rule = append(cfg.Rule[:i], cfg.Rule[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) updateGroups(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.GroupSpec { + var i int + exists := false + + match := func(info types.BaseClusterGroupInfo) bool { + return info.GetClusterGroupInfo().Name == spec.Info.GetClusterGroupInfo().Name + } + + if spec.Operation == types.ArrayUpdateOperationRemove { + match = func(info types.BaseClusterGroupInfo) bool { + return info.GetClusterGroupInfo().Name == spec.ArrayUpdateSpec.RemoveKey.(string) + } + } + + for i = range cfg.Group { + if match(cfg.Group[i].GetClusterGroupInfo()) { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + cfg.Group = append(cfg.Group, spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + cfg.Group[i] = spec.Info + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.Group = append(cfg.Group[:i], cfg.Group[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) updateOverridesDAS(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.DasVmConfigSpec { + var i int + var key types.ManagedObjectReference + exists := false + + if spec.Operation == types.ArrayUpdateOperationRemove { + key = spec.RemoveKey.(types.ManagedObjectReference) + } else { + key = spec.Info.Key + } + + for i = range cfg.DasVmConfig { + if cfg.DasVmConfig[i].Key == key { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + cfg.DasVmConfig = append(cfg.DasVmConfig, *spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + src := spec.Info.DasSettings + if src == nil { + return new(types.InvalidArgument) + } + dst := cfg.DasVmConfig[i].DasSettings + if src.RestartPriority != "" { + dst.RestartPriority = src.RestartPriority + } + if src.RestartPriorityTimeout != 0 { + dst.RestartPriorityTimeout = src.RestartPriorityTimeout + } + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.DasVmConfig = append(cfg.DasVmConfig[:i], cfg.DasVmConfig[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) updateOverridesDRS(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.DrsVmConfigSpec { + var i int + var key types.ManagedObjectReference + exists := false + + if spec.Operation == types.ArrayUpdateOperationRemove { + key = spec.RemoveKey.(types.ManagedObjectReference) + } else { + key = spec.Info.Key + } + + for i = range cfg.DrsVmConfig { + if cfg.DrsVmConfig[i].Key == key { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + cfg.DrsVmConfig = append(cfg.DrsVmConfig, *spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + if spec.Info.Enabled != nil { + cfg.DrsVmConfig[i].Enabled = spec.Info.Enabled + } + if spec.Info.Behavior != "" { + cfg.DrsVmConfig[i].Behavior = spec.Info.Behavior + } + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.DrsVmConfig = append(cfg.DrsVmConfig[:i], cfg.DrsVmConfig[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) updateOverridesVmOrchestration(_ *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.VmOrchestrationSpec { + var i int + var key types.ManagedObjectReference + exists := false + + if spec.Operation == types.ArrayUpdateOperationRemove { + key = spec.RemoveKey.(types.ManagedObjectReference) + } else { + key = spec.Info.Vm + } + + for i = range cfg.VmOrchestration { + if cfg.VmOrchestration[i].Vm == key { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + cfg.VmOrchestration = append(cfg.VmOrchestration, *spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + if spec.Info.VmReadiness.ReadyCondition != "" { + cfg.VmOrchestration[i].VmReadiness.ReadyCondition = spec.Info.VmReadiness.ReadyCondition + } + if spec.Info.VmReadiness.PostReadyDelay != 0 { + cfg.VmOrchestration[i].VmReadiness.PostReadyDelay = spec.Info.VmReadiness.PostReadyDelay + } + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.VmOrchestration = append(cfg.VmOrchestration[:i], cfg.VmOrchestration[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) addStorageHost(ctx *Context, ref types.ManagedObjectReference) types.BaseMethodFault { + ds := ctx.Map.Get(ref).(*HostSystem).ConfigManager.DatastoreSystem + hds := ctx.Map.Get(*ds).(*HostDatastoreSystem) + return hds.createVsanDatastore(ctx) +} + +func (c *ClusterComputeResource) updateVSAN(ctx *Context, cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + if cspec.VsanConfig == nil { + return nil + } + + if cfg.VsanConfigInfo == nil { + cfg.VsanConfigInfo = cspec.VsanConfig + if cfg.VsanConfigInfo.DefaultConfig == nil { + cfg.VsanConfigInfo.DefaultConfig = new(types.VsanClusterConfigInfoHostDefaultInfo) + } + } else { + if cspec.VsanConfig.Enabled != nil { + cfg.VsanConfigInfo.Enabled = cspec.VsanConfig.Enabled + } + } + + if cfg.VsanConfigInfo.DefaultConfig.Uuid == "" { + cfg.VsanConfigInfo.DefaultConfig.Uuid = uuid.NewString() + } + + if isTrue(cfg.VsanConfigInfo.Enabled) { + for _, ref := range c.Host { + if err := c.addStorageHost(ctx, ref); err != nil { + return err + } + } + } + + return nil +} + +func (c *ClusterComputeResource) ReconfigureComputeResourceTask(ctx *Context, req *types.ReconfigureComputeResource_Task) soap.HasFault { + task := CreateTask(c, "reconfigureCluster", func(*Task) (types.AnyType, types.BaseMethodFault) { + spec, ok := req.Spec.(*types.ClusterConfigSpecEx) + if !ok { + return nil, new(types.InvalidArgument) + } + + updates := []func(*Context, *types.ClusterConfigInfoEx, *types.ClusterConfigSpecEx) types.BaseMethodFault{ + c.update, + c.updateRules, + c.updateGroups, + c.updateOverridesDAS, + c.updateOverridesDRS, + c.updateOverridesVmOrchestration, + c.updateVSAN, + } + + for _, update := range updates { + if err := update(ctx, c.ConfigurationEx.(*types.ClusterConfigInfoEx), spec); err != nil { + return nil, err + } + } + + return nil, nil + }) + + return &methods.ReconfigureComputeResource_TaskBody{ + Res: &types.ReconfigureComputeResource_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (c *ClusterComputeResource) MoveIntoTask(ctx *Context, req *types.MoveInto_Task) soap.HasFault { + task := CreateTask(c, "moveInto", func(*Task) (types.AnyType, types.BaseMethodFault) { + for _, ref := range req.Host { + host := ctx.Map.Get(ref).(*HostSystem) + + if *host.Parent == c.Self { + return nil, new(types.DuplicateName) // host already in this cluster + } + + switch parent := ctx.Map.Get(*host.Parent).(type) { + case *ClusterComputeResource: + if !host.Runtime.InMaintenanceMode { + return nil, new(types.InvalidState) + } + + RemoveReference(&parent.Host, ref) + case *mo.ComputeResource: + ctx.Map.Remove(ctx, parent.Self) + } + + c.Host = append(c.Host, ref) + host.Parent = &c.Self + } + + return nil, nil + }) + + return &methods.MoveInto_TaskBody{ + Res: &types.MoveInto_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (c *ClusterComputeResource) PlaceVm(ctx *Context, req *types.PlaceVm) soap.HasFault { + body := new(methods.PlaceVmBody) + + if len(c.Host) == 0 { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + res := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXvmotionPlacement), + ReasonText: string(types.RecommendationReasonCodeXvmotionPlacement), + Target: &c.Self, + } + + hosts := req.PlacementSpec.Hosts + if len(hosts) == 0 { + hosts = c.Host + } + + datastores := req.PlacementSpec.Datastores + if len(datastores) == 0 { + datastores = c.Datastore + } + + switch types.PlacementSpecPlacementType(req.PlacementSpec.PlacementType) { + case types.PlacementSpecPlacementTypeClone, types.PlacementSpecPlacementTypeCreate: + spec := &types.VirtualMachineRelocateSpec{ + Datastore: &datastores[rand.Intn(len(c.Datastore))], + Host: &hosts[rand.Intn(len(c.Host))], + Pool: c.ResourcePool, + } + res.Action = append(res.Action, &types.PlacementAction{ + Vm: req.PlacementSpec.Vm, + TargetHost: spec.Host, + RelocateSpec: spec, + }) + case types.PlacementSpecPlacementTypeReconfigure: + // Validate input. + if req.PlacementSpec.ConfigSpec == nil { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "PlacementSpec.configSpec", + }) + return body + } + + // Update PlacementResult. + vmObj := ctx.Map.Get(*req.PlacementSpec.Vm).(*VirtualMachine) + spec := &types.VirtualMachineRelocateSpec{ + Datastore: &vmObj.Datastore[0], + Host: vmObj.Runtime.Host, + Pool: vmObj.ResourcePool, + DiskMoveType: string(types.VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndAllowSharing), + } + res.Action = append(res.Action, &types.PlacementAction{ + Vm: req.PlacementSpec.Vm, + TargetHost: spec.Host, + RelocateSpec: spec, + }) + case types.PlacementSpecPlacementTypeRelocate: + // Validate fields of req.PlacementSpec, if explicitly provided. + if !validatePlacementSpecForPlaceVmRelocate(ctx, req, body) { + return body + } + + // After validating req.PlacementSpec, we must have a valid req.PlacementSpec.Vm. + vmObj := ctx.Map.Get(*req.PlacementSpec.Vm).(*VirtualMachine) + + // Populate RelocateSpec's common fields, if not explicitly provided. + populateRelocateSpecForPlaceVmRelocate(&req.PlacementSpec.RelocateSpec, vmObj) + + // Update PlacementResult. + res.Action = append(res.Action, &types.PlacementAction{ + Vm: req.PlacementSpec.Vm, + TargetHost: req.PlacementSpec.RelocateSpec.Host, + RelocateSpec: req.PlacementSpec.RelocateSpec, + }) + default: + log.Printf("unsupported placement type: %s", req.PlacementSpec.PlacementType) + body.Fault_ = Fault("", new(types.NotSupported)) + return body + } + + body.Res = &types.PlaceVmResponse{ + Returnval: types.PlacementResult{ + Recommendations: []types.ClusterRecommendation{res}, + }, + } + + return body +} + +// validatePlacementSpecForPlaceVmRelocate validates the fields of req.PlacementSpec for a relocate placement type. +// Returns true if the fields are valid, false otherwise. +func validatePlacementSpecForPlaceVmRelocate(ctx *Context, req *types.PlaceVm, body *methods.PlaceVmBody) bool { + if req.PlacementSpec.Vm == nil { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "PlacementSpec", + }) + return false + } + + // Oddly when the VM is not found, PlaceVm complains about configSpec being invalid, despite this being + // a relocate placement type. Possibly due to treating the missing VM as a create placement type + // internally, which requires the configSpec to be present. + vmObj, exist := ctx.Map.Get(*req.PlacementSpec.Vm).(*VirtualMachine) + if !exist { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "PlacementSpec.configSpec", + }) + return false + } + + return validateRelocateSpecForPlaceVmRelocate(ctx, req.PlacementSpec.RelocateSpec, body, vmObj) +} + +// validateRelocateSpecForPlaceVmRelocate validates the fields of req.PlacementSpec.RelocateSpec for a relocate +// placement type. Returns true if the fields are valid, false otherwise. +func validateRelocateSpecForPlaceVmRelocate(ctx *Context, spec *types.VirtualMachineRelocateSpec, body *methods.PlaceVmBody, vmObj *VirtualMachine) bool { + if spec == nil { + // An empty relocate spec is valid, as it will be populated with default values. + return true + } + + if spec.Host != nil { + if _, exist := ctx.Map.Get(*spec.Host).(*HostSystem); !exist { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{ + Obj: *spec.Host, + }) + return false + } + } + + if spec.Datastore != nil { + if _, exist := ctx.Map.Get(*spec.Datastore).(*Datastore); !exist { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{ + Obj: *spec.Datastore, + }) + return false + } + } + + if spec.Pool != nil { + if _, exist := ctx.Map.Get(*spec.Pool).(*ResourcePool); !exist { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{ + Obj: *spec.Pool, + }) + return false + } + } + + if spec.Disk != nil { + deviceList := object.VirtualDeviceList(vmObj.Config.Hardware.Device) + vdiskList := deviceList.SelectByType(&types.VirtualDisk{}) + for _, disk := range spec.Disk { + var diskFound bool + for _, vdisk := range vdiskList { + if disk.DiskId == vdisk.GetVirtualDevice().Key { + diskFound = true + break + } + } + if !diskFound { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "PlacementSpec.vm", + }) + return false + } + + // Unlike a non-existing spec.Datastore that throws ManagedObjectNotFound, a non-existing disk.Datastore + // throws InvalidArgument. + if _, exist := ctx.Map.Get(disk.Datastore).(*Datastore); !exist { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "RelocateSpec", + }) + return false + } + } + } + + return true +} + +// populateRelocateSpecForPlaceVmRelocate populates the fields of req.PlacementSpec.RelocateSpec for a relocate +// placement type, if not explicitly provided. +func populateRelocateSpecForPlaceVmRelocate(specPtr **types.VirtualMachineRelocateSpec, vmObj *VirtualMachine) { + if *specPtr == nil { + *specPtr = &types.VirtualMachineRelocateSpec{} + } + + spec := *specPtr + + if spec.DiskMoveType == "" { + spec.DiskMoveType = string(types.VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndDisallowSharing) + } + + if spec.Datastore == nil { + spec.Datastore = &vmObj.Datastore[0] + } + + if spec.Host == nil { + spec.Host = vmObj.Runtime.Host + } + + if spec.Pool == nil { + spec.Pool = vmObj.ResourcePool + } + + if spec.Disk == nil { + deviceList := object.VirtualDeviceList(vmObj.Config.Hardware.Device) + for _, vdisk := range deviceList.SelectByType(&types.VirtualDisk{}) { + spec.Disk = append(spec.Disk, types.VirtualMachineRelocateSpecDiskLocator{ + DiskId: vdisk.GetVirtualDevice().Key, + Datastore: *spec.Datastore, + DiskMoveType: spec.DiskMoveType, + }) + } + } +} + +func CreateClusterComputeResource(ctx *Context, f *Folder, name string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, types.BaseMethodFault) { + if e := ctx.Map.FindByName(name, f.ChildEntity); e != nil { + return nil, &types.DuplicateName{ + Name: e.Entity().Name, + Object: e.Reference(), + } + } + + cluster := &ClusterComputeResource{} + cluster.EnvironmentBrowser = newEnvironmentBrowser(ctx) + cluster.Name = name + cluster.Network = ctx.Map.getEntityDatacenter(f).defaultNetwork() + cluster.Summary = &types.ClusterComputeResourceSummary{ + UsageSummary: new(types.ClusterUsageSummary), + } + + config := &types.ClusterConfigInfoEx{} + cluster.ConfigurationEx = config + + config.VmSwapPlacement = string(types.VirtualMachineConfigInfoSwapPlacementTypeVmDirectory) + config.DrsConfig.Enabled = types.NewBool(true) + + pool := NewResourcePool(ctx) + ctx.Map.PutEntity(cluster, ctx.Map.NewEntity(pool)) + cluster.ResourcePool = &pool.Self + + folderPutChild(ctx, &f.Folder, cluster) + pool.Owner = cluster.Self + + return cluster, nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/container.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/container.go new file mode 100644 index 000000000..c924f450b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/container.go @@ -0,0 +1,825 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "archive/tar" + "bufio" + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log" + "net" + "os" + "os/exec" + "path" + "regexp" + "strings" + "sync" + "time" +) + +var ( + shell = "/bin/sh" + eventWatch eventWatcher +) + +const ( + deleteWithContainer = "lifecycle=container" + createdByVcsim = "createdBy=vcsim" +) + +func init() { + if sh, err := exec.LookPath("bash"); err != nil { + shell = sh + } +} + +type eventWatcher struct { + sync.Mutex + + stdin io.WriteCloser + stdout io.ReadCloser + process *os.Process + + // watches is a map of container IDs to container objects + watches map[string]*container +} + +// container provides methods to manage a container within a simulator VM lifecycle. +type container struct { + sync.Mutex + + id string + name string + + cancelWatch context.CancelFunc + changes chan struct{} +} + +type networkSettings struct { + Gateway string + IPAddress string + IPPrefixLen int + MacAddress string +} + +type containerDetails struct { + Config struct { + Hostname string + Domainname string + DNS []string `json:"dns"` + } + State struct { + Running bool + Paused bool + } + NetworkSettings struct { + networkSettings + Networks map[string]networkSettings + } +} + +type unknownContainer error +type uninitializedContainer error + +var sanitizeNameRx = regexp.MustCompile(`[\(\)\s]`) + +func sanitizeName(name string) string { + return sanitizeNameRx.ReplaceAllString(name, "-") +} + +func constructContainerName(name, uid string) string { + return fmt.Sprintf("vcsim-%s-%s", sanitizeName(name), uid) +} + +func constructVolumeName(containerName, uid, volumeName string) string { + return constructContainerName(containerName, uid) + "--" + sanitizeName(volumeName) +} + +func prefixToMask(prefix int) string { + mask := net.CIDRMask(prefix, 32) + return fmt.Sprintf("%d.%d.%d.%d", mask[0], mask[1], mask[2], mask[3]) +} + +type tarEntry struct { + header *tar.Header + content []byte +} + +// From https://docs.docker.com/engine/reference/commandline/cp/ : +// > It is not possible to copy certain system files such as resources under /proc, /sys, /dev, tmpfs, and mounts created by the user in the container. +// > However, you can still copy such files by manually running tar in docker exec. +func copyToGuest(id string, dest string, length int64, reader io.Reader) error { + cmd := exec.Command("docker", "exec", "-i", id, "tar", "Cxf", path.Dir(dest), "-") + cmd.Stderr = os.Stderr + stdin, err := cmd.StdinPipe() + if err != nil { + return err + } + + err = cmd.Start() + if err != nil { + return err + } + + tw := tar.NewWriter(stdin) + _ = tw.WriteHeader(&tar.Header{ + Name: path.Base(dest), + Size: length, + Mode: 0444, + ModTime: time.Now(), + }) + + _, err = io.Copy(tw, reader) + + twErr := tw.Close() + stdinErr := stdin.Close() + + waitErr := cmd.Wait() + + if err != nil || twErr != nil || stdinErr != nil || waitErr != nil { + return fmt.Errorf("copy: {%s}, tw: {%s}, stdin: {%s}, wait: {%s}", err, twErr, stdinErr, waitErr) + } + + return nil +} + +func copyFromGuest(id string, src string, sink func(int64, io.Reader) error) error { + cmd := exec.Command("docker", "exec", id, "tar", "Ccf", path.Dir(src), "-", path.Base(src)) + cmd.Stderr = os.Stderr + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + if err = cmd.Start(); err != nil { + return err + } + + tr := tar.NewReader(stdout) + header, err := tr.Next() + if err != nil { + return err + } + + err = sink(header.Size, tr) + waitErr := cmd.Wait() + + if err != nil || waitErr != nil { + return fmt.Errorf("err: {%s}, wait: {%s}", err, waitErr) + } + + return nil +} + +// createVolume creates a volume populated with the provided files +// If the header.Size is omitted or set to zero, then len(content+1) is used. +// Docker appears to treat this volume create command as idempotent so long as it's identical +// to an existing volume, so we can use this both for creating volumes inline in container create (for labelling) and +// for population after. +// returns: +// +// uid - string +// err - error or nil +func createVolume(volumeName string, labels []string, files []tarEntry) (string, error) { + image := os.Getenv("VCSIM_BUSYBOX") + if image == "" { + image = "busybox" + } + + name := sanitizeName(volumeName) + uid := "" + + // label the volume if specified - this requires the volume be created before use + if len(labels) > 0 { + run := []string{"volume", "create"} + for i := range labels { + run = append(run, "--label", labels[i]) + } + run = append(run, name) + cmd := exec.Command("docker", run...) + out, err := cmd.Output() + if err != nil { + return "", err + } + uid = strings.TrimSpace(string(out)) + + if name == "" { + name = uid + } + } + + run := []string{"run", "--rm", "-i"} + run = append(run, "-v", name+":/"+name) + run = append(run, image, "tar", "-C", "/"+name, "-xf", "-") + cmd := exec.Command("docker", run...) + stdin, err := cmd.StdinPipe() + if err != nil { + return uid, err + } + + err = cmd.Start() + if err != nil { + return uid, err + } + + tw := tar.NewWriter(stdin) + + for _, file := range files { + header := file.header + + if header.Size == 0 && len(file.content) > 0 { + header.Size = int64(len(file.content)) + } + + if header.ModTime.IsZero() { + header.ModTime = time.Now() + } + + if header.Mode == 0 { + header.Mode = 0444 + } + + tarErr := tw.WriteHeader(header) + if tarErr == nil { + _, tarErr = tw.Write(file.content) + } + } + + err = nil + twErr := tw.Close() + stdinErr := stdin.Close() + if twErr != nil || stdinErr != nil { + err = fmt.Errorf("tw: {%s}, stdin: {%s}", twErr, stdinErr) + } + + if waitErr := cmd.Wait(); waitErr != nil { + stderr := "" + if xerr, ok := waitErr.(*exec.ExitError); ok { + stderr = string(xerr.Stderr) + } + log.Printf("%s %s: %s %s", name, cmd.Args, waitErr, stderr) + + err = fmt.Errorf("%s, wait: {%s}", err, waitErr) + return uid, err + } + + return uid, err +} + +func getBridge(bridgeName string) (string, error) { + // {"CreatedAt":"2023-07-11 19:22:25.45027052 +0000 UTC","Driver":"bridge","ID":"fe52c7502c5d","IPv6":"false","Internal":"false","Labels":"goodbye=,hello=","Name":"testnet","Scope":"local"} + // podman has distinctly different fields at v4.4.1 so commented out fields that don't match. We only actually care about ID + type bridgeNet struct { + // CreatedAt string + Driver string + ID string + // IPv6 string + // Internal string + // Labels string + Name string + // Scope string + } + + // if the underlay bridge already exists, return that + // we don't check for a specific label or similar so that it's possible to use a bridge created by other frameworks for composite testing + var bridge bridgeNet + cmd := exec.Command("docker", "network", "ls", "--format={{json .}}", "-f", fmt.Sprintf("name=%s$", bridgeName)) + out, err := cmd.Output() + if err != nil { + log.Printf("vcsim %s: %s, %s", cmd.Args, err, out) + return "", err + } + + // unfortunately docker returns an empty string not an empty json doc and podman returns '[]' + // podman also returns an array of matches even when there's only one, so we normalize. + str := strings.TrimSpace(string(out)) + str = strings.TrimPrefix(str, "[") + str = strings.TrimSuffix(str, "]") + if len(str) == 0 { + return "", nil + } + + err = json.Unmarshal([]byte(str), &bridge) + if err != nil { + log.Printf("vcsim %s: %s, %s", cmd.Args, err, str) + return "", err + } + + return bridge.ID, nil +} + +// createBridge creates a bridge network if one does not already exist +// returns: +// +// uid - string +// err - error or nil +func createBridge(bridgeName string, labels ...string) (string, error) { + + id, err := getBridge(bridgeName) + if err != nil { + return "", err + } + + if id != "" { + return id, nil + } + + run := []string{"network", "create", "--label", createdByVcsim} + for i := range labels { + run = append(run, "--label", labels[i]) + } + run = append(run, bridgeName) + + cmd := exec.Command("docker", run...) + out, err := cmd.Output() + if err != nil { + log.Printf("vcsim %s: %s: %s", cmd.Args, out, err) + return "", err + } + + // docker returns the ID regardless of whether you supply a name when creating the network, however + // podman returns the pretty name, so we have to normalize + id, err = getBridge(bridgeName) + if err != nil { + return "", err + } + + return id, nil +} + +// create +// - name - pretty name, eg. vm name +// - id - uuid or similar - this is merged into container name rather than dictating containerID +// - networks - set of bridges to connect the container to +// - volumes - colon separated tuple of volume name to mount path. Passed directly to docker via -v so mount options can be postfixed. +// - env - array of environment vairables in name=value form +// - optsAndImage - pass-though options and must include at least the container image to use, including tag if necessary +// - args - the command+args to pass to the container +func create(ctx *Context, name string, id string, networks []string, volumes []string, ports []string, env []string, image string, args []string) (*container, error) { + if len(image) == 0 { + return nil, errors.New("cannot create container backing without an image") + } + + var c container + c.name = constructContainerName(name, id) + c.changes = make(chan struct{}) + + for i := range volumes { + // we'll pre-create anonymous volumes, simply for labelling consistency + volName := strings.Split(volumes[i], ":") + createVolume(volName[0], []string{deleteWithContainer, "container=" + c.name}, nil) + } + + // assemble env + var dockerNet []string + var dockerVol []string + var dockerPort []string + var dockerEnv []string + + for i := range env { + dockerEnv = append(dockerEnv, "--env", env[i]) + } + + for i := range volumes { + dockerVol = append(dockerVol, "-v", volumes[i]) + } + + for i := range ports { + dockerPort = append(dockerPort, "-p", ports[i]) + } + + for i := range networks { + dockerNet = append(dockerNet, "--network", networks[i]) + } + + run := []string{"docker", "create", "--name", c.name} + run = append(run, dockerNet...) + run = append(run, dockerVol...) + run = append(run, dockerPort...) + run = append(run, dockerEnv...) + run = append(run, image) + run = append(run, args...) + + // this combines all the run options into a single string that's passed to /bin/bash -c as the single argument to force bash parsing. + // TODO: make this configurable behaviour so users also have the option of not escaping everything for bash + cmd := exec.Command(shell, "-c", strings.Join(run, " ")) + out, err := cmd.Output() + if err != nil { + stderr := "" + if xerr, ok := err.(*exec.ExitError); ok { + stderr = string(xerr.Stderr) + } + log.Printf("%s %s: %s %s", name, cmd.Args, err, stderr) + + return nil, err + } + + c.id = strings.TrimSpace(string(out)) + + return &c, nil +} + +// createVolume takes the specified files and writes them into a volume named for the container. +func (c *container) createVolume(name string, labels []string, files []tarEntry) (string, error) { + return createVolume(c.name+"--"+name, append(labels, "container="+c.name), files) +} + +// inspect retrieves and parses container properties into directly usable struct +// returns: +// +// out - the stdout of the command +// detail - basic struct populated with container details +// err: +// * if c.id is empty, or docker returns "No such object", will return an uninitializedContainer error +// * err from either execution or parsing of json output +func (c *container) inspect() (out []byte, detail containerDetails, err error) { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + err = uninitializedContainer(errors.New("inspect of uninitialized container")) + return + } + + var details []containerDetails + + cmd := exec.Command("docker", "inspect", c.id) + out, err = cmd.Output() + if eErr, ok := err.(*exec.ExitError); ok { + if strings.Contains(string(eErr.Stderr), "No such object") { + err = uninitializedContainer(errors.New("inspect of uninitialized container")) + } + } + + if err != nil { + return + } + + if err = json.NewDecoder(bytes.NewReader(out)).Decode(&details); err != nil { + return + } + + if len(details) != 1 { + err = fmt.Errorf("multiple containers (%d) match ID: %s", len(details), c.id) + return + } + + detail = details[0] + + // DNS setting + f, oerr := os.Open("/etc/docker/daemon.json") + if oerr != nil { + return + } + err = json.NewDecoder(f).Decode(&detail.Config) + _ = f.Close() + + return +} + +// start +// - if the container already exists, start it or unpause it. +func (c *container) start(ctx *Context) error { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + return uninitializedContainer(errors.New("start of uninitialized container")) + } + + start := "start" + _, detail, err := c.inspect() + if err != nil { + return err + } + + if detail.State.Paused { + start = "unpause" + } + + cmd := exec.Command("docker", start, c.id) + err = cmd.Run() + if err != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, err) + } + + return err +} + +// pause the container (if any) for the given vm. +func (c *container) pause(ctx *Context) error { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + return uninitializedContainer(errors.New("pause of uninitialized container")) + } + + cmd := exec.Command("docker", "pause", c.id) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, err) + } + + return err +} + +// restart the container (if any) for the given vm. +func (c *container) restart(ctx *Context) error { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + return uninitializedContainer(errors.New("restart of uninitialized container")) + } + + cmd := exec.Command("docker", "restart", c.id) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, err) + } + + return err +} + +// stop the container (if any) for the given vm. +func (c *container) stop(ctx *Context) error { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + return uninitializedContainer(errors.New("stop of uninitialized container")) + } + + cmd := exec.Command("docker", "stop", c.id) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, err) + } + + return err +} + +// exec invokes the specified command, with executable being the first of the args, in the specified container +// returns +// +// string - combined stdout and stderr from command +// err +// * uninitializedContainer error - if c.id is empty +// * err from cmd execution +func (c *container) exec(ctx *Context, args []string) (string, error) { + c.Lock() + id := c.id + c.Unlock() + + if id == "" { + return "", uninitializedContainer(errors.New("exec into uninitialized container")) + } + + args = append([]string{"exec", c.id}, args...) + cmd := exec.Command("docker", args...) + res, err := cmd.CombinedOutput() + if err != nil { + log.Printf("%s: %s (%s)", c.name, cmd.Args, string(res)) + return "", err + } + + return strings.TrimSpace(string(res)), nil +} + +// remove the container (if any) for the given vm. Considers removal of an uninitialized container success. +// Also removes volumes and networks that indicate they are lifecycle coupled with this container. +// returns: +// +// err - joined err from deletion of container and any volumes or networks that have coupled lifecycle +func (c *container) remove(ctx *Context) error { + c.Lock() + defer c.Unlock() + + if c.id == "" { + // consider absence success + return nil + } + + cmd := exec.Command("docker", "rm", "-v", "-f", c.id) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, err) + return err + } + + cmd = exec.Command("docker", "volume", "ls", "-q", "--filter", "label=container="+c.name, "--filter", "label="+deleteWithContainer) + volumesToReap, lsverr := cmd.Output() + if lsverr != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, lsverr) + } + log.Printf("%s volumes: %s", c.name, volumesToReap) + + var rmverr error + if len(volumesToReap) > 0 { + run := []string{"volume", "rm", "-f"} + run = append(run, strings.Split(string(volumesToReap), "\n")...) + cmd = exec.Command("docker", run...) + out, rmverr := cmd.Output() + if rmverr != nil { + log.Printf("%s %s: %s, %s", c.name, cmd.Args, rmverr, out) + } + } + + cmd = exec.Command("docker", "network", "ls", "-q", "--filter", "label=container="+c.name, "--filter", "label="+deleteWithContainer) + networksToReap, lsnerr := cmd.Output() + if lsnerr != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, lsnerr) + } + + var rmnerr error + if len(networksToReap) > 0 { + run := []string{"network", "rm", "-f"} + run = append(run, strings.Split(string(volumesToReap), "\n")...) + cmd = exec.Command("docker", run...) + rmnerr = cmd.Run() + if rmnerr != nil { + log.Printf("%s %s: %s", c.name, cmd.Args, rmnerr) + } + } + + if err != nil || lsverr != nil || rmverr != nil || lsnerr != nil || rmnerr != nil { + return fmt.Errorf("err: {%s}, lsverr: {%s}, rmverr: {%s}, lsnerr:{%s}, rmerr: {%s}", err, lsverr, rmverr, lsnerr, rmnerr) + } + + if c.cancelWatch != nil { + c.cancelWatch() + eventWatch.ignore(c) + } + c.id = "" + return nil +} + +// updated is a simple trigger allowing a caller to indicate that something has likely changed about the container +// and interested parties should re-inspect as needed. +func (c *container) updated() { + consolidationWindow := 250 * time.Millisecond + if d, err := time.ParseDuration(os.Getenv("VCSIM_EVENT_CONSOLIDATION_WINDOW")); err == nil { + consolidationWindow = d + } + + select { + case c.changes <- struct{}{}: + time.Sleep(consolidationWindow) + // as this is only a hint to avoid waiting for the full inspect interval, we don't care about accumulating + // multiple triggers. We do pause to allow large numbers of sequential updates to consolidate + default: + } +} + +// watchContainer monitors the underlying container and updates +// properties based on the container status. This occurs until either +// the container or the VM is removed. +// returns: +// +// err - uninitializedContainer error - if c.id is empty +func (c *container) watchContainer(ctx *Context, updateFn func(*containerDetails, *container) error) error { + c.Lock() + defer c.Unlock() + + if c.id == "" { + return uninitializedContainer(errors.New("Attempt to watch uninitialized container")) + } + + eventWatch.watch(c) + + cancelCtx, cancelFunc := context.WithCancel(ctx) + c.cancelWatch = cancelFunc + + // Update the VM from the container at regular intervals until the done + // channel is closed. + go func() { + inspectInterval := 10 * time.Second + if d, err := time.ParseDuration(os.Getenv("VCSIM_INSPECT_INTERVAL")); err == nil { + inspectInterval = d + } + ticker := time.NewTicker(inspectInterval) + + update := func() { + _, details, err := c.inspect() + var rmErr error + var removing bool + if _, ok := err.(uninitializedContainer); ok { + removing = true + rmErr = c.remove(ctx) + } + + updateErr := updateFn(&details, c) + // if we don't succeed we want to re-try + if removing && rmErr == nil && updateErr == nil { + ticker.Stop() + return + } + if updateErr != nil { + log.Printf("vcsim container watch: %s %s", c.id, updateErr) + } + } + + for { + select { + case <-c.changes: + update() + case <-ticker.C: + update() + case <-cancelCtx.Done(): + return + } + } + }() + + return nil +} + +func (w *eventWatcher) watch(c *container) { + w.Lock() + defer w.Unlock() + + if w.watches == nil { + w.watches = make(map[string]*container) + } + + w.watches[c.id] = c + + if w.stdin == nil { + cmd := exec.Command("docker", "events", "--format", "'{{.ID}}'", "--filter", "Type=container") + w.stdout, _ = cmd.StdoutPipe() + w.stdin, _ = cmd.StdinPipe() + err := cmd.Start() + if err != nil { + log.Printf("docker event watcher: %s %s", cmd.Args, err) + w.stdin = nil + w.stdout = nil + w.process = nil + + return + } + + w.process = cmd.Process + + go w.monitor() + } +} + +func (w *eventWatcher) ignore(c *container) { + w.Lock() + + delete(w.watches, c.id) + + if len(w.watches) == 0 && w.stdin != nil { + w.stop() + } + + w.Unlock() +} + +func (w *eventWatcher) monitor() { + w.Lock() + watches := len(w.watches) + w.Unlock() + + if watches == 0 { + return + } + + scanner := bufio.NewScanner(w.stdout) + for scanner.Scan() { + id := strings.TrimSpace(scanner.Text()) + + w.Lock() + container := w.watches[id] + w.Unlock() + + if container != nil { + // this is called in a routine to allow an event consolidation window + go container.updated() + } + } +} + +func (w *eventWatcher) stop() { + if w.stdin != nil { + w.stdin.Close() + w.stdin = nil + } + if w.stdout != nil { + w.stdout.Close() + w.stdout = nil + } + w.process.Kill() +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/container_host_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/container_host_system.go new file mode 100644 index 000000000..688c85efe --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/container_host_system.go @@ -0,0 +1,341 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "strings" + + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +const ( + advOptPrefixPnicToUnderlayPrefix = "RUN.underlay." + advOptContainerBackingImage = "RUN.container" + defaultUnderlayBridgeName = "vcsim-underlay" +) + +type simHost struct { + host *HostSystem + c *container +} + +// createSimHostMounts iterates over the provide filesystem mount info, creating docker volumes. It does _not_ delete volumes +// already created if creation of one fails. +// Returns: +// volume mounts: mount options suitable to pass directly to docker +// exec commands: a set of commands to run in the sim host after creation +// error: if construction of the above outputs fails +func createSimHostMounts(ctx *Context, containerName string, mounts []types.HostFileSystemMountInfo) ([]string, [][]string, error) { + var dockerVol []string + var symlinkCmds [][]string + + for i := range mounts { + info := &mounts[i] + name := info.Volume.GetHostFileSystemVolume().Name + + // NOTE: if we ever need persistence cross-invocation we can look at encoding the disk info as a label + labels := []string{"name=" + name, "container=" + containerName, deleteWithContainer} + dockerUuid, err := createVolume("", labels, nil) + if err != nil { + return nil, nil, err + } + + uuid := volumeIDtoHostVolumeUUID(dockerUuid) + name = strings.Replace(name, uuidToken, uuid, -1) + + switch vol := info.Volume.(type) { + case *types.HostVmfsVolume: + vol.BlockSizeMb = 1 + vol.BlockSize = units.KB + vol.UnmapGranularity = units.KB + vol.UnmapPriority = "low" + vol.MajorVersion = 6 + vol.Version = "6.82" + vol.Uuid = uuid + vol.HostFileSystemVolume.Name = name + for e := range vol.Extent { + vol.Extent[e].DiskName = "____simulated_volume_____" + if vol.Extent[e].Partition == 0 { + // HACK: this should be unique within the diskname, but for now this will suffice + // partitions start at 1 + vol.Extent[e].Partition = int32(e + 1) + } + } + vol.Ssd = types.NewBool(true) + vol.Local = types.NewBool(true) + case *types.HostVfatVolume: + vol.HostFileSystemVolume.Name = name + } + + info.VStorageSupport = "vStorageUnsupported" + + info.MountInfo.Path = "/vmfs/volumes/" + uuid + info.MountInfo.Mounted = types.NewBool(true) + info.MountInfo.Accessible = types.NewBool(true) + if info.MountInfo.AccessMode == "" { + info.MountInfo.AccessMode = "readWrite" + } + + opt := "rw" + if info.MountInfo.AccessMode == "readOnly" { + opt = "ro" + } + + dockerVol = append(dockerVol, fmt.Sprintf("%s:/vmfs/volumes/%s:%s", dockerUuid, uuid, opt)) + + // create symlinks from /vmfs/volumes/ for the Volume Name - the direct mount (path) is only the uuid + // ? can we do this via a script in the ESX image instead of via exec? + // ? are the volume names exposed in any manner inside the host? They must be because these mounts exist but where does that come from? Chicken and egg problem? ConfigStore? + symlinkCmds = append(symlinkCmds, []string{"ln", "-s", fmt.Sprintf("/vmfs/volumes/%s", uuid), fmt.Sprintf("/vmfs/volumes/%s", name)}) + if strings.HasPrefix(name, "OSDATA") { + symlinkCmds = append(symlinkCmds, []string{"mkdir", "-p", "/var/lib/vmware"}) + symlinkCmds = append(symlinkCmds, []string{"ln", "-s", fmt.Sprintf("/vmfs/volumes/%s", uuid), "/var/lib/vmware/osdata"}) + } + } + + return dockerVol, symlinkCmds, nil +} + +// createSimHostNetworks creates the networks for the host if not already created. Because we expect multiple hosts on the same network to act as a cluster +// it's likely that only the first host will create networks. +// This includes: +// * bridge network per-pNIC +// * bridge network per-DVS +// +// Returns: +// * array of networks to attach to +// * array of commands to run +// * error +// +// TODO: implement bridge network per DVS - not needed until container backed VMs are "created" on container backed "hosts" +func createSimHostNetworks(ctx *Context, containerName string, networkInfo *types.HostNetworkInfo, advOpts *OptionManager) ([]string, [][]string, error) { + var dockerNet []string + var cmds [][]string + + existingNets := make(map[string]string) + + // a pnic does not have an IP so this is purely a connectivity statement, not a network identity, however this is not how docker works + // so we're going to end up with a veth (our pnic) that does have an IP assigned. That IP will end up being used in a NetConfig structure associated + // with the pNIC. See HostSystem.getNetConfigInterface. + for i := range networkInfo.Pnic { + pnicName := networkInfo.Pnic[i].Device + + bridge := getPnicUnderlay(advOpts, pnicName) + + if pnic, attached := existingNets[bridge]; attached { + return nil, nil, fmt.Errorf("cannot attach multiple pNICs to the same underlay: %s and %s both attempting to connect to %s for %s", pnic, pnicName, bridge, containerName) + } + + _, err := createBridge(bridge) + if err != nil { + return nil, nil, err + } + + dockerNet = append(dockerNet, bridge) + existingNets[bridge] = pnicName + } + + return dockerNet, cmds, nil +} + +func getPnicUnderlay(advOpts *OptionManager, pnicName string) string { + queryRes := advOpts.QueryOptions(&types.QueryOptions{Name: advOptPrefixPnicToUnderlayPrefix + pnicName}).(*methods.QueryOptionsBody).Res + return queryRes.Returnval[0].GetOptionValue().Value.(string) +} + +// createSimulationHostcreates a simHost binding if the host.ConfigManager.AdvancedOption set contains a key "RUN.container". +// If the set does not contain that key, this returns nil. +// Methods on the simHost type are written to check for nil object so the return from this call can be blindly +// assigned and invoked without the caller caring about whether a binding for a backing container was warranted. +// +// The created simhost is based off of the details of the supplied host system. +// VMFS locations are created based on FileSystemMountInfo +// Bridge networks are created to simulate underlay networks - one per pNIC. You cannot connect two pNICs to the same underlay. +// +// On Network connectivity - initially this is using docker network constructs. This means we cannot easily use nested "ip netns" so we cannot +// have a perfect representation of the ESX structure: pnic(veth)->vswtich(bridge)->{vmk,vnic}(veth) +// Instead we have the following: +// * bridge network per underlay - everything connects directly to the underlay +// * VMs/CRXs connect to the underlay dictated by the Uplink pNIC attached to their vSwitch +// * hostd vmknic gets the "host" container IP - we don't currently support multiple vmknics with different IPs +// * no support for mocking VLANs +func createSimulationHost(ctx *Context, host *HostSystem) (*simHost, error) { + sh := &simHost{ + host: host, + } + + advOpts := ctx.Map.Get(host.ConfigManager.AdvancedOption.Reference()).(*OptionManager) + fault := advOpts.QueryOptions(&types.QueryOptions{Name: "RUN.container"}).(*methods.QueryOptionsBody).Fault() + if fault != nil { + if _, ok := fault.VimFault().(*types.InvalidName); ok { + return nil, nil + } + return nil, fmt.Errorf("errror retrieving container backing from host config manager: %+v", fault.VimFault()) + } + + // assemble env + var dockerEnv []string + + var execCmds [][]string + + var err error + + hName := host.Summary.Config.Name + hUuid := host.Summary.Hardware.Uuid + containerName := constructContainerName(hName, hUuid) + + // create volumes and mounts + dockerVol, volCmds, err := createSimHostMounts(ctx, containerName, host.Config.FileSystemVolume.MountInfo) + if err != nil { + return nil, err + } + execCmds = append(execCmds, volCmds...) + + // create networks + dockerNet, netCmds, err := createSimHostNetworks(ctx, containerName, host.Config.Network, advOpts) + if err != nil { + return nil, err + } + execCmds = append(execCmds, netCmds...) + + // create the container + sh.c, err = create(ctx, hName, hUuid, dockerNet, dockerVol, nil, dockerEnv, "alpine:3.20.3", []string{"sleep", "infinity"}) + if err != nil { + return nil, err + } + + // start the container + err = sh.c.start(ctx) + if err != nil { + return nil, err + } + + // run post-creation steps + for _, cmd := range execCmds { + _, err := sh.c.exec(ctx, cmd) + if err != nil { + return nil, err + } + } + + _, detail, err := sh.c.inspect() + if err != nil { + return nil, err + } + for i := range host.Config.Network.Pnic { + pnic := &host.Config.Network.Pnic[i] + bridge := getPnicUnderlay(advOpts, pnic.Device) + settings := detail.NetworkSettings.Networks[bridge] + + // it doesn't really make sense at an ESX level to set this information as IP bindings are associated with + // vnics (VMs) or vmknics (daemons such as hostd). + // However it's a useful location to stash this info in a manner that can be retrieved at a later date. + pnic.Spec.Ip.IpAddress = settings.IPAddress + pnic.Spec.Ip.SubnetMask = prefixToMask(settings.IPPrefixLen) + + pnic.Mac = settings.MacAddress + } + + // update the active "management" nicType with the container IP for vmnic0 + netconfig, err := host.getNetConfigInterface(ctx, "management") + if err != nil { + return nil, err + } + netconfig.vmk.Spec.Ip.IpAddress = netconfig.uplink.Spec.Ip.IpAddress + netconfig.vmk.Spec.Ip.SubnetMask = netconfig.uplink.Spec.Ip.SubnetMask + netconfig.vmk.Spec.Mac = netconfig.uplink.Mac + + return sh, nil +} + +// remove destroys the container associated with the host and any volumes with labels specifying their lifecycle +// is coupled with the container +func (sh *simHost) remove(ctx *Context) error { + if sh == nil { + return nil + } + + return sh.c.remove(ctx) +} + +// volumeIDtoHostVolumeUUID takes the 64 char docker uuid and converts it into a 32char ESX form of 8-8-4-12 +// Perhaps we should do this using an md5 rehash, but instead we just take the first 32char for ease of cross-reference. +func volumeIDtoHostVolumeUUID(id string) string { + return fmt.Sprintf("%s-%s-%s-%s", id[0:8], id[8:16], id[16:20], id[20:32]) +} + +// By reference to physical system, partition numbering tends to work out like this: +// 1. EFI System (100 MB) +// Free space (1.97 MB) +// 5. Basic Data (4 GB) (bootbank1) +// 6. Basic Data (4 GB) (bootbank2) +// 7. VMFSL (119.9 GB) (os-data) +// 8. VMFS (1 TB) (datastore1) +// I assume the jump from 1 -> 5 harks back to the primary/logical partitions from MBT days +const uuidToken = "%__UUID__%" + +var defaultSimVolumes = []types.HostFileSystemMountInfo{ + { + MountInfo: types.HostMountInfo{ + AccessMode: "readWrite", + }, + Volume: &types.HostVmfsVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "VMFS", + Name: "datastore1", + Capacity: 1 * units.TB, + }, + Extent: []types.HostScsiDiskPartition{ + { + Partition: 8, + }, + }, + }, + }, + { + MountInfo: types.HostMountInfo{ + AccessMode: "readWrite", + }, + Volume: &types.HostVmfsVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "OSDATA-%__UUID__%", + Capacity: 128 * units.GB, + }, + Extent: []types.HostScsiDiskPartition{ + { + Partition: 7, + }, + }, + }, + }, + { + MountInfo: types.HostMountInfo{ + AccessMode: "readOnly", + }, + Volume: &types.HostVfatVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "BOOTBANK1", + Capacity: 4 * units.GB, + }, + }, + }, + { + MountInfo: types.HostMountInfo{ + AccessMode: "readOnly", + }, + Volume: &types.HostVfatVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "BOOTBANK2", + Capacity: 4 * units.GB, + }, + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go new file mode 100644 index 000000000..0748dc743 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go @@ -0,0 +1,520 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "archive/tar" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "log" + "net/http" + "strconv" + "strings" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +const ContainerBackingOptionKey = "RUN.container" + +var ( + toolsRunning = []types.PropertyChange{ + {Name: "guest.toolsStatus", Val: types.VirtualMachineToolsStatusToolsOk}, + {Name: "guest.toolsRunningStatus", Val: string(types.VirtualMachineToolsRunningStatusGuestToolsRunning)}, + } + + toolsNotRunning = []types.PropertyChange{ + {Name: "guest.toolsStatus", Val: types.VirtualMachineToolsStatusToolsNotRunning}, + {Name: "guest.toolsRunningStatus", Val: string(types.VirtualMachineToolsRunningStatusGuestToolsNotRunning)}, + } +) + +type simVM struct { + vm *VirtualMachine + c *container +} + +// createSimulationVM inspects the provided VirtualMachine and creates a simVM binding for it if +// the vm.Config.ExtraConfig set contains a key "RUN.container". +// If the ExtraConfig set does not contain that key, this returns nil. +// Methods on the simVM type are written to check for nil object so the return from this call can be blindly +// assigned and invoked without the caller caring about whether a binding for a backing container was warranted. +func createSimulationVM(vm *VirtualMachine) *simVM { + svm := &simVM{ + vm: vm, + } + + for _, opt := range vm.Config.ExtraConfig { + val := opt.GetOptionValue() + if val.Key == ContainerBackingOptionKey { + return svm + } + } + + return nil +} + +// applies container network settings to vm.Guest properties. +func (svm *simVM) syncNetworkConfigToVMGuestProperties() error { + if svm == nil { + return nil + } + + out, detail, err := svm.c.inspect() + if err != nil { + return err + } + + svm.vm.Config.Annotation = "inspect" + svm.vm.logPrintf("%s: %s", svm.vm.Config.Annotation, string(out)) + + netS := detail.NetworkSettings.networkSettings + + // ? Why is this valid - we're taking the first entry while iterating over a MAP + for _, n := range detail.NetworkSettings.Networks { + netS = n + break + } + + if detail.State.Paused { + svm.vm.Runtime.PowerState = types.VirtualMachinePowerStateSuspended + } else if detail.State.Running { + svm.vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOn + } else { + svm.vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff + } + + svm.vm.Guest.IpAddress = netS.IPAddress + svm.vm.Summary.Guest.IpAddress = netS.IPAddress + if svm.vm.Guest.HostName == "" { + svm.vm.Guest.HostName = detail.Config.Hostname + } + + if len(svm.vm.Guest.Net) != 0 { + net := &svm.vm.Guest.Net[0] + net.IpAddress = []string{netS.IPAddress} + net.MacAddress = netS.MacAddress + net.IpConfig = &types.NetIpConfigInfo{ + IpAddress: []types.NetIpConfigInfoIpAddress{{ + IpAddress: netS.IPAddress, + PrefixLength: int32(netS.IPPrefixLen), + State: string(types.NetIpConfigInfoIpAddressStatusPreferred), + }}, + } + + gsi := types.GuestStackInfo{ + DnsConfig: &types.NetDnsConfigInfo{ + Dhcp: false, + HostName: svm.vm.Guest.HostName, + DomainName: detail.Config.Domainname, + IpAddress: detail.Config.DNS, + SearchDomain: nil, + }, + IpRouteConfig: &types.NetIpRouteConfigInfo{ + IpRoute: []types.NetIpRouteConfigInfoIpRoute{{ + Network: "0.0.0.0", + PrefixLength: 0, + Gateway: types.NetIpRouteConfigInfoGateway{ + IpAddress: netS.Gateway, + Device: "0", + }, + }}, + }, + } + svm.vm.Guest.IpStack = []types.GuestStackInfo{gsi} + } + + for _, d := range svm.vm.Config.Hardware.Device { + if eth, ok := d.(types.BaseVirtualEthernetCard); ok { + eth.GetVirtualEthernetCard().MacAddress = netS.MacAddress + break + } + } + + return nil +} + +func (svm *simVM) prepareGuestOperation(auth types.BaseGuestAuthentication) types.BaseMethodFault { + if svm == nil || svm.c == nil || svm.c.id == "" { + return new(types.GuestOperationsUnavailable) + } + + if svm.vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + return &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: svm.vm.Runtime.PowerState, + } + } + + switch creds := auth.(type) { + case *types.NamePasswordAuthentication: + if creds.Username == "" || creds.Password == "" { + return new(types.InvalidGuestLogin) + } + default: + return new(types.InvalidGuestLogin) + } + + return nil +} + +// populateDMI writes BIOS UUID DMI files to a container volume +func (svm *simVM) populateDMI() error { + if svm.c == nil { + return nil + } + + files := []tarEntry{ + { + &tar.Header{ + Name: "product_uuid", + Mode: 0444, + }, + []byte(productUUID(svm.vm.uid)), + }, + { + &tar.Header{ + Name: "product_serial", + Mode: 0444, + }, + []byte(productSerial(svm.vm.uid)), + }, + } + + _, err := svm.c.createVolume("dmi", []string{deleteWithContainer}, files) + return err +} + +// start runs the container if specified by the RUN.container extraConfig property. +// lazily creates a container backing if specified by an ExtraConfig property with key "RUN.container" +func (svm *simVM) start(ctx *Context) error { + if svm == nil { + return nil + } + + if svm.c != nil && svm.c.id != "" { + err := svm.c.start(ctx) + if err != nil { + log.Printf("%s %s: %s", svm.vm.Name, "start", err) + } else { + ctx.Update(svm.vm, toolsRunning) + } + + return err + } + + var args []string + var env []string + var ports []string + mountDMI := true + + for _, opt := range svm.vm.Config.ExtraConfig { + val := opt.GetOptionValue() + if val.Key == ContainerBackingOptionKey { + run := val.Value.(string) + err := json.Unmarshal([]byte(run), &args) + if err != nil { + args = []string{run} + } + + continue + } + + if val.Key == "RUN.mountdmi" { + var mount bool + err := json.Unmarshal([]byte(val.Value.(string)), &mount) + if err == nil { + mountDMI = mount + } + + continue + } + + if strings.HasPrefix(val.Key, "RUN.port.") { + // ? would this not make more sense as a set of tuples in the value? + // or inlined into the RUN.container freeform string as is the case with the nginx volume in the examples? + sKey := strings.Split(val.Key, ".") + containerPort := sKey[len(sKey)-1] + ports = append(ports, fmt.Sprintf("%s:%s", val.Value.(string), containerPort)) + + continue + } + + if strings.HasPrefix(val.Key, "RUN.env.") { + sKey := strings.Split(val.Key, ".") + envKey := sKey[len(sKey)-1] + env = append(env, fmt.Sprintf("%s=%s", envKey, val.Value.(string))) + } + + if strings.HasPrefix(val.Key, "guestinfo.") { + key := strings.Replace(strings.ToUpper(val.Key), ".", "_", -1) + env = append(env, fmt.Sprintf("VMX_%s=%s", key, val.Value.(string))) + + continue + } + } + + if len(args) == 0 { + // not an error - it's simply a simVM that shouldn't be backed by a container + return nil + } + + if len(env) != 0 { + // Configure env as the data access method for cloud-init-vmware-guestinfo + env = append(env, "VMX_GUESTINFO=true") + } + + volumes := []string{} + if mountDMI { + volumes = append(volumes, constructVolumeName(svm.vm.Name, svm.vm.uid.String(), "dmi")+":/sys/class/dmi/id") + } + + var err error + svm.c, err = create(ctx, svm.vm.Name, svm.vm.uid.String(), nil, volumes, ports, env, args[0], args[1:]) + if err != nil { + return err + } + + if mountDMI { + // not combined with the test assembling volumes because we want to have the container name first. + // cannot add a label to a volume after creation, so if we want to associate with the container ID the + // container must come first + err = svm.populateDMI() + if err != nil { + return err + } + } + + err = svm.c.start(ctx) + if err != nil { + log.Printf("%s %s: %s %s", svm.vm.Name, "start", args, err) + return err + } + + ctx.Update(svm.vm, toolsRunning) + + svm.vm.logPrintf("%s: %s", args, svm.c.id) + + if err = svm.syncNetworkConfigToVMGuestProperties(); err != nil { + log.Printf("%s inspect %s: %s", svm.vm.Name, svm.c.id, err) + } + + callback := func(details *containerDetails, c *container) error { + if c.id == "" && svm.vm != nil { + // If the container cannot be found then destroy this VM unless the VM is no longer configured for container backing (svm.vm == nil) + taskRef := svm.vm.DestroyTask(ctx, &types.Destroy_Task{This: svm.vm.Self}).(*methods.Destroy_TaskBody).Res.Returnval + task, ok := ctx.Map.Get(taskRef).(*Task) + if !ok { + panic(fmt.Sprintf("couldn't retrieve task for moref %+q while deleting VM %s", taskRef, svm.vm.Name)) + } + + // Wait for the task to complete and see if there is an error. + task.Wait() + if task.Info.Error != nil { + msg := fmt.Sprintf("failed to destroy vm: err=%v", *task.Info.Error) + svm.vm.logPrintf(msg) + + return errors.New(msg) + } + } + + return svm.syncNetworkConfigToVMGuestProperties() + } + + // Start watching the container resource. + err = svm.c.watchContainer(ctx, callback) + if _, ok := err.(uninitializedContainer); ok { + // the container has been deleted before we could watch, despite successful launch so clean up. + callback(nil, svm.c) + + // successful launch so nil the error + return nil + } + + return err +} + +// stop the container (if any) for the given vm. +func (svm *simVM) stop(ctx *Context) error { + if svm == nil || svm.c == nil { + return nil + } + + err := svm.c.stop(ctx) + if err != nil { + log.Printf("%s %s: %s", svm.vm.Name, "stop", err) + + return err + } + + ctx.Update(svm.vm, toolsNotRunning) + + return nil +} + +// pause the container (if any) for the given vm. +func (svm *simVM) pause(ctx *Context) error { + if svm == nil || svm.c == nil { + return nil + } + + err := svm.c.pause(ctx) + if err != nil { + log.Printf("%s %s: %s", svm.vm.Name, "pause", err) + + return err + } + + ctx.Update(svm.vm, toolsNotRunning) + + return nil +} + +// restart the container (if any) for the given vm. +func (svm *simVM) restart(ctx *Context) error { + if svm == nil || svm.c == nil { + return nil + } + + err := svm.c.restart(ctx) + if err != nil { + log.Printf("%s %s: %s", svm.vm.Name, "restart", err) + + return err + } + + ctx.Update(svm.vm, toolsRunning) + + return nil +} + +// remove the container (if any) for the given vm. +func (svm *simVM) remove(ctx *Context) error { + if svm == nil || svm.c == nil { + return nil + } + + err := svm.c.remove(ctx) + if err != nil { + log.Printf("%s %s: %s", svm.vm.Name, "remove", err) + + return err + } + + return nil +} + +func (svm *simVM) exec(ctx *Context, auth types.BaseGuestAuthentication, args []string) (string, types.BaseMethodFault) { + if svm == nil || svm.c == nil { + return "", nil + } + + fault := svm.prepareGuestOperation(auth) + if fault != nil { + return "", fault + } + + out, err := svm.c.exec(ctx, args) + if err != nil { + log.Printf("%s: %s (%s)", svm.vm.Name, args, string(out)) + return "", new(types.GuestOperationsFault) + } + + return strings.TrimSpace(string(out)), nil +} + +func guestUpload(id string, file string, r *http.Request) error { + // TODO: decide behaviour for no container + err := copyToGuest(id, file, r.ContentLength, r.Body) + _ = r.Body.Close() + return err +} + +func guestDownload(id string, file string, w http.ResponseWriter) error { + // TODO: decide behaviour for no container + sink := func(len int64, r io.Reader) error { + w.Header().Set("Content-Length", strconv.FormatInt(len, 10)) + _, err := io.Copy(w, r) + return err + } + + err := copyFromGuest(id, file, sink) + return err +} + +const guestPrefix = "/guestFile/" + +// ServeGuest handles container guest file upload/download +func ServeGuest(w http.ResponseWriter, r *http.Request) { + // Real vCenter form: /guestFile?id=139&token=... + // vcsim form: /guestFile/tmp/foo/bar?id=ebc8837b8cb6&token=... + + id := r.URL.Query().Get("id") + file := strings.TrimPrefix(r.URL.Path, guestPrefix[:len(guestPrefix)-1]) + var err error + + switch r.Method { + case http.MethodPut: + err = guestUpload(id, file, r) + case http.MethodGet: + err = guestDownload(id, file, w) + default: + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + if err != nil { + log.Printf("%s %s: %s", r.Method, r.URL, err) + w.WriteHeader(http.StatusInternalServerError) + } +} + +// productSerial returns the uuid in /sys/class/dmi/id/product_serial format +func productSerial(id uuid.UUID) string { + var dst [len(id)*2 + len(id) - 1]byte + + j := 0 + for i := 0; i < len(id); i++ { + hex.Encode(dst[j:j+2], id[i:i+1]) + j += 3 + if j < len(dst) { + s := j - 1 + if s == len(dst)/2 { + dst[s] = '-' + } else { + dst[s] = ' ' + } + } + } + + return fmt.Sprintf("VMware-%s", string(dst[:])) +} + +// productUUID returns the uuid in /sys/class/dmi/id/product_uuid format +func productUUID(id uuid.UUID) string { + var dst [36]byte + + hex.Encode(dst[0:2], id[3:4]) + hex.Encode(dst[2:4], id[2:3]) + hex.Encode(dst[4:6], id[1:2]) + hex.Encode(dst[6:8], id[0:1]) + dst[8] = '-' + hex.Encode(dst[9:11], id[5:6]) + hex.Encode(dst[11:13], id[4:5]) + dst[13] = '-' + hex.Encode(dst[14:16], id[7:8]) + hex.Encode(dst[16:18], id[6:7]) + dst[18] = '-' + hex.Encode(dst[19:23], id[8:10]) + dst[23] = '-' + hex.Encode(dst[24:], id[10:]) + + return strings.ToUpper(string(dst[:])) +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/crypto_manager_kmip.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/crypto_manager_kmip.go new file mode 100644 index 000000000..fd14418eb --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/crypto_manager_kmip.go @@ -0,0 +1,657 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "slices" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/crypto" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +const ( + nativeKeyProvider = string(types.KmipClusterInfoKmsManagementTypeNativeProvider) +) + +type CryptoManagerKmip struct { + mo.CryptoManagerKmip + + keyIDToProviderID map[string]string +} + +func (m *CryptoManagerKmip) init(r *Registry) { + if m.keyIDToProviderID == nil { + m.keyIDToProviderID = map[string]string{} + } +} + +func (m *CryptoManagerKmip) ListKmipServers( + ctx *Context, req *types.ListKmipServers) soap.HasFault { + + body := methods.ListKmipServersBody{ + Res: &types.ListKmipServersResponse{}, + } + + if len(m.KmipServers) > 0 { + limit := len(m.KmipServers) + if req.Limit != nil { + if reqLimit := int(*req.Limit); reqLimit >= 0 && reqLimit < limit { + limit = reqLimit + } + } + body.Res.Returnval = m.KmipServers[0:limit] + } + + return &body + +} + +// TODO: Implement req.DefaultsToParent +func (m *CryptoManagerKmip) GetDefaultKmsCluster( + ctx *Context, req *types.GetDefaultKmsCluster) soap.HasFault { + + var ( + providerID string + body methods.GetDefaultKmsClusterBody + ) + + for i := range m.KmipServers { + c := m.KmipServers[i] + if req.Entity != nil { + for j := range c.UseAsEntityDefault { + if *req.Entity == c.UseAsEntityDefault[j] { + providerID = c.ClusterId.Id + } + } + } else if c.UseAsDefault { + providerID = c.ClusterId.Id + } + if providerID != "" { + break + } + } + + if providerID == "" { + body.Fault_ = Fault("No default provider", &types.RuntimeFault{}) + } else { + body.Res = &types.GetDefaultKmsClusterResponse{ + Returnval: &types.KeyProviderId{Id: providerID}, + } + } + + return &body +} + +type retrieveKmipServerStatusTask struct { + *CryptoManagerKmip + get []types.KmipClusterInfo + ctx *Context +} + +func (c *retrieveKmipServerStatusTask) Run( + task *Task) (types.AnyType, types.BaseMethodFault) { + + var result []types.CryptoManagerKmipClusterStatus + + if len(c.get) == 0 { + c.get = make([]types.KmipClusterInfo, len(c.KmipServers)) + copy(c.get, c.KmipServers) + } + + for i := range c.get { + g := &c.get[i] + if len(g.Servers) == 0 { + for j := range c.KmipServers { + if g.ClusterId.Id == c.KmipServers[j].ClusterId.Id { + g.Servers = make( + []types.KmipServerInfo, len(c.KmipServers[j].Servers)) + copy(g.Servers, c.KmipServers[j].Servers) + } + } + } + } + + for i := range c.KmipServers { + for j := range c.get { + if c.KmipServers[i].ClusterId.Id == c.get[j].ClusterId.Id { + clusterStatus := types.CryptoManagerKmipClusterStatus{ + ClusterId: types.KeyProviderId{ + Id: c.KmipServers[i].ClusterId.Id, + }, + ManagementType: c.KmipServers[i].ManagementType, + OverallStatus: types.ManagedEntityStatusGreen, + } + for k := range c.KmipServers[i].Servers { + for l := range c.get[j].Servers { + if c.KmipServers[i].Servers[k].Name == c.get[j].Servers[l].Name { + clusterStatus.Servers = append( + clusterStatus.Servers, + types.CryptoManagerKmipServerStatus{ + Name: c.KmipServers[i].Servers[k].Name, + Status: types.ManagedEntityStatusGreen, + }, + ) + } + } + } + result = append(result, clusterStatus) + } + } + } + + return types.ArrayOfCryptoManagerKmipClusterStatus{ + CryptoManagerKmipClusterStatus: result, + }, nil +} + +func (m *CryptoManagerKmip) RetrieveKmipServersStatusTask( + ctx *Context, req *types.RetrieveKmipServersStatus_Task) soap.HasFault { + + var body methods.RetrieveKmipServersStatus_TaskBody + + runner := &retrieveKmipServerStatusTask{ + CryptoManagerKmip: m, + ctx: ctx, + get: req.Clusters, + } + task := CreateTask( + runner.Reference(), + "retrieveKmipServerStatus", + runner.Run) + + body.Res = &types.RetrieveKmipServersStatus_TaskResponse{ + Returnval: task.Run(ctx), + } + + return &body +} + +func (m *CryptoManagerKmip) MarkDefault( + ctx *Context, req *types.MarkDefault) soap.HasFault { + + return m.SetDefaultKmsCluster( + ctx, + &types.SetDefaultKmsCluster{ + This: req.This, + ClusterId: &types.KeyProviderId{ + Id: req.ClusterId.Id, + }, + }) + +} + +func (m *CryptoManagerKmip) SetDefaultKmsCluster( + ctx *Context, req *types.SetDefaultKmsCluster) soap.HasFault { + + var ( + validClusterID bool + body methods.SetDefaultKmsClusterBody + ) + + for i := range m.KmipServers { + c := &m.KmipServers[i] + if req.ClusterId != nil && req.ClusterId.Id != "" { + if c.ClusterId.Id != req.ClusterId.Id { + c.UseAsDefault = false + c.UseAsEntityDefault = nil + } else { + validClusterID = true + if req.Entity == nil { + c.UseAsDefault = true + } else { + found := false + for j := range c.UseAsEntityDefault { + if *req.Entity == c.UseAsEntityDefault[j] { + found = true + break + } + } + if !found { + c.UseAsEntityDefault = append( + c.UseAsEntityDefault, + *req.Entity) + } + } + } + } else if req.Entity != nil { + x := -1 + for j := range c.UseAsEntityDefault { + if *req.Entity == c.UseAsEntityDefault[j] { + x = j + break + } + } + if x >= 0 { + c.UseAsEntityDefault = slices.Delete( + c.UseAsEntityDefault, x, x+1) + } + } else { + c.UseAsDefault = false + } + } + + if req.ClusterId != nil && req.ClusterId.Id != "" && !validClusterID { + body.Fault_ = Fault("Invalid cluster ID", &types.RuntimeFault{}) + } else { + body.Res = &types.SetDefaultKmsClusterResponse{} + } + + return &body +} + +// real vCenter only allows TrustAuthority, but we allow more to simplify test setup +var validClusterTypes = []string{ + string(types.KmipClusterInfoKmsManagementTypeTrustAuthority), + string(types.KmipClusterInfoKmsManagementTypeUnknown), + string(types.KmipClusterInfoKmsManagementTypeNativeProvider), +} + +func (m *CryptoManagerKmip) RegisterKmsCluster( + ctx *Context, req *types.RegisterKmsCluster) soap.HasFault { + + var body methods.RegisterKmsClusterBody + + if slices.Contains(validClusterTypes, req.ManagementType) { + for i := range m.KmipServers { + if req.ClusterId.Id == m.KmipServers[i].ClusterId.Id { + body.Fault_ = Fault("Already registered", &types.RuntimeFault{}) + } + } + } else { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "managementType", + }) + } + if body.Fault_ == nil { + body.Res = &types.RegisterKmsClusterResponse{} + m.KmipServers = append(m.KmipServers, + types.KmipClusterInfo{ + ClusterId: types.KeyProviderId{ + Id: req.ClusterId.Id, + }, + ManagementType: req.ManagementType, + }) + } + + return &body +} + +func (m *CryptoManagerKmip) UnregisterKmsCluster( + ctx *Context, req *types.UnregisterKmsCluster) soap.HasFault { + + var body methods.UnregisterKmsClusterBody + + x := -1 + for i := range m.KmipServers { + if req.ClusterId.Id == m.KmipServers[i].ClusterId.Id { + x = i + } + } + + if x < 0 { + body.Fault_ = Fault("Invalid cluster ID", &types.RuntimeFault{}) + } else { + m.KmipServers = slices.Delete(m.KmipServers, x, x+1) + body.Res = &types.UnregisterKmsClusterResponse{} + } + + return &body +} + +func (m *CryptoManagerKmip) RegisterKmipServer( + ctx *Context, req *types.RegisterKmipServer) soap.HasFault { + + var ( + validClusterID bool + alreadyRegistered bool + body methods.RegisterKmipServerBody + ) + + if req.Server.Info.Name == "" { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "server.info.name"}) + return &body + } + + for i := range m.KmipServers { + c := &m.KmipServers[i] + + if req.Server.ClusterId.Id == c.ClusterId.Id { + validClusterID = true + for j := range c.Servers { + if req.Server.Info.Name == c.Servers[j].Name { + alreadyRegistered = true + break + } + } + if !alreadyRegistered { + c.Servers = append(c.Servers, req.Server.Info) + } + } + + if validClusterID || alreadyRegistered { + break + } + } + + if alreadyRegistered { + body.Fault_ = Fault("Already registered", &types.RuntimeFault{}) + } else { + if !validClusterID { + m.KmipServers = append(m.KmipServers, + types.KmipClusterInfo{ + ClusterId: types.KeyProviderId{ + Id: req.Server.ClusterId.Id, + }, + ManagementType: string(types.KmipClusterInfoKmsManagementTypeVCenter), + Servers: []types.KmipServerInfo{req.Server.Info}, + }) + } + + body.Res = &types.RegisterKmipServerResponse{} + } + + return &body +} + +func (m *CryptoManagerKmip) RemoveKmipServer( + ctx *Context, req *types.RemoveKmipServer) soap.HasFault { + + var ( + validClusterID bool + validServerName bool + body methods.RemoveKmipServerBody + ) + + for i := range m.KmipServers { + c := &m.KmipServers[i] + + if req.ClusterId.Id == c.ClusterId.Id { + validClusterID = true + + x := -1 + for j := range c.Servers { + if req.ServerName == c.Servers[j].Name { + x = j + break + } + } + + if x >= 0 { + validServerName = true + c.Servers = slices.Delete(c.Servers, x, x+1) + } + } + + if validClusterID { + break + } + } + + if !validClusterID { + body.Fault_ = Fault("Invalid cluster ID", &types.RuntimeFault{}) + } else if !validServerName { + body.Fault_ = Fault("Invalid server name", &types.RuntimeFault{}) + } else { + body.Res = &types.RemoveKmipServerResponse{} + } + + return &body +} + +func (m *CryptoManagerKmip) UpdateKmipServer( + ctx *Context, req *types.UpdateKmipServer) soap.HasFault { + + var ( + validClusterID bool + validServerName bool + body methods.UpdateKmipServerBody + ) + + for i := range m.KmipServers { + c := &m.KmipServers[i] + + if req.Server.ClusterId.Id == c.ClusterId.Id { + validClusterID = true + for j := range c.Servers { + if req.Server.Info.Name == c.Servers[j].Name { + validServerName = true + c.Servers[j] = req.Server.Info + break + } + } + } + + if validClusterID { + break + } + } + + if !validClusterID { + body.Fault_ = Fault("Invalid cluster ID", &types.RuntimeFault{}) + } else if !validServerName { + body.Fault_ = Fault("Invalid server name", &types.RuntimeFault{}) + } else { + body.Res = &types.UpdateKmipServerResponse{} + } + + return &body +} + +func (m *CryptoManagerKmip) GenerateKey( + ctx *Context, req *types.GenerateKey) soap.HasFault { + + var ( + provider types.KmipClusterInfo + body methods.GenerateKeyBody + ) + + for i := range m.KmipServers { + c := m.KmipServers[i] + if req.KeyProvider == nil { + if c.UseAsDefault { + provider = c + } + } else if req.KeyProvider.Id == c.ClusterId.Id { + provider = c + } + if provider.ClusterId.Id != "" { + break + } + } + + if provider.ClusterId.Id == "" { + body.Fault_ = Fault("No default provider", &types.RuntimeFault{}) + } else if provider.ManagementType == nativeKeyProvider { + body.Fault_ = Fault( + "Cannot generate keys with native key provider", + &types.RuntimeFault{}) + } else { + newKey := uuid.NewString() + m.keyIDToProviderID[newKey] = provider.ClusterId.Id + + body.Res = &types.GenerateKeyResponse{ + Returnval: types.CryptoKeyResult{ + Success: true, + KeyId: types.CryptoKeyId{ + KeyId: newKey, + ProviderId: &types.KeyProviderId{ + Id: provider.ClusterId.Id, + }, + }, + }, + } + } + + return &body +} + +func (m *CryptoManagerKmip) ListKeys( + ctx *Context, req *types.ListKeys) soap.HasFault { + + body := methods.ListKeysBody{ + Res: &types.ListKeysResponse{}, + } + + if len(m.keyIDToProviderID) > 0 { + var ( + i int + limit = len(m.keyIDToProviderID) + ) + if req.Limit != nil { + if reqLimit := int(*req.Limit); reqLimit >= 0 && reqLimit < limit { + limit = reqLimit + } + } + for keyID, providerID := range m.keyIDToProviderID { + if i >= limit { + break + } + i++ + body.Res.Returnval = append(body.Res.Returnval, types.CryptoKeyId{ + KeyId: keyID, + ProviderId: &types.KeyProviderId{ + Id: providerID, + }, + }) + } + } + + return &body +} + +func (m *CryptoManagerKmip) QueryCryptoKeyStatus( + ctx *Context, req *types.QueryCryptoKeyStatus) soap.HasFault { + + status := make([]types.CryptoManagerKmipCryptoKeyStatus, len(req.KeyIds)) + + servers := make(map[string]types.KmipClusterInfo, len(m.KmipServers)) + for _, p := range m.KmipServers { + servers[p.KeyId] = p + } + + for i, id := range req.KeyIds { + s := types.CryptoManagerKmipCryptoKeyStatus{KeyId: id} + + if req.CheckKeyBitMap&crypto.CheckKeyAvailable != 0 { + s.KeyAvailable = types.NewBool(false) + s.Reason = string(types.CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateMissingInKMS) + + providerID := "" + if id.ProviderId != nil { + providerID = id.ProviderId.Id + } + cluster := servers[providerID] + if pid, ok := m.keyIDToProviderID[id.KeyId]; ok { + if cluster.ManagementType == string(types.KmipClusterInfoKmsManagementTypeNativeProvider) { + s.Reason = string(types.CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateManagedByNKP) + } else if pid == providerID { + *s.KeyAvailable = true + s.Reason = "" + } + } + } + + if req.CheckKeyBitMap&crypto.CheckKeyUsedByVms != 0 { + for _, obj := range ctx.Map.All("VirtualMachine") { + ctx.WithLock(obj, func() { + if key := obj.(*VirtualMachine).Config.KeyId; key != nil { + if *key == id { + status[i].EncryptedVMs = append(status[i].EncryptedVMs, obj.Reference()) + } + } + }) + } + } + + status[i] = s + } + + return &methods.QueryCryptoKeyStatusBody{ + Res: &types.QueryCryptoKeyStatusResponse{ + Returnval: status, + }, + } +} + +func getDefaultProvider( + ctx *Context, + vm *VirtualMachine, + generateKey bool) (string, string) { + + m := ctx.Map.CryptoManager() + if m == nil { + return "", "" + } + + var ( + providerID string + keyID string + ) + + ctx.WithLock(m, func() { + // Lookup the default provider ID via the VM's parent entities: + // host, host folder, cluster. + if host := vm.Runtime.Host; host != nil { + for i := range m.KmipServers { + kmipCluster := m.KmipServers[i] + for j := range kmipCluster.UseAsEntityDefault { + parent := host + for providerID == "" && parent != nil { + if kmipCluster.UseAsEntityDefault[j] == *parent { + providerID = kmipCluster.ClusterId.Id + break + } else { + // TODO (akutz): Support looking up the + // default entity via the host + // folder and cluster. + parent = nil + } + } + if providerID != "" { + break + } + } + if providerID != "" { + break + } + } + } + + // If the default provider ID has not been discovered, see if + // any of the providers are the global default. + if providerID == "" { + for i := range m.KmipServers { + if providerID == "" && m.KmipServers[i].UseAsDefault { + providerID = m.KmipServers[i].ClusterId.Id + break + } + } + } + }) + + if providerID != "" && generateKey { + keyID = generateKeyForProvider(ctx, providerID) + } + + return providerID, keyID +} + +func generateKeyForProvider(ctx *Context, providerID string) string { + m := ctx.Map.CryptoManager() + if m == nil { + return "" + } + var keyID string + ctx.WithLock(m, func() { + keyID = uuid.NewString() + m.keyIDToProviderID[keyID] = providerID + }) + return keyID +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go new file mode 100644 index 000000000..910a59f3c --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go @@ -0,0 +1,209 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type CustomFieldsManager struct { + mo.CustomFieldsManager + + nextKey int32 +} + +// Iterates through all entities of passed field type; +// Removes found field from their custom field properties. +func entitiesFieldRemove(ctx *Context, field types.CustomFieldDef) { + entities := ctx.Map.All(field.ManagedObjectType) + for _, e := range entities { + entity := e.Entity() + ctx.WithLock(entity, func() { + aFields := entity.AvailableField + for i, aField := range aFields { + if aField.Key == field.Key { + entity.AvailableField = append(aFields[:i], aFields[i+1:]...) + break + } + } + + values := e.Entity().Value + for i, value := range values { + if value.(*types.CustomFieldStringValue).Key == field.Key { + entity.Value = append(values[:i], values[i+1:]...) + break + } + } + + cValues := e.Entity().CustomValue + for i, cValue := range cValues { + if cValue.(*types.CustomFieldStringValue).Key == field.Key { + entity.CustomValue = append(cValues[:i], cValues[i+1:]...) + break + } + } + }) + } +} + +// Iterates through all entities of passed field type; +// Renames found field in entity's AvailableField property. +func entitiesFieldRename(ctx *Context, field types.CustomFieldDef) { + entities := ctx.Map.All(field.ManagedObjectType) + for _, e := range entities { + entity := e.Entity() + ctx.WithLock(entity, func() { + aFields := entity.AvailableField + for i, aField := range aFields { + if aField.Key == field.Key { + aFields[i].Name = field.Name + break + } + } + }) + } +} + +func (c *CustomFieldsManager) findByNameType(name, moType string) (int, *types.CustomFieldDef) { + for i, field := range c.Field { + if (field.ManagedObjectType == "" || field.ManagedObjectType == moType || moType == "") && + field.Name == name { + return i, &c.Field[i] + } + } + + return -1, nil +} + +func (c *CustomFieldsManager) findByKey(key int32) (int, *types.CustomFieldDef) { + for i, field := range c.Field { + if field.Key == key { + return i, &c.Field[i] + } + } + + return -1, nil +} + +func (c *CustomFieldsManager) AddCustomFieldDef(ctx *Context, req *types.AddCustomFieldDef) soap.HasFault { + body := &methods.AddCustomFieldDefBody{} + + _, field := c.findByNameType(req.Name, req.MoType) + if field != nil { + body.Fault_ = Fault("", &types.DuplicateName{ + Name: req.Name, + Object: c.Reference(), + }) + return body + } + + def := types.CustomFieldDef{ + Key: c.nextKey, + Name: req.Name, + ManagedObjectType: req.MoType, + Type: req.MoType, + FieldDefPrivileges: req.FieldDefPolicy, + FieldInstancePrivileges: req.FieldPolicy, + } + + entities := ctx.Map.All(req.MoType) + for _, e := range entities { + entity := e.Entity() + ctx.WithLock(entity, func() { + entity.AvailableField = append(entity.AvailableField, def) + }) + } + + c.Field = append(c.Field, def) + c.nextKey++ + + body.Res = &types.AddCustomFieldDefResponse{ + Returnval: def, + } + return body +} + +func (c *CustomFieldsManager) RemoveCustomFieldDef(ctx *Context, req *types.RemoveCustomFieldDef) soap.HasFault { + body := &methods.RemoveCustomFieldDefBody{} + + i, field := c.findByKey(req.Key) + if field == nil { + body.Fault_ = Fault("", &types.NotFound{}) + return body + } + + entitiesFieldRemove(ctx, *field) + + c.Field = append(c.Field[:i], c.Field[i+1:]...) + + body.Res = &types.RemoveCustomFieldDefResponse{} + return body +} + +func (c *CustomFieldsManager) RenameCustomFieldDef(ctx *Context, req *types.RenameCustomFieldDef) soap.HasFault { + body := &methods.RenameCustomFieldDefBody{} + + _, field := c.findByKey(req.Key) + if field == nil { + body.Fault_ = Fault("", &types.NotFound{}) + return body + } + + field.Name = req.Name + + entitiesFieldRename(ctx, *field) + + body.Res = &types.RenameCustomFieldDefResponse{} + return body +} + +func (c *CustomFieldsManager) SetField(ctx *Context, req *types.SetField) soap.HasFault { + body := &methods.SetFieldBody{} + + _, field := c.findByKey(req.Key) + if field == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "key"}) + return body + } + + newValue := &types.CustomFieldStringValue{ + CustomFieldValue: types.CustomFieldValue{Key: req.Key}, + Value: req.Value, + } + + removeIndex := func(s []types.BaseCustomFieldValue, i int) []types.BaseCustomFieldValue { + new := make([]types.BaseCustomFieldValue, 0) + new = append(new, s[:i]...) + return append(new, s[i+1:]...) + } + + removeExistingValues := func(s []types.BaseCustomFieldValue) []types.BaseCustomFieldValue { + for i := 0; i < len(s); { + if s[i].GetCustomFieldValue().Key == newValue.GetCustomFieldValue().Key { + s = removeIndex(s, i) + } + i++ + } + return s + } + + entity := ctx.Map.Get(req.Entity).(mo.Entity).Entity() + + ctx.WithLock(entity, func() { + // Check if custom value and value are already set. If so, remove them. + entity.CustomValue = removeExistingValues(entity.CustomValue) + entity.Value = removeExistingValues(entity.Value) + + // Add the new value + entity.CustomValue = append(entity.CustomValue, newValue) + entity.Value = append(entity.Value, newValue) + }) + + body.Res = &types.SetFieldResponse{} + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go new file mode 100644 index 000000000..869578bec --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go @@ -0,0 +1,346 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "encoding/pem" + "fmt" + "sync/atomic" + "time" + + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var DefaultCustomizationSpec = []types.CustomizationSpecItem{ + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-linux", + Description: "", + Type: "Linux", + ChangeVersion: "1569965707", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationLinuxOptions{}, + Identity: &types.CustomizationLinuxPrep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + HostName: &types.CustomizationVirtualMachineName{}, + Domain: "eng.vmware.com", + TimeZone: "Pacific/Apia", + HwClockUTC: types.NewBool(true), + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{ + DnsSuffixList: nil, + DnsServerList: []string{"127.0.1.1"}, + }, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationDhcpIpGenerator{}, + SubnetMask: "", + Gateway: nil, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-linux-static", + Description: "", + Type: "Linux", + ChangeVersion: "1569969598", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationLinuxOptions{}, + Identity: &types.CustomizationLinuxPrep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + HostName: &types.CustomizationPrefixName{ + CustomizationName: types.CustomizationName{}, + Base: "vcsim", + }, + Domain: "eng.vmware.com", + TimeZone: "Africa/Cairo", + HwClockUTC: types.NewBool(true), + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{ + DnsSuffixList: nil, + DnsServerList: []string{"127.0.1.1"}, + }, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-windows-static", + Description: "", + Type: "Windows", + ChangeVersion: "1569978029", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationWinOptions{ + CustomizationOptions: types.CustomizationOptions{}, + ChangeSID: true, + DeleteAccounts: false, + Reboot: "", + }, + Identity: &types.CustomizationSysprep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + GuiUnattended: types.CustomizationGuiUnattended{ + Password: (*types.CustomizationPassword)(nil), + TimeZone: 2, + AutoLogon: false, + AutoLogonCount: 1, + }, + UserData: types.CustomizationUserData{ + FullName: "vcsim", + OrgName: "VMware", + ComputerName: &types.CustomizationVirtualMachineName{}, + ProductId: "", + }, + GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), + Identification: types.CustomizationIdentification{ + JoinWorkgroup: "WORKGROUP", + JoinDomain: "", + DomainAdmin: "", + DomainAdminPassword: (*types.CustomizationPassword)(nil), + }, + LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ + AutoMode: "perServer", + AutoUsers: 5, + }, + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{}, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-windows-domain", + Description: "", + Type: "Windows", + ChangeVersion: "1569970234", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationWinOptions{ + CustomizationOptions: types.CustomizationOptions{}, + ChangeSID: true, + DeleteAccounts: false, + Reboot: "", + }, + Identity: &types.CustomizationSysprep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + GuiUnattended: types.CustomizationGuiUnattended{ + Password: &types.CustomizationPassword{ + Value: "3Gs...==", + PlainText: false, + }, + TimeZone: 15, + AutoLogon: false, + AutoLogonCount: 1, + }, + UserData: types.CustomizationUserData{ + FullName: "dougm", + OrgName: "VMware", + ComputerName: &types.CustomizationVirtualMachineName{}, + ProductId: "", + }, + GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), + Identification: types.CustomizationIdentification{ + JoinWorkgroup: "", + JoinDomain: "DOMAIN", + DomainAdmin: "vcsim", + DomainAdminPassword: &types.CustomizationPassword{ + Value: "H3g...==", + PlainText: false, + }, + }, + LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ + AutoMode: "perServer", + AutoUsers: 5, + }, + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{}, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, +} + +type CustomizationSpecManager struct { + mo.CustomizationSpecManager + + items []types.CustomizationSpecItem +} + +func (m *CustomizationSpecManager) init(r *Registry) { + m.items = DefaultCustomizationSpec + + // Real VC is different DN, X509v3 extensions, etc. + // This is still useful for testing []byte of DER encoded cert over SOAP + if len(m.EncryptionKey) == 0 { + block, _ := pem.Decode(internal.LocalhostCert) + m.EncryptionKey = block.Bytes + } +} + +var customizeNameCounter uint64 + +func customizeName(vm *VirtualMachine, base types.BaseCustomizationName) string { + n := atomic.AddUint64(&customizeNameCounter, 1) + + switch name := base.(type) { + case *types.CustomizationPrefixName: + return fmt.Sprintf("%s-%d", name.Base, n) + case *types.CustomizationCustomName: + return fmt.Sprintf("%s-%d", name.Argument, n) + case *types.CustomizationFixedName: + return name.Name + case *types.CustomizationUnknownName: + return "" + case *types.CustomizationVirtualMachineName: + return fmt.Sprintf("%s-%d", vm.Name, n) + default: + return "" + } +} + +func (m *CustomizationSpecManager) DoesCustomizationSpecExist(ctx *Context, req *types.DoesCustomizationSpecExist) soap.HasFault { + exists := false + + for _, item := range m.items { + if item.Info.Name == req.Name { + exists = true + break + } + } + + return &methods.DoesCustomizationSpecExistBody{ + Res: &types.DoesCustomizationSpecExistResponse{ + Returnval: exists, + }, + } +} + +func (m *CustomizationSpecManager) GetCustomizationSpec(ctx *Context, req *types.GetCustomizationSpec) soap.HasFault { + body := new(methods.GetCustomizationSpecBody) + + for _, item := range m.items { + if item.Info.Name == req.Name { + body.Res = &types.GetCustomizationSpecResponse{ + Returnval: item, + } + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *CustomizationSpecManager) CreateCustomizationSpec(ctx *Context, req *types.CreateCustomizationSpec) soap.HasFault { + body := new(methods.CreateCustomizationSpecBody) + + for _, item := range m.items { + if item.Info.Name == req.Item.Info.Name { + body.Fault_ = Fault("", &types.AlreadyExists{Name: req.Item.Info.Name}) + return body + } + } + + m.items = append(m.items, req.Item) + body.Res = new(types.CreateCustomizationSpecResponse) + + return body +} + +func (m *CustomizationSpecManager) OverwriteCustomizationSpec(ctx *Context, req *types.OverwriteCustomizationSpec) soap.HasFault { + body := new(methods.OverwriteCustomizationSpecBody) + + for i, item := range m.items { + if item.Info.Name == req.Item.Info.Name { + m.items[i] = req.Item + body.Res = new(types.OverwriteCustomizationSpecResponse) + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *CustomizationSpecManager) Get() mo.Reference { + clone := *m + + for i := range clone.items { + clone.Info = append(clone.Info, clone.items[i].Info) + } + + return &clone +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/datacenter.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/datacenter.go new file mode 100644 index 000000000..098ac9f12 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/datacenter.go @@ -0,0 +1,210 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "log" + "strings" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type Datacenter struct { + mo.Datacenter + + isESX bool +} + +// NewDatacenter creates a Datacenter and its child folders. +func NewDatacenter(ctx *Context, f *mo.Folder) *Datacenter { + dc := &Datacenter{ + isESX: f.Self == esx.RootFolder.Self, + } + + if dc.isESX { + dc.Datacenter = esx.Datacenter + } + + folderPutChild(ctx, f, dc) + + dc.createFolders(ctx) + + return dc +} + +func (dc *Datacenter) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, dc, r) +} + +// Create Datacenter Folders. +// Every Datacenter has 4 inventory Folders: Vm, Host, Datastore and Network. +// The ESX folder child types are limited to 1 type. +// The VC folders have additional child types, including nested folders. +func (dc *Datacenter) createFolders(ctx *Context) { + folders := []struct { + ref *types.ManagedObjectReference + name string + types []string + }{ + {&dc.VmFolder, "vm", []string{"VirtualMachine", "VirtualApp", "Folder"}}, + {&dc.HostFolder, "host", []string{"ComputeResource", "Folder"}}, + {&dc.DatastoreFolder, "datastore", []string{"Datastore", "StoragePod", "Folder"}}, + {&dc.NetworkFolder, "network", []string{"Network", "DistributedVirtualSwitch", "Folder"}}, + } + + for _, f := range folders { + folder := &Folder{} + folder.Name = f.name + + if dc.isESX { + folder.ChildType = f.types[:1] + folder.Self = *f.ref + ctx.Map.PutEntity(dc, folder) + } else { + folder.ChildType = f.types + e := ctx.Map.PutEntity(dc, folder) + + // propagate the generated morefs to Datacenter + ref := e.Reference() + f.ref.Type = ref.Type + f.ref.Value = ref.Value + } + } + + net := ctx.Map.Get(dc.NetworkFolder).(*Folder) + + for _, ref := range esx.Datacenter.Network { + // Add VM Network by default to each Datacenter + network := &mo.Network{} + network.Self = ref + network.Name = strings.Split(ref.Value, "-")[1] + network.Entity().Name = network.Name + if !dc.isESX { + network.Self.Value = "" // we want a different moid per-DC + } + + folderPutChild(ctx, &net.Folder, network) + } +} + +func (dc *Datacenter) defaultNetwork() []types.ManagedObjectReference { + return dc.Network[:1] // VM Network +} + +// folder returns the Datacenter folder that can contain the given object type +func (dc *Datacenter) folder(ctx *Context, obj mo.Entity) *mo.Folder { + folders := []types.ManagedObjectReference{ + dc.VmFolder, + dc.HostFolder, + dc.DatastoreFolder, + dc.NetworkFolder, + } + otype := getManagedObject(obj).Type() + rtype := obj.Reference().Type + + for i := range folders { + folder, _ := asFolderMO(ctx.Map.Get(folders[i])) + for _, kind := range folder.ChildType { + if rtype == kind { + return folder + } + if f, ok := otype.FieldByName(kind); ok && f.Anonymous { + return folder + } + } + } + + log.Panicf("failed to find folder for type=%s", rtype) + return nil +} + +func datacenterEventArgument(ctx *Context, obj mo.Entity) *types.DatacenterEventArgument { + dc, ok := obj.(*Datacenter) + if !ok { + dc = ctx.Map.getEntityDatacenter(obj) + } + return &types.DatacenterEventArgument{ + Datacenter: dc.Self, + EntityEventArgument: types.EntityEventArgument{Name: dc.Name}, + } +} + +func (dc *Datacenter) PowerOnMultiVMTask(ctx *Context, req *types.PowerOnMultiVM_Task) soap.HasFault { + task := CreateTask(dc, "powerOnMultiVM", func(_ *Task) (types.AnyType, types.BaseMethodFault) { + if dc.isESX { + return nil, new(types.NotImplemented) + } + + // Return per-VM tasks, structured as: + // thisTask.result - DC level task + // +- []Attempted + // +- subTask.result - VM level powerOn task result + // +- ... + res := types.ClusterPowerOnVmResult{} + res.Attempted = []types.ClusterAttemptedVmInfo{} + + for _, ref := range req.Vm { + vm, ok := ctx.Map.Get(ref).(*VirtualMachine) + if !ok { + continue + } + // This task creates multiple subtasks which violates the assumption + // of 1:1 Context:Task, which results in data races in objects + // like the Simulator.Event manager. This is the minimum context + // required for the PowerOnVMTask to complete. + taskCtx := &Context{ + Context: ctx.Context, + Session: ctx.Session, + Map: ctx.Map, + } + + // NOTE: Simulator does not actually perform any specific host-level placement + // (equivalent to vSphere DRS). + taskCtx.WithLock(vm, func() { + vmTaskBody := vm.PowerOnVMTask(taskCtx, &types.PowerOnVM_Task{}).(*methods.PowerOnVM_TaskBody) + res.Attempted = append(res.Attempted, types.ClusterAttemptedVmInfo{Vm: ref, Task: &vmTaskBody.Res.Returnval}) + }) + } + + return res, nil + }) + + return &methods.PowerOnMultiVM_TaskBody{ + Res: &types.PowerOnMultiVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (d *Datacenter) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(d, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + folders := []types.ManagedObjectReference{ + d.VmFolder, + d.HostFolder, + } + + for _, ref := range folders { + f, _ := asFolderMO(ctx.Map.Get(ref)) + if len(f.ChildEntity) != 0 { + return nil, &types.ResourceInUse{} + } + } + + p, _ := asFolderMO(ctx.Map.Get(*d.Parent)) + folderRemoveChild(ctx, p, d.Self) + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/dataset.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/dataset.go new file mode 100644 index 000000000..177850140 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/dataset.go @@ -0,0 +1,53 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vapi/vm/dataset" +) + +type DataSet struct { + *dataset.Info + ID string + Entries map[string]string +} + +func copyDataSetsForVmClone(src map[string]*DataSet) map[string]*DataSet { + copy := make(map[string]*DataSet, len(src)) + for k, v := range src { + if v.OmitFromSnapshotAndClone { + continue + } + copy[k] = copyDataSet(v) + } + return copy +} + +func copyDataSet(src *DataSet) *DataSet { + if src == nil { + return nil + } + copy := &DataSet{ + Info: &dataset.Info{ + Name: src.Name, + Description: src.Description, + Host: src.Host, + Guest: src.Guest, + Used: src.Used, + OmitFromSnapshotAndClone: src.OmitFromSnapshotAndClone, + }, + ID: src.ID, + Entries: copyEntries(src.Entries), + } + return copy +} + +func copyEntries(src map[string]string) map[string]string { + copy := make(map[string]string, len(src)) + for k, v := range src { + copy[k] = v + } + return copy +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore.go new file mode 100644 index 000000000..13bab9eaa --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore.go @@ -0,0 +1,176 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "net/url" + "os" + "path" + "strings" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type Datastore struct { + mo.Datastore + + namespace map[string]string // TODO: make thread safe +} + +func (ds *Datastore) eventArgument() *types.DatastoreEventArgument { + return &types.DatastoreEventArgument{ + Datastore: ds.Self, + EntityEventArgument: types.EntityEventArgument{Name: ds.Name}, + } +} + +func (ds *Datastore) model(m *Model) error { + info := ds.Info.GetDatastoreInfo() + u, _ := url.Parse(info.Url) + if u.Scheme == "ds" { + // rewrite saved vmfs path to a local temp dir + u.Path = path.Clean(u.Path) + parent := strings.ReplaceAll(path.Dir(u.Path), "/", "_") + name := strings.ReplaceAll(path.Base(u.Path), ":", "_") + + dir, err := m.createTempDir(parent, name) + if err != nil { + return err + } + + info.Url = dir + } else { + // rewrite local path from a saved vcsim instance + dir, err := m.createTempDir(path.Base(u.Path)) + if err != nil { + return err + } + + info.Url = dir + } + + ds.Summary.Url = info.Url + + return nil +} + +// resolve Datastore relative file path to absolute path. +// vSAN top-level directories are named with its vSAN object uuid. +// The directory uuid or friendlyName can be used the various FileManager, +// VirtualDiskManager, etc. methods that have a Datastore path param. +// Note that VirtualDevice file backing paths must use the vSAN uuid. +func (ds *Datastore) resolve(ctx *Context, p string, remove ...bool) string { + if p == "" || !internal.IsDatastoreVSAN(ds.Datastore) { + return path.Join(ds.Summary.Url, p) + } + + rm := len(remove) != 0 && remove[0] + unlock := ctx.Map.AcquireLock(ctx, ds.Self) + defer unlock() + + if ds.namespace == nil { + ds.namespace = make(map[string]string) + } + + elem := strings.Split(p, "/") + dir := elem[0] + + _, err := uuid.Parse(dir) + if err != nil { + // Translate friendlyName to UUID + id, ok := ds.namespace[dir] + if !ok { + id = uuid.NewString() + ds.namespace[dir] = id + } + + elem[0] = id + p = path.Join(elem...) + if rm { + delete(ds.namespace, id) + } + } else if rm { + // UUID was given + for name, id := range ds.namespace { + if p == id { + delete(ds.namespace, name) + break + } + } + } + + return path.Join(ds.Summary.Url, p) +} + +func parseDatastorePath(dsPath string) (*object.DatastorePath, types.BaseMethodFault) { + var p object.DatastorePath + + if p.FromString(dsPath) { + return &p, nil + } + + return nil, &types.InvalidDatastorePath{DatastorePath: dsPath} +} + +func (ds *Datastore) RefreshDatastore(*Context, *types.RefreshDatastore) soap.HasFault { + r := &methods.RefreshDatastoreBody{} + + _, err := os.Stat(ds.Info.GetDatastoreInfo().Url) + if err != nil { + r.Fault_ = Fault(err.Error(), &types.HostConfigFault{}) + return r + } + + ds.Summary.Capacity = int64(units.ByteSize(units.TB)) * int64(len(ds.Host)) + ds.Summary.FreeSpace = ds.Summary.Capacity + + info := ds.Info.GetDatastoreInfo() + + info.FreeSpace = ds.Summary.FreeSpace + info.MaxMemoryFileSize = ds.Summary.Capacity + info.MaxFileSize = ds.Summary.Capacity + info.Timestamp = types.NewTime(time.Now()) + + r.Res = &types.RefreshDatastoreResponse{} + return r +} + +func (ds *Datastore) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(ds, "destroy", func(*Task) (types.AnyType, types.BaseMethodFault) { + if len(ds.Vm) != 0 { + return nil, &types.ResourceInUse{ + Type: ds.Self.Type, + Name: ds.Name, + } + } + + for _, mount := range ds.Host { + host := ctx.Map.Get(mount.Key).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Datastore, ds.Self) + parent := hostParent(ctx, &host.HostSystem) + ctx.Map.RemoveReference(ctx, parent, &parent.Datastore, ds.Self) + } + + p, _ := asFolderMO(ctx.Map.Get(*ds.Parent)) + folderRemoveChild(ctx, p, ds.Self) + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore_namespace_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore_namespace_manager.go new file mode 100644 index 000000000..083b15b23 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/datastore_namespace_manager.go @@ -0,0 +1,175 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "path" + "strings" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type DatastoreNamespaceManager struct { + mo.DatastoreNamespaceManager +} + +func (m *DatastoreNamespaceManager) ConvertNamespacePathToUuidPath(ctx *Context, req *types.ConvertNamespacePathToUuidPath) soap.HasFault { + body := new(methods.ConvertNamespacePathToUuidPathBody) + + if req.Datacenter == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "datacenterRef"}) + return body + } + + dc, ok := ctx.Map.Get(*req.Datacenter).(*Datacenter) + if !ok { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: *req.Datacenter}) + return body + } + + var ds *Datastore + ns := "" + + for _, ref := range dc.Datastore { + ds = ctx.Map.Get(ref).(*Datastore) + ns = strings.TrimPrefix(req.NamespaceUrl, ds.Summary.Url) + if ns != req.NamespaceUrl { + break + } + ds = nil + } + + if ds == nil { + body.Fault_ = Fault("", &types.InvalidDatastorePath{DatastorePath: req.NamespaceUrl}) + return body + } + + if !internal.IsDatastoreVSAN(ds.Datastore) { + body.Fault_ = Fault("", &types.InvalidDatastore{Datastore: &ds.Self}) + return body + } + + body.Res = &types.ConvertNamespacePathToUuidPathResponse{ + Returnval: ds.resolve(ctx, ns), + } + + return body +} + +func (m *DatastoreNamespaceManager) CreateDirectory(ctx *Context, req *types.CreateDirectory) soap.HasFault { + body := new(methods.CreateDirectoryBody) + + ds, ok := ctx.Map.Get(req.Datastore).(*Datastore) + if !ok { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: req.Datastore}) + return body + } + + if !internal.IsDatastoreVSAN(ds.Datastore) { + body.Fault_ = Fault("", &types.CannotCreateFile{ + FileFault: types.FileFault{ + File: "Datastore not supported for directory creation by DatastoreNamespaceManager", + }, + }) + return body + } + + if !isValidFileName(req.DisplayName) { + body.Fault_ = Fault("", &types.InvalidDatastorePath{DatastorePath: req.DisplayName}) + return body + } + + p := object.DatastorePath{ + Datastore: ds.Name, + Path: req.DisplayName, + } + + dc := ctx.Map.getEntityDatacenter(ds) + + fm := ctx.Map.FileManager() + + fault := fm.MakeDirectory(ctx, &types.MakeDirectory{ + This: fm.Self, + Name: p.String(), + Datacenter: &dc.Self, + }) + + if fault.Fault() != nil { + body.Fault_ = fault.Fault() + } else { + body.Res = &types.CreateDirectoryResponse{ + Returnval: ds.resolve(ctx, req.DisplayName), + } + } + + return body +} + +func (m *DatastoreNamespaceManager) DeleteDirectory(ctx *Context, req *types.DeleteDirectory) soap.HasFault { + body := new(methods.DeleteDirectoryBody) + + if req.Datacenter == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "datacenterRef"}) + return body + } + + dc, ok := ctx.Map.Get(*req.Datacenter).(*Datacenter) + if !ok { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: *req.Datacenter}) + return body + } + + var ds *Datastore + for _, ref := range dc.Datastore { + ds = ctx.Map.Get(ref).(*Datastore) + if strings.HasPrefix(req.DatastorePath, ds.Summary.Url) { + break + } + ds = nil + } + + if ds == nil || strings.Contains(req.DatastorePath, "..") { + body.Fault_ = Fault("", &types.InvalidDatastorePath{DatastorePath: req.DatastorePath}) + return body + } + + if !internal.IsDatastoreVSAN(ds.Datastore) { + body.Fault_ = Fault("", &types.FileFault{ + File: "Datastore not supported for directory deletion by DatastoreNamespaceManager", + }) + return body + } + + name := &object.DatastorePath{ + Datastore: ds.Name, + Path: path.Base(req.DatastorePath), + } + + fm := ctx.Map.FileManager() + + fault := fm.deleteDatastoreFile(ctx, &types.DeleteDatastoreFile_Task{ + Name: name.String(), + Datacenter: req.Datacenter, + }) + + if fault != nil { + body.Fault_ = Fault("", fault) + } else { + body.Res = new(types.DeleteDirectoryResponse) + } + + return body +} + +func isValidFileName(s string) bool { + return !strings.Contains(s, "/") && + !strings.Contains(s, "\\") && + !strings.Contains(s, "..") +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/doc.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/doc.go new file mode 100644 index 000000000..660eefd19 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/doc.go @@ -0,0 +1,10 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +/* +Package simulator is a mock framework for the vSphere API. + +See also: https://github.com/vmware/govmomi/blob/main/vcsim/README.md +*/ +package simulator diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs.go new file mode 100644 index 000000000..50413ea6d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs.go @@ -0,0 +1,422 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "strconv" + "strings" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type DistributedVirtualSwitch struct { + mo.DistributedVirtualSwitch + + types.FetchDVPortsResponse +} + +func (s *DistributedVirtualSwitch) eventArgument() *types.DvsEventArgument { + return &types.DvsEventArgument{ + EntityEventArgument: types.EntityEventArgument{ + Name: s.Name, + }, + Dvs: s.Self, + } +} + +func (s *DistributedVirtualSwitch) event(ctx *Context) types.DvsEvent { + return types.DvsEvent{ + Event: types.Event{ + Datacenter: datacenterEventArgument(ctx, s), + Dvs: s.eventArgument(), + }, + } +} + +func (s *DistributedVirtualSwitch) AddDVPortgroupTask(ctx *Context, c *types.AddDVPortgroup_Task) soap.HasFault { + task := CreateTask(s, "addDVPortgroup", func(t *Task) (types.AnyType, types.BaseMethodFault) { + f := ctx.Map.getEntityParent(s, "Folder").(*Folder) + + portgroups := s.Portgroup + portgroupNames := s.Summary.PortgroupName + + for _, spec := range c.Spec { + pg := &DistributedVirtualPortgroup{} + pg.Name = spec.Name + pg.Entity().Name = pg.Name + + // Standard AddDVPortgroupTask() doesn't allow duplicate names, but NSX 3.0 does create some DVPGs with the same name. + // Allow duplicate names using this prefix so we can reproduce and test this condition. + if strings.HasPrefix(pg.Name, "NSX-") || spec.BackingType == string(types.DistributedVirtualPortgroupBackingTypeNsx) { + if spec.LogicalSwitchUuid == "" { + spec.LogicalSwitchUuid = uuid.New().String() + } + if spec.SegmentId == "" { + spec.SegmentId = fmt.Sprintf("/infra/segments/vnet_%s", uuid.New().String()) + } + + } else { + if obj := ctx.Map.FindByName(pg.Name, f.ChildEntity); obj != nil { + return nil, &types.DuplicateName{ + Name: pg.Name, + Object: obj.Reference(), + } + } + } + + folderPutChild(ctx, &f.Folder, pg) + + pg.Key = pg.Self.Value + pg.Config = types.DVPortgroupConfigInfo{ + Key: pg.Key, + Name: pg.Name, + NumPorts: spec.NumPorts, + DistributedVirtualSwitch: &s.Self, + DefaultPortConfig: spec.DefaultPortConfig, + Description: spec.Description, + Type: spec.Type, + Policy: spec.Policy, + PortNameFormat: spec.PortNameFormat, + Scope: spec.Scope, + VendorSpecificConfig: spec.VendorSpecificConfig, + ConfigVersion: spec.ConfigVersion, + AutoExpand: spec.AutoExpand, + VmVnicNetworkResourcePoolKey: spec.VmVnicNetworkResourcePoolKey, + LogicalSwitchUuid: spec.LogicalSwitchUuid, + SegmentId: spec.SegmentId, + BackingType: spec.BackingType, + } + + if pg.Config.LogicalSwitchUuid != "" { + if pg.Config.BackingType == "" { + pg.Config.BackingType = "nsx" + } + } + + if pg.Config.DefaultPortConfig == nil { + pg.Config.DefaultPortConfig = &types.VMwareDVSPortSetting{ + Vlan: new(types.VmwareDistributedVirtualSwitchVlanIdSpec), + UplinkTeamingPolicy: &types.VmwareUplinkPortTeamingPolicy{ + Policy: &types.StringPolicy{ + Value: "loadbalance_srcid", + }, + ReversePolicy: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + NotifySwitches: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + RollingOrder: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + }, + } + } + + if pg.Config.Policy == nil { + pg.Config.Policy = &types.VMwareDVSPortgroupPolicy{ + DVPortgroupPolicy: types.DVPortgroupPolicy{ + BlockOverrideAllowed: true, + ShapingOverrideAllowed: false, + VendorConfigOverrideAllowed: false, + LivePortMovingAllowed: false, + PortConfigResetAtDisconnect: true, + NetworkResourcePoolOverrideAllowed: types.NewBool(false), + TrafficFilterOverrideAllowed: types.NewBool(false), + }, + VlanOverrideAllowed: false, + UplinkTeamingOverrideAllowed: false, + SecurityPolicyOverrideAllowed: false, + IpfixOverrideAllowed: types.NewBool(false), + } + } + + for i := 0; i < int(spec.NumPorts); i++ { + pg.PortKeys = append(pg.PortKeys, strconv.Itoa(i)) + } + + portgroups = append(portgroups, pg.Self) + portgroupNames = append(portgroupNames, pg.Name) + + for _, h := range s.Summary.HostMember { + pg.Host = append(pg.Host, h) + + host := ctx.Map.Get(h).(*HostSystem) + ctx.Map.AppendReference(ctx, host, &host.Network, pg.Reference()) + + parent := ctx.Map.Get(*host.HostSystem.Parent) + computeNetworks := append(hostParent(ctx, &host.HostSystem).Network, pg.Reference()) + ctx.Update(parent, []types.PropertyChange{ + {Name: "network", Val: computeNetworks}, + }) + } + + ctx.postEvent(&types.DVPortgroupCreatedEvent{ + DVPortgroupEvent: pg.event(ctx), + }) + } + + ctx.Update(s, []types.PropertyChange{ + {Name: "portgroup", Val: portgroups}, + {Name: "summary.portgroupName", Val: portgroupNames}, + }) + + return nil, nil + }) + + return &methods.AddDVPortgroup_TaskBody{ + Res: &types.AddDVPortgroup_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (s *DistributedVirtualSwitch) ReconfigureDvsTask(ctx *Context, req *types.ReconfigureDvs_Task) soap.HasFault { + task := CreateTask(s, "reconfigureDvs", func(t *Task) (types.AnyType, types.BaseMethodFault) { + spec := req.Spec.GetDVSConfigSpec() + + members := s.Summary.HostMember + + for _, member := range spec.Host { + h := ctx.Map.Get(member.Host) + if h == nil { + return nil, &types.ManagedObjectNotFound{Obj: member.Host} + } + + host := h.(*HostSystem) + + switch types.ConfigSpecOperation(member.Operation) { + case types.ConfigSpecOperationAdd: + if FindReference(s.Summary.HostMember, member.Host) != nil { + return nil, &types.AlreadyExists{Name: host.Name} + } + + hostNetworks := append(host.Network, s.Portgroup...) + ctx.Update(host, []types.PropertyChange{ + {Name: "network", Val: hostNetworks}, + }) + members = append(members, member.Host) + parent := ctx.Map.Get(*host.HostSystem.Parent) + + var pgs []types.ManagedObjectReference + for _, ref := range s.Portgroup { + pg := ctx.Map.Get(ref).(*DistributedVirtualPortgroup) + pgs = append(pgs, ref) + + pgHosts := append(pg.Host, member.Host) + ctx.Update(pg, []types.PropertyChange{ + {Name: "host", Val: pgHosts}, + }) + + cr := hostParent(ctx, &host.HostSystem) + if FindReference(cr.Network, ref) == nil { + computeNetworks := append(cr.Network, ref) + ctx.Update(parent, []types.PropertyChange{ + {Name: "network", Val: computeNetworks}, + }) + } + } + + ctx.postEvent(&types.DvsHostJoinedEvent{ + DvsEvent: s.event(ctx), + HostJoined: *host.eventArgument(), + }) + case types.ConfigSpecOperationRemove: + for _, ref := range host.Vm { + vm := ctx.Map.Get(ref).(*VirtualMachine) + if pg := FindReference(vm.Network, s.Portgroup...); pg != nil { + return nil, &types.ResourceInUse{ + Type: pg.Type, + Name: pg.Value, + } + } + } + + RemoveReference(&members, member.Host) + + ctx.postEvent(&types.DvsHostLeftEvent{ + DvsEvent: s.event(ctx), + HostLeft: *host.eventArgument(), + }) + case types.ConfigSpecOperationEdit: + return nil, &types.NotSupported{} + } + } + + ctx.Update(s, []types.PropertyChange{ + {Name: "summary.hostMember", Val: members}, + }) + + ctx.postEvent(&types.DvsReconfiguredEvent{ + DvsEvent: s.event(ctx), + ConfigSpec: spec, + }) + + return nil, nil + }) + + return &methods.ReconfigureDvs_TaskBody{ + Res: &types.ReconfigureDvs_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (s *DistributedVirtualSwitch) FetchDVPorts(ctx *Context, req *types.FetchDVPorts) soap.HasFault { + body := &methods.FetchDVPortsBody{} + body.Res = &types.FetchDVPortsResponse{ + Returnval: s.dvPortgroups(ctx, req.Criteria), + } + return body +} + +func (s *DistributedVirtualSwitch) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(s, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + // TODO: should return ResourceInUse fault if any VM is using a port on this switch + // and past that, remove refs from each host.Network, etc + f := ctx.Map.getEntityParent(s, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, s.Reference()) + ctx.postEvent(&types.DvsDestroyedEvent{DvsEvent: s.event(ctx)}) + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (s *DistributedVirtualSwitch) dvPortgroups(ctx *Context, criteria *types.DistributedVirtualSwitchPortCriteria) []types.DistributedVirtualPort { + res := s.FetchDVPortsResponse.Returnval + if len(res) != 0 { + return res + } + + for _, ref := range s.Portgroup { + pg := ctx.Map.Get(ref).(*DistributedVirtualPortgroup) + + for _, key := range pg.PortKeys { + res = append(res, types.DistributedVirtualPort{ + DvsUuid: s.Uuid, + Key: key, + PortgroupKey: pg.Key, + Config: types.DVPortConfigInfo{ + Setting: pg.Config.DefaultPortConfig, + }, + }) + } + } + + // filter ports by criteria + res = s.filterDVPorts(res, criteria) + + return res +} + +func (s *DistributedVirtualSwitch) filterDVPorts( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if criteria == nil { + return ports + } + + ports = s.filterDVPortsByPortgroupKey(ports, criteria) + ports = s.filterDVPortsByPortKey(ports, criteria) + ports = s.filterDVPortsByConnected(ports, criteria) + + return ports +} + +func (s *DistributedVirtualSwitch) filterDVPortsByPortgroupKey( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if len(criteria.PortgroupKey) == 0 || criteria.Inside == nil { + return ports + } + + // inside portgroup keys + if *criteria.Inside { + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + for _, pgk := range criteria.PortgroupKey { + if p.PortgroupKey == pgk { + filtered = append(filtered, p) + break + } + } + } + return filtered + } + + // outside portgroup keys + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + found := false + for _, pgk := range criteria.PortgroupKey { + if p.PortgroupKey == pgk { + found = true + break + } + } + + if !found { + filtered = append(filtered, p) + } + } + return filtered +} + +func (s *DistributedVirtualSwitch) filterDVPortsByPortKey( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if len(criteria.PortKey) == 0 { + return ports + } + + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + for _, pk := range criteria.PortKey { + if p.Key == pk { + filtered = append(filtered, p) + break + } + } + } + + return filtered +} + +func (s *DistributedVirtualSwitch) filterDVPortsByConnected( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if criteria.Connected == nil { + return ports + } + + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + connected := p.Connectee != nil + if connected == *criteria.Connected { + filtered = append(filtered, p) + } + } + + return filtered +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go new file mode 100644 index 000000000..aa2aad46a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go @@ -0,0 +1,39 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type DistributedVirtualSwitchManager struct { + mo.DistributedVirtualSwitchManager +} + +func (m *DistributedVirtualSwitchManager) DVSManagerLookupDvPortGroup(ctx *Context, req *types.DVSManagerLookupDvPortGroup) soap.HasFault { + body := &methods.DVSManagerLookupDvPortGroupBody{} + + for _, obj := range ctx.Map.All("DistributedVirtualSwitch") { + dvs := obj.(*DistributedVirtualSwitch) + if dvs.Uuid == req.SwitchUuid { + for _, ref := range dvs.Portgroup { + pg := ctx.Map.Get(ref).(*DistributedVirtualPortgroup) + if pg.Key == req.PortgroupKey { + body.Res = &types.DVSManagerLookupDvPortGroupResponse{ + Returnval: &ref, + } + return body + } + } + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/entity.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/entity.go new file mode 100644 index 000000000..742f5415f --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/entity.go @@ -0,0 +1,35 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +func RenameTask(ctx *Context, e mo.Entity, r *types.Rename_Task, dup ...bool) soap.HasFault { + task := CreateTask(e, "rename", func(t *Task) (types.AnyType, types.BaseMethodFault) { + obj := ctx.Map.Get(r.This).(mo.Entity).Entity() + + canDup := len(dup) == 1 && dup[0] + if parent, ok := asFolderMO(ctx.Map.Get(*obj.Parent)); ok && !canDup { + if ctx.Map.FindByName(r.NewName, parent.ChildEntity) != nil { + return nil, &types.InvalidArgument{InvalidProperty: "name"} + } + } + + ctx.Update(e, []types.PropertyChange{{Name: "name", Val: r.NewName}}) + + return nil, nil + }) + + return &methods.Rename_TaskBody{ + Res: &types.Rename_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/environment_browser.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/environment_browser.go new file mode 100644 index 000000000..9026706f5 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/environment_browser.go @@ -0,0 +1,329 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type EnvironmentBrowser struct { + mo.EnvironmentBrowser + + QueryConfigTargetResponse types.QueryConfigTargetResponse + QueryConfigOptionResponse types.QueryConfigOptionResponse + QueryConfigOptionDescriptorResponse types.QueryConfigOptionDescriptorResponse + QueryTargetCapabilitiesResponse types.QueryTargetCapabilitiesResponse +} + +func newEnvironmentBrowser( + ctx *Context, + hostRefs ...types.ManagedObjectReference) *types.ManagedObjectReference { + + env := new(EnvironmentBrowser) + env.initDescriptorReturnVal(ctx, hostRefs...) + ctx.Map.Put(env) + return &env.Self +} + +func (b *EnvironmentBrowser) addHost( + ctx *Context, hostRef types.ManagedObjectReference) { + + // Get a set of unique hosts. + hostSet := map[types.ManagedObjectReference]struct{}{ + hostRef: {}, + } + for i := range b.QueryConfigOptionDescriptorResponse.Returnval { + cod := b.QueryConfigOptionDescriptorResponse.Returnval[i] + for j := range cod.Host { + if _, ok := hostSet[cod.Host[j]]; !ok { + hostSet[cod.Host[j]] = struct{}{} + } + } + } + + // Get a list of unique hosts. + var hostRefs []types.ManagedObjectReference + for ref := range hostSet { + hostRefs = append(hostRefs, ref) + } + + // Clear the descriptor's return val. + b.QueryConfigOptionDescriptorResponse.Returnval = nil + + b.initDescriptorReturnVal(ctx, hostRefs...) +} + +func (b *EnvironmentBrowser) initDescriptorReturnVal( + ctx *Context, hostRefs ...types.ManagedObjectReference) { + + // Get the max supported hardware version for this list of hosts. + var maxHardwareVersion types.HardwareVersion + maxHardwareVersionForHost := map[types.ManagedObjectReference]types.HardwareVersion{} + for j := range hostRefs { + ref := hostRefs[j] + ctx.WithLock(ref, func() { + host := ctx.Map.Get(ref).(*HostSystem) + hostVersion := types.MustParseESXiVersion(host.Config.Product.Version) + hostHardwareVersion := hostVersion.HardwareVersion() + maxHardwareVersionForHost[ref] = hostHardwareVersion + if !maxHardwareVersion.IsValid() { + maxHardwareVersion = hostHardwareVersion + return + } + if hostHardwareVersion > maxHardwareVersion { + maxHardwareVersion = hostHardwareVersion + } + }) + } + + if !maxHardwareVersion.IsValid() { + return + } + + hardwareVersions := types.GetHardwareVersions() + for i := range hardwareVersions { + hv := hardwareVersions[i] + dco := hv == maxHardwareVersion + cod := types.VirtualMachineConfigOptionDescriptor{ + Key: hv.String(), + Description: hv.String(), + DefaultConfigOption: types.NewBool(dco), + CreateSupported: types.NewBool(true), + RunSupported: types.NewBool(true), + UpgradeSupported: types.NewBool(true), + } + for hostRef, hostVer := range maxHardwareVersionForHost { + if hostVer >= hv { + cod.Host = append(cod.Host, hostRef) + } + } + + b.QueryConfigOptionDescriptorResponse.Returnval = append( + b.QueryConfigOptionDescriptorResponse.Returnval, cod) + + if dco { + break + } + } +} + +func (b *EnvironmentBrowser) hosts(ctx *Context) []types.ManagedObjectReference { + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + for _, obj := range ctx.Map.objects { + switch e := obj.(type) { + case *mo.ComputeResource: + if b.Self == *e.EnvironmentBrowser { + return e.Host + } + case *ClusterComputeResource: + if b.Self == *e.EnvironmentBrowser { + return e.Host + } + } + } + return nil +} + +func (b *EnvironmentBrowser) QueryConfigOption(req *types.QueryConfigOption) soap.HasFault { + body := new(methods.QueryConfigOptionBody) + + opt := b.QueryConfigOptionResponse.Returnval + if opt == nil { + opt = &types.VirtualMachineConfigOption{ + Version: esx.HardwareVersion, + DefaultDevice: esx.VirtualDevice, + } + } + + body.Res = &types.QueryConfigOptionResponse{ + Returnval: opt, + } + + return body +} + +func guestFamily(id string) string { + // TODO: We could capture the entire GuestOsDescriptor list from EnvironmentBrowser, + // but it is a ton of data.. this should be good enough for now. + switch { + case strings.HasPrefix(id, "win"): + return string(types.VirtualMachineGuestOsFamilyWindowsGuest) + case strings.HasPrefix(id, "darwin"): + return string(types.VirtualMachineGuestOsFamilyDarwinGuestFamily) + default: + return string(types.VirtualMachineGuestOsFamilyLinuxGuest) + } +} + +func (b *EnvironmentBrowser) QueryConfigOptionEx(req *types.QueryConfigOptionEx) soap.HasFault { + body := new(methods.QueryConfigOptionExBody) + + opt := b.QueryConfigOptionResponse.Returnval + if opt == nil { + opt = &types.VirtualMachineConfigOption{ + Version: esx.HardwareVersion, + DefaultDevice: esx.VirtualDevice, + } + } + + if req.Spec != nil { + // From the SDK QueryConfigOptionEx doc: + // "If guestId is nonempty, the guestOSDescriptor array of the config option is filtered to match against the guest IDs in the spec. + // If there is no match, the whole list is returned." + for _, id := range req.Spec.GuestId { + for _, gid := range GuestID { + if string(gid) == id { + opt.GuestOSDescriptor = []types.GuestOsDescriptor{{ + Id: id, + Family: guestFamily(id), + }} + + break + } + } + } + } + + if len(opt.GuestOSDescriptor) == 0 { + for i := range GuestID { + id := string(GuestID[i]) + opt.GuestOSDescriptor = append(opt.GuestOSDescriptor, types.GuestOsDescriptor{ + Id: id, + Family: guestFamily(id), + }) + } + } + + body.Res = &types.QueryConfigOptionExResponse{ + Returnval: opt, + } + + return body +} + +func (b *EnvironmentBrowser) QueryConfigOptionDescriptor(ctx *Context, req *types.QueryConfigOptionDescriptor) soap.HasFault { + body := &methods.QueryConfigOptionDescriptorBody{ + Res: &types.QueryConfigOptionDescriptorResponse{ + Returnval: b.QueryConfigOptionDescriptorResponse.Returnval, + }, + } + + return body +} + +func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryConfigTarget) soap.HasFault { + body := &methods.QueryConfigTargetBody{ + Res: &types.QueryConfigTargetResponse{ + Returnval: b.QueryConfigTargetResponse.Returnval, + }, + } + + if body.Res.Returnval != nil { + return body + } + + target := &types.ConfigTarget{ + SmcPresent: types.NewBool(false), + } + body.Res.Returnval = target + + var hosts []types.ManagedObjectReference + if req.Host == nil { + hosts = b.hosts(ctx) + } else { + hosts = append(hosts, *req.Host) + } + + seen := make(map[types.ManagedObjectReference]bool) + + for i := range hosts { + host := ctx.Map.Get(hosts[i]).(*HostSystem) + target.NumCpus += int32(host.Summary.Hardware.NumCpuPkgs) + target.NumCpuCores += int32(host.Summary.Hardware.NumCpuCores) + target.NumNumaNodes++ + + for _, ref := range host.Datastore { + if seen[ref] { + continue + } + seen[ref] = true + + ds := ctx.Map.Get(ref).(*Datastore) + target.Datastore = append(target.Datastore, types.VirtualMachineDatastoreInfo{ + VirtualMachineTargetInfo: types.VirtualMachineTargetInfo{ + Name: ds.Name, + }, + Datastore: ds.Summary, + Capability: ds.Capability, + Mode: string(types.HostMountModeReadWrite), + VStorageSupport: string(types.FileSystemMountInfoVStorageSupportStatusVStorageUnsupported), + }) + } + + for _, ref := range host.Network { + if seen[ref] { + continue + } + seen[ref] = true + + switch n := ctx.Map.Get(ref).(type) { + case *mo.Network: + target.Network = append(target.Network, types.VirtualMachineNetworkInfo{ + VirtualMachineTargetInfo: types.VirtualMachineTargetInfo{ + Name: n.Name, + }, + Network: n.Summary.GetNetworkSummary(), + }) + case *DistributedVirtualPortgroup: + dvs := ctx.Map.Get(*n.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + target.DistributedVirtualPortgroup = append(target.DistributedVirtualPortgroup, types.DistributedVirtualPortgroupInfo{ + SwitchName: dvs.Name, + SwitchUuid: dvs.Uuid, + PortgroupName: n.Name, + PortgroupKey: n.Key, + PortgroupType: n.Config.Type, + UplinkPortgroup: false, + Portgroup: n.Self, + NetworkReservationSupported: types.NewBool(false), + }) + case *DistributedVirtualSwitch: + target.DistributedVirtualSwitch = append(target.DistributedVirtualSwitch, types.DistributedVirtualSwitchInfo{ + SwitchName: n.Name, + SwitchUuid: n.Uuid, + DistributedVirtualSwitch: n.Self, + NetworkReservationSupported: types.NewBool(false), + }) + } + } + } + + return body +} + +func (b *EnvironmentBrowser) QueryTargetCapabilities(ctx *Context, req *types.QueryTargetCapabilities) soap.HasFault { + body := &methods.QueryTargetCapabilitiesBody{ + Res: &types.QueryTargetCapabilitiesResponse{ + Returnval: b.QueryTargetCapabilitiesResponse.Returnval, + }, + } + + if body.Res.Returnval != nil { + return body + } + + body.Res.Returnval = &types.HostCapability{ + VmotionSupported: true, + MaintenanceModeSupported: true, + } + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go new file mode 100644 index 000000000..1136f1815 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go @@ -0,0 +1,93 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// RoleList is the default template for the AuthorizationManager roleList property. +// Capture method: +// govc object.collect -s -dump AuthorizationManager:ha-authmgr roleList +var RoleList = []types.AuthorizationRole{ + { + RoleId: -8, + System: true, + Name: "NoTrustedAdmin", + Info: &types.Description{ + Label: "No Trusted Infrastructure administrator", + Summary: "Full access without Trusted Infrastructure privileges", + }, + Privilege: []string{"Alarm.Acknowledge", "Alarm.Create", "Alarm.Delete", "Alarm.DisableActions", "Alarm.Edit", "Alarm.SetStatus", "Alarm.ToggleEnableOnEntity", "Authorization.ModifyPermissions", "Authorization.ModifyPrivileges", "Authorization.ModifyRoles", "Authorization.ModifyVTContainerMappings", "Authorization.ModifyVTContainers", "Authorization.ReassignRolePermissions", "AutoDeploy.Host.AssociateMachine", "AutoDeploy.Profile.Create", "AutoDeploy.Profile.Edit", "AutoDeploy.Rule.Create", "AutoDeploy.Rule.Delete", "AutoDeploy.Rule.Edit", "AutoDeploy.RuleSet.Activate", "AutoDeploy.RuleSet.Edit", "Certificate.Manage", "CertificateAuthority.Administer", "CertificateAuthority.Manage", "CertificateManagement.Administer", "CertificateManagement.Manage", "CertificateManagementSubscriptions.Create", "CertificateManagementSubscriptions.Delete", "CertificateManagementSubscriptions.Update", "Cns.Searchable", "ComputePolicy.Manage", "ContentLibrary.AddCertToTrustStore", "ContentLibrary.AddLibraryItem", "ContentLibrary.AddSubscription", "ContentLibrary.CheckInTemplate", "ContentLibrary.CheckOutTemplate", "ContentLibrary.CreateLocalLibrary", "ContentLibrary.CreateSubscribedLibrary", "ContentLibrary.DeleteCertFromTrustStore", "ContentLibrary.DeleteLibraryItem", "ContentLibrary.DeleteLocalLibrary", "ContentLibrary.DeleteSubscribedLibrary", "ContentLibrary.DeleteSubscription", "ContentLibrary.DownloadSession", "ContentLibrary.EvictLibraryItem", "ContentLibrary.EvictSubscribedLibrary", "ContentLibrary.GetConfiguration", "ContentLibrary.ImportStorage", "ContentLibrary.ManageClusterRegistryResource", "ContentLibrary.ManageRegistry", "ContentLibrary.ManageRegistryProject", "ContentLibrary.MigrateLibrary", "ContentLibrary.ProbeSubscription", "ContentLibrary.PublishLibrary", "ContentLibrary.PublishLibraryItem", "ContentLibrary.ReadStorage", "ContentLibrary.SyncLibrary", "ContentLibrary.SyncLibraryItem", "ContentLibrary.TypeIntrospection", "ContentLibrary.UpdateConfiguration", "ContentLibrary.UpdateLibrary", "ContentLibrary.UpdateLibraryItem", "ContentLibrary.UpdateLocalLibrary", "ContentLibrary.UpdateSession", "ContentLibrary.UpdateSubscribedLibrary", "ContentLibrary.UpdateSubscription", "Cryptographer.Access", "Cryptographer.AddDisk", "Cryptographer.Clone", "Cryptographer.Decrypt", "Cryptographer.Encrypt", "Cryptographer.EncryptNew", "Cryptographer.ManageEncryptionPolicy", "Cryptographer.ManageKeyServers", "Cryptographer.ManageKeys", "Cryptographer.Migrate", "Cryptographer.ReadKeyServersInfo", "Cryptographer.Recrypt", "Cryptographer.RegisterHost", "Cryptographer.RegisterVM", "DVPortgroup.Create", "DVPortgroup.Delete", "DVPortgroup.Modify", "DVPortgroup.PolicyOp", "DVPortgroup.ScopeOp", "DVSwitch.Create", "DVSwitch.Delete", "DVSwitch.HostOp", "DVSwitch.Modify", "DVSwitch.Move", "DVSwitch.PolicyOp", "DVSwitch.PortConfig", "DVSwitch.PortSetting", "DVSwitch.ResourceManagement", "DVSwitch.Vspan", "Datacenter.Create", "Datacenter.Delete", "Datacenter.IpPoolConfig", "Datacenter.IpPoolQueryAllocations", "Datacenter.IpPoolReleaseIp", "Datacenter.Move", "Datacenter.Reconfigure", "Datacenter.Rename", "Datacenter.UpdateCarbonInfo", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.ConfigIOManagement", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "DirectPathProfileManager.Manage", "DrProxy.Host.Configure", "DrProxy.Host.ManageService", "DrProxy.Host.View", "DrProxy.License.Update", "DrProxy.License.View", "DrProxy.Progress.Control", "DrProxy.Vm.Configure", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.ExternalFolderManagement", "Folder.Move", "Folder.Rename", "FoundationLoadBalancers.Manage", "Global.CancelTask", "Global.CapacityPlanning", "Global.Diagnostics", "Global.DisableMethods", "Global.EnableMethods", "Global.GlobalTag", "Global.Health", "Global.Licenses", "Global.LogEvent", "Global.ManageCustomFields", "Global.Proxy", "Global.ScriptAction", "Global.ServiceManagers", "Global.SetCustomField", "Global.Settings", "Global.SystemTag", "Global.VCServer", "GuestDataPublisher.GetData", "HLM.Create", "HLM.Manage", "HealthUpdateProvider.Register", "HealthUpdateProvider.Unregister", "HealthUpdateProvider.Update", "Host.Cim.CimInteraction", "Host.Config.AdvancedConfig", "Host.Config.AuthenticationStore", "Host.Config.AutoStart", "Host.Config.Connection", "Host.Config.DateTime", "Host.Config.Firmware", "Host.Config.GuestStore", "Host.Config.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Nvdimm", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.ProductLocker", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemFirewallRuleSet", "Host.Config.SystemManagement", "Host.Entropy.Read", "Host.Entropy.Write", "Host.Hbr.HbrDaemonManagement", "Host.Hbr.HbrManagement", "Host.Inventory.AddHostToCluster", "Host.Inventory.AddStandaloneHost", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "Host.Inventory.ManageClusterLifecyle", "Host.Inventory.MoveCluster", "Host.Inventory.MoveHost", "Host.Inventory.RemoveHostFromCluster", "Host.Inventory.RenameCluster", "Host.Local.CreateVM", "Host.Local.DeleteVM", "Host.Local.InstallAgent", "Host.Local.ManageUserGroups", "Host.Local.ReconfigVM", "Host.Sgx.Register", "Host.Stats.Query", "Infraprofile.Read", "Infraprofile.Write", "IntercomNamespace.Read", "IntercomNamespace.Write", "InventoryService.Tagging.AttachTag", "InventoryService.Tagging.CreateCategory", "InventoryService.Tagging.CreateTag", "InventoryService.Tagging.DeleteCategory", "InventoryService.Tagging.DeleteTag", "InventoryService.Tagging.EditCategory", "InventoryService.Tagging.EditTag", "InventoryService.Tagging.ModifyUsedByForCategory", "InventoryService.Tagging.ModifyUsedByForTag", "InventoryService.Tagging.ObjectAttachable", "Namespaces.Backup", "Namespaces.Configure", "Namespaces.ListAccess", "Namespaces.Manage", "Namespaces.ManageCapabilities", "Namespaces.ManageDisks", "Namespaces.SelfServiceManage", "Namespaces.Upgrade", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Nsx.Manage", "Nsx.ModifyAll", "Nsx.Read", "Observability.Admin", "Observability.StatsProvider.Manage", "OvfManager.OvfConsumerAccess", "PartnerRestDaemon.Read", "PartnerRestDaemon.Write", "Performance.ModifyIntervals", "Plugin.Management", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "ReplicationService.Administer", "Resource.ApplyRecommendation", "Resource.AssignVAppToPool", "Resource.AssignVMToPool", "Resource.ColdMigrate", "Resource.CreatePool", "Resource.DeletePool", "Resource.EditPool", "Resource.HotMigrate", "Resource.MovePool", "Resource.QueryVMotion", "Resource.RenamePool", "ScheduledTask.Create", "ScheduledTask.Delete", "ScheduledTask.Edit", "ScheduledTask.Run", "ServiceAccount.Administer", "ServiceAccount.ManageAccount", "ServiceAccount.ManagePassword", "Sessions.CollectPrivilegeChecks", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "SettingsStore.Manage", "StoragePod.Config", "StorageProfile.Apply", "StorageProfile.Update", "StorageProfile.View", "StorageViews.ConfigureService", "StorageViews.View", "SupervisorServices.Install", "SupervisorServices.Manage", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "Task.Update.Task.Update", "TenantManager.Query", "TenantManager.Update", "TokenService.PersistableTokenExchange", "TransferService.Manage", "TransferService.Monitor", "Trust.Administer", "Trust.Manage", "VApp.ApplicationConfig", "VApp.AssignResourcePool", "VApp.AssignVApp", "VApp.AssignVM", "VApp.Clone", "VApp.Create", "VApp.Delete", "VApp.Export", "VApp.ExtractOvfEnvironment", "VApp.Import", "VApp.InstanceConfig", "VApp.ManagedByConfig", "VApp.Move", "VApp.PowerOff", "VApp.PowerOn", "VApp.PullFromUrls", "VApp.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VcIdentityProviders.Create", "VcIdentityProviders.Manage", "VcIdentityProviders.Read", "VcIntegrity.Baseline.com.vmware.vcIntegrity.AssignBaselines", "VcIntegrity.Baseline.com.vmware.vcIntegrity.ManageBaselines", "VcIntegrity.ClusterConfiguration.Export", "VcIntegrity.ClusterConfiguration.Modify", "VcIntegrity.ClusterConfiguration.Remediate", "VcIntegrity.ClusterConfiguration.View", "VcIntegrity.FileUpload.com.vmware.vcIntegrity.ImportFile", "VcIntegrity.General.com.vmware.vcIntegrity.Configure", "VcIntegrity.HardwareCompatibility.Read", "VcIntegrity.HardwareCompatibility.Write", "VcIntegrity.Updates.com.vmware.vcIntegrity.Remediate", "VcIntegrity.Updates.com.vmware.vcIntegrity.Scan", "VcIntegrity.Updates.com.vmware.vcIntegrity.Stage", "VcIntegrity.Updates.com.vmware.vcIntegrity.ViewStatus", "VcIntegrity.lifecycleDepots.Delete", "VcIntegrity.lifecycleGeneral.Read", "VcIntegrity.lifecycleGeneral.Write", "VcIntegrity.lifecycleHealth.Read", "VcIntegrity.lifecycleHealth.Write", "VcIntegrity.lifecycleSettings.Read", "VcIntegrity.lifecycleSettings.Write", "VcIntegrity.lifecycleSoftwareRemediation.Read", "VcIntegrity.lifecycleSoftwareRemediation.Write", "VcIntegrity.lifecycleSoftwareSpecification.Read", "VcIntegrity.lifecycleSoftwareSpecification.Write", "VcIntegrity.systemVM.Read", "VcIntegrity.systemVM.Write", "VcLifecycle.Upgrade", "VcLifecycle.View", "VirtualMachine.Config.AddExistingDisk", "VirtualMachine.Config.AddNewDisk", "VirtualMachine.Config.AddRemoveDevice", "VirtualMachine.Config.AdvancedConfig", "VirtualMachine.Config.Annotation", "VirtualMachine.Config.CPUCount", "VirtualMachine.Config.ChangeTracking", "VirtualMachine.Config.DiskExtend", "VirtualMachine.Config.DiskLease", "VirtualMachine.Config.EditDevice", "VirtualMachine.Config.HostUSBDevice", "VirtualMachine.Config.ManagedBy", "VirtualMachine.Config.Memory", "VirtualMachine.Config.MksControl", "VirtualMachine.Config.QueryFTCompatibility", "VirtualMachine.Config.QueryUnownedFiles", "VirtualMachine.Config.RawDevice", "VirtualMachine.Config.ReloadFromPath", "VirtualMachine.Config.RemoveDisk", "VirtualMachine.Config.Rename", "VirtualMachine.Config.ResetGuestInfo", "VirtualMachine.Config.Resource", "VirtualMachine.Config.Settings", "VirtualMachine.Config.SwapPlacement", "VirtualMachine.Config.ToggleForkParent", "VirtualMachine.Config.UpgradeVirtualHardware", "VirtualMachine.DataSets.DataSetCreate", "VirtualMachine.DataSets.DataSetDelete", "VirtualMachine.DataSets.DataSetEntryDelete", "VirtualMachine.DataSets.DataSetEntryGet", "VirtualMachine.DataSets.DataSetEntryList", "VirtualMachine.DataSets.DataSetEntrySet", "VirtualMachine.DataSets.DataSetGet", "VirtualMachine.DataSets.DataSetList", "VirtualMachine.DataSets.DataSetUpdate", "VirtualMachine.DataSets.Export", "VirtualMachine.GuestOperations.Execute", "VirtualMachine.GuestOperations.Modify", "VirtualMachine.GuestOperations.ModifyAliases", "VirtualMachine.GuestOperations.Query", "VirtualMachine.GuestOperations.QueryAliases", "VirtualMachine.Hbr.ConfigureReplication", "VirtualMachine.Hbr.MonitorReplication", "VirtualMachine.Hbr.ReplicaManagement", "VirtualMachine.Interact.AnswerQuestion", "VirtualMachine.Interact.Backup", "VirtualMachine.Interact.ConsoleInteract", "VirtualMachine.Interact.CreateScreenshot", "VirtualMachine.Interact.CreateSecondary", "VirtualMachine.Interact.DefragmentAllDisks", "VirtualMachine.Interact.DeviceConnection", "VirtualMachine.Interact.DisableSecondary", "VirtualMachine.Interact.DnD", "VirtualMachine.Interact.EnableSecondary", "VirtualMachine.Interact.GuestControl", "VirtualMachine.Interact.MakePrimary", "VirtualMachine.Interact.Pause", "VirtualMachine.Interact.PowerOff", "VirtualMachine.Interact.PowerOn", "VirtualMachine.Interact.PutUsbScanCodes", "VirtualMachine.Interact.Record", "VirtualMachine.Interact.Replay", "VirtualMachine.Interact.Reset", "VirtualMachine.Interact.SESparseMaintenance", "VirtualMachine.Interact.SetCDMedia", "VirtualMachine.Interact.SetFloppyMedia", "VirtualMachine.Interact.Suspend", "VirtualMachine.Interact.SuspendToMemory", "VirtualMachine.Interact.TerminateFaultTolerantVM", "VirtualMachine.Interact.ToolsInstall", "VirtualMachine.Interact.TurnOffFaultTolerance", "VirtualMachine.Inventory.Create", "VirtualMachine.Inventory.CreateFromExisting", "VirtualMachine.Inventory.Delete", "VirtualMachine.Inventory.Move", "VirtualMachine.Inventory.Register", "VirtualMachine.Inventory.Unregister", "VirtualMachine.Namespace.Event", "VirtualMachine.Namespace.EventNotify", "VirtualMachine.Namespace.Management", "VirtualMachine.Namespace.ModifyContent", "VirtualMachine.Namespace.Query", "VirtualMachine.Namespace.ReadContent", "VirtualMachine.Provisioning.Clone", "VirtualMachine.Provisioning.CloneTemplate", "VirtualMachine.Provisioning.CreateTemplateFromVM", "VirtualMachine.Provisioning.Customize", "VirtualMachine.Provisioning.DeployTemplate", "VirtualMachine.Provisioning.DiskRandomAccess", "VirtualMachine.Provisioning.DiskRandomRead", "VirtualMachine.Provisioning.FileRandomAccess", "VirtualMachine.Provisioning.GetVmFiles", "VirtualMachine.Provisioning.MarkAsTemplate", "VirtualMachine.Provisioning.MarkAsVM", "VirtualMachine.Provisioning.ModifyCustSpecs", "VirtualMachine.Provisioning.PromoteDisks", "VirtualMachine.Provisioning.PutVmFiles", "VirtualMachine.Provisioning.ReadCustSpecs", "VirtualMachine.State.CreateSnapshot", "VirtualMachine.State.RemoveSnapshot", "VirtualMachine.State.RenameSnapshot", "VirtualMachine.State.RevertToSnapshot", "VirtualMachineClasses.Manage", "VmCam.Administer", "VmResourceProfiles.Manage", "Vsan.Cluster.ShallowRekey", "Vsan.Xvc.UpdateClientInfo", "Zone.Manage", "Zone.ObjectAttachable", "vSANStats.Access", "vService.CreateDependency", "vService.DestroyDependency", "vService.ReconfigureDependency", "vService.UpdateDependency", "vSphereClient.UtilizeVerificationCode", "vSphereDataProtection.Protection", "vSphereDataProtection.Recovery", "vStats.CollectAny", "vStats.QueryAny", "vStats.Settings"}, + }, + { + RoleId: -7, + System: true, + Name: "TrustedAdmin", + Info: &types.Description{ + Label: "Trusted Infrastructure administrator", + Summary: "Setup and monitoring of Trusted Infrastructure", + }, + Privilege: []string{"Host.Tpm.Read", "Host.Tpm.Unseal", "System.Anonymous", "System.Read", "System.View", "TrustedAdmin.ConfigureHostCertificates", "TrustedAdmin.ConfigureHostMetadata", "TrustedAdmin.ConfigureTokenConversionPolicy", "TrustedAdmin.ManageAttestingSSO", "TrustedAdmin.ManageKMSTrust", "TrustedAdmin.ManageTrustedHosts", "TrustedAdmin.ReadAttestingSSO", "TrustedAdmin.ReadKMSTrust", "TrustedAdmin.ReadStsInfo", "TrustedAdmin.ReadTrustedHosts", "TrustedAdmin.RetrieveHostMetadata", "TrustedAdmin.RetrieveTPMHostCertificates"}, + }, + { + RoleId: -6, + System: true, + Name: "NoCryptoAdmin", + Info: &types.Description{ + Label: "No cryptography administrator", + Summary: "Full access without Cryptographic operations and Trusted Infrastructure privileges", + }, + Privilege: []string{"Alarm.Acknowledge", "Alarm.Create", "Alarm.Delete", "Alarm.DisableActions", "Alarm.Edit", "Alarm.SetStatus", "Alarm.ToggleEnableOnEntity", "Authorization.ModifyPermissions", "Authorization.ModifyPrivileges", "Authorization.ModifyRoles", "Authorization.ModifyVTContainerMappings", "Authorization.ModifyVTContainers", "Authorization.ReassignRolePermissions", "AutoDeploy.Host.AssociateMachine", "AutoDeploy.Profile.Create", "AutoDeploy.Profile.Edit", "AutoDeploy.Rule.Create", "AutoDeploy.Rule.Delete", "AutoDeploy.Rule.Edit", "AutoDeploy.RuleSet.Activate", "AutoDeploy.RuleSet.Edit", "Certificate.Manage", "CertificateAuthority.Administer", "CertificateAuthority.Manage", "CertificateManagement.Administer", "CertificateManagement.Manage", "CertificateManagementSubscriptions.Create", "CertificateManagementSubscriptions.Delete", "CertificateManagementSubscriptions.Update", "Cns.Searchable", "ComputePolicy.Manage", "ContentLibrary.AddCertToTrustStore", "ContentLibrary.AddLibraryItem", "ContentLibrary.AddSubscription", "ContentLibrary.CheckInTemplate", "ContentLibrary.CheckOutTemplate", "ContentLibrary.CreateLocalLibrary", "ContentLibrary.CreateSubscribedLibrary", "ContentLibrary.DeleteCertFromTrustStore", "ContentLibrary.DeleteLibraryItem", "ContentLibrary.DeleteLocalLibrary", "ContentLibrary.DeleteSubscribedLibrary", "ContentLibrary.DeleteSubscription", "ContentLibrary.DownloadSession", "ContentLibrary.EvictLibraryItem", "ContentLibrary.EvictSubscribedLibrary", "ContentLibrary.GetConfiguration", "ContentLibrary.ImportStorage", "ContentLibrary.ManageClusterRegistryResource", "ContentLibrary.ManageRegistry", "ContentLibrary.ManageRegistryProject", "ContentLibrary.MigrateLibrary", "ContentLibrary.ProbeSubscription", "ContentLibrary.PublishLibrary", "ContentLibrary.PublishLibraryItem", "ContentLibrary.ReadStorage", "ContentLibrary.SyncLibrary", "ContentLibrary.SyncLibraryItem", "ContentLibrary.TypeIntrospection", "ContentLibrary.UpdateConfiguration", "ContentLibrary.UpdateLibrary", "ContentLibrary.UpdateLibraryItem", "ContentLibrary.UpdateLocalLibrary", "ContentLibrary.UpdateSession", "ContentLibrary.UpdateSubscribedLibrary", "ContentLibrary.UpdateSubscription", "DVPortgroup.Create", "DVPortgroup.Delete", "DVPortgroup.Modify", "DVPortgroup.PolicyOp", "DVPortgroup.ScopeOp", "DVSwitch.Create", "DVSwitch.Delete", "DVSwitch.HostOp", "DVSwitch.Modify", "DVSwitch.Move", "DVSwitch.PolicyOp", "DVSwitch.PortConfig", "DVSwitch.PortSetting", "DVSwitch.ResourceManagement", "DVSwitch.Vspan", "Datacenter.Create", "Datacenter.Delete", "Datacenter.IpPoolConfig", "Datacenter.IpPoolQueryAllocations", "Datacenter.IpPoolReleaseIp", "Datacenter.Move", "Datacenter.Reconfigure", "Datacenter.Rename", "Datacenter.UpdateCarbonInfo", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.ConfigIOManagement", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "DirectPathProfileManager.Manage", "DrProxy.Host.Configure", "DrProxy.Host.ManageService", "DrProxy.Host.View", "DrProxy.License.Update", "DrProxy.License.View", "DrProxy.Progress.Control", "DrProxy.Vm.Configure", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.ExternalFolderManagement", "Folder.Move", "Folder.Rename", "FoundationLoadBalancers.Manage", "Global.CancelTask", "Global.CapacityPlanning", "Global.DisableMethods", "Global.EnableMethods", "Global.GlobalTag", "Global.Health", "Global.Licenses", "Global.LogEvent", "Global.ManageCustomFields", "Global.Proxy", "Global.ScriptAction", "Global.ServiceManagers", "Global.SetCustomField", "Global.Settings", "Global.SystemTag", "Global.VCServer", "GuestDataPublisher.GetData", "HLM.Create", "HLM.Manage", "HealthUpdateProvider.Register", "HealthUpdateProvider.Unregister", "HealthUpdateProvider.Update", "Host.Cim.CimInteraction", "Host.Config.AdvancedConfig", "Host.Config.AuthenticationStore", "Host.Config.AutoStart", "Host.Config.Connection", "Host.Config.DateTime", "Host.Config.Firmware", "Host.Config.GuestStore", "Host.Config.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Nvdimm", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.ProductLocker", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemFirewallRuleSet", "Host.Config.SystemManagement", "Host.Entropy.Read", "Host.Entropy.Write", "Host.Hbr.HbrDaemonManagement", "Host.Hbr.HbrManagement", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "Host.Inventory.ManageClusterLifecyle", "Host.Inventory.MoveCluster", "Host.Inventory.MoveHost", "Host.Inventory.RemoveHostFromCluster", "Host.Inventory.RenameCluster", "Host.Local.CreateVM", "Host.Local.DeleteVM", "Host.Local.InstallAgent", "Host.Local.ReconfigVM", "Host.Sgx.Register", "Host.Stats.Query", "Infraprofile.Read", "Infraprofile.Write", "IntercomNamespace.Read", "IntercomNamespace.Write", "InventoryService.Tagging.AttachTag", "InventoryService.Tagging.CreateCategory", "InventoryService.Tagging.CreateTag", "InventoryService.Tagging.DeleteCategory", "InventoryService.Tagging.DeleteTag", "InventoryService.Tagging.EditCategory", "InventoryService.Tagging.EditTag", "InventoryService.Tagging.ModifyUsedByForCategory", "InventoryService.Tagging.ModifyUsedByForTag", "InventoryService.Tagging.ObjectAttachable", "Namespaces.Backup", "Namespaces.Configure", "Namespaces.ListAccess", "Namespaces.Manage", "Namespaces.ManageCapabilities", "Namespaces.ManageDisks", "Namespaces.SelfServiceManage", "Namespaces.Upgrade", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Nsx.Manage", "Nsx.ModifyAll", "Nsx.Read", "Observability.Admin", "Observability.StatsProvider.Manage", "OvfManager.OvfConsumerAccess", "PartnerRestDaemon.Read", "PartnerRestDaemon.Write", "Performance.ModifyIntervals", "Plugin.Management", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "ReplicationService.Administer", "Resource.ApplyRecommendation", "Resource.AssignVAppToPool", "Resource.AssignVMToPool", "Resource.ColdMigrate", "Resource.CreatePool", "Resource.DeletePool", "Resource.EditPool", "Resource.HotMigrate", "Resource.MovePool", "Resource.QueryVMotion", "Resource.RenamePool", "ScheduledTask.Create", "ScheduledTask.Delete", "ScheduledTask.Edit", "ScheduledTask.Run", "ServiceAccount.Administer", "ServiceAccount.ManageAccount", "ServiceAccount.ManagePassword", "Sessions.CollectPrivilegeChecks", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "SettingsStore.Manage", "StoragePod.Config", "StorageProfile.Apply", "StorageProfile.Update", "StorageProfile.View", "StorageViews.ConfigureService", "StorageViews.View", "SupervisorServices.Install", "SupervisorServices.Manage", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "Task.Update.Task.Update", "TenantManager.Query", "TenantManager.Update", "TokenService.PersistableTokenExchange", "TransferService.Manage", "TransferService.Monitor", "Trust.Administer", "Trust.Manage", "VApp.ApplicationConfig", "VApp.AssignResourcePool", "VApp.AssignVApp", "VApp.AssignVM", "VApp.Clone", "VApp.Create", "VApp.Delete", "VApp.Export", "VApp.ExtractOvfEnvironment", "VApp.Import", "VApp.InstanceConfig", "VApp.ManagedByConfig", "VApp.Move", "VApp.PowerOff", "VApp.PowerOn", "VApp.PullFromUrls", "VApp.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VcIdentityProviders.Create", "VcIdentityProviders.Manage", "VcIdentityProviders.Read", "VcIntegrity.Baseline.com.vmware.vcIntegrity.AssignBaselines", "VcIntegrity.Baseline.com.vmware.vcIntegrity.ManageBaselines", "VcIntegrity.ClusterConfiguration.Export", "VcIntegrity.ClusterConfiguration.Modify", "VcIntegrity.ClusterConfiguration.Remediate", "VcIntegrity.ClusterConfiguration.View", "VcIntegrity.FileUpload.com.vmware.vcIntegrity.ImportFile", "VcIntegrity.General.com.vmware.vcIntegrity.Configure", "VcIntegrity.HardwareCompatibility.Read", "VcIntegrity.HardwareCompatibility.Write", "VcIntegrity.Updates.com.vmware.vcIntegrity.Remediate", "VcIntegrity.Updates.com.vmware.vcIntegrity.Scan", "VcIntegrity.Updates.com.vmware.vcIntegrity.Stage", "VcIntegrity.Updates.com.vmware.vcIntegrity.ViewStatus", "VcIntegrity.lifecycleDepots.Delete", "VcIntegrity.lifecycleGeneral.Read", "VcIntegrity.lifecycleGeneral.Write", "VcIntegrity.lifecycleHealth.Read", "VcIntegrity.lifecycleHealth.Write", "VcIntegrity.lifecycleSettings.Read", "VcIntegrity.lifecycleSettings.Write", "VcIntegrity.lifecycleSoftwareRemediation.Read", "VcIntegrity.lifecycleSoftwareRemediation.Write", "VcIntegrity.lifecycleSoftwareSpecification.Read", "VcIntegrity.lifecycleSoftwareSpecification.Write", "VcIntegrity.systemVM.Read", "VcIntegrity.systemVM.Write", "VcLifecycle.Upgrade", "VcLifecycle.View", "VirtualMachine.Config.AddExistingDisk", "VirtualMachine.Config.AddNewDisk", "VirtualMachine.Config.AddRemoveDevice", "VirtualMachine.Config.AdvancedConfig", "VirtualMachine.Config.Annotation", "VirtualMachine.Config.CPUCount", "VirtualMachine.Config.ChangeTracking", "VirtualMachine.Config.DiskExtend", "VirtualMachine.Config.DiskLease", "VirtualMachine.Config.EditDevice", "VirtualMachine.Config.HostUSBDevice", "VirtualMachine.Config.ManagedBy", "VirtualMachine.Config.Memory", "VirtualMachine.Config.MksControl", "VirtualMachine.Config.QueryFTCompatibility", "VirtualMachine.Config.QueryUnownedFiles", "VirtualMachine.Config.RawDevice", "VirtualMachine.Config.ReloadFromPath", "VirtualMachine.Config.RemoveDisk", "VirtualMachine.Config.Rename", "VirtualMachine.Config.ResetGuestInfo", "VirtualMachine.Config.Resource", "VirtualMachine.Config.Settings", "VirtualMachine.Config.SwapPlacement", "VirtualMachine.Config.ToggleForkParent", "VirtualMachine.Config.UpgradeVirtualHardware", "VirtualMachine.DataSets.DataSetCreate", "VirtualMachine.DataSets.DataSetDelete", "VirtualMachine.DataSets.DataSetEntryDelete", "VirtualMachine.DataSets.DataSetEntryGet", "VirtualMachine.DataSets.DataSetEntryList", "VirtualMachine.DataSets.DataSetEntrySet", "VirtualMachine.DataSets.DataSetGet", "VirtualMachine.DataSets.DataSetList", "VirtualMachine.DataSets.DataSetUpdate", "VirtualMachine.DataSets.Export", "VirtualMachine.GuestOperations.Execute", "VirtualMachine.GuestOperations.Modify", "VirtualMachine.GuestOperations.ModifyAliases", "VirtualMachine.GuestOperations.Query", "VirtualMachine.GuestOperations.QueryAliases", "VirtualMachine.Hbr.ConfigureReplication", "VirtualMachine.Hbr.MonitorReplication", "VirtualMachine.Hbr.ReplicaManagement", "VirtualMachine.Interact.AnswerQuestion", "VirtualMachine.Interact.Backup", "VirtualMachine.Interact.ConsoleInteract", "VirtualMachine.Interact.CreateScreenshot", "VirtualMachine.Interact.CreateSecondary", "VirtualMachine.Interact.DefragmentAllDisks", "VirtualMachine.Interact.DeviceConnection", "VirtualMachine.Interact.DisableSecondary", "VirtualMachine.Interact.DnD", "VirtualMachine.Interact.EnableSecondary", "VirtualMachine.Interact.MakePrimary", "VirtualMachine.Interact.Pause", "VirtualMachine.Interact.PowerOff", "VirtualMachine.Interact.PowerOn", "VirtualMachine.Interact.PutUsbScanCodes", "VirtualMachine.Interact.Record", "VirtualMachine.Interact.Replay", "VirtualMachine.Interact.Reset", "VirtualMachine.Interact.SESparseMaintenance", "VirtualMachine.Interact.SetCDMedia", "VirtualMachine.Interact.SetFloppyMedia", "VirtualMachine.Interact.Suspend", "VirtualMachine.Interact.SuspendToMemory", "VirtualMachine.Interact.TerminateFaultTolerantVM", "VirtualMachine.Interact.ToolsInstall", "VirtualMachine.Interact.TurnOffFaultTolerance", "VirtualMachine.Inventory.Create", "VirtualMachine.Inventory.CreateFromExisting", "VirtualMachine.Inventory.Delete", "VirtualMachine.Inventory.Move", "VirtualMachine.Inventory.Register", "VirtualMachine.Inventory.Unregister", "VirtualMachine.Namespace.Event", "VirtualMachine.Namespace.EventNotify", "VirtualMachine.Namespace.Management", "VirtualMachine.Namespace.ModifyContent", "VirtualMachine.Namespace.Query", "VirtualMachine.Namespace.ReadContent", "VirtualMachine.Provisioning.Clone", "VirtualMachine.Provisioning.CloneTemplate", "VirtualMachine.Provisioning.CreateTemplateFromVM", "VirtualMachine.Provisioning.Customize", "VirtualMachine.Provisioning.DeployTemplate", "VirtualMachine.Provisioning.DiskRandomAccess", "VirtualMachine.Provisioning.DiskRandomRead", "VirtualMachine.Provisioning.FileRandomAccess", "VirtualMachine.Provisioning.GetVmFiles", "VirtualMachine.Provisioning.MarkAsTemplate", "VirtualMachine.Provisioning.MarkAsVM", "VirtualMachine.Provisioning.ModifyCustSpecs", "VirtualMachine.Provisioning.PromoteDisks", "VirtualMachine.Provisioning.PutVmFiles", "VirtualMachine.Provisioning.ReadCustSpecs", "VirtualMachine.State.CreateSnapshot", "VirtualMachine.State.RemoveSnapshot", "VirtualMachine.State.RenameSnapshot", "VirtualMachine.State.RevertToSnapshot", "VirtualMachineClasses.Manage", "VmCam.Administer", "VmResourceProfiles.Manage", "Vsan.Cluster.ShallowRekey", "Vsan.Xvc.UpdateClientInfo", "Zone.Manage", "Zone.ObjectAttachable", "vSANStats.Access", "vService.CreateDependency", "vService.DestroyDependency", "vService.ReconfigureDependency", "vService.UpdateDependency", "vSphereClient.UtilizeVerificationCode", "vSphereDataProtection.Protection", "vSphereDataProtection.Recovery", "vStats.CollectAny", "vStats.QueryAny", "vStats.Settings"}, + }, + { + RoleId: -5, + System: true, + Name: "NoAccess", + Info: &types.Description{ + Label: "No access", + Summary: "Used for restricting granted access", + }, + Privilege: nil, + }, + { + RoleId: -4, + System: true, + Name: "Anonymous", + Info: &types.Description{ + Label: "Anonymous", + Summary: "Not logged-in user (cannot be granted)", + }, + Privilege: []string{"System.Anonymous"}, + }, + { + RoleId: -3, + System: true, + Name: "View", + Info: &types.Description{ + Label: "View", + Summary: "Visibility access (cannot be granted)", + }, + Privilege: []string{"System.Anonymous", "System.View"}, + }, + { + RoleId: -2, + System: true, + Name: "ReadOnly", + Info: &types.Description{ + Label: "Read-only", + Summary: "See details of objects, but not make changes", + }, + Privilege: []string{"System.Anonymous", "System.Read", "System.View"}, + }, + { + RoleId: -1, + System: true, + Name: "Admin", + Info: &types.Description{ + Label: "Administrator", + Summary: "Full access rights", + }, + Privilege: []string{"Alarm.Acknowledge", "Alarm.Create", "Alarm.Delete", "Alarm.DisableActions", "Alarm.Edit", "Alarm.SetStatus", "Alarm.ToggleEnableOnEntity", "Authorization.ModifyPermissions", "Authorization.ModifyPrivileges", "Authorization.ModifyRoles", "Authorization.ModifyVTContainerMappings", "Authorization.ModifyVTContainers", "Authorization.ReassignRolePermissions", "AutoDeploy.Host.AssociateMachine", "AutoDeploy.Profile.Create", "AutoDeploy.Profile.Edit", "AutoDeploy.Rule.Create", "AutoDeploy.Rule.Delete", "AutoDeploy.Rule.Edit", "AutoDeploy.RuleSet.Activate", "AutoDeploy.RuleSet.Edit", "Certificate.Manage", "CertificateAuthority.Administer", "CertificateAuthority.Manage", "CertificateManagement.Administer", "CertificateManagement.Manage", "CertificateManagementSubscriptions.Create", "CertificateManagementSubscriptions.Delete", "CertificateManagementSubscriptions.Update", "Cns.Searchable", "ComputePolicy.Manage", "ContentLibrary.AddCertToTrustStore", "ContentLibrary.AddLibraryItem", "ContentLibrary.AddSubscription", "ContentLibrary.CheckInTemplate", "ContentLibrary.CheckOutTemplate", "ContentLibrary.CreateLocalLibrary", "ContentLibrary.CreateSubscribedLibrary", "ContentLibrary.DeleteCertFromTrustStore", "ContentLibrary.DeleteLibraryItem", "ContentLibrary.DeleteLocalLibrary", "ContentLibrary.DeleteSubscribedLibrary", "ContentLibrary.DeleteSubscription", "ContentLibrary.DownloadSession", "ContentLibrary.EvictLibraryItem", "ContentLibrary.EvictSubscribedLibrary", "ContentLibrary.GetConfiguration", "ContentLibrary.ImportStorage", "ContentLibrary.ManageClusterRegistryResource", "ContentLibrary.ManageRegistry", "ContentLibrary.ManageRegistryProject", "ContentLibrary.MigrateLibrary", "ContentLibrary.ProbeSubscription", "ContentLibrary.PublishLibrary", "ContentLibrary.PublishLibraryItem", "ContentLibrary.ReadStorage", "ContentLibrary.SyncLibrary", "ContentLibrary.SyncLibraryItem", "ContentLibrary.TypeIntrospection", "ContentLibrary.UpdateConfiguration", "ContentLibrary.UpdateLibrary", "ContentLibrary.UpdateLibraryItem", "ContentLibrary.UpdateLocalLibrary", "ContentLibrary.UpdateSession", "ContentLibrary.UpdateSubscribedLibrary", "ContentLibrary.UpdateSubscription", "Cryptographer.Access", "Cryptographer.AddDisk", "Cryptographer.Clone", "Cryptographer.Decrypt", "Cryptographer.Encrypt", "Cryptographer.EncryptNew", "Cryptographer.ManageEncryptionPolicy", "Cryptographer.ManageKeyServers", "Cryptographer.ManageKeys", "Cryptographer.Migrate", "Cryptographer.ReadKeyServersInfo", "Cryptographer.Recrypt", "Cryptographer.RegisterHost", "Cryptographer.RegisterVM", "DVPortgroup.Create", "DVPortgroup.Delete", "DVPortgroup.Modify", "DVPortgroup.PolicyOp", "DVPortgroup.ScopeOp", "DVSwitch.Create", "DVSwitch.Delete", "DVSwitch.HostOp", "DVSwitch.Modify", "DVSwitch.Move", "DVSwitch.PolicyOp", "DVSwitch.PortConfig", "DVSwitch.PortSetting", "DVSwitch.ResourceManagement", "DVSwitch.Vspan", "Datacenter.Create", "Datacenter.Delete", "Datacenter.IpPoolConfig", "Datacenter.IpPoolQueryAllocations", "Datacenter.IpPoolReleaseIp", "Datacenter.Move", "Datacenter.Reconfigure", "Datacenter.Rename", "Datacenter.UpdateCarbonInfo", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.ConfigIOManagement", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "DirectPathProfileManager.Manage", "DrProxy.Host.Configure", "DrProxy.Host.ManageService", "DrProxy.Host.View", "DrProxy.License.Update", "DrProxy.License.View", "DrProxy.Progress.Control", "DrProxy.Vm.Configure", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.ExternalFolderManagement", "Folder.Move", "Folder.Rename", "FoundationLoadBalancers.Manage", "Global.CancelTask", "Global.CapacityPlanning", "Global.Diagnostics", "Global.DisableMethods", "Global.EnableMethods", "Global.GlobalTag", "Global.Health", "Global.Licenses", "Global.LogEvent", "Global.ManageCustomFields", "Global.Proxy", "Global.ScriptAction", "Global.ServiceManagers", "Global.SetCustomField", "Global.Settings", "Global.SystemTag", "Global.VCServer", "GuestDataPublisher.GetData", "HLM.Create", "HLM.Manage", "HealthUpdateProvider.Register", "HealthUpdateProvider.Unregister", "HealthUpdateProvider.Update", "Host.Cim.CimInteraction", "Host.Config.AdvancedConfig", "Host.Config.AuthenticationStore", "Host.Config.AutoStart", "Host.Config.Connection", "Host.Config.DateTime", "Host.Config.Firmware", "Host.Config.GuestStore", "Host.Config.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Nvdimm", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.ProductLocker", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemFirewallRuleSet", "Host.Config.SystemManagement", "Host.Entropy.Read", "Host.Entropy.Write", "Host.Hbr.HbrDaemonManagement", "Host.Hbr.HbrManagement", "Host.Inventory.AddHostToCluster", "Host.Inventory.AddStandaloneHost", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "Host.Inventory.ManageClusterLifecyle", "Host.Inventory.MoveCluster", "Host.Inventory.MoveHost", "Host.Inventory.RemoveHostFromCluster", "Host.Inventory.RenameCluster", "Host.Local.CreateVM", "Host.Local.DeleteVM", "Host.Local.InstallAgent", "Host.Local.ManageUserGroups", "Host.Local.ReconfigVM", "Host.Sgx.Register", "Host.Stats.Query", "Host.Tpm.Read", "Host.Tpm.Unseal", "Infraprofile.Read", "Infraprofile.Write", "IntercomNamespace.Read", "IntercomNamespace.Write", "InventoryService.Tagging.AttachTag", "InventoryService.Tagging.CreateCategory", "InventoryService.Tagging.CreateTag", "InventoryService.Tagging.DeleteCategory", "InventoryService.Tagging.DeleteTag", "InventoryService.Tagging.EditCategory", "InventoryService.Tagging.EditTag", "InventoryService.Tagging.ModifyUsedByForCategory", "InventoryService.Tagging.ModifyUsedByForTag", "InventoryService.Tagging.ObjectAttachable", "Namespaces.Backup", "Namespaces.Configure", "Namespaces.ListAccess", "Namespaces.Manage", "Namespaces.ManageCapabilities", "Namespaces.ManageDisks", "Namespaces.SelfServiceManage", "Namespaces.Upgrade", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Nsx.Manage", "Nsx.ModifyAll", "Nsx.Read", "Observability.Admin", "Observability.StatsProvider.Manage", "OvfManager.OvfConsumerAccess", "PartnerRestDaemon.Read", "PartnerRestDaemon.Write", "Performance.ModifyIntervals", "Plugin.Management", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "ReplicationService.Administer", "Resource.ApplyRecommendation", "Resource.AssignVAppToPool", "Resource.AssignVMToPool", "Resource.ColdMigrate", "Resource.CreatePool", "Resource.DeletePool", "Resource.EditPool", "Resource.HotMigrate", "Resource.MovePool", "Resource.QueryVMotion", "Resource.RenamePool", "ScheduledTask.Create", "ScheduledTask.Delete", "ScheduledTask.Edit", "ScheduledTask.Run", "ServiceAccount.Administer", "ServiceAccount.ManageAccount", "ServiceAccount.ManagePassword", "Sessions.CollectPrivilegeChecks", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "SettingsStore.Manage", "StoragePod.Config", "StorageProfile.Apply", "StorageProfile.Update", "StorageProfile.View", "StorageViews.ConfigureService", "StorageViews.View", "SupervisorServices.Install", "SupervisorServices.Manage", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "Task.Update.Task.Update", "TenantManager.Query", "TenantManager.Update", "TokenService.PersistableTokenExchange", "TransferService.Manage", "TransferService.Monitor", "Trust.Administer", "Trust.Manage", "TrustedAdmin.ConfigureHostCertificates", "TrustedAdmin.ConfigureHostMetadata", "TrustedAdmin.ConfigureTokenConversionPolicy", "TrustedAdmin.ManageAttestingSSO", "TrustedAdmin.ManageKMSTrust", "TrustedAdmin.ManageTrustedHosts", "TrustedAdmin.ReadAttestingSSO", "TrustedAdmin.ReadKMSTrust", "TrustedAdmin.ReadStsInfo", "TrustedAdmin.ReadTrustedHosts", "TrustedAdmin.RetrieveHostMetadata", "TrustedAdmin.RetrieveTPMHostCertificates", "VApp.ApplicationConfig", "VApp.AssignResourcePool", "VApp.AssignVApp", "VApp.AssignVM", "VApp.Clone", "VApp.Create", "VApp.Delete", "VApp.Export", "VApp.ExtractOvfEnvironment", "VApp.Import", "VApp.InstanceConfig", "VApp.ManagedByConfig", "VApp.Move", "VApp.PowerOff", "VApp.PowerOn", "VApp.PullFromUrls", "VApp.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VcIdentityProviders.Create", "VcIdentityProviders.Manage", "VcIdentityProviders.Read", "VcIntegrity.Baseline.com.vmware.vcIntegrity.AssignBaselines", "VcIntegrity.Baseline.com.vmware.vcIntegrity.ManageBaselines", "VcIntegrity.ClusterConfiguration.Export", "VcIntegrity.ClusterConfiguration.Modify", "VcIntegrity.ClusterConfiguration.Remediate", "VcIntegrity.ClusterConfiguration.View", "VcIntegrity.FileUpload.com.vmware.vcIntegrity.ImportFile", "VcIntegrity.General.com.vmware.vcIntegrity.Configure", "VcIntegrity.HardwareCompatibility.Read", "VcIntegrity.HardwareCompatibility.Write", "VcIntegrity.Updates.com.vmware.vcIntegrity.Remediate", "VcIntegrity.Updates.com.vmware.vcIntegrity.Scan", "VcIntegrity.Updates.com.vmware.vcIntegrity.Stage", "VcIntegrity.Updates.com.vmware.vcIntegrity.ViewStatus", "VcIntegrity.lifecycleDepots.Delete", "VcIntegrity.lifecycleGeneral.Read", "VcIntegrity.lifecycleGeneral.Write", "VcIntegrity.lifecycleHealth.Read", "VcIntegrity.lifecycleHealth.Write", "VcIntegrity.lifecycleSettings.Read", "VcIntegrity.lifecycleSettings.Write", "VcIntegrity.lifecycleSoftwareRemediation.Read", "VcIntegrity.lifecycleSoftwareRemediation.Write", "VcIntegrity.lifecycleSoftwareSpecification.Read", "VcIntegrity.lifecycleSoftwareSpecification.Write", "VcIntegrity.systemVM.Read", "VcIntegrity.systemVM.Write", "VcLifecycle.Upgrade", "VcLifecycle.View", "VirtualMachine.Config.AddExistingDisk", "VirtualMachine.Config.AddNewDisk", "VirtualMachine.Config.AddRemoveDevice", "VirtualMachine.Config.AdvancedConfig", "VirtualMachine.Config.Annotation", "VirtualMachine.Config.CPUCount", "VirtualMachine.Config.ChangeTracking", "VirtualMachine.Config.DiskExtend", "VirtualMachine.Config.DiskLease", "VirtualMachine.Config.EditDevice", "VirtualMachine.Config.HostUSBDevice", "VirtualMachine.Config.ManagedBy", "VirtualMachine.Config.Memory", "VirtualMachine.Config.MksControl", "VirtualMachine.Config.QueryFTCompatibility", "VirtualMachine.Config.QueryUnownedFiles", "VirtualMachine.Config.RawDevice", "VirtualMachine.Config.ReloadFromPath", "VirtualMachine.Config.RemoveDisk", "VirtualMachine.Config.Rename", "VirtualMachine.Config.ResetGuestInfo", "VirtualMachine.Config.Resource", "VirtualMachine.Config.Settings", "VirtualMachine.Config.SwapPlacement", "VirtualMachine.Config.ToggleForkParent", "VirtualMachine.Config.UpgradeVirtualHardware", "VirtualMachine.DataSets.DataSetCreate", "VirtualMachine.DataSets.DataSetDelete", "VirtualMachine.DataSets.DataSetEntryDelete", "VirtualMachine.DataSets.DataSetEntryGet", "VirtualMachine.DataSets.DataSetEntryList", "VirtualMachine.DataSets.DataSetEntrySet", "VirtualMachine.DataSets.DataSetGet", "VirtualMachine.DataSets.DataSetList", "VirtualMachine.DataSets.DataSetUpdate", "VirtualMachine.DataSets.Export", "VirtualMachine.GuestOperations.Execute", "VirtualMachine.GuestOperations.Modify", "VirtualMachine.GuestOperations.ModifyAliases", "VirtualMachine.GuestOperations.Query", "VirtualMachine.GuestOperations.QueryAliases", "VirtualMachine.Hbr.ConfigureReplication", "VirtualMachine.Hbr.MonitorReplication", "VirtualMachine.Hbr.ReplicaManagement", "VirtualMachine.Interact.AnswerQuestion", "VirtualMachine.Interact.Backup", "VirtualMachine.Interact.ConsoleInteract", "VirtualMachine.Interact.CreateScreenshot", "VirtualMachine.Interact.CreateSecondary", "VirtualMachine.Interact.DefragmentAllDisks", "VirtualMachine.Interact.DeviceConnection", "VirtualMachine.Interact.DisableSecondary", "VirtualMachine.Interact.DnD", "VirtualMachine.Interact.EnableSecondary", "VirtualMachine.Interact.GuestControl", "VirtualMachine.Interact.MakePrimary", "VirtualMachine.Interact.Pause", "VirtualMachine.Interact.PowerOff", "VirtualMachine.Interact.PowerOn", "VirtualMachine.Interact.PutUsbScanCodes", "VirtualMachine.Interact.Record", "VirtualMachine.Interact.Replay", "VirtualMachine.Interact.Reset", "VirtualMachine.Interact.SESparseMaintenance", "VirtualMachine.Interact.SetCDMedia", "VirtualMachine.Interact.SetFloppyMedia", "VirtualMachine.Interact.Suspend", "VirtualMachine.Interact.SuspendToMemory", "VirtualMachine.Interact.TerminateFaultTolerantVM", "VirtualMachine.Interact.ToolsInstall", "VirtualMachine.Interact.TurnOffFaultTolerance", "VirtualMachine.Inventory.Create", "VirtualMachine.Inventory.CreateFromExisting", "VirtualMachine.Inventory.Delete", "VirtualMachine.Inventory.Move", "VirtualMachine.Inventory.Register", "VirtualMachine.Inventory.Unregister", "VirtualMachine.Namespace.Event", "VirtualMachine.Namespace.EventNotify", "VirtualMachine.Namespace.Management", "VirtualMachine.Namespace.ModifyContent", "VirtualMachine.Namespace.Query", "VirtualMachine.Namespace.ReadContent", "VirtualMachine.Provisioning.Clone", "VirtualMachine.Provisioning.CloneTemplate", "VirtualMachine.Provisioning.CreateTemplateFromVM", "VirtualMachine.Provisioning.Customize", "VirtualMachine.Provisioning.DeployTemplate", "VirtualMachine.Provisioning.DiskRandomAccess", "VirtualMachine.Provisioning.DiskRandomRead", "VirtualMachine.Provisioning.FileRandomAccess", "VirtualMachine.Provisioning.GetVmFiles", "VirtualMachine.Provisioning.MarkAsTemplate", "VirtualMachine.Provisioning.MarkAsVM", "VirtualMachine.Provisioning.ModifyCustSpecs", "VirtualMachine.Provisioning.PromoteDisks", "VirtualMachine.Provisioning.PutVmFiles", "VirtualMachine.Provisioning.ReadCustSpecs", "VirtualMachine.State.CreateSnapshot", "VirtualMachine.State.RemoveSnapshot", "VirtualMachine.State.RenameSnapshot", "VirtualMachine.State.RevertToSnapshot", "VirtualMachineClasses.Manage", "VmCam.Administer", "VmResourceProfiles.Manage", "Vsan.Cluster.ShallowRekey", "Vsan.Xvc.UpdateClientInfo", "Zone.Manage", "Zone.ObjectAttachable", "vSANStats.Access", "vService.CreateDependency", "vService.DestroyDependency", "vService.ReconfigureDependency", "vService.UpdateDependency", "vSphereClient.UtilizeVerificationCode", "vSphereDataProtection.Protection", "vSphereDataProtection.Recovery", "vStats.CollectAny", "vStats.QueryAny", "vStats.Settings"}, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/command_info.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/command_info.go new file mode 100644 index 000000000..1c9a3369c --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/command_info.go @@ -0,0 +1,663 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "github.com/vmware/govmomi/cli/esx" +) + +// CommandInfo generated via `govc host.esxcli.model -c -dump` +var CommandInfo = []esx.CommandInfo{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "hardware.clock", DisplayName: "clock", Help: "Interaction with the hardware clock."}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Display the current hardware clock time."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "Set the hardware clock time. Any missing parameters will default to the current time."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "day", DisplayName: "day", Help: "Day"}, + Aliases: []string{"-d", "--day"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "hour", DisplayName: "hour", Help: "Hour"}, + Aliases: []string{"-H", "--hour"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "min", DisplayName: "min", Help: "Minute"}, + Aliases: []string{"-m", "--min"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "month", DisplayName: "month", Help: "Month"}, + Aliases: []string{"-M", "--month"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "sec", DisplayName: "sec", Help: "Second"}, + Aliases: []string{"-s", "--sec"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "year", DisplayName: "year", Help: "Year"}, + Aliases: []string{"-y", "--year"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "hardware.platform", DisplayName: "platform", Help: "Platform information."}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Get information about the platform"}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "fields:PlatformGet", Value: "UUID,Product Name,Vendor Name,Serial Number,Enclosure Serial Number,BIOS Asset Tag,IPMI Supported"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:PlatformGet", Value: "Platform Information"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "iscsi.software", DisplayName: "software", Help: "Operations that can be performed on software iSCSI"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Software iSCSI information."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "Enable or disable software iSCSI."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "enabled", DisplayName: "enabled", Help: "Enable or disable the module."}, + Aliases: []string{"-e", "--enabled"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "name", DisplayName: "name", Help: "The iSCSI initiator name.\nThe initiator name must not be specified when disabling software iSCSI."}, + Aliases: []string{"-n", "--name"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "network.firewall", DisplayName: "firewall", Help: "A set of commands for firewall related operations"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Get the firewall status."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "load", DisplayName: "load", Help: "Load firewall module and rulesets configuration."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "refresh", DisplayName: "refresh", Help: "Load ruleset configuration for firewall."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "Set firewall enabled status and default action."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "defaultaction", DisplayName: "default-action", Help: "Set to true to set defaultaction PASS, set to false to DROP."}, + Aliases: []string{"-d", "--default-action"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "enabled", DisplayName: "enabled", Help: "Set to true to enable the firewall, set to false to disable the firewall."}, + Aliases: []string{"-e", "--enabled"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "unload", DisplayName: "unload", Help: "Allow unload firewall module."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "network.ip.connection", DisplayName: "connection", Help: "List active tcpip connections"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "list", DisplayName: "list", Help: "List active TCP/IP connections"}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "netstack", DisplayName: "netstack", Help: "The network stack instance; if unspecified, use the default netstack instance"}, + Aliases: []string{"-N", "--netstack"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "type", DisplayName: "type", Help: "Connection type: [ip, tcp, udp, all]"}, + Aliases: []string{"-t", "--type"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:IpConnection", Value: "Proto,Recv Q,Send Q,Local Address,Foreign Address,State,World ID,CC Algo,World Name"}, + {Key: "formatter", Value: "table"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "network.nic.ring.current", DisplayName: "current", Help: "Commands to access current NIC RX/TX ring buffer parameters"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Get current RX/TX ring buffer parameters of a NIC"}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "nicname", DisplayName: "nic-name", Help: "The name of the NIC whose current RX/TX ring buffer parameters should be retrieved."}, + Aliases: []string{"-n", "--nic-name"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:RingInfo", Value: "RX,RX Mini,RX Jumbo,TX"}, + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "Set current RX/TX ring buffer parameters of a NIC"}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "nicname", DisplayName: "nic-name", Help: "The name of the NIC whose current RX/TX ring buffer parameters should be set."}, + Aliases: []string{"-n", "--nic-name"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "rx", DisplayName: "rx", Help: "Number of ring entries for the RX ring."}, + Aliases: []string{"-r", "--rx"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "rxjumbo", DisplayName: "rx-jumbo", Help: "Number of ring entries for the RX jumbo ring."}, + Aliases: []string{"-j", "--rx-jumbo"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "rxmini", DisplayName: "rx-mini", Help: "Number of ring entries for the RX mini ring."}, + Aliases: []string{"-m", "--rx-mini"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "tx", DisplayName: "tx", Help: "Number of ring entries for the TX ring."}, + Aliases: []string{"-t", "--tx"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "network.nic.ring.preset", DisplayName: "preset", Help: "Commands to access preset maximums for NIC RX/TX ring buffer parameters."}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Get preset maximums for RX/TX ring buffer parameters of a NIC."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "nicname", DisplayName: "nic-name", Help: "The name of the NIC whose preset maximums for RX/TX ring buffer parameters should be retrieved."}, + Aliases: []string{"-n", "--nic-name"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:RingInfo", Value: "Max RX,Max RX Mini,Max RX Jumbo,Max TX"}, + {Key: "formatter", Value: "simple"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "network.vm", DisplayName: "vm", Help: "A set of commands for VM related operations"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "list", DisplayName: "list", Help: "List networking information for the VM's that have active ports."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "fields:VM", Value: "World ID,Name,Num Ports,Networks"}, + {Key: "formatter", Value: "table"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "software.vib", DisplayName: "vib", Help: "Install, update, remove, or display individual VIB packages"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Displays detailed information about one or more installed VIBs on the host and the managed DPU(s)."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "rebootingimage", DisplayName: "rebooting-image", Help: "Displays information for the ESXi image which becomes active after a reboot, or nothing if the pending-reboot image has not been created yet. If not specified, information from the current ESXi image in memory will be returned."}, + Aliases: []string{"--rebooting-image"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "vibname", DisplayName: "vibname", Help: "Specifies one or more installed VIBs to display more information about. If this option is not specified, then all of the installed VIBs will be displayed. Must be one of the following forms: name, name:version, vendor:name, or vendor:name:version."}, + Aliases: []string{"-n", "--vibname"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:VIBExt", Value: "Name,Version,Type,Vendor,Acceptance Level,Summary,Description,ReferenceURLs,Creation Date,Depends,Conflicts,Replaces,Provides,Maintenance Mode Required,Hardware Platforms Required,Live Install Allowed,Live Remove Allowed,Stateless Ready,Overlay,Tags,Payloads,Platforms"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:VIBExt", Value: "%ID%"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "install", DisplayName: "install", Help: "Installs VIB packages from a URL or depot. VIBs may be installed, upgraded, or downgraded. WARNING: If your installation requires a reboot, you need to disable HA first."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "depot", DisplayName: "depot", Help: "Specifies full remote URLs of the depot index.xml or server file path pointing to an offline bundle .zip file."}, + Aliases: []string{"-d", "--depot"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "dryrun", DisplayName: "dry-run", Help: "Performs a dry-run only. Report the VIB-level operations that would be performed, but do not change anything in the system."}, + Aliases: []string{"--dry-run"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "force", DisplayName: "force", Help: "Bypasses checks for package dependencies, conflicts, obsolescence, and acceptance levels. Really not recommended unless you know what you are doing. Use of this option will result in a warning being displayed in vSphere Web Client. Use this option only when instructed to do so by VMware Technical Support."}, + Aliases: []string{"-f", "--force"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "maintenancemode", DisplayName: "maintenance-mode", Help: "Pretends that maintenance mode is in effect. Otherwise, installation will stop for live installs that require maintenance mode. This flag has no effect for reboot required remediations."}, + Aliases: []string{"--maintenance-mode"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "noliveinstall", DisplayName: "no-live-install", Help: "Forces an install to /altbootbank even if the VIBs are eligible for live installation or removal. Will cause installation to be skipped on PXE-booted hosts."}, + Aliases: []string{"--no-live-install"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "nosigcheck", DisplayName: "no-sig-check", Help: "Bypasses acceptance level verification, including signing. Use of this option poses a large security risk and will result in a SECURITY ALERT warning being displayed in vSphere Web Client."}, + Aliases: []string{"--no-sig-check"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "proxy", DisplayName: "proxy", Help: "Specifies a proxy server to use for HTTP, FTP, and HTTPS connections. The format is proxy-url:port."}, + Aliases: []string{"--proxy"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "vibname", DisplayName: "vibname", Help: "Specifies VIBs from a depot, using one of the following forms: name, name:version, vendor:name, or vendor:name:version."}, + Aliases: []string{"-n", "--vibname"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "viburl", DisplayName: "viburl", Help: "Specifies one or more URLs to VIB packages to install. http:, https:, ftp:, and file: are all supported. If 'file:' is used, then the file path must be an absolute path on the ESXi host."}, + Aliases: []string{"-v", "--viburl"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:DpuInstallationResult", Value: "DPU ID,Message,VIBs Installed,VIBs Removed,VIBs Skipped"}, + {Key: "fields:InstallationResult", Value: "Message,VIBs Installed,VIBs Removed,VIBs Skipped,Reboot Required,DPU Results"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:InstallationResult", Value: "Installation Result"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "list", DisplayName: "list", Help: "Lists the installed VIB packages on the host and the managed DPU(s)."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "rebootingimage", DisplayName: "rebooting-image", Help: "Displays information for the ESXi image which becomes active after a reboot, or nothing if the pending-reboot image has not been created yet. If not specified, information from the current ESXi image in memory will be returned."}, + Aliases: []string{"--rebooting-image"}, + Flag: true, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:VIBSummaryExt", Value: "Name,Version,Vendor,Acceptance Level,Install Date,Platforms"}, + {Key: "formatter", Value: "table"}, + {Key: "header:VIBSummaryExt", Value: "%ID%"}, + {Key: "show-header", Value: "true"}, + {Key: "table-columns", Value: "Name,Version,Vendor,Acceptance Level,Install Date,Platforms"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "remove", DisplayName: "remove", Help: "Removes VIB packages from the host. WARNING: If your installation requires a reboot, you need to disable HA first."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "dryrun", DisplayName: "dry-run", Help: "Performs a dry-run only. Report the VIB-level operations that would be performed, but do not change anything in the system."}, + Aliases: []string{"--dry-run"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "force", DisplayName: "force", Help: "Bypasses checks for package dependencies, conflicts, obsolescence, and acceptance levels. Really not recommended unless you know what you are doing. Use of this option will result in a warning being displayed in vSphere Web Client. Use this option only when instructed to do so by VMware Technical Support."}, + Aliases: []string{"-f", "--force"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "maintenancemode", DisplayName: "maintenance-mode", Help: "Pretends that maintenance mode is in effect. Otherwise, remove will stop for live removes that require maintenance mode. This flag has no effect for reboot required remediations."}, + Aliases: []string{"--maintenance-mode"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "noliveinstall", DisplayName: "no-live-install", Help: "Forces an remove to /altbootbank even if the VIBs are eligible for live removal. Will cause installation to be skipped on PXE-booted hosts."}, + Aliases: []string{"--no-live-install"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "vibname", DisplayName: "vibname", Help: "Specifies one or more VIBs on the host to remove. Must be one of the following forms: name, name:version, vendor:name, vendor:name:version."}, + Aliases: []string{"-n", "--vibname"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:DpuInstallationResult", Value: "DPU ID,Message,VIBs Installed,VIBs Removed,VIBs Skipped"}, + {Key: "fields:InstallationResult", Value: "Message,VIBs Installed,VIBs Removed,VIBs Skipped,Reboot Required,DPU Results"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:InstallationResult", Value: "Removal Result"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "update", DisplayName: "update", Help: "Update installed VIBs to newer VIB packages. No new VIBs will be installed, only updates. WARNING: If your installation requires a reboot, you need to disable HA first."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "depot", DisplayName: "depot", Help: "Specifies full remote URLs of the depot index.xml or server file path pointing to an offline bundle .zip file."}, + Aliases: []string{"-d", "--depot"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "dryrun", DisplayName: "dry-run", Help: "Performs a dry-run only. Report the VIB-level operations that would be performed, but do not change anything in the system."}, + Aliases: []string{"--dry-run"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "force", DisplayName: "force", Help: "Bypasses checks for package dependencies, conflicts, obsolescence, and acceptance levels. Really not recommended unless you know what you are doing. Use of this option will result in a warning being displayed in vSphere Web Client. Use this option only when instructed to do so by VMware Technical Support."}, + Aliases: []string{"-f", "--force"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "maintenancemode", DisplayName: "maintenance-mode", Help: "Pretends that maintenance mode is in effect. Otherwise, installation will stop for live installs that require maintenance mode. This flag has no effect for reboot required remediations."}, + Aliases: []string{"--maintenance-mode"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "noliveinstall", DisplayName: "no-live-install", Help: "Forces an install to /altbootbank even if the VIBs are eligible for live installation or removal. Will cause installation to be skipped on PXE-booted hosts."}, + Aliases: []string{"--no-live-install"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "nosigcheck", DisplayName: "no-sig-check", Help: "Bypasses acceptance level verification, including signing. Use of this option poses a large security risk and will result in a SECURITY ALERT warning being displayed in vSphere Web Client."}, + Aliases: []string{"--no-sig-check"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "proxy", DisplayName: "proxy", Help: "Specifies a proxy server to use for HTTP, FTP, and HTTPS connections. The format is proxy-url:port."}, + Aliases: []string{"--proxy"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "vibname", DisplayName: "vibname", Help: "Specifies VIBs from a depot, using one of the following forms: name, name:version, vendor:name, or vendor:name:version. VIB packages which are not updates will be skipped."}, + Aliases: []string{"-n", "--vibname"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "viburl", DisplayName: "viburl", Help: "Specifies one or more URLs to VIB packages to update to. http:, https:, ftp:, and file: are all supported. VIB packages which are not updates will be skipped."}, + Aliases: []string{"-v", "--viburl"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:DpuInstallationResult", Value: "DPU ID,Message,VIBs Installed,VIBs Removed,VIBs Skipped"}, + {Key: "fields:InstallationResult", Value: "Message,VIBs Installed,VIBs Removed,VIBs Skipped,Reboot Required,DPU Results"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:InstallationResult", Value: "Installation Result"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "system.hostname", DisplayName: "hostname", Help: "Operations pertaining the network name of the ESX host."}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Get the host, domain or fully qualified name of the ESX host."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "This command allows the user to set the hostname, domain name or fully qualified domain name of the ESX host."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "domain", DisplayName: "domain", Help: "The domain name to set for the ESX host. This option is mutually exclusive with the --fqdn option."}, + Aliases: []string{"-d", "--domain"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "fqdn", DisplayName: "fqdn", Help: "Set the fully qualified domain name of the ESX host."}, + Aliases: []string{"-f", "--fqdn"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "host", DisplayName: "host", Help: "The host name to set for the ESX host. This name should not contain the DNS domain name of the host and can only contain letters, numbers and '-'. NOTE this is not the fully qualified name, that can be set with the --fqdn option. This option is mutually exclusive with the --fqdn option."}, + Aliases: []string{"-H", "--host"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "system.settings.advanced", DisplayName: "advanced", Help: "The advanced settings are a set of VMkernel options that specific configuration settings to be modified. These options are typically in place for specific workarounds or debugging."}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "add", DisplayName: "add", Help: "Add a user defined advanced option to the /UserVars/ advanced option tree."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "description", DisplayName: "description", Help: "Description of the new option."}, + Aliases: []string{"-d", "--description"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "hidden", DisplayName: "hidden", Help: "Whether the option is hidden."}, + Aliases: []string{"-H", "--hidden"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "hostspecific", DisplayName: "host-specific", Help: "This indicates that the value of this option is always unique to a host."}, + Aliases: []string{"-O", "--host-specific"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "impact", DisplayName: "impact", Help: "This specifies the impact on the host when the value of the option is modified: \n maintenance-mode: This indicates that the host must be in maintenance mode before the option value is modified.\n reboot: This indicates that the host must be rebooted for the option value to take effect.\n"}, + Aliases: []string{"-I", "--impact"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "intdefault", DisplayName: "int-default", Help: "The default value of the new option (integer option only, required)."}, + Aliases: []string{"-i", "--int-default"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "max", DisplayName: "max", Help: "The maximum allowed value (integer option only, required)."}, + Aliases: []string{"-M", "--max"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "min", DisplayName: "min", Help: "The minimum allowed value (integer option only, required)."}, + Aliases: []string{"-m", "--min"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "option", DisplayName: "option", Help: "The name of the new option. Valid characters: letters, digits and underscore."}, + Aliases: []string{"-o", "--option"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "stringdefault", DisplayName: "string-default", Help: "The default value of the new option (string option only). An empty string is assumed if not specified."}, + Aliases: []string{"-s", "--string-default"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "type", DisplayName: "type", Help: "The type of the new option. Supported values: \n integer: Advanced option with integer value.\n string: Advanced option with string value.\n"}, + Aliases: []string{"-t", "--type"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "list", DisplayName: "list", Help: "List the advanced options available from the VMkernel."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "delta", DisplayName: "delta", Help: "Only display options whose values differ from their default."}, + Aliases: []string{"-d", "--delta"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "option", DisplayName: "option", Help: "Only get the information for a single VMkernel advanced option."}, + Aliases: []string{"-o", "--option"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "tree", DisplayName: "tree", Help: "Limit the list of advanced option to a specific sub tree."}, + Aliases: []string{"-t", "--tree"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "fields:SettingsAdvancedOption", Value: "Path,Type,Int Value,Default Int Value,Min Value,Max Value,String Value,Default String Value,Valid Characters,Description,Host Specific,Impact"}, + {Key: "formatter", Value: "simple"}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "remove", DisplayName: "remove", Help: "Remove a user defined advanced option from the /UserVars/ advanced option tree."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "option", DisplayName: "option", Help: "The name of the option to remove (without the /UserVars/ prefix as it is implied)."}, + Aliases: []string{"-o", "--option"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "set", DisplayName: "set", Help: "Set the value of an advanced option."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "default", DisplayName: "default", Help: "Reset the option to its default value."}, + Aliases: []string{"-d", "--default"}, + Flag: true, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "intvalue", DisplayName: "int-value", Help: "If the option is an integer value use this option."}, + Aliases: []string{"-i", "--int-value"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "option", DisplayName: "option", Help: "The name of the option to set the value of. Example: \"/Misc/HostName\""}, + Aliases: []string{"-o", "--option"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "stringvalue", DisplayName: "string-value", Help: "If the option is a string use this option."}, + Aliases: []string{"-s", "--string-value"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "system.stats.uptime", DisplayName: "uptime", Help: "System uptime, in microseconds"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "get", DisplayName: "get", Help: "Display the number of microseconds the system has been running."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: "simple"}, + }, + }, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "vm.process", DisplayName: "process", Help: "Operations on running virtual machine processes"}, + Method: []esx.CommandInfoMethod{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "kill", DisplayName: "kill", Help: "Used to forcibly kill Virtual Machines that are stuck and not responding to normal stop operations."}, + Param: []esx.CommandInfoParam{ + { + CommandInfoItem: esx.CommandInfoItem{Name: "type", DisplayName: "type", Help: "The type of kill operation to attempt. There are three types of VM kills that can be attempted: [soft, hard, force]. Users should always attempt 'soft' kills first, which will give the VMX process a chance to shutdown cleanly (like kill or kill -SIGTERM). If that does not work move to 'hard' kills which will shutdown the process immediately (like kill -9 or kill -SIGKILL). 'force' should be used as a last resort attempt to kill the VM. If all three fail then a reboot is required."}, + Aliases: []string{"-t", "--type"}, + Flag: false, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "worldid", DisplayName: "world-id", Help: "The World ID of the Virtual Machine to kill. This can be obtained from the 'vm process list' command"}, + Aliases: []string{"-w", "--world-id"}, + Flag: false, + }, + }, + Hints: esx.CommandInfoHints{ + {Key: "formatter", Value: ""}, + }, + }, + { + CommandInfoItem: esx.CommandInfoItem{Name: "list", DisplayName: "list", Help: "List the virtual machines on this system. This command currently will only list running VMs on the system."}, + Param: nil, + Hints: esx.CommandInfoHints{ + {Key: "fields:VirtualMachine", Value: "World ID,Process ID,VMX Cartel ID,UUID,Display Name,Config File"}, + {Key: "formatter", Value: "simple"}, + {Key: "header:VirtualMachine", Value: "%Display Name%"}, + }, + }, + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go new file mode 100644 index 000000000..412c4c291 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go @@ -0,0 +1,46 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// Datacenter is the default template for Datacenter properties. +// Capture method: +// govc datacenter.info -dump +var Datacenter = mo.Datacenter{ + ManagedEntity: mo.ManagedEntity{ + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Datacenter", Value: "ha-datacenter"}, + Value: nil, + AvailableField: nil, + }, + Parent: (*types.ManagedObjectReference)(nil), + CustomValue: nil, + OverallStatus: "", + ConfigStatus: "", + ConfigIssue: nil, + EffectiveRole: nil, + Permission: nil, + Name: "ha-datacenter", + DisabledMethod: nil, + RecentTask: nil, + DeclaredAlarmState: nil, + TriggeredAlarmState: nil, + AlarmActionsEnabled: (*bool)(nil), + Tag: nil, + }, + VmFolder: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-vm"}, + HostFolder: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-host"}, + DatastoreFolder: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-datastore"}, + NetworkFolder: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-network"}, + Datastore: nil, + Network: []types.ManagedObjectReference{ + {Type: "Network", Value: "HaNetwork-VM Network"}, + }, + Configuration: types.DatacenterConfigInfo{}, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/doc.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/doc.go new file mode 100644 index 000000000..8e977ff5a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/doc.go @@ -0,0 +1,8 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +/* +Package esx contains SOAP responses from an ESX server, captured using `govc ... -dump`. +*/ +package esx diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go new file mode 100644 index 000000000..8fa7e3083 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go @@ -0,0 +1,296 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// EventInfo is the default template for the EventManager description.eventInfo property. +// Capture method: +// govc object.collect -s -dump EventManager:ha-eventmgr description.eventInfo +// The captured list has been manually pruned and FullFormat fields changed to use Go's template variable syntax. +var EventInfo = []types.EventDescriptionEventDetail{ + { + Key: "UserLoginSessionEvent", + Description: "User login", + Category: "info", + FullFormat: "User {{.UserName}}@{{.IpAddress}} logged in as {{.UserAgent}}", + }, + { + Key: "UserLogoutSessionEvent", + Description: "User logout", + Category: "info", + FullFormat: "User {{.UserName}}@{{.IpAddress}} logged out (login time: {{.LoginTime}}, number of API invocations: {{.CallCount}}, user agent: {{.UserAgent}})", + }, + { + Key: "DatacenterCreatedEvent", + Description: "Datacenter created", + Category: "info", + FullFormat: "Created datacenter {{.Datacenter.Name}} in folder {{.Parent.Name}}", + }, + { + Key: "DatastoreFileMovedEvent", + Description: "File or directory moved to datastore", + Category: "info", + FullFormat: "Move of file or directory {{.SourceFile}} from {{.SourceDatastore.Name}} to {{.Datastore.Name}} as {{.TargetFile}}", + }, + { + Key: "DatastoreFileCopiedEvent", + Description: "File or directory copied to datastore", + Category: "info", + FullFormat: "Copy of file or directory {{.SourceFile}} from {{.SourceDatastore.Name}} to {{.Datastore.Name}} as {{.TargetFile}}", + }, + { + Key: "DatastoreFileDeletedEvent", + Description: "File or directory deleted", + Category: "info", + FullFormat: "Deletion of file or directory {{.TargetFile}} from {{.Datastore.Name}} was initiated", + }, + { + Key: "EnteringMaintenanceModeEvent", + Description: "Entering maintenance mode", + Category: "info", + FullFormat: "Host {{.Host.Name}} in {{.Datacenter.Name}} has started to enter maintenance mode", + }, + { + Key: "EnteredMaintenanceModeEvent", + Description: "Entered maintenance mode", + Category: "info", + FullFormat: "Host {{.Host.Name}} in {{.Datacenter.Name}} has entered maintenance mode", + }, + { + Key: "ExitMaintenanceModeEvent", + Description: "Exit maintenance mode", + Category: "info", + FullFormat: "Host {{.Host.Name}} in {{.Datacenter.Name}} has exited maintenance mode", + }, + { + Key: "HostRemovedEvent", + Description: "Host removed", + FullFormat: "Removed host {{.Host.Name}} in {{.Datacenter.Name}}", + Category: "info", + }, + { + Key: "VmSuspendedEvent", + Description: "VM suspended", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is suspended", + }, + { + Key: "VmMigratedEvent", + Description: "VM migrated", + Category: "info", + FullFormat: "Migration of virtual machine {{.Vm.Name}} from {{.SourceHost.Name}}, {{.SourceDatastore.Name}} to {{.Host.Name}}, {{.Ds.Name}} completed", + }, + { + Key: "VmBeingMigratedEvent", + Description: "VM migrating", + Category: "info", + FullFormat: "Relocating {{.Vm.Name}} from {{.Host.Name}, {{.Ds.Name}} in {{.Datacenter.Name}} to {{.DestHost.Name}, {{.DestDatastore.Name}} in {{.DestDatacenter.Name}}", + }, + { + Key: "VmMacAssignedEvent", + Description: "VM MAC assigned", + Category: "info", + FullFormat: "New MAC address ({{.Mac}}) assigned to adapter {{.Adapter}} for {{.Vm.Name}}", + }, + { + Key: "VmRegisteredEvent", + Description: "VM registered", + Category: "info", + FullFormat: "Registered {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmReconfiguredEvent", + Description: "VM reconfigured", + Category: "info", + FullFormat: "Reconfigured {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmGuestRebootEvent", + Description: "Guest reboot", + Category: "info", + FullFormat: "Guest OS reboot for {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmBeingClonedEvent", + Description: "VM being cloned", + Category: "info", + FullFormat: "Cloning {{.Vm.Name}} on host {{.Host.Name}} in {{.Datacenter.Name}} to {{.DestName}} on host {{.DestHost.Name}}", + }, + { + Key: "VmClonedEvent", + Description: "VM cloned", + Category: "info", + FullFormat: "Clone of {{.SourceVm.Name}} completed", + }, + { + Key: "VmBeingDeployedEvent", + Description: "Deploying VM", + Category: "info", + FullFormat: "Deploying {{.Vm.Name}} on host {{.Host.Name}} in {{.Datacenter.Name}} from template {{.SrcTemplate.Name}}", + }, + { + Key: "VmDeployedEvent", + Description: "VM deployed", + Category: "info", + FullFormat: "Template {{.SrcTemplate.Name}} deployed on host {{.Host.Name}}", + }, + { + Key: "VmInstanceUuidAssignedEvent", + Description: "Assign a new instance UUID", + Category: "info", + FullFormat: "Assign a new instance UUID ({{.InstanceUuid}}) to {{.Vm.Name}}", + }, + { + Key: "VmPoweredOnEvent", + Description: "VM powered on", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is powered on", + }, + { + Key: "VmStartingEvent", + Description: "VM starting", + Category: "info", + FullFormat: "{{.Vm.Name}} on host {{.Host.Name}} in {{.Datacenter.Name}} is starting", + }, + { + Key: "VmStoppingEvent", + Description: "VM stopping", + Category: "info", + FullFormat: "{{.Vm.Name}} on host {{.Host.Name}} in {{.Datacenter.Name}} is stopping", + }, + { + Key: "VmSuspendingEvent", + Description: "VM being suspended", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is being suspended", + }, + { + Key: "VmResumingEvent", + Description: "VM resuming", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is resumed", + }, + { + Key: "VmBeingCreatedEvent", + Description: "Creating VM", + Category: "info", + FullFormat: "Creating {{.Vm.Name}} on host {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmCreatedEvent", + Description: "VM created", + Category: "info", + FullFormat: "Created virtual machine {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmRemovedEvent", + Description: "VM removed", + Category: "info", + FullFormat: "Removed {{.Vm.Name}} on {{.Host.Name}} from {{.Datacenter.Name}}", + }, + { + Key: "VmResettingEvent", + Description: "VM resetting", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is reset", + }, + { + Key: "VmGuestShutdownEvent", + Description: "Guest OS shut down", + Category: "info", + FullFormat: "Guest OS shut down for {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmUuidAssignedEvent", + Description: "VM UUID assigned", + Category: "info", + FullFormat: "Assigned new BIOS UUID ({{.Uuid}}) to {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "VmPoweredOffEvent", + Description: "VM powered off", + Category: "info", + FullFormat: "{{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}} is powered off", + }, + { + Key: "VmRelocatedEvent", + Description: "VM relocated", + Category: "info", + FullFormat: "Completed the relocation of the virtual machine", + }, + { + Key: "CustomizationFailed", + Description: "An error occurred during customization", + Category: "info", + FullFormat: "An error occurred during customization on VM {{.Vm.Name}}", + }, + { + Key: "CustomizationStartedEvent", + Description: "Started customization", + Category: "info", + FullFormat: "Started customization of VM {{.Vm.Name}}", + }, + { + Key: "CustomizationSucceeded", + Description: "Customization succeeded", + Category: "info", + FullFormat: "Customization of VM {{.Vm.Name}} succeeded", + }, + { + Key: "DrsVmMigratedEvent", + Description: "DRS VM migrated", + Category: "info", + FullFormat: "DRS migrated {{.Vm.Name}} from {{.SourceHost.Name}} to {{.Host.Name}} in cluster {{.ComputeResource.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "DrsVmPoweredOnEvent", + Description: "DRS VM powered on", + Category: "info", + FullFormat: "DRS powered On {{.Vm.Name}} on {{.Host.Name}} in {{.Datacenter.Name}}", + }, + { + Key: "DvsCreatedEvent", + Description: "vSphere Distributed Switch created", + Category: "info", + FullFormat: "A vSphere Distributed Switch {{.Dvs.Name}} was created in {{.Datacenter.Name}}.", + }, + { + Key: "DvsDestroyedEvent", + Description: "vSphere Distributed Switch deleted", + Category: "info", + FullFormat: "vSphere Distributed Switch {{.Dvs.Name}} in {{.Datacenter.Name}} was deleted.", + }, + { + Key: "DvsReconfiguredEvent", + Description: "vSphere Distributed Switch reconfigured", + Category: "info", + FullFormat: "The vSphere Distributed Switch {{.Dvs.Name}} in {{.Datacenter.Name}} was reconfigured.", + }, + { + Key: "DvsHostJoinedEvent", + Description: "Host joined the vSphere Distributed Switch", + Category: "info", + FullFormat: "The host {{.HostJoined.Name}} joined the vSphere Distributed Switch {{.Dvs.Name}} in {{.Datacenter.Name}}.", + }, + { + Key: "DvsHostLeftEvent", + Description: "Host left vSphere Distributed Switch", + Category: "info", + FullFormat: "The host {{.HostLeft.Name}} left the vSphere Distributed Switch {{.Dvs.Name}} in {{.Datacenter.Name}}.", + }, + { + Key: "DVPortgroupCreatedEvent", + Description: "dvPort group created", + Category: "info", + FullFormat: "dvPort group {{.Net.Name}} in {{.Datacenter.Name}} was added to switch {{.Dvs.Name}}.", + }, + { + Key: "DVPortgroupDestroyedEvent", + Description: "dvPort group deleted", + Category: "info", + FullFormat: "dvPort group {{.Net.Name}} in {{.Datacenter.Name}} was deleted.", + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_capability.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_capability.go new file mode 100644 index 000000000..5f4af9b71 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_capability.go @@ -0,0 +1,12 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// HostCapability captured via `govc object.collect -dump $host capability` +var HostCapability = &types.HostCapability{ + MaxSupportedVmMemory: 25149440, // 25TB since 7.0U1 +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_filesystemvolume.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_filesystemvolume.go new file mode 100644 index 000000000..32e77e290 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_filesystemvolume.go @@ -0,0 +1,132 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/types" +) + +// HostConfigInfo is the default template for the HostSystem config property. +// Capture method: +// govc object.collect -s -dump HostSystem:ha-host config.fileSystemVolume +// - slightly modified for uuids and DiskName +var HostFileSystemVolumeInfo = types.HostFileSystemVolumeInfo{ + VolumeTypeList: []string{"VMFS", "NFS", "NFS41", "vsan", "VVOL", "VFFS", "OTHER", "PMEM"}, + MountInfo: []types.HostFileSystemMountInfo{ + { + MountInfo: types.HostMountInfo{ + Path: "/vmfs/volumes/deadbeef-01234567-89ab-cdef00000003", + AccessMode: "readWrite", + Mounted: types.NewBool(true), + Accessible: types.NewBool(true), + InaccessibleReason: "", + MountFailedReason: "", + }, + Volume: &types.HostVmfsVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "VMFS", + Name: "datastore1", + Capacity: 3.5 * units.TB, + }, + BlockSizeMb: 1, + BlockSize: units.KB, + UnmapGranularity: units.KB, + UnmapPriority: "low", + UnmapBandwidthSpec: (*types.VmfsUnmapBandwidthSpec)(nil), + MaxBlocks: 61 * units.MB, + MajorVersion: 6, + Version: "6.82", + Uuid: "deadbeef-01234567-89ab-cdef00000003", + Extent: []types.HostScsiDiskPartition{ + { + DiskName: "____simulated_volumes_____", + Partition: 8, + }, + }, + VmfsUpgradable: false, + ForceMountedInfo: (*types.HostForceMountedInfo)(nil), + Ssd: types.NewBool(true), + Local: types.NewBool(true), + ScsiDiskType: "", + }, + VStorageSupport: "vStorageUnsupported", + }, + { + MountInfo: types.HostMountInfo{ + Path: "/vmfs/volumes/deadbeef-01234567-89ab-cdef00000002", + AccessMode: "readWrite", + Mounted: types.NewBool(true), + Accessible: types.NewBool(true), + InaccessibleReason: "", + MountFailedReason: "", + }, + Volume: &types.HostVmfsVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "OSDATA-deadbeef-01234567-89ab-cdef00000002", + Capacity: 128 * units.GB, + }, + BlockSizeMb: 1, + BlockSize: units.KB, + UnmapGranularity: 0, + UnmapPriority: "", + UnmapBandwidthSpec: (*types.VmfsUnmapBandwidthSpec)(nil), + MaxBlocks: 256 * units.KB, + MajorVersion: 1, + Version: "1.00", + Uuid: "deadbeef-01234567-89ab-cdef00000002", + Extent: []types.HostScsiDiskPartition{ + { + DiskName: "____simulated_volumes_____", + Partition: 7, + }, + }, + VmfsUpgradable: false, + ForceMountedInfo: (*types.HostForceMountedInfo)(nil), + Ssd: types.NewBool(true), + Local: types.NewBool(true), + ScsiDiskType: "", + }, + VStorageSupport: "vStorageUnsupported", + }, + { + MountInfo: types.HostMountInfo{ + Path: "/vmfs/volumes/deadbeef-01234567-89ab-cdef00000001", + AccessMode: "readOnly", + Mounted: types.NewBool(true), + Accessible: types.NewBool(true), + InaccessibleReason: "", + MountFailedReason: "", + }, + Volume: &types.HostVfatVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "BOOTBANK1", + Capacity: 4 * units.GB, + }, + }, + VStorageSupport: "", + }, + { + MountInfo: types.HostMountInfo{ + Path: "/vmfs/volumes/deadbeef-01234567-89ab-cdef00000000", + AccessMode: "readOnly", + Mounted: types.NewBool(true), + Accessible: types.NewBool(true), + InaccessibleReason: "", + MountFailedReason: "", + }, + Volume: &types.HostVfatVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Type: "OTHER", + Name: "BOOTBANK2", + Capacity: 4 * units.GB, + }, + }, + VStorageSupport: "", + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go new file mode 100644 index 000000000..c68c506c3 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go @@ -0,0 +1,1107 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25/types" +) + +// HostConfigInfo is the default template for the HostSystem config property. +// Capture method: +// govc object.collect -s -dump HostSystem:ha-host config +var HostConfigInfo = types.HostConfigInfo{ + Host: types.ManagedObjectReference{Type: "HostSystem", Value: "ha-host"}, + Product: types.AboutInfo{ + Name: "VMware ESXi", + FullName: "VMware ESXi 8.0.2 build-21997540", + Vendor: "VMware, Inc.", + Version: "8.0.2", + Build: "21997540", + LocaleVersion: "INTL", + LocaleBuild: "000", + OsType: "vmnix-x86", + ProductLineId: "embeddedEsx", + ApiType: "HostAgent", + ApiVersion: "8.0.2.0", + InstanceUuid: "", + LicenseProductName: "VMware ESX Server", + LicenseProductVersion: "8.0.2", + }, + DeploymentInfo: &types.HostDeploymentInfo{ + BootedFromStatelessCache: types.NewBool(false), + }, + HyperThread: &types.HostHyperThreadScheduleInfo{ + Available: false, + Active: false, + Config: true, + }, + ConsoleReservation: (*types.ServiceConsoleReservationInfo)(nil), + VirtualMachineReservation: (*types.VirtualMachineMemoryReservationInfo)(nil), + StorageDevice: &HostStorageDeviceInfo, + FileSystemVolume: &HostFileSystemVolumeInfo, + SystemFile: nil, + Network: &types.HostNetworkInfo{ + Vswitch: []types.HostVirtualSwitch{ + { + Name: "vSwitch0", + Key: "key-vim.host.VirtualSwitch-vSwitch0", + NumPorts: 1536, + NumPortsAvailable: 1530, + Mtu: 1500, + Portgroup: []string{"key-vim.host.PortGroup-VM Network", "key-vim.host.PortGroup-Management Network"}, + Pnic: []string{"key-vim.host.PhysicalNic-vmnic0"}, + Spec: types.HostVirtualSwitchSpec{ + NumPorts: 128, + Bridge: &types.HostVirtualSwitchBondBridge{ + HostVirtualSwitchBridge: types.HostVirtualSwitchBridge{}, + NicDevice: []string{"vmnic0"}, + Beacon: &types.HostVirtualSwitchBeaconConfig{ + Interval: 1, + }, + LinkDiscoveryProtocolConfig: &types.LinkDiscoveryProtocolConfig{ + Protocol: "cdp", + Operation: "listen", + }, + }, + Policy: &types.HostNetworkPolicy{ + Security: &types.HostNetworkSecurityPolicy{ + AllowPromiscuous: types.NewBool(false), + MacChanges: types.NewBool(true), + ForgedTransmits: types.NewBool(true), + }, + NicTeaming: &types.HostNicTeamingPolicy{ + Policy: "loadbalance_srcid", + ReversePolicy: types.NewBool(true), + NotifySwitches: types.NewBool(true), + RollingOrder: types.NewBool(false), + FailureCriteria: &types.HostNicFailureCriteria{ + CheckSpeed: "minimum", + Speed: 10, + CheckDuplex: types.NewBool(false), + FullDuplex: types.NewBool(false), + CheckErrorPercent: types.NewBool(false), + Percentage: 0, + CheckBeacon: types.NewBool(false), + }, + NicOrder: &types.HostNicOrderPolicy{ + ActiveNic: []string{"vmnic0"}, + StandbyNic: nil, + }, + }, + OffloadPolicy: &types.HostNetOffloadCapabilities{ + CsumOffload: types.NewBool(true), + TcpSegmentation: types.NewBool(true), + ZeroCopyXmit: types.NewBool(true), + }, + ShapingPolicy: &types.HostNetworkTrafficShapingPolicy{ + Enabled: types.NewBool(false), + AverageBandwidth: 0, + PeakBandwidth: 0, + BurstSize: 0, + }, + }, + Mtu: 0, + }, + }, + }, + ProxySwitch: nil, + Portgroup: []types.HostPortGroup{ + { + Key: "key-vim.host.PortGroup-VM Network", + Port: nil, + Vswitch: "key-vim.host.VirtualSwitch-vSwitch0", + ComputedPolicy: types.HostNetworkPolicy{ + Security: &types.HostNetworkSecurityPolicy{ + AllowPromiscuous: types.NewBool(false), + MacChanges: types.NewBool(true), + ForgedTransmits: types.NewBool(true), + }, + NicTeaming: &types.HostNicTeamingPolicy{ + Policy: "loadbalance_srcid", + ReversePolicy: types.NewBool(true), + NotifySwitches: types.NewBool(true), + RollingOrder: types.NewBool(false), + FailureCriteria: &types.HostNicFailureCriteria{ + CheckSpeed: "minimum", + Speed: 10, + CheckDuplex: types.NewBool(false), + FullDuplex: types.NewBool(false), + CheckErrorPercent: types.NewBool(false), + Percentage: 0, + CheckBeacon: types.NewBool(false), + }, + NicOrder: &types.HostNicOrderPolicy{ + ActiveNic: []string{"vmnic0"}, + StandbyNic: nil, + }, + }, + OffloadPolicy: &types.HostNetOffloadCapabilities{ + CsumOffload: types.NewBool(true), + TcpSegmentation: types.NewBool(true), + ZeroCopyXmit: types.NewBool(true), + }, + ShapingPolicy: &types.HostNetworkTrafficShapingPolicy{ + Enabled: types.NewBool(false), + AverageBandwidth: 0, + PeakBandwidth: 0, + BurstSize: 0, + }, + }, + Spec: types.HostPortGroupSpec{ + Name: "VM Network", + VlanId: 0, + VswitchName: "vSwitch0", + Policy: types.HostNetworkPolicy{ + Security: &types.HostNetworkSecurityPolicy{}, + NicTeaming: &types.HostNicTeamingPolicy{ + Policy: "", + ReversePolicy: (*bool)(nil), + NotifySwitches: (*bool)(nil), + RollingOrder: (*bool)(nil), + FailureCriteria: &types.HostNicFailureCriteria{}, + NicOrder: (*types.HostNicOrderPolicy)(nil), + }, + OffloadPolicy: &types.HostNetOffloadCapabilities{}, + ShapingPolicy: &types.HostNetworkTrafficShapingPolicy{}, + }, + }, + }, + { + Key: "key-vim.host.PortGroup-Management Network", + Port: []types.HostPortGroupPort{ + { + Key: "key-vim.host.PortGroup.Port-33554436", + Mac: []string{"00:0c:29:81:d8:a0"}, + Type: "host", + }, + }, + Vswitch: "key-vim.host.VirtualSwitch-vSwitch0", + ComputedPolicy: types.HostNetworkPolicy{ + Security: &types.HostNetworkSecurityPolicy{ + AllowPromiscuous: types.NewBool(false), + MacChanges: types.NewBool(true), + ForgedTransmits: types.NewBool(true), + }, + NicTeaming: &types.HostNicTeamingPolicy{ + Policy: "loadbalance_srcid", + ReversePolicy: types.NewBool(true), + NotifySwitches: types.NewBool(true), + RollingOrder: types.NewBool(false), + FailureCriteria: &types.HostNicFailureCriteria{ + CheckSpeed: "minimum", + Speed: 10, + CheckDuplex: types.NewBool(false), + FullDuplex: types.NewBool(false), + CheckErrorPercent: types.NewBool(false), + Percentage: 0, + CheckBeacon: types.NewBool(false), + }, + NicOrder: &types.HostNicOrderPolicy{ + ActiveNic: []string{"vmnic0"}, + StandbyNic: nil, + }, + }, + OffloadPolicy: &types.HostNetOffloadCapabilities{ + CsumOffload: types.NewBool(true), + TcpSegmentation: types.NewBool(true), + ZeroCopyXmit: types.NewBool(true), + }, + ShapingPolicy: &types.HostNetworkTrafficShapingPolicy{ + Enabled: types.NewBool(false), + AverageBandwidth: 0, + PeakBandwidth: 0, + BurstSize: 0, + }, + }, + Spec: types.HostPortGroupSpec{ + Name: "Management Network", + VlanId: 0, + VswitchName: "vSwitch0", + Policy: types.HostNetworkPolicy{ + Security: &types.HostNetworkSecurityPolicy{}, + NicTeaming: &types.HostNicTeamingPolicy{ + Policy: "loadbalance_srcid", + ReversePolicy: (*bool)(nil), + NotifySwitches: types.NewBool(true), + RollingOrder: types.NewBool(false), + FailureCriteria: &types.HostNicFailureCriteria{ + CheckSpeed: "", + Speed: 0, + CheckDuplex: (*bool)(nil), + FullDuplex: (*bool)(nil), + CheckErrorPercent: (*bool)(nil), + Percentage: 0, + CheckBeacon: types.NewBool(false), + }, + NicOrder: &types.HostNicOrderPolicy{ + ActiveNic: []string{"vmnic0"}, + StandbyNic: nil, + }, + }, + OffloadPolicy: &types.HostNetOffloadCapabilities{}, + ShapingPolicy: &types.HostNetworkTrafficShapingPolicy{}, + }, + }, + }, + }, + Pnic: []types.PhysicalNic{ + { + Key: "key-vim.host.PhysicalNic-vmnic0", + Device: "vmnic0", + Pci: "0000:0b:00.0", + Driver: "nvmxnet3", + LinkSpeed: &types.PhysicalNicLinkInfo{ + SpeedMb: 10000, + Duplex: true, + }, + ValidLinkSpecification: []types.PhysicalNicLinkInfo{ + { + SpeedMb: 10000, + Duplex: true, + }, + }, + Spec: types.PhysicalNicSpec{ + Ip: &types.HostIpConfig{}, + LinkSpeed: &types.PhysicalNicLinkInfo{ + SpeedMb: 10000, + Duplex: true, + }, + }, + WakeOnLanSupported: false, + Mac: "00:0c:29:81:d8:a0", + FcoeConfiguration: &types.FcoeConfig{ + PriorityClass: 3, + SourceMac: "00:0c:29:81:d8:a0", + VlanRange: []types.FcoeConfigVlanRange{ + {}, + }, + Capabilities: types.FcoeConfigFcoeCapabilities{ + PriorityClass: false, + SourceMacAddress: false, + VlanRange: true, + }, + FcoeActive: false, + }, + VmDirectPathGen2Supported: types.NewBool(false), + VmDirectPathGen2SupportedMode: "", + ResourcePoolSchedulerAllowed: types.NewBool(true), + ResourcePoolSchedulerDisallowedReason: nil, + AutoNegotiateSupported: types.NewBool(false), + }, + { + Key: "key-vim.host.PhysicalNic-vmnic1", + Device: "vmnic1", + Pci: "0000:13:00.0", + Driver: "nvmxnet3", + LinkSpeed: &types.PhysicalNicLinkInfo{ + SpeedMb: 10000, + Duplex: true, + }, + ValidLinkSpecification: []types.PhysicalNicLinkInfo{ + { + SpeedMb: 10000, + Duplex: true, + }, + }, + Spec: types.PhysicalNicSpec{ + Ip: &types.HostIpConfig{}, + LinkSpeed: &types.PhysicalNicLinkInfo{ + SpeedMb: 10000, + Duplex: true, + }, + }, + WakeOnLanSupported: false, + Mac: "00:0c:29:81:d8:aa", + FcoeConfiguration: &types.FcoeConfig{ + PriorityClass: 3, + SourceMac: "00:0c:29:81:d8:aa", + VlanRange: []types.FcoeConfigVlanRange{ + {}, + }, + Capabilities: types.FcoeConfigFcoeCapabilities{ + PriorityClass: false, + SourceMacAddress: false, + VlanRange: true, + }, + FcoeActive: false, + }, + VmDirectPathGen2Supported: types.NewBool(false), + VmDirectPathGen2SupportedMode: "", + ResourcePoolSchedulerAllowed: types.NewBool(true), + ResourcePoolSchedulerDisallowedReason: nil, + AutoNegotiateSupported: types.NewBool(false), + }, + }, + Vnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "key-vim.host.PortGroup.Port-33554436", + }, + }, + ConsoleVnic: nil, + DnsConfig: &types.HostDnsConfig{ + Dhcp: true, + VirtualNicDevice: "vmk0", + HostName: "localhost", + DomainName: "localdomain", + Address: []string{"8.8.8.8"}, + SearchDomain: []string{"localdomain"}, + }, + IpRouteConfig: &types.HostIpRouteConfig{ + DefaultGateway: "127.0.0.1", + GatewayDevice: "", + IpV6DefaultGateway: "", + IpV6GatewayDevice: "", + }, + ConsoleIpRouteConfig: nil, + RouteTableInfo: &types.HostIpRouteTableInfo{ + IpRoute: []types.HostIpRouteEntry{ + { + Network: "0.0.0.0", + PrefixLength: 0, + Gateway: "127.0.0.1", + DeviceName: "vmk0", + }, + { + Network: "127.0.0.0", + PrefixLength: 8, + Gateway: "0.0.0.0", + DeviceName: "vmk0", + }, + }, + Ipv6Route: nil, + }, + Dhcp: nil, + Nat: nil, + IpV6Enabled: types.NewBool(false), + AtBootIpV6Enabled: types.NewBool(false), + NetStackInstance: []types.HostNetStackInstance{ + { + Key: "vSphereProvisioning", + Name: "", + DnsConfig: &types.HostDnsConfig{}, + IpRouteConfig: &types.HostIpRouteConfig{}, + RequestedMaxNumberOfConnections: 11000, + CongestionControlAlgorithm: "newreno", + IpV6Enabled: types.NewBool(true), + RouteTableConfig: (*types.HostIpRouteTableConfig)(nil), + }, + { + Key: "vmotion", + Name: "", + DnsConfig: &types.HostDnsConfig{}, + IpRouteConfig: &types.HostIpRouteConfig{}, + RequestedMaxNumberOfConnections: 11000, + CongestionControlAlgorithm: "newreno", + IpV6Enabled: types.NewBool(true), + RouteTableConfig: (*types.HostIpRouteTableConfig)(nil), + }, + { + Key: "defaultTcpipStack", + Name: "defaultTcpipStack", + DnsConfig: &types.HostDnsConfig{ + Dhcp: true, + VirtualNicDevice: "vmk0", + HostName: "localhost", + DomainName: "localdomain", + Address: []string{"8.8.8.8"}, + SearchDomain: []string{"localdomain"}, + }, + IpRouteConfig: &types.HostIpRouteConfig{ + DefaultGateway: "127.0.0.1", + GatewayDevice: "", + IpV6DefaultGateway: "", + IpV6GatewayDevice: "", + }, + RequestedMaxNumberOfConnections: 11000, + CongestionControlAlgorithm: "newreno", + IpV6Enabled: types.NewBool(true), + RouteTableConfig: &types.HostIpRouteTableConfig{ + IpRoute: []types.HostIpRouteOp{ + { + ChangeOperation: "ignore", + Route: types.HostIpRouteEntry{ + Network: "0.0.0.0", + PrefixLength: 0, + Gateway: "127.0.0.1", + DeviceName: "vmk0", + }, + }, + { + ChangeOperation: "ignore", + Route: types.HostIpRouteEntry{ + Network: "127.0.0.0", + PrefixLength: 8, + Gateway: "0.0.0.0", + DeviceName: "vmk0", + }, + }, + }, + Ipv6Route: nil, + }, + }, + }, + OpaqueSwitch: nil, + OpaqueNetwork: nil, + }, + Vmotion: &types.HostVMotionInfo{ + NetConfig: &types.HostVMotionNetConfig{ + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "VMotionConfig.vmotion.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: "", + }, + IpConfig: (*types.HostIpConfig)(nil), + }, + VirtualNicManagerInfo: &types.HostVirtualNicManagerInfo{ + NetConfig: []types.VirtualNicManagerNetConfig{ + { + NicType: "faultToleranceLogging", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "faultToleranceLogging.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "management", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk1", + Key: "management.key-vim.host.VirtualNic-vmk1", + Portgroup: "", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "192.168.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:00", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + { + Device: "vmk0", + Key: "management.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: []string{"management.key-vim.host.VirtualNic-vmk0"}, + }, + { + NicType: "vSphereProvisioning", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vSphereProvisioning.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "vSphereReplication", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vSphereReplication.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "vSphereReplicationNFC", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vSphereReplicationNFC.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "vmotion", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vmotion.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "vsan", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vsan.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + { + NicType: "vsanWitness", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "vsanWitness.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:a0", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, + }, + SelectedVnic: nil, + }, + }, + }, + Capabilities: &types.HostNetCapabilities{ + CanSetPhysicalNicLinkSpeed: true, + SupportsNicTeaming: true, + NicTeamingPolicy: []string{"loadbalance_ip", "loadbalance_srcmac", "loadbalance_srcid", "failover_explicit"}, + SupportsVlan: true, + UsesServiceConsoleNic: false, + SupportsNetworkHints: true, + MaxPortGroupsPerVswitch: 0, + VswitchConfigSupported: true, + VnicConfigSupported: true, + IpRouteConfigSupported: true, + DnsConfigSupported: true, + DhcpOnVnicSupported: true, + IpV6Supported: types.NewBool(true), + }, + DatastoreCapabilities: &types.HostDatastoreSystemCapabilities{ + NfsMountCreationRequired: true, + NfsMountCreationSupported: true, + LocalDatastoreSupported: false, + VmfsExtentExpansionSupported: types.NewBool(true), + }, + OffloadCapabilities: &types.HostNetOffloadCapabilities{ + CsumOffload: types.NewBool(true), + TcpSegmentation: types.NewBool(true), + ZeroCopyXmit: types.NewBool(true), + }, + Service: &types.HostServiceInfo{ + Service: []types.HostService{ + { + Key: "DCUI", + Label: "Direct Console UI", + Required: false, + Uninstallable: false, + Running: true, + Ruleset: nil, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "TSM", + Label: "ESXi Shell", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: nil, + Policy: "off", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "TSM-SSH", + Label: "SSH", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: nil, + Policy: "off", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "lbtd", + Label: "Load-Based Teaming Daemon", + Required: false, + Uninstallable: false, + Running: true, + Ruleset: nil, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "lwsmd", + Label: "Active Directory Service", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: nil, + Policy: "off", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "ntpd", + Label: "NTP Daemon", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: []string{"ntpClient"}, + Policy: "off", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "pcscd", + Label: "PC/SC Smart Card Daemon", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: nil, + Policy: "off", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "sfcbd-watchdog", + Label: "CIM Server", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: []string{"CIMHttpServer", "CIMHttpsServer"}, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "snmpd", + Label: "SNMP Server", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: []string{"snmp"}, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "vmsyslogd", + Label: "Syslog Server", + Required: true, + Uninstallable: false, + Running: true, + Ruleset: nil, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "vpxa", + Label: "VMware vCenter Agent", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: []string{"vpxHeartbeats"}, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-base", + Description: "This VIB contains all of the base functionality of vSphere ESXi.", + }, + }, + { + Key: "xorg", + Label: "X.Org Server", + Required: false, + Uninstallable: false, + Running: false, + Ruleset: nil, + Policy: "on", + SourcePackage: &types.HostServiceSourcePackage{ + SourcePackageName: "esx-xserver", + Description: "This VIB contains X Server used for virtual machine 3D hardware acceleration.", + }, + }, + }, + }, + Firewall: &HostFirewallInfo, + AutoStart: &types.HostAutoStartManagerConfig{ + Defaults: &types.AutoStartDefaults{ + Enabled: (*bool)(nil), + StartDelay: 120, + StopDelay: 120, + WaitForHeartbeat: types.NewBool(false), + StopAction: "PowerOff", + }, + PowerInfo: nil, + }, + ActiveDiagnosticPartition: &types.HostDiagnosticPartition{ + StorageType: "directAttached", + DiagnosticType: "singleHost", + Slots: -15, + Id: types.HostScsiDiskPartition{ + DiskName: "mpx.vmhba0:C0:T0:L0", + Partition: 9, + }, + }, + Option: nil, + OptionDef: nil, + Flags: &types.HostFlagInfo{}, + AdminDisabled: (*bool)(nil), + LockdownMode: "lockdownDisabled", + Ipmi: (*types.HostIpmiInfo)(nil), + SslThumbprintInfo: (*types.HostSslThumbprintInfo)(nil), + SslThumbprintData: nil, + Certificate: internal.LocalhostCert, + PciPassthruInfo: nil, + AuthenticationManagerInfo: &types.HostAuthenticationManagerInfo{ + AuthConfig: []types.BaseHostAuthenticationStoreInfo{ + &types.HostLocalAuthenticationInfo{ + HostAuthenticationStoreInfo: types.HostAuthenticationStoreInfo{ + Enabled: true, + }, + }, + &types.HostActiveDirectoryInfo{ + HostDirectoryStoreInfo: types.HostDirectoryStoreInfo{}, + JoinedDomain: "", + TrustedDomain: nil, + DomainMembershipStatus: "", + SmartCardAuthenticationEnabled: types.NewBool(false), + }, + }, + }, + FeatureVersion: nil, + PowerSystemCapability: &types.PowerSystemCapability{ + AvailablePolicy: []types.HostPowerPolicy{ + { + Key: 1, + Name: "PowerPolicy.static.name", + ShortName: "static", + Description: "PowerPolicy.static.description", + }, + { + Key: 2, + Name: "PowerPolicy.dynamic.name", + ShortName: "dynamic", + Description: "PowerPolicy.dynamic.description", + }, + { + Key: 3, + Name: "PowerPolicy.low.name", + ShortName: "low", + Description: "PowerPolicy.low.description", + }, + { + Key: 4, + Name: "PowerPolicy.custom.name", + ShortName: "custom", + Description: "PowerPolicy.custom.description", + }, + }, + }, + PowerSystemInfo: &types.PowerSystemInfo{ + CurrentPolicy: types.HostPowerPolicy{ + Key: 2, + Name: "PowerPolicy.dynamic.name", + ShortName: "dynamic", + Description: "PowerPolicy.dynamic.description", + }, + }, + CacheConfigurationInfo: []types.HostCacheConfigurationInfo{ + { + Key: types.ManagedObjectReference{Type: "Datastore", Value: "5980f676-21a5db76-9eef-000c2981d8a0"}, + SwapSize: 0, + }, + }, + WakeOnLanCapable: types.NewBool(false), + FeatureCapability: nil, + MaskedFeatureCapability: nil, + VFlashConfigInfo: nil, + VsanHostConfig: &types.VsanHostConfigInfo{ + Enabled: types.NewBool(false), + HostSystem: &types.ManagedObjectReference{Type: "HostSystem", Value: "ha-host"}, + ClusterInfo: &types.VsanHostConfigInfoClusterInfo{}, + StorageInfo: &types.VsanHostConfigInfoStorageInfo{ + AutoClaimStorage: types.NewBool(false), + DiskMapping: nil, + DiskMapInfo: nil, + ChecksumEnabled: (*bool)(nil), + }, + NetworkInfo: &types.VsanHostConfigInfoNetworkInfo{}, + FaultDomainInfo: &types.VsanHostFaultDomainInfo{}, + }, + DomainList: nil, + ScriptCheckSum: nil, + HostConfigCheckSum: nil, + GraphicsInfo: nil, + SharedPassthruGpuTypes: nil, + GraphicsConfig: &types.HostGraphicsConfig{ + HostDefaultGraphicsType: "shared", + SharedPassthruAssignmentPolicy: "performance", + DeviceType: nil, + }, + IoFilterInfo: []types.HostIoFilterInfo{ + { + IoFilterInfo: types.IoFilterInfo{ + Id: "VMW_spm_1.0.0", + Name: "spm", + Vendor: "VMW", + Version: "1.0.230", + Type: "datastoreIoControl", + Summary: "VMware Storage I/O Control", + ReleaseDate: "2016-07-21", + }, + Available: true, + }, + { + IoFilterInfo: types.IoFilterInfo{ + Id: "VMW_vmwarevmcrypt_1.0.0", + Name: "vmwarevmcrypt", + Vendor: "VMW", + Version: "1.0.0", + Type: "encryption", + Summary: "VMcrypt IO Filter", + ReleaseDate: "2016-07-21", + }, + Available: true, + }, + }, + SriovDevicePool: nil, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go new file mode 100644 index 000000000..723cfbfe0 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go @@ -0,0 +1,1413 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// HostFirewallInfo is the default template for the HostSystem config.firewall property. +// Capture method: +// govc object.collect -s -dump HostSystem:ha-host config.firewall +var HostFirewallInfo = types.HostFirewallInfo{ + DynamicData: types.DynamicData{}, + DefaultPolicy: types.HostFirewallDefaultPolicy{ + DynamicData: types.DynamicData{}, + IncomingBlocked: types.NewBool(true), + OutgoingBlocked: types.NewBool(true), + }, + Ruleset: []types.HostFirewallRuleset{ + { + DynamicData: types.DynamicData{}, + Key: "CIMHttpServer", + Label: "CIM Server", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 5988, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "sfcbd-watchdog", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "CIMHttpsServer", + Label: "CIM Secure Server", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 5989, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "sfcbd-watchdog", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "CIMSLP", + Label: "CIM SLP", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 427, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 427, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 427, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 427, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "DHCPv6", + Label: "DHCPv6", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 547, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 546, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 547, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 546, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "DVFilter", + Label: "DVFilter", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 2222, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "DVSSync", + Label: "DVSSync", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 8302, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8301, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8301, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8302, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "HBR", + Label: "HBR", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 31031, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 44046, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "NFC", + Label: "NFC", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 902, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 902, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "WOL", + Label: "WOL", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 9, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "activeDirectoryAll", + Label: "Active Directory All", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 88, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 88, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 123, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 137, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 139, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 389, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 389, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 445, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 464, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 464, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 3268, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 7476, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 2020, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "cmmds", + Label: "Virtual SAN Clustering Service", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 12345, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 23451, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 12345, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 23451, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 12321, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 12321, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "dhcp", + Label: "DHCP Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 68, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 68, + EndPort: 0, + Direction: "outbound", + PortType: "src", + Protocol: "udp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "dns", + Label: "DNS Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 53, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 53, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 53, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "esxupdate", + Label: "esxupdate", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 443, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "faultTolerance", + Label: "Fault Tolerance", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 80, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8300, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8300, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "ftpClient", + Label: "FTP Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 21, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 20, + EndPort: 0, + Direction: "inbound", + PortType: "src", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "gdbserver", + Label: "gdbserver", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 1000, + EndPort: 9999, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 50000, + EndPort: 50999, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "httpClient", + Label: "httpClient", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 80, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 443, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "iSCSI", + Label: "Software iSCSI Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 3260, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "iofiltervp", + Label: "iofiltervp", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 9080, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "ipfam", + Label: "NSX Distributed Logical Router Service", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 6999, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 6999, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "nfs41Client", + Label: "nfs41Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "nfsClient", + Label: "NFS Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "ntpClient", + Label: "NTP Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 123, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "ntpd", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "pvrdma", + Label: "pvrdma", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 28250, + EndPort: 28761, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 28250, + EndPort: 28761, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "rabbitmqproxy", + Label: "rabbitmqproxy", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 5671, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "rdt", + Label: "Virtual SAN Transport", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 2233, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 2233, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "remoteSerialPort", + Label: "VM serial port connected over network", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 23, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 1024, + EndPort: 65535, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "snmp", + Label: "SNMP Server", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 161, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "snmpd", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "sshClient", + Label: "SSH Client", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 22, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "sshServer", + Label: "SSH Server", + Required: true, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 22, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "syslog", + Label: "syslog", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 514, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 514, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 1514, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "updateManager", + Label: "vCenter Update Manager", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 80, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 9000, + EndPort: 9100, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vMotion", + Label: "vMotion", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 8000, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8000, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vSPC", + Label: "VM serial port connected to vSPC", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vSphereClient", + Label: "vSphere Web Client", + Required: true, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 902, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 443, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vpxHeartbeats", + Label: "VMware vCenter Agent", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 902, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "vpxa", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vsanEncryption", + Label: "vsanEncryption", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vsanhealth-multicasttest", + Label: "vsanhealth-multicasttest", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 5001, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "udp", + }, + { + DynamicData: types.DynamicData{}, + Port: 5001, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "udp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vsanvp", + Label: "vsanvp", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 8080, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + { + DynamicData: types.DynamicData{}, + Port: 8080, + EndPort: 0, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "vvold", + Label: "vvold", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 0, + EndPort: 65535, + Direction: "outbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: false, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + { + DynamicData: types.DynamicData{}, + Key: "webAccess", + Label: "vSphere Web Access", + Required: false, + Rule: []types.HostFirewallRule{ + { + DynamicData: types.DynamicData{}, + Port: 80, + EndPort: 0, + Direction: "inbound", + PortType: "dst", + Protocol: "tcp", + }, + }, + Service: "", + Enabled: true, + AllowedHosts: &types.HostFirewallRulesetIpList{ + DynamicData: types.DynamicData{}, + IpAddress: nil, + IpNetwork: nil, + AllIp: true, + }, + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go new file mode 100644 index 000000000..d71f6d5f0 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go @@ -0,0 +1,853 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "time" + + "github.com/vmware/govmomi/vim25/types" +) + +// HostHardwareInfo is the default template for the HostSystem hardware property. +// Capture method: +// +// govc object.collect -s -dump HostSystem:ha-host hardware +var HostHardwareInfo = &types.HostHardwareInfo{ + SystemInfo: types.HostSystemInfo{ + Vendor: "VMware, Inc.", + Model: "VMware Virtual Platform", + Uuid: "e88d4d56-9f1e-3ea1-71fa-13a8e1a7fd70", + OtherIdentifyingInfo: []types.HostSystemIdentificationInfo{ + { + IdentifierValue: " No Asset Tag", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + Label: "Asset Tag", + Summary: "Asset tag of the system", + }, + Key: "AssetTag", + }, + }, + { + IdentifierValue: "[MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + Label: "OEM specific string", + Summary: "OEM specific string", + }, + Key: "OemSpecificString", + }, + }, + { + IdentifierValue: "Welcome to the Virtual Machine", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + Label: "OEM specific string", + Summary: "OEM specific string", + }, + Key: "OemSpecificString", + }, + }, + { + IdentifierValue: "VMware-56 4d 8d e8 1e 9f a1 3e-71 fa 13 a8 e1 a7 fd 70", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + Label: "Service tag", + Summary: "Service tag of the system", + }, + Key: "ServiceTag", + }, + }, + }, + }, + CpuPowerManagementInfo: &types.HostCpuPowerManagementInfo{ + CurrentPolicy: "Balanced", + HardwareSupport: "", + }, + CpuInfo: types.HostCpuInfo{ + NumCpuPackages: 2, + NumCpuCores: 2, + NumCpuThreads: 2, + Hz: 3591345000, + }, + CpuPkg: []types.HostCpuPackage{ + { + Index: 0, + Vendor: "intel", + Hz: 3591345000, + BusHz: 115849838, + Description: "Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz", + ThreadId: []int16{0}, + CpuFeature: []types.HostCpuIdInfo{ + { + Level: 0, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:1101", + Ebx: "0111:0101:0110:1110:0110:0101:0100:0111", + Ecx: "0110:1100:0110:0101:0111:0100:0110:1110", + Edx: "0100:1001:0110:0101:0110:1110:0110:1001", + }, + { + Level: 1, + Vendor: "", + Eax: "0000:0000:0000:0010:0000:0110:1101:0111", + Ebx: "0000:0000:0000:0001:0000:1000:0000:0000", + Ecx: "1001:0111:1011:1010:0010:0010:0010:1011", + Edx: "0000:1111:1010:1011:1111:1011:1111:1111", + }, + { + Level: -2147483648, + Vendor: "", + Eax: "1000:0000:0000:0000:0000:0000:0000:1000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + { + Level: -2147483647, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:0000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0001", + Edx: "0010:1000:0001:0000:0000:1000:0000:0000", + }, + { + Level: -2147483640, + Vendor: "", + Eax: "0000:0000:0000:0000:0011:0000:0010:1010", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + }, + }, + { + Index: 1, + Vendor: "intel", + Hz: 3591345000, + BusHz: 115849838, + Description: "Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz", + ThreadId: []int16{1}, + CpuFeature: []types.HostCpuIdInfo{ + { + Level: 0, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:1101", + Ebx: "0111:0101:0110:1110:0110:0101:0100:0111", + Ecx: "0110:1100:0110:0101:0111:0100:0110:1110", + Edx: "0100:1001:0110:0101:0110:1110:0110:1001", + }, + { + Level: 1, + Vendor: "", + Eax: "0000:0000:0000:0010:0000:0110:1101:0111", + Ebx: "0000:0010:0000:0001:0000:1000:0000:0000", + Ecx: "1001:0111:1011:1010:0010:0010:0010:1011", + Edx: "0000:1111:1010:1011:1111:1011:1111:1111", + }, + { + Level: -2147483648, + Vendor: "", + Eax: "1000:0000:0000:0000:0000:0000:0000:1000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + { + Level: -2147483647, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:0000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0001", + Edx: "0010:1000:0001:0000:0000:1000:0000:0000", + }, + { + Level: -2147483640, + Vendor: "", + Eax: "0000:0000:0000:0000:0011:0000:0010:1010", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + }, + }, + }, + MemorySize: 4294430720, + NumaInfo: &types.HostNumaInfo{ + Type: "NUMA", + NumNodes: 1, + NumaNode: []types.HostNumaNode{ + { + TypeId: 0x0, + CpuID: []int16{1, 0}, + MemoryRangeBegin: 4294967296, + MemoryRangeLength: 1073741824, + }, + }, + }, + SmcPresent: types.NewBool(false), + PciDevice: []types.HostPciDevice{ + { + Id: "0000:00:00.0", + ClassId: 1536, + Bus: 0x0, + Slot: 0x0, + Function: 0x0, + VendorId: -32634, + SubVendorId: 5549, + VendorName: "Intel Corporation", + DeviceId: 29072, + SubDeviceId: 6518, + ParentBridge: "", + DeviceName: "Virtual Machine Chipset", + }, + { + Id: "0000:00:01.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x1, + Function: 0x0, + VendorId: -32634, + SubVendorId: 0, + VendorName: "Intel Corporation", + DeviceId: 29073, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "440BX/ZX/DX - 82443BX/ZX/DX AGP bridge", + }, + { + Id: "0000:00:07.0", + ClassId: 1537, + Bus: 0x0, + Slot: 0x7, + Function: 0x0, + VendorId: -32634, + SubVendorId: 5549, + VendorName: "Intel Corporation", + DeviceId: 28944, + SubDeviceId: 6518, + ParentBridge: "", + DeviceName: "Virtual Machine Chipset", + }, + { + Id: "0000:00:07.1", + ClassId: 257, + Bus: 0x0, + Slot: 0x7, + Function: 0x1, + VendorId: -32634, + SubVendorId: 5549, + VendorName: "Intel Corporation", + DeviceId: 28945, + SubDeviceId: 6518, + ParentBridge: "", + DeviceName: "PIIX4 for 430TX/440BX/MX IDE Controller", + }, + { + Id: "0000:00:07.3", + ClassId: 1664, + Bus: 0x0, + Slot: 0x7, + Function: 0x3, + VendorId: -32634, + SubVendorId: 5549, + VendorName: "Intel Corporation", + DeviceId: 28947, + SubDeviceId: 6518, + ParentBridge: "", + DeviceName: "Virtual Machine Chipset", + }, + { + Id: "0000:00:07.7", + ClassId: 2176, + Bus: 0x0, + Slot: 0x7, + Function: 0x7, + VendorId: 5549, + SubVendorId: 5549, + VendorName: "VMware", + DeviceId: 1856, + SubDeviceId: 1856, + ParentBridge: "", + DeviceName: "Virtual Machine Communication Interface", + }, + { + Id: "0000:00:0f.0", + ClassId: 768, + Bus: 0x0, + Slot: 0xf, + Function: 0x0, + VendorId: 5549, + SubVendorId: 5549, + VendorName: "VMware", + DeviceId: 1029, + SubDeviceId: 1029, + ParentBridge: "", + DeviceName: "SVGA II Adapter", + }, + { + Id: "0000:00:11.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x11, + Function: 0x0, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1936, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI bridge", + }, + { + Id: "0000:00:15.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x0, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.1", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x1, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.2", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x2, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.3", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x3, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.4", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x4, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.5", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x5, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.6", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x6, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:15.7", + ClassId: 1540, + Bus: 0x0, + Slot: 0x15, + Function: 0x7, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x0, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.1", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x1, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.2", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x2, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.3", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x3, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.4", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x4, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.5", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x5, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.6", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x6, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:16.7", + ClassId: 1540, + Bus: 0x0, + Slot: 0x16, + Function: 0x7, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x0, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.1", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x1, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.2", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x2, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.3", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x3, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.4", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x4, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.5", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x5, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.6", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x6, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:17.7", + ClassId: 1540, + Bus: 0x0, + Slot: 0x17, + Function: 0x7, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.0", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x0, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.1", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x1, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.2", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x2, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.3", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x3, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.4", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x4, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.5", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x5, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.6", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x6, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:00:18.7", + ClassId: 1540, + Bus: 0x0, + Slot: 0x18, + Function: 0x7, + VendorId: 5549, + SubVendorId: 0, + VendorName: "VMware", + DeviceId: 1952, + SubDeviceId: 0, + ParentBridge: "", + DeviceName: "PCI Express Root Port", + }, + { + Id: "0000:03:00.0", + ClassId: 263, + Bus: 0x3, + Slot: 0x0, + Function: 0x0, + VendorId: 5549, + SubVendorId: 5549, + VendorName: "VMware", + DeviceId: 1984, + SubDeviceId: 1984, + ParentBridge: "0000:00:15.0", + DeviceName: "PVSCSI SCSI Controller", + }, + { + Id: "0000:0b:00.0", + ClassId: 512, + Bus: 0xb, + Slot: 0x0, + Function: 0x0, + VendorId: 5549, + SubVendorId: 5549, + VendorName: "VMware Inc.", + DeviceId: 1968, + SubDeviceId: 1968, + ParentBridge: "0000:00:16.0", + DeviceName: "vmxnet3 Virtual Ethernet Controller", + }, + { + Id: "0000:13:00.0", + ClassId: 512, + Bus: 0x13, + Slot: 0x0, + Function: 0x0, + VendorId: 5549, + SubVendorId: 5549, + VendorName: "VMware Inc.", + DeviceId: 1968, + SubDeviceId: 1968, + ParentBridge: "0000:00:17.0", + DeviceName: "vmxnet3 Virtual Ethernet Controller", + }, + }, + CpuFeature: []types.HostCpuIdInfo{ + { + Level: 0, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:1101", + Ebx: "0111:0101:0110:1110:0110:0101:0100:0111", + Ecx: "0110:1100:0110:0101:0111:0100:0110:1110", + Edx: "0100:1001:0110:0101:0110:1110:0110:1001", + }, + { + Level: 1, + Vendor: "", + Eax: "0000:0000:0000:0010:0000:0110:1101:0111", + Ebx: "0000:0000:0000:0001:0000:1000:0000:0000", + Ecx: "1001:0111:1011:1010:0010:0010:0010:1011", + Edx: "0000:1111:1010:1011:1111:1011:1111:1111", + }, + { + Level: -2147483648, + Vendor: "", + Eax: "1000:0000:0000:0000:0000:0000:0000:1000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + { + Level: -2147483647, + Vendor: "", + Eax: "0000:0000:0000:0000:0000:0000:0000:0000", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0001", + Edx: "0010:1000:0001:0000:0000:1000:0000:0000", + }, + { + Level: -2147483640, + Vendor: "", + Eax: "0000:0000:0000:0000:0011:0000:0010:1010", + Ebx: "0000:0000:0000:0000:0000:0000:0000:0000", + Ecx: "0000:0000:0000:0000:0000:0000:0000:0000", + Edx: "0000:0000:0000:0000:0000:0000:0000:0000", + }, + }, + BiosInfo: &types.HostBIOSInfo{ + BiosVersion: "6.00", + ReleaseDate: nil, + Vendor: "", + MajorRelease: 0, + MinorRelease: 0, + FirmwareMajorRelease: 0, + FirmwareMinorRelease: 0, + }, + ReliableMemoryInfo: &types.HostReliableMemoryInfo{}, +} + +func init() { + date, _ := time.Parse("2006-01-02", "2015-07-02") + + HostHardwareInfo.BiosInfo.ReleaseDate = &date +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go new file mode 100644 index 000000000..885bc490f --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go @@ -0,0 +1,335 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// HostStorageDeviceInfo is the default template for the HostSystem config.storageDevice property. +// Capture method: +// +// govc object.collect -s -dump HostSystem:ha-host config.storageDevice +var HostStorageDeviceInfo = types.HostStorageDeviceInfo{ + HostBusAdapter: []types.BaseHostHostBusAdapter{ + &types.HostParallelScsiHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.ParallelScsiHba-vmhba0", + Device: "vmhba0", + Bus: 3, + Status: "unknown", + Model: "PVSCSI SCSI Controller", + Driver: "pvscsi", + Pci: "0000:03:00.0", + }, + }, + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba1", + Device: "vmhba1", + Bus: 0, + Status: "unknown", + Model: "PIIX4 for 430TX/440BX/MX IDE Controller", + Driver: "vmkata", + Pci: "0000:00:07.1", + }, + }, + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba64", + Device: "vmhba64", + Bus: 0, + Status: "unknown", + Model: "PIIX4 for 430TX/440BX/MX IDE Controller", + Driver: "vmkata", + Pci: "0000:00:07.1", + }, + }, + }, + ScsiLun: []types.BaseScsiLun{ + &types.ScsiLun{ + HostDevice: types.HostDevice{ + DeviceName: "/vmfs/devices/cdrom/mpx.vmhba1:C0:T0:L0", + DeviceType: "cdrom", + }, + Key: "key-vim.host.ScsiLun-0005000000766d686261313a303a30", + Uuid: "0005000000766d686261313a303a30", + Descriptor: []types.ScsiLunDescriptor{ + { + Quality: "lowQuality", + Id: "mpx.vmhba1:C0:T0:L0", + }, + { + Quality: "lowQuality", + Id: "vml.0005000000766d686261313a303a30", + }, + { + Quality: "lowQuality", + Id: "0005000000766d686261313a303a30", + }, + }, + CanonicalName: "mpx.vmhba1:C0:T0:L0", + DisplayName: "Local NECVMWar CD-ROM (mpx.vmhba1:C0:T0:L0)", + LunType: "cdrom", + Vendor: "NECVMWar", + Model: "VMware IDE CDR00", + Revision: "1.00", + ScsiLevel: 5, + SerialNumber: "unavailable", + DurableName: (*types.ScsiLunDurableName)(nil), + AlternateName: []types.ScsiLunDurableName{ + { + Namespace: "GENERIC_VPD", + NamespaceId: 0x5, + Data: []uint8{0x0, 0x0, 0x0, 0x4, 0x0, 0xb0, 0xb1, 0xb2}, + }, + { + Namespace: "GENERIC_VPD", + NamespaceId: 0x5, + Data: []uint8{0x0, 0xb2, 0x0, 0x4, 0x1, 0x60, 0x0, 0x0}, + }, + }, + StandardInquiry: []uint8{0x0, 0x0, 0x6, 0x2, 0x1f, 0x0, 0x0, 0x72}, + QueueDepth: 0, + OperationalState: []string{"ok"}, + Capabilities: &types.ScsiLunCapabilities{}, + VStorageSupport: "vStorageUnsupported", + ProtocolEndpoint: types.NewBool(false), + }, + &types.HostScsiDisk{ + ScsiLun: types.ScsiLun{ + HostDevice: types.HostDevice{ + DeviceName: "/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0", + DeviceType: "disk", + }, + Key: "key-vim.host.ScsiDisk-0000000000766d686261303a303a30", + Uuid: "0000000000766d686261303a303a30", + Descriptor: []types.ScsiLunDescriptor{ + { + Quality: "lowQuality", + Id: "mpx.vmhba0:C0:T0:L0", + }, + { + Quality: "lowQuality", + Id: "vml.0000000000766d686261303a303a30", + }, + { + Quality: "lowQuality", + Id: "0000000000766d686261303a303a30", + }, + }, + CanonicalName: "mpx.vmhba0:C0:T0:L0", + DisplayName: "Local VMware, Disk (mpx.vmhba0:C0:T0:L0)", + LunType: "disk", + Vendor: "VMware, ", + Model: "VMware Virtual S", + Revision: "1.0 ", + ScsiLevel: 2, + SerialNumber: "unavailable", + DurableName: (*types.ScsiLunDurableName)(nil), + AlternateName: []types.ScsiLunDurableName{ + { + Namespace: "GENERIC_VPD", + NamespaceId: 0x5, + Data: []uint8{0x0, 0x0, 0x0, 0x4, 0x0, 0xb0, 0xb1, 0xb2}, + }, + { + Namespace: "GENERIC_VPD", + NamespaceId: 0x5, + Data: []uint8{0x0, 0xb2, 0x0, 0x4, 0x1, 0x60, 0x0, 0x0}, + }, + }, + StandardInquiry: []uint8{0x0, 0x0, 0x6, 0x2, 0x1f, 0x0, 0x0, 0x72}, + QueueDepth: 1024, + OperationalState: []string{"ok"}, + Capabilities: &types.ScsiLunCapabilities{}, + VStorageSupport: "vStorageUnsupported", + ProtocolEndpoint: types.NewBool(false), + }, + Capacity: types.HostDiskDimensionsLba{ + BlockSize: 512, + Block: 67108864, + }, + DevicePath: "/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0", + Ssd: types.NewBool(true), + LocalDisk: types.NewBool(true), + PhysicalLocation: nil, + EmulatedDIXDIFEnabled: types.NewBool(false), + VsanDiskInfo: (*types.VsanHostVsanDiskInfo)(nil), + ScsiDiskType: "native512", + }, + }, + ScsiTopology: &types.HostScsiTopology{ + Adapter: []types.HostScsiTopologyInterface{ + { + Key: "key-vim.host.ScsiTopology.Interface-vmhba0", + Adapter: "key-vim.host.ParallelScsiHba-vmhba0", + Target: []types.HostScsiTopologyTarget{ + { + Key: "key-vim.host.ScsiTopology.Target-vmhba0:0:0", + Target: 0, + Lun: []types.HostScsiTopologyLun{ + { + Key: "key-vim.host.ScsiTopology.Lun-0000000000766d686261303a303a30", + Lun: 0, + ScsiLun: "key-vim.host.ScsiDisk-0000000000766d686261303a303a30", + }, + }, + Transport: &types.HostParallelScsiTargetTransport{}, + }, + }, + }, + { + Key: "key-vim.host.ScsiTopology.Interface-vmhba1", + Adapter: "key-vim.host.BlockHba-vmhba1", + Target: []types.HostScsiTopologyTarget{ + { + Key: "key-vim.host.ScsiTopology.Target-vmhba1:0:0", + Target: 0, + Lun: []types.HostScsiTopologyLun{ + { + Key: "key-vim.host.ScsiTopology.Lun-0005000000766d686261313a303a30", + Lun: 0, + ScsiLun: "key-vim.host.ScsiLun-0005000000766d686261313a303a30", + }, + }, + Transport: &types.HostBlockAdapterTargetTransport{}, + }, + }, + }, + { + Key: "key-vim.host.ScsiTopology.Interface-vmhba64", + Adapter: "key-vim.host.BlockHba-vmhba64", + Target: nil, + }, + }, + }, + MultipathInfo: &types.HostMultipathInfo{ + Lun: []types.HostMultipathInfoLogicalUnit{ + { + Key: "key-vim.host.MultipathInfo.LogicalUnit-0005000000766d686261313a303a30", + Id: "0005000000766d686261313a303a30", + Lun: "key-vim.host.ScsiLun-0005000000766d686261313a303a30", + Path: []types.HostMultipathInfoPath{ + { + Key: "key-vim.host.MultipathInfo.Path-vmhba1:C0:T0:L0", + Name: "vmhba1:C0:T0:L0", + PathState: "active", + State: "active", + IsWorkingPath: types.NewBool(true), + Adapter: "key-vim.host.BlockHba-vmhba1", + Lun: "key-vim.host.MultipathInfo.LogicalUnit-0005000000766d686261313a303a30", + Transport: &types.HostBlockAdapterTargetTransport{}, + }, + }, + Policy: &types.HostMultipathInfoFixedLogicalUnitPolicy{ + HostMultipathInfoLogicalUnitPolicy: types.HostMultipathInfoLogicalUnitPolicy{ + Policy: "VMW_PSP_FIXED", + }, + Prefer: "vmhba1:C0:T0:L0", + }, + StorageArrayTypePolicy: &types.HostMultipathInfoLogicalUnitStorageArrayTypePolicy{ + Policy: "VMW_SATP_LOCAL", + }, + }, + { + Key: "key-vim.host.MultipathInfo.LogicalUnit-0000000000766d686261303a303a30", + Id: "0000000000766d686261303a303a30", + Lun: "key-vim.host.ScsiDisk-0000000000766d686261303a303a30", + Path: []types.HostMultipathInfoPath{ + { + Key: "key-vim.host.MultipathInfo.Path-vmhba0:C0:T0:L0", + Name: "vmhba0:C0:T0:L0", + PathState: "active", + State: "active", + IsWorkingPath: types.NewBool(true), + Adapter: "key-vim.host.ParallelScsiHba-vmhba0", + Lun: "key-vim.host.MultipathInfo.LogicalUnit-0000000000766d686261303a303a30", + Transport: &types.HostParallelScsiTargetTransport{}, + }, + }, + Policy: &types.HostMultipathInfoFixedLogicalUnitPolicy{ + HostMultipathInfoLogicalUnitPolicy: types.HostMultipathInfoLogicalUnitPolicy{ + Policy: "VMW_PSP_FIXED", + }, + Prefer: "vmhba0:C0:T0:L0", + }, + StorageArrayTypePolicy: &types.HostMultipathInfoLogicalUnitStorageArrayTypePolicy{ + Policy: "VMW_SATP_LOCAL", + }, + }, + }, + }, + PlugStoreTopology: &types.HostPlugStoreTopology{ + Adapter: []types.HostPlugStoreTopologyAdapter{ + { + Key: "key-vim.host.PlugStoreTopology.Adapter-vmhba0", + Adapter: "key-vim.host.ParallelScsiHba-vmhba0", + Path: []string{"key-vim.host.PlugStoreTopology.Path-vmhba0:C0:T0:L0"}, + }, + { + Key: "key-vim.host.PlugStoreTopology.Adapter-vmhba1", + Adapter: "key-vim.host.BlockHba-vmhba1", + Path: []string{"key-vim.host.PlugStoreTopology.Path-vmhba1:C0:T0:L0"}, + }, + { + Key: "key-vim.host.PlugStoreTopology.Adapter-vmhba64", + Adapter: "key-vim.host.BlockHba-vmhba64", + Path: nil, + }, + }, + Path: []types.HostPlugStoreTopologyPath{ + { + Key: "key-vim.host.PlugStoreTopology.Path-vmhba0:C0:T0:L0", + Name: "vmhba0:C0:T0:L0", + ChannelNumber: 0, + TargetNumber: 0, + LunNumber: 0, + Adapter: "key-vim.host.PlugStoreTopology.Adapter-vmhba0", + Target: "key-vim.host.PlugStoreTopology.Target-pscsi.0:0", + Device: "key-vim.host.PlugStoreTopology.Device-0000000000766d686261303a303a30", + }, + { + Key: "key-vim.host.PlugStoreTopology.Path-vmhba1:C0:T0:L0", + Name: "vmhba1:C0:T0:L0", + ChannelNumber: 0, + TargetNumber: 0, + LunNumber: 0, + Adapter: "key-vim.host.PlugStoreTopology.Adapter-vmhba1", + Target: "key-vim.host.PlugStoreTopology.Target-ide.0:0", + Device: "key-vim.host.PlugStoreTopology.Device-0005000000766d686261313a303a30", + }, + }, + Target: []types.HostPlugStoreTopologyTarget{ + { + Key: "key-vim.host.PlugStoreTopology.Target-pscsi.0:0", + Transport: &types.HostParallelScsiTargetTransport{}, + }, + { + Key: "key-vim.host.PlugStoreTopology.Target-ide.0:0", + Transport: &types.HostBlockAdapterTargetTransport{}, + }, + }, + Device: []types.HostPlugStoreTopologyDevice{ + { + Key: "key-vim.host.PlugStoreTopology.Device-0005000000766d686261313a303a30", + Lun: "key-vim.host.ScsiLun-0005000000766d686261313a303a30", + Path: []string{"key-vim.host.PlugStoreTopology.Path-vmhba1:C0:T0:L0"}, + }, + { + Key: "key-vim.host.PlugStoreTopology.Device-0000000000766d686261303a303a30", + Lun: "key-vim.host.ScsiDisk-0000000000766d686261303a303a30", + Path: []string{"key-vim.host.PlugStoreTopology.Path-vmhba0:C0:T0:L0"}, + }, + }, + Plugin: []types.HostPlugStoreTopologyPlugin{ + { + Key: "key-vim.host.PlugStoreTopology.Plugin-NMP", + Name: "NMP", + Device: []string{"key-vim.host.PlugStoreTopology.Device-0005000000766d686261313a303a30", "key-vim.host.PlugStoreTopology.Device-0000000000766d686261303a303a30"}, + ClaimedPath: []string{"key-vim.host.PlugStoreTopology.Path-vmhba0:C0:T0:L0", "key-vim.host.PlugStoreTopology.Path-vmhba1:C0:T0:L0"}, + }, + }, + }, + SoftwareInternetScsiEnabled: false, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go new file mode 100644 index 000000000..fe084a948 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go @@ -0,0 +1,1790 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "time" + + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// HostSystem is the default template for HostSystem properties. +// Capture method: +// +// govc host.info -dump +var HostSystem = mo.HostSystem{ + ManagedEntity: mo.ManagedEntity{ + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "HostSystem", Value: "ha-host"}, + Value: nil, + AvailableField: nil, + }, + Parent: &types.ManagedObjectReference{Type: "ComputeResource", Value: "ha-compute-res"}, + CustomValue: nil, + OverallStatus: "", + ConfigStatus: "", + ConfigIssue: nil, + EffectiveRole: nil, + Permission: nil, + Name: "", + DisabledMethod: nil, + RecentTask: nil, + DeclaredAlarmState: nil, + TriggeredAlarmState: nil, + AlarmActionsEnabled: (*bool)(nil), + Tag: nil, + }, + Runtime: types.HostRuntimeInfo{ + DynamicData: types.DynamicData{}, + ConnectionState: "connected", + PowerState: "poweredOn", + StandbyMode: "none", + InMaintenanceMode: false, + BootTime: (*time.Time)(nil), + HealthSystemRuntime: &types.HealthSystemRuntime{ + DynamicData: types.DynamicData{}, + SystemHealthInfo: &types.HostSystemHealthInfo{ + DynamicData: types.DynamicData{}, + NumericSensorInfo: []types.HostNumericSensorInfo{ + { + DynamicData: types.DynamicData{}, + Name: "VMware Rollup Health State", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "system", + }, + { + DynamicData: types.DynamicData{}, + Name: "CPU socket #0 Level-1 Cache is 16384 B", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Processors", + }, + { + DynamicData: types.DynamicData{}, + Name: "CPU socket #0 Level-2 Cache is 0 B", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Processors", + }, + { + DynamicData: types.DynamicData{}, + Name: "CPU socket #1 Level-1 Cache is 16384 B", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Processors", + }, + { + DynamicData: types.DynamicData{}, + Name: "CPU socket #1 Level-2 Cache is 0 B", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Processors", + }, + { + DynamicData: types.DynamicData{}, + Name: "Phoenix Technologies LTD System BIOS 6.00 2014-05-20 00:00:00.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware, Inc. VMware ESXi 6.0.0 build-3634798 2016-03-07 00:00:00.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-ata-piix 2.12-10vmw.600.2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-lsi-mptsas-plugin 1.0.0-1vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-mlx4-core 1.9.7.0-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-lsi-mpt2sas-plugin 1.0.0-4vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-aacraid 1.1.5.1-9vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-via 0.3.3-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-qla4xxx 5.01.03.2-7vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-sata-promise 2.12-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-megaraid-mbox 2.20.5.1-6vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware vsan 6.0.0-2.34.3563498 2016-02-17 17:18:19.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-e1000 8.0.3.1-5vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-serverworks 0.4.3-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-mptspi 4.23.01.00-9vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-nx-nic 5.0.621-5vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware block-cciss 3.6.14-10vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-bnx2x 1.78.80.v60.12-1vmw.600.2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ipmi-ipmi-devintf 39.1-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-mptsas 4.23.01.00-9vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-megaraid2 2.00.4-9vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware nvme 1.0e.0.35-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware esx-xserver 6.0.0-2.34.3634798 2016-03-08 07:39:27.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware nmlx4-en 3.0.0.0-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-hp-hpsa-plugin 1.0.0-1vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-megaraid-sas 6.603.55.00-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-enic 2.1.2.38-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsi-msgpt3 06.255.12.00-8vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-ahci 3.0-22vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-forcedeth 0.61-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-atiixp 0.4.6-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware elxnet 10.2.309.6v-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware esx-dvfilter-generic-fastpath 6.0.0-2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware uhci-usb-uhci 1.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-amd 0.3.10-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-sata-sil24 1.1-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ohci-usb-ohci 1.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-igb 5.0.5.1.1-5vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-pdc2027x 1.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ehci-ehci-hcd 1.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-lsi-lsi-mr3-plugin 1.0.0-2vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-ixgbe 3.7.13.7.14iov-20vmw.600.2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware vsanhealth 6.0.0-3000000.3.0.2.34.3544323 2016-02-12 06:45:30.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-cnic 1.78.76.v60.13-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-sata-svw 2.3-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ipmi-ipmi-msghandler 39.1-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware emulex-esx-elxnetcli 10.2.309.6v-2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-aic79xx 3.1-5vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware qlnativefc 2.0.12.0-5vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-lsi-lsi-msgpt3-plugin 1.0.0-1vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ima-qla4xxx 2.02.18-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-mlx4-en 1.9.7.0-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-e1000e 3.2.2.1-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-tg3 3.131d.v60.4-2vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-hpsa 6.0.0.44-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-bnx2fc 1.78.78.v60.8-1vmw.600.2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware cpu-microcode 6.0.0-2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-fnic 1.5.0.45-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware nmlx4-rdma 3.0.0.0-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-vmxnet3 1.1.3.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lpfc 10.2.309.8-2vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware esx-ui 1.0.0-3617585 2016-03-03 04:52:43.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-cmd64x 0.2.5-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsi-mr3 6.605.08.00-7vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-hpt3x2n 0.3.4-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-sata-nv 3.5-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware misc-cnic-register 1.78.75.v60.7-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware lsu-lsi-megaraid-sas-plugin 1.0.0-2vmw.600.2.34.3634798 2016-03-08 07:39:28.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ata-pata-sil680 0.4.8-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware esx-tboot 6.0.0-2.34.3634798 2016-03-08 07:39:27.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware xhci-xhci 1.0-3vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-ips 7.12.05-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-adp94xx 1.0.8.12-6vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware rste 2.0.2.0088-4vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware ipmi-ipmi-si-drv 39.1-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMWARE mtip32xx-native 3.8.5-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-mpt2sas 19.00.00.00-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware misc-drivers 6.0.0-2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware nmlx4-core 3.0.0.0-1vmw.600.2.34.3634798 2016-03-08 07:38:46.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware sata-sata-sil 2.3-4vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware esx-base 6.0.0-2.34.3634798 2016-03-08 07:39:18.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware scsi-bnx2i 2.78.76.v60.8-1vmw.600.2.34.3634798 2016-03-08 07:38:41.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "VMware net-bnx2 2.2.4f.v60.10-1vmw.600.2.34.3634798 2016-03-08 07:38:45.000", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "e1000 driver 8.0.3.1-NAPI", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + { + DynamicData: types.DynamicData{}, + Name: "e1000 device firmware N/A", + HealthState: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Sensor is operating under normal conditions", + }, + Key: "green", + }, + CurrentReading: 0, + UnitModifier: 0, + BaseUnits: "", + RateUnits: "", + SensorType: "Software Components", + }, + }, + }, + HardwareStatusInfo: &types.HostHardwareStatusInfo{ + DynamicData: types.DynamicData{}, + MemoryStatusInfo: nil, + CpuStatusInfo: []types.BaseHostHardwareElementInfo{ + &types.HostHardwareElementInfo{ + DynamicData: types.DynamicData{}, + Name: "CPU socket #0", + Status: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Physical element is functioning as expected", + }, + Key: "Green", + }, + }, + &types.HostHardwareElementInfo{ + DynamicData: types.DynamicData{}, + Name: "CPU socket #1", + Status: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Green", + Summary: "Physical element is functioning as expected", + }, + Key: "Green", + }, + }, + }, + StorageStatusInfo: nil, + }, + }, + DasHostState: (*types.ClusterDasFdmHostState)(nil), + TpmPcrValues: nil, + VsanRuntimeInfo: &types.VsanHostRuntimeInfo{}, + NetworkRuntimeInfo: &types.HostRuntimeInfoNetworkRuntimeInfo{ + DynamicData: types.DynamicData{}, + NetStackInstanceRuntimeInfo: []types.HostRuntimeInfoNetStackInstanceRuntimeInfo{ + { + DynamicData: types.DynamicData{}, + NetStackInstanceKey: "defaultTcpipStack", + State: "active", + VmknicKeys: []string{"vmk0"}, + MaxNumberOfConnections: 11000, + CurrentIpV6Enabled: types.NewBool(true), + }, + }, + NetworkResourceRuntime: (*types.HostNetworkResourceRuntime)(nil), + }, + VFlashResourceRuntimeInfo: (*types.HostVFlashManagerVFlashResourceRunTimeInfo)(nil), + HostMaxVirtualDiskCapacity: 68169720922112, + }, + Summary: types.HostListSummary{ + DynamicData: types.DynamicData{}, + Host: &types.ManagedObjectReference{Type: "HostSystem", Value: "ha-host"}, + Hardware: &types.HostHardwareSummary{ + DynamicData: types.DynamicData{}, + Vendor: "VMware, Inc.", + Model: "VMware Virtual Platform", + Uuid: "564d2f12-8041-639b-5018-05a835b72eaf", + OtherIdentifyingInfo: []types.HostSystemIdentificationInfo{ + { + DynamicData: types.DynamicData{}, + IdentifierValue: " No Asset Tag", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Asset Tag", + Summary: "Asset tag of the system", + }, + Key: "AssetTag", + }, + }, + { + DynamicData: types.DynamicData{}, + IdentifierValue: "[MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "OEM specific string", + Summary: "OEM specific string", + }, + Key: "OemSpecificString", + }, + }, + { + DynamicData: types.DynamicData{}, + IdentifierValue: "Welcome to the Virtual Machine", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "OEM specific string", + Summary: "OEM specific string", + }, + Key: "OemSpecificString", + }, + }, + { + DynamicData: types.DynamicData{}, + IdentifierValue: "VMware-56 4d 2f 12 80 41 63 9b-50 18 05 a8 35 b7 2e af", + IdentifierType: &types.ElementDescription{ + Description: types.Description{ + DynamicData: types.DynamicData{}, + Label: "Service tag", + Summary: "Service tag of the system", + }, + Key: "ServiceTag", + }, + }, + }, + MemorySize: 4294430720, + CpuModel: "Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz", + CpuMhz: 2294, + NumCpuPkgs: 2, + NumCpuCores: 2, + NumCpuThreads: 2, + NumNics: 1, + NumHBAs: 3, + }, + Runtime: (*types.HostRuntimeInfo)(nil), + Config: types.HostConfigSummary{ + DynamicData: types.DynamicData{}, + Name: "localhost.localdomain", + Port: 902, + SslThumbprint: "", + Product: &HostConfigInfo.Product, + VmotionEnabled: false, + FaultToleranceEnabled: types.NewBool(true), + FeatureVersion: nil, + AgentVmDatastore: (*types.ManagedObjectReference)(nil), + AgentVmNetwork: (*types.ManagedObjectReference)(nil), + }, + QuickStats: types.HostListSummaryQuickStats{ + DynamicData: types.DynamicData{}, + OverallCpuUsage: 67, + OverallMemoryUsage: 1404, + DistributedCpuFairness: 0, + DistributedMemoryFairness: 0, + Uptime: 77229, + }, + OverallStatus: "gray", + RebootRequired: false, + CustomValue: nil, + ManagementServerIp: "127.0.0.1", + MaxEVCModeKey: "", + CurrentEVCModeKey: "", + Gateway: (*types.HostListSummaryGatewaySummary)(nil), + }, + Hardware: (*types.HostHardwareInfo)(nil), + Capability: (*types.HostCapability)(nil), + LicensableResource: types.HostLicensableResourceInfo{ + Resource: []types.KeyAnyValue{ + { + Key: "numCpuPackages", + Value: types.KeyValue{ + Key: "numCpuPackages", + Value: "2", + }, + }, + }, + }, + ConfigManager: types.HostConfigManager{ + DynamicData: types.DynamicData{}, + CpuScheduler: &types.ManagedObjectReference{Type: "HostCpuSchedulerSystem", Value: "cpuSchedulerSystem"}, + DatastoreSystem: &types.ManagedObjectReference{Type: "HostDatastoreSystem", Value: "ha-datastoresystem"}, + MemoryManager: &types.ManagedObjectReference{Type: "HostMemorySystem", Value: "memoryManagerSystem"}, + StorageSystem: &types.ManagedObjectReference{Type: "HostStorageSystem", Value: "storageSystem"}, + NetworkSystem: &types.ManagedObjectReference{Type: "HostNetworkSystem", Value: "networkSystem"}, + VmotionSystem: &types.ManagedObjectReference{Type: "HostVMotionSystem", Value: "ha-vmotion-system"}, + VirtualNicManager: &types.ManagedObjectReference{Type: "HostVirtualNicManager", Value: "ha-vnic-mgr"}, + ServiceSystem: &types.ManagedObjectReference{Type: "HostServiceSystem", Value: "serviceSystem"}, + FirewallSystem: &types.ManagedObjectReference{Type: "HostFirewallSystem", Value: "firewallSystem"}, + AdvancedOption: &types.ManagedObjectReference{Type: "OptionManager", Value: "ha-adv-options"}, + DiagnosticSystem: &types.ManagedObjectReference{Type: "HostDiagnosticSystem", Value: "diagnosticsystem"}, + AutoStartManager: &types.ManagedObjectReference{Type: "HostAutoStartManager", Value: "ha-autostart-mgr"}, + SnmpSystem: &types.ManagedObjectReference{Type: "HostSnmpSystem", Value: "ha-snmp-agent"}, + DateTimeSystem: &types.ManagedObjectReference{Type: "HostDateTimeSystem", Value: "dateTimeSystem"}, + PatchManager: &types.ManagedObjectReference{Type: "HostPatchManager", Value: "ha-host-patch-manager"}, + ImageConfigManager: &types.ManagedObjectReference{Type: "HostImageConfigManager", Value: "ha-image-config-manager"}, + BootDeviceSystem: (*types.ManagedObjectReference)(nil), + FirmwareSystem: &types.ManagedObjectReference{Type: "HostFirmwareSystem", Value: "ha-firmwareSystem"}, + HealthStatusSystem: &types.ManagedObjectReference{Type: "HostHealthStatusSystem", Value: "healthStatusSystem"}, + PciPassthruSystem: &types.ManagedObjectReference{Type: "HostPciPassthruSystem", Value: "ha-pcipassthrusystem"}, + LicenseManager: &types.ManagedObjectReference{Type: "LicenseManager", Value: "ha-license-manager"}, + KernelModuleSystem: &types.ManagedObjectReference{Type: "HostKernelModuleSystem", Value: "kernelModuleSystem"}, + AuthenticationManager: &types.ManagedObjectReference{Type: "HostAuthenticationManager", Value: "ha-auth-manager"}, + PowerSystem: &types.ManagedObjectReference{Type: "HostPowerSystem", Value: "ha-power-system"}, + CacheConfigurationManager: &types.ManagedObjectReference{Type: "HostCacheConfigurationManager", Value: "ha-cache-configuration-manager"}, + EsxAgentHostManager: (*types.ManagedObjectReference)(nil), + IscsiManager: &types.ManagedObjectReference{Type: "IscsiManager", Value: "iscsiManager"}, + VFlashManager: &types.ManagedObjectReference{Type: "HostVFlashManager", Value: "ha-vflash-manager"}, + VsanSystem: &types.ManagedObjectReference{Type: "HostVsanSystem", Value: "vsanSystem"}, + MessageBusProxy: &types.ManagedObjectReference{Type: "MessageBusProxy", Value: "messageBusProxy"}, + UserDirectory: &types.ManagedObjectReference{Type: "UserDirectory", Value: "ha-user-directory"}, + AccountManager: &types.ManagedObjectReference{Type: "HostLocalAccountManager", Value: "ha-localacctmgr"}, + HostAccessManager: &types.ManagedObjectReference{Type: "HostAccessManager", Value: "ha-host-access-manager"}, + GraphicsManager: &types.ManagedObjectReference{Type: "HostGraphicsManager", Value: "ha-graphics-manager"}, + VsanInternalSystem: &types.ManagedObjectReference{Type: "HostVsanInternalSystem", Value: "ha-vsan-internal-system"}, + CertificateManager: &types.ManagedObjectReference{Type: "HostCertificateManager", Value: "ha-certificate-manager"}, + }, + Config: &HostConfigInfo, + Vm: nil, + Datastore: nil, + Network: nil, + DatastoreBrowser: types.ManagedObjectReference{Type: "HostDatastoreBrowser", Value: "ha-host-datastorebrowser"}, + SystemResources: (*types.HostSystemResourceInfo)(nil), +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_vnic_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_vnic_manager.go new file mode 100644 index 000000000..3613c4a05 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/host_vnic_manager.go @@ -0,0 +1,35 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +var VirtualNicManagerNetConfig = []types.VirtualNicManagerNetConfig{ + { + NicType: "management", + MultiSelectAllowed: true, + CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk0", + Key: "management.key-vim.host.VirtualNic-vmk0", + Portgroup: "Management Network", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "127.0.0.1", + SubnetMask: "255.0.0.0", + }, + Mac: "00:0c:29:81:d8:a0", + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + SystemOwned: types.NewBool(false), + }, + }, + }, + SelectedVnic: []string{"management.key-vim.host.VirtualNic-vmk0"}, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go new file mode 100644 index 000000000..41c7497e1 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go @@ -0,0 +1,15060 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// HistoricalInterval is the default template for the PerformanceManager historicalInterval property. +// Capture method: +// +// govc object.collect -s -dump PerformanceManager:ha-perfmgr historicalInterval +var HistoricalInterval = []types.PerfInterval{ + { + Enabled: true, + Key: 1, + Length: 129600, + Name: "PastDay", + SamplingPeriod: 300, + }, +} + +// PerfCounter is the default template for the PerformanceManager perfCounter property. +// Capture method: +// +// govc object.collect -s -dump PerformanceManager:ha-perfmgr perfCounter +var PerfCounter = []types.PerfCounterInfo{ + { + Key: 0, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{1, 2, 3}, + }, + { + Key: 1, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 2, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 3, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 4, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{5, 6, 7}, + }, + { + Key: 5, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 6, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 7, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 8, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reserved capacity", + Summary: "Total CPU capacity reserved by virtual machines", + }, + Key: "reservedCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 9, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "Amount of time spent on system processes on each virtual CPU in the virtual machine", + }, + Key: "system", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 10, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Wait", + Summary: "Total CPU time spent in wait state", + }, + Key: "wait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 11, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ready", + Summary: "Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU during last measurement interval", + }, + Key: "ready", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 12, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Used", + Summary: "Total CPU usage", + }, + Key: "used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 13, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Idle", + Summary: "Total time that the CPU spent in an idle state", + }, + Key: "idle", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 14, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap wait", + Summary: "CPU time spent waiting for swap-in", + }, + Key: "swapwait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 15, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{16, 17, 18}, + }, + { + Key: 16, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 17, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 18, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 19, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{20, 21, 22}, + }, + { + Key: 20, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 21, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 22, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 23, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total capacity", + Summary: "Total CPU capacity reserved by and available for virtual machines", + }, + Key: "totalCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 24, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Latency", + Summary: "Percent of time the virtual machine is unable to run because it is contending for access to the physical CPU(s)", + }, + Key: "latency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 25, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Entitlement", + Summary: "CPU resources devoted by the ESX scheduler", + }, + Key: "entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 26, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Demand", + Summary: "The amount of CPU resources a virtual machine would use if there were no CPU contention or CPU limit", + }, + Key: "demand", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 27, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Co-stop", + Summary: "Time the virtual machine is ready to run, but is unable to run due to co-scheduling constraints", + }, + Key: "costop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 28, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max limited", + Summary: "Time the virtual machine is ready to run, but is not run due to maxing out its CPU limit setting", + }, + Key: "maxlimited", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 29, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overlap", + Summary: "Time the virtual machine was interrupted to perform system services on behalf of itself or other virtual machines", + }, + Key: "overlap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 30, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Run", + Summary: "Time the virtual machine is scheduled to run", + }, + Key: "run", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 31, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Demand-to-entitlement ratio", + Summary: "CPU resource entitlement to CPU demand ratio (in percents)", + }, + Key: "demandEntitlementRatio", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 32, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Readiness", + Summary: "Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU", + }, + Key: "readiness", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65536, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65537, 65538, 65539}, + }, + { + Key: 65537, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65538, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65539, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65540, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65541, 65542, 65543}, + }, + { + Key: 65541, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65542, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65543, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65544, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65545, 65546, 65547}, + }, + { + Key: 65545, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65546, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65547, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65548, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65549, 65550, 65551}, + }, + { + Key: 65549, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65550, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65551, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65552, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65553, 65554, 65555}, + }, + { + Key: 65553, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65554, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65555, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65556, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65557, 65558, 65559}, + }, + { + Key: 65557, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65558, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65559, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65560, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65561, 65562, 65563}, + }, + { + Key: 65561, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65562, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65563, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65568, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65569, 65570, 65571}, + }, + { + Key: 65569, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65570, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65571, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65572, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65573, 65574, 65575}, + }, + { + Key: 65573, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65574, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65575, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65576, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65577, 65578, 65579}, + }, + { + Key: 65577, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65578, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65579, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65580, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Free state", + Summary: "Current memory availability state of ESXi. Possible values are high, clear, soft, hard, low. The state value determines the techniques used for memory reclamation from virtual machines", + }, + Key: "state", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65581, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65582, 65583, 65584}, + }, + { + Key: 65582, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65583, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65584, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65585, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65586, 65587, 65588}, + }, + { + Key: 65586, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65587, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65588, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65589, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation consumed", + Summary: "Memory reservation consumed by powered-on virtual machines", + }, + Key: "reservedCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65590, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65591, 65592, 65593}, + }, + { + Key: 65591, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65592, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65593, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65594, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65595, 65596, 65597}, + }, + { + Key: 65595, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65596, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65597, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65598, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65599, 65600, 65601}, + }, + { + Key: 65599, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65600, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65601, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65602, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65603, 65604, 65605}, + }, + { + Key: 65603, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65604, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65605, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65606, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65607, 65608, 65609}, + }, + { + Key: 65607, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65608, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65609, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65610, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65611, 65612, 65613}, + }, + { + Key: 65611, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65612, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65613, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65614, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65615, 65616, 65617}, + }, + { + Key: 65615, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65616, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65617, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65618, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in rate", + Summary: "Rate at which guest physical memory is swapped in from the swap space", + }, + Key: "swapinRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65619, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out rate", + Summary: "Rate at which guest physical memory is swapped out to the swap space", + }, + Key: "swapoutRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65620, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active write", + Summary: "Amount of guest physical memory that is being actively written by guest. Activeness is estimated by ESXi", + }, + Key: "activewrite", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65621, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compressed", + Summary: "Guest physical memory pages that have undergone memory compression", + }, + Key: "compressed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65622, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compression rate", + Summary: "Rate of guest physical memory page compression by ESXi", + }, + Key: "compressionRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65623, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Decompression rate", + Summary: "Rate of guest physical memory decompression", + }, + Key: "decompressionRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65624, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead reserved", + Summary: "Host physical memory reserved by ESXi, for its data structures, for running the virtual machine", + }, + Key: "overheadMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65625, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total reservation", + Summary: "Total reservation, available and consumed, for powered-on virtual machines", + }, + Key: "totalCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65626, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compressed", + Summary: "Amount of guest physical memory pages compressed by ESXi", + }, + Key: "zipped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65627, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compression saved", + Summary: "Host physical memory, reclaimed from a virtual machine, by memory compression. This value is less than the value of 'Compressed' memory", + }, + Key: "zipSaved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65628, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Page-fault latency", + Summary: "Percentage of time the virtual machine spent waiting to swap in or decompress guest physical memory", + }, + Key: "latency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65629, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Entitlement", + Summary: "Amount of host physical memory the virtual machine deserves, as determined by ESXi", + }, + Key: "entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65630, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reclamation threshold", + Summary: "Threshold of free host physical memory below which ESXi will begin actively reclaiming memory from virtual machines by swapping, compression and ballooning", + }, + Key: "lowfreethreshold", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65631, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65635, 65636, 65637}, + }, + { + Key: 65632, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in rate", + Summary: "Rate at which guest physical memory is swapped in from the host swap cache", + }, + Key: "llSwapInRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65633, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out rate", + Summary: "Rate at which guest physical memory is swapped out to the host swap cache", + }, + Key: "llSwapOutRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65634, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead active", + Summary: "Estimate of the host physical memory, from Overhead consumed, that is actively read or written to by ESXi", + }, + Key: "overheadTouched", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65635, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65636, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65637, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65638, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65639, 65640, 65641}, + }, + { + Key: 65639, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65640, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65641, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65642, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{65643, 65644, 65645}, + }, + { + Key: 65643, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65644, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65645, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65646, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Size", + Summary: "Space used for holding VMFS Pointer Blocks in memory", + }, + Key: "vmfs.pbc.size", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65647, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum VMFS PB Cache Size", + Summary: "Maximum size the VMFS Pointer Block Cache can grow to", + }, + Key: "vmfs.pbc.sizeMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65648, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS Working Set", + Summary: "Amount of file blocks whose addresses are cached in the VMFS PB Cache", + }, + Key: "vmfs.pbc.workingSet", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "TB", + Summary: "Terabyte", + }, + Key: "teraBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65649, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum VMFS Working Set", + Summary: "Maximum amount of file blocks whose addresses are cached in the VMFS PB Cache", + }, + Key: "vmfs.pbc.workingSetMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "TB", + Summary: "Terabyte", + }, + Key: "teraBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65650, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Overhead", + Summary: "Amount of VMFS heap used by the VMFS PB Cache", + }, + Key: "vmfs.pbc.overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 65651, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Capacity Miss Ratio", + Summary: "Trailing average of the ratio of capacity misses to compulsory misses for the VMFS PB Cache", + }, + Key: "vmfs.pbc.capMissRatio", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131072, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{131073, 131074, 131075}, + }, + { + Key: 131073, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131074, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131075, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131076, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read requests", + Summary: "Number of disk reads during the collection interval", + }, + Key: "numberRead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131077, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write requests", + Summary: "Number of disk writes during the collection interval", + }, + Key: "numberWrite", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131078, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Average number of kilobytes read from the disk each second during the collection interval", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131079, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Average number of kilobytes written to disk each second during the collection interval", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131080, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Commands issued", + Summary: "Number of SCSI commands issued during the collection interval", + }, + Key: "commands", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131081, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Commands aborted", + Summary: "Number of SCSI commands aborted during the collection interval", + }, + Key: "commandsAborted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131082, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Bus resets", + Summary: "Number of SCSI-bus reset commands issued during the collection interval", + }, + Key: "busResets", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131083, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device read latency", + Summary: "Average amount of time, in milliseconds, to read from the physical device", + }, + Key: "deviceReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131084, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel read latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI read command", + }, + Key: "kernelReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131085, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI read command issued from the guest OS to the virtual machine", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131086, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue read latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI read command, during the collection interval", + }, + Key: "queueReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131087, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device write latency", + Summary: "Average amount of time, in milliseconds, to write to the physical device", + }, + Key: "deviceWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131088, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel write latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI write command", + }, + Key: "kernelWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131089, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI write command issued by the guest OS to the virtual machine", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131090, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue write latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI write command, during the collection interval", + }, + Key: "queueWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131091, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device command latency", + Summary: "Average amount of time, in milliseconds, to complete a SCSI command from the physical device", + }, + Key: "deviceLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131092, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel command latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI command", + }, + Key: "kernelLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131093, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Command latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI command issued by the guest OS to the virtual machine", + }, + Key: "totalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131094, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue command latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI command, during the collection interval", + }, + Key: "queueLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131095, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all disks used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131096, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum queue depth", + Summary: "Maximum queue depth", + }, + Key: "maxQueueDepth", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131097, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of disk reads per second during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131098, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of disk writes per second during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 131099, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of SCSI commands issued per second during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196608, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{196609, 196610, 196611}, + }, + { + Key: 196609, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196610, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196611, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196612, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packets received", + Summary: "Number of packets received during the interval", + }, + Key: "packetsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196613, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packets transmitted", + Summary: "Number of packets transmitted during the interval", + }, + Key: "packetsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196614, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data receive rate", + Summary: "Average rate at which data was received during the interval", + }, + Key: "received", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196615, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data transmit rate", + Summary: "Average rate at which data was transmitted during the interval", + }, + Key: "transmitted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196616, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Receive packets dropped", + Summary: "Number of receives dropped", + }, + Key: "droppedRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196617, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Transmit packets dropped", + Summary: "Number of transmits dropped", + }, + Key: "droppedTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196618, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data receive rate", + Summary: "Average amount of data received per second", + }, + Key: "bytesRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196619, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data transmit rate", + Summary: "Average amount of data transmitted per second", + }, + Key: "bytesTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196620, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Broadcast receives", + Summary: "Number of broadcast packets received during the sampling interval", + }, + Key: "broadcastRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196621, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Broadcast transmits", + Summary: "Number of broadcast packets transmitted during the sampling interval", + }, + Key: "broadcastTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196622, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Multicast receives", + Summary: "Number of multicast packets received during the sampling interval", + }, + Key: "multicastRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196623, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Multicast transmits", + Summary: "Number of multicast packets transmitted during the sampling interval", + }, + Key: "multicastTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196624, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packet receive errors", + Summary: "Number of packets with errors received during the sampling interval", + }, + Key: "errorsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196625, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packet transmit errors", + Summary: "Number of packets with errors transmitted during the sampling interval", + }, + Key: "errorsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196626, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Unknown protocol frames", + Summary: "Number of frames with unknown protocol received during the sampling interval", + }, + Key: "unknownProtos", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196627, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pnicBytesRx", + Summary: "pnicBytesRx", + }, + Key: "pnicBytesRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 196628, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pnicBytesTx", + Summary: "pnicBytesTx", + }, + Key: "pnicBytesTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262144, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Uptime", + Summary: "Total time elapsed, in seconds, since last system startup", + }, + Key: "uptime", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "s", + Summary: "Second", + }, + Key: "second", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262145, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heartbeat", + Summary: "Number of heartbeats issued per virtual machine during the interval", + }, + Key: "heartbeat", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262146, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk usage", + Summary: "Amount of disk space usage for each mount point", + }, + Key: "diskUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262147, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (None)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "none", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{262148, 262149, 262150}, + }, + { + Key: 262148, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Average)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262149, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Maximum)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262150, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Minimum)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262151, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory touched", + Summary: "Memory touched by the system resource group", + }, + Key: "resourceMemTouched", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262152, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory mapped", + Summary: "Memory mapped by the system resource group", + }, + Key: "resourceMemMapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262153, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory share saved", + Summary: "Memory saved due to sharing by the system resource group", + }, + Key: "resourceMemShared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262154, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory swapped", + Summary: "Memory swapped out by the system resource group", + }, + Key: "resourceMemSwapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262155, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory overhead", + Summary: "Overhead memory consumed by the system resource group", + }, + Key: "resourceMemOverhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262156, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory shared", + Summary: "Memory shared by the system resource group", + }, + Key: "resourceMemCow", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262157, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory zero", + Summary: "Zero filled memory used by the system resource group", + }, + Key: "resourceMemZero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262158, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU running (1 min. average)", + Summary: "CPU running average over 1 minute of the system resource group", + }, + Key: "resourceCpuRun1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262159, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU active (1 min average)", + Summary: "CPU active average over 1 minute of the system resource group", + }, + Key: "resourceCpuAct1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262160, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU maximum limited (1 min)", + Summary: "CPU maximum limited over 1 minute of the system resource group", + }, + Key: "resourceCpuMaxLimited1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262161, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU running (5 min average)", + Summary: "CPU running average over 5 minutes of the system resource group", + }, + Key: "resourceCpuRun5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262162, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU active (5 min average)", + Summary: "CPU active average over 5 minutes of the system resource group", + }, + Key: "resourceCpuAct5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262163, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU maximum limited (5 min)", + Summary: "CPU maximum limited over 5 minutes of the system resource group", + }, + Key: "resourceCpuMaxLimited5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262164, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation minimum (in MHz)", + Summary: "CPU allocation reservation (in MHz) of the system resource group", + }, + Key: "resourceCpuAllocMin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262165, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation maximum (in MHz)", + Summary: "CPU allocation limit (in MHz) of the system resource group", + }, + Key: "resourceCpuAllocMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262166, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation shares", + Summary: "CPU allocation shares of the system resource group", + }, + Key: "resourceCpuAllocShares", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262167, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation minimum (in KB)", + Summary: "Memory allocation reservation (in KB) of the system resource group", + }, + Key: "resourceMemAllocMin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262168, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation maximum (in KB)", + Summary: "Memory allocation limit (in KB) of the system resource group", + }, + Key: "resourceMemAllocMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262169, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation shares", + Summary: "Memory allocation shares of the system resource group", + }, + Key: "resourceMemAllocShares", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262170, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "OS Uptime", + Summary: "Total time elapsed, in seconds, since last operating system boot-up", + }, + Key: "osUptime", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "s", + Summary: "Second", + }, + Key: "second", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262171, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory consumed", + Summary: "Memory consumed by the system resource group", + }, + Key: "resourceMemConsumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 262172, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "File descriptors used", + Summary: "Number of file descriptors used by the system resource group", + }, + Key: "resourceFdUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327680, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (1 min average)", + Summary: "CPU active average over 1 minute", + }, + Key: "actav1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327681, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (1 min peak)", + Summary: "CPU active peak over 1 minute", + }, + Key: "actpk1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327682, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (1 min average)", + Summary: "CPU running average over 1 minute", + }, + Key: "runav1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327683, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (5 min average)", + Summary: "CPU active average over 5 minutes", + }, + Key: "actav5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327684, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (5 min peak)", + Summary: "CPU active peak over 5 minutes", + }, + Key: "actpk5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327685, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (5 min average)", + Summary: "CPU running average over 5 minutes", + }, + Key: "runav5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327686, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (15 min average)", + Summary: "CPU active average over 15 minutes", + }, + Key: "actav15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327687, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (15 min peak)", + Summary: "CPU active peak over 15 minutes", + }, + Key: "actpk15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327688, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (15 min average)", + Summary: "CPU running average over 15 minutes", + }, + Key: "runav15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327689, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (1 min peak)", + Summary: "CPU running peak over 1 minute", + }, + Key: "runpk1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327690, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (1 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 1 minute", + }, + Key: "maxLimited1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327691, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (5 min peak)", + Summary: "CPU running peak over 5 minutes", + }, + Key: "runpk5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327692, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (5 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 5 minutes", + }, + Key: "maxLimited5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327693, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (15 min peak)", + Summary: "CPU running peak over 15 minutes", + }, + Key: "runpk15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327694, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (15 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 15 minutes", + }, + Key: "maxLimited15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327695, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Group CPU sample count", + Summary: "Group CPU sample count", + }, + Key: "sampleCount", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 327696, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Group CPU sample period", + Summary: "Group CPU sample period", + }, + Key: "samplePeriod", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 393216, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "Amount of total configured memory that is available for use", + }, + Key: "memUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 393217, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap used", + Summary: "Sum of the memory swapped by all powered-on virtual machines on the host", + }, + Key: "swapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 393218, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap in", + Summary: "Amount of memory that is swapped in for the Service Console", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 393219, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap out", + Summary: "Amount of memory that is swapped out for the Service Console", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 393220, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU usage", + Summary: "Amount of Service Console CPU usage", + }, + Key: "cpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458752, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of commands issued per second by the storage adapter during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458753, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second by the storage adapter during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458754, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second by the storage adapter during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458755, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data by the storage adapter", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458756, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data by the storage adapter", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458757, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read by the storage adapter takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458758, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write by the storage adapter takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 458759, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all storage adapters used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524288, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of commands issued per second on the storage path during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524289, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second on the storage path during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524290, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second on the storage path during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524291, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data on the storage path", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524292, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data on the storage path", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524293, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read issued on the storage path takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524294, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write issued on the storage path takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 524295, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all storage paths used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589824, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second to the virtual disk during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589825, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second to the virtual disk during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589826, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data from the virtual disk", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589827, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data to the virtual disk", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589828, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read from the virtual disk takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589829, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write to the virtual disk takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589830, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average number of outstanding read requests", + Summary: "Average number of outstanding read requests to the virtual disk during the collection interval", + }, + Key: "readOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589831, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average number of outstanding write requests", + Summary: "Average number of outstanding write requests to the virtual disk during the collection interval", + }, + Key: "writeOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589832, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read workload metric", + Summary: "Storage DRS virtual disk metric for the read workload model", + }, + Key: "readLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589833, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write workload metric", + Summary: "Storage DRS virtual disk metric for the write workload model", + }, + Key: "writeLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589834, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read request size", + Summary: "Average read request size in bytes", + }, + Key: "readIOSize", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589835, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write request size", + Summary: "Average write request size in bytes", + }, + Key: "writeIOSize", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589836, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of small seeks", + Summary: "Number of seeks during the interval that were less than 64 LBNs apart", + }, + Key: "smallSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589837, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of medium seeks", + Summary: "Number of seeks during the interval that were between 64 and 8192 LBNs apart", + }, + Key: "mediumSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589838, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of large seeks", + Summary: "Number of seeks during the interval that were greater than 8192 LBNs apart", + }, + Key: "largeSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589839, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read Latency (us)", + Summary: "Read latency in microseconds", + }, + Key: "readLatencyUS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589840, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write Latency (us)", + Summary: "Write latency in microseconds", + }, + Key: "writeLatencyUS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589841, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache I/Os per second for the virtual disk", + Summary: "The average virtual Flash Read Cache I/Os per second value for the virtual disk", + }, + Key: "vFlashCacheIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589842, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache latency for the virtual disk", + Summary: "The average virtual Flash Read Cache latency value for the virtual disk", + }, + Key: "vFlashCacheLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 589843, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache throughput for virtual disk", + Summary: "The average virtual Flash Read Cache throughput value for the virtual disk", + }, + Key: "vFlashCacheThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655360, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second to the datastore during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655361, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second to the datastore during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655362, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data from the datastore", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655363, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data to the datastore", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655364, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read from the datastore takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655365, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write to the datastore takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655366, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control normalized latency", + Summary: "Storage I/O Control size-normalized I/O latency", + }, + Key: "sizeNormalizedDatastoreLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655367, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control aggregated IOPS", + Summary: "Storage I/O Control aggregated IOPS", + }, + Key: "datastoreIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655368, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore bytes read", + Summary: "Storage DRS datastore bytes read", + }, + Key: "datastoreReadBytes", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655369, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore bytes written", + Summary: "Storage DRS datastore bytes written", + }, + Key: "datastoreWriteBytes", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655370, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore read I/O rate", + Summary: "Storage DRS datastore read I/O rate", + }, + Key: "datastoreReadIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655371, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore write I/O rate", + Summary: "Storage DRS datastore write I/O rate", + }, + Key: "datastoreWriteIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655372, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore normalized read latency", + Summary: "Storage DRS datastore normalized read latency", + }, + Key: "datastoreNormalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655373, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore normalized write latency", + Summary: "Storage DRS datastore normalized write latency", + }, + Key: "datastoreNormalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655374, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore outstanding read requests", + Summary: "Storage DRS datastore outstanding read requests", + }, + Key: "datastoreReadOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655375, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore outstanding write requests", + Summary: "Storage DRS datastore outstanding write requests", + }, + Key: "datastoreWriteOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655376, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control datastore maximum queue depth", + Summary: "Storage I/O Control datastore maximum queue depth", + }, + Key: "datastoreMaxQueueDepth", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655377, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore read workload metric", + Summary: "Storage DRS datastore metric for read workload model", + }, + Key: "datastoreReadLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655378, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore write workload metric", + Summary: "Storage DRS datastore metric for write workload model", + }, + Key: "datastoreWriteLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655379, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all datastores used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655380, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control active time percentage", + Summary: "Percentage of time Storage I/O Control actively controlled datastore latency", + }, + Key: "siocActiveTimePercentage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 655381, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore latency observed by VMs", + Summary: "The average datastore latency as seen by virtual machines", + }, + Key: "datastoreVMObservedLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 720896, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Current power usage", + }, + Key: "power", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 720897, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cap", + Summary: "Maximum allowed power usage", + }, + Key: "powerCap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 720898, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Energy usage", + Summary: "Total energy used since last stats reset", + }, + Key: "energy", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "J", + Summary: "Joule", + }, + Key: "joule", + }, + RollupType: "summation", + StatsType: "delta", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 786432, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication VM Count", + Summary: "Current number of replicated virtual machines", + }, + Key: "hbrNumVms", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 786433, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Replication Data Receive Rate", + Summary: "Average amount of data received per second", + }, + Key: "hbrNetRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 786434, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Replication Data Transmit Rate", + Summary: "Average amount of data transmitted per second", + }, + Key: "hbrNetTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 851968, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of caches controlled by the virtual flash module", + Summary: "Number of caches controlled by the virtual flash module", + }, + Key: "numActiveVMDKs", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual flash", + Summary: "Virtual flash module related statistical values", + }, + Key: "vflashModule", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245184, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read IOPS", + Summary: "Read IOPS", + }, + Key: "readIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245185, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read throughput", + Summary: "Read throughput in kBps", + }, + Key: "readThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245186, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read latency", + Summary: "Average read latency in ms", + }, + Key: "readAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245187, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max read latency", + Summary: "Max read latency in ms", + }, + Key: "readMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245188, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cache hit rate", + Summary: "Cache hit rate percentage", + }, + Key: "readCacheHitRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245189, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read congestion per sampling interval", + Summary: "Read congestion", + }, + Key: "readCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245190, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write IOPS", + Summary: "Write IOPS", + }, + Key: "writeIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245191, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write throughput", + Summary: "Write throughput in kBps", + }, + Key: "writeThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245192, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write latency", + Summary: "Average write latency in ms", + }, + Key: "writeAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245193, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max write latency", + Summary: "Max write latency in ms", + }, + Key: "writeMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245194, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write congestion per sampling interval", + Summary: "Write congestion", + }, + Key: "writeCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245195, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write IOPS", + Summary: "Recovery write IOPS", + }, + Key: "recoveryWriteIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245196, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write through-put", + Summary: "Recovery write through-put in kBps", + }, + Key: "recoveryWriteThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245197, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average recovery write latency", + Summary: "Average recovery write latency in ms", + }, + Key: "recoveryWriteAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245198, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max recovery write latency", + Summary: "Max recovery write latency in ms", + }, + Key: "recoveryWriteMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1245199, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write congestion per sampling interval", + Summary: "Recovery write congestion", + }, + Key: "recoveryWriteCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310720, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{1310721, 1310722, 1310723}, + }, + { + Key: 1310721, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310722, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310723, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310724, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{1310725, 1310726, 1310727}, + }, + { + Key: 1310725, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310726, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310727, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310728, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: []int32{1310729, 1310730, 1310731}, + }, + { + Key: 1310729, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310730, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310731, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1310732, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Temperature", + Summary: "The temperature of a GPU in degrees celsius", + }, + Key: "temperature", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "℃", + Summary: "Temperature in degrees Celsius", + }, + Key: "celsius", + }, + RollupType: "average", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, + { + Key: 1376256, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Persistent memory available reservation", + Summary: "Persistent memory available reservation on a host.", + }, + Key: "available.reservation", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "PMEM", + Summary: "PMEM", + }, + Key: "pmem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 0, + PerDeviceLevel: 0, + AssociatedCounterId: nil, + }, +} + +// *********************************** VM Metrics ************************************ +var VmMetrics = []types.PerfMetricId{ + { + CounterId: 11, + Instance: "$cpu", + }, + { + CounterId: 1, + Instance: "", + }, + { + CounterId: 12, + Instance: "", + }, + { + CounterId: 9, + Instance: "", + }, + { + CounterId: 29, + Instance: "", + }, + { + CounterId: 30, + Instance: "$cpu", + }, + { + CounterId: 24, + Instance: "", + }, + { + CounterId: 13, + Instance: "", + }, + { + CounterId: 10, + Instance: "$cpu", + }, + { + CounterId: 14, + Instance: "$cpu", + }, + { + CounterId: 27, + Instance: "$cpu", + }, + { + CounterId: 25, + Instance: "", + }, + { + CounterId: 5, + Instance: "$cpu", + }, + { + CounterId: 32, + Instance: "$cpu", + }, + { + CounterId: 14, + Instance: "", + }, + { + CounterId: 12, + Instance: "$cpu", + }, + { + CounterId: 10, + Instance: "", + }, + { + CounterId: 28, + Instance: "$cpu", + }, + { + CounterId: 5, + Instance: "", + }, + { + CounterId: 27, + Instance: "", + }, + { + CounterId: 31, + Instance: "", + }, + { + CounterId: 32, + Instance: "", + }, + { + CounterId: 26, + Instance: "", + }, + { + CounterId: 13, + Instance: "$cpu", + }, + { + CounterId: 28, + Instance: "", + }, + { + CounterId: 30, + Instance: "", + }, + { + CounterId: 11, + Instance: "", + }, + { + CounterId: 655379, + Instance: "", + }, + + { + CounterId: 655362, + Instance: "$physDisk", + }, + { + CounterId: 655363, + Instance: "$physDisk", + }, + { + CounterId: 655360, + Instance: "$physDisk", + }, + { + CounterId: 655364, + Instance: "$physDisk", + }, + { + CounterId: 655361, + Instance: "$physDisk", + }, + { + CounterId: 655365, + Instance: "$physDisk", + }, + + { + CounterId: 131095, + Instance: "", + }, + { + CounterId: 65549, + Instance: "", + }, + { + CounterId: 65595, + Instance: "", + }, + { + CounterId: 65632, + Instance: "", + }, + { + CounterId: 65591, + Instance: "", + }, + { + CounterId: 65623, + Instance: "", + }, + { + CounterId: 65628, + Instance: "", + }, + { + CounterId: 65621, + Instance: "", + }, + { + CounterId: 65618, + Instance: "", + }, + { + CounterId: 65634, + Instance: "", + }, + { + CounterId: 65624, + Instance: "", + }, + { + CounterId: 65586, + Instance: "", + }, + { + CounterId: 65545, + Instance: "", + }, + { + CounterId: 65633, + Instance: "", + }, + { + CounterId: 65607, + Instance: "", + }, + { + CounterId: 65541, + Instance: "", + }, + { + CounterId: 65626, + Instance: "", + }, + { + CounterId: 65620, + Instance: "", + }, + { + CounterId: 65611, + Instance: "", + }, + { + CounterId: 65629, + Instance: "", + }, + { + CounterId: 65622, + Instance: "", + }, + { + CounterId: 65619, + Instance: "", + }, + { + CounterId: 65553, + Instance: "", + }, + { + CounterId: 65627, + Instance: "", + }, + { + CounterId: 65635, + Instance: "", + }, + { + CounterId: 65599, + Instance: "", + }, + { + CounterId: 65582, + Instance: "", + }, + { + CounterId: 65537, + Instance: "", + }, + { + CounterId: 65603, + Instance: "", + }, + { + CounterId: 196622, + Instance: "4000", + }, + { + CounterId: 196612, + Instance: "", + }, + { + CounterId: 196617, + Instance: "", + }, + { + CounterId: 196613, + Instance: "", + }, + { + CounterId: 196619, + Instance: "4000", + }, + { + CounterId: 196618, + Instance: "4000", + }, + { + CounterId: 196617, + Instance: "4000", + }, + { + CounterId: 196621, + Instance: "4000", + }, + { + CounterId: 196616, + Instance: "4000", + }, + { + CounterId: 196615, + Instance: "4000", + }, + { + CounterId: 196614, + Instance: "4000", + }, + { + CounterId: 196618, + Instance: "", + }, + { + CounterId: 196609, + Instance: "4000", + }, + { + CounterId: 196619, + Instance: "", + }, + { + CounterId: 196622, + Instance: "", + }, + { + CounterId: 196628, + Instance: "4000", + }, + { + CounterId: 196609, + Instance: "", + }, + { + CounterId: 196612, + Instance: "4000", + }, + { + CounterId: 196628, + Instance: "", + }, + { + CounterId: 196627, + Instance: "", + }, + { + CounterId: 196616, + Instance: "", + }, + { + CounterId: 196613, + Instance: "4000", + }, + { + CounterId: 196627, + Instance: "4000", + }, + { + CounterId: 196614, + Instance: "", + }, + { + CounterId: 196621, + Instance: "", + }, + { + CounterId: 196620, + Instance: "4000", + }, + { + CounterId: 196620, + Instance: "", + }, + { + CounterId: 196623, + Instance: "", + }, + { + CounterId: 196615, + Instance: "", + }, + { + CounterId: 196623, + Instance: "4000", + }, + { + CounterId: 720898, + Instance: "", + }, + { + CounterId: 720896, + Instance: "", + }, + { + CounterId: 327684, + Instance: "", + }, + { + CounterId: 327687, + Instance: "", + }, + { + CounterId: 327693, + Instance: "", + }, + { + CounterId: 327680, + Instance: "", + }, + { + CounterId: 327685, + Instance: "", + }, + { + CounterId: 327694, + Instance: "", + }, + { + CounterId: 327686, + Instance: "", + }, + { + CounterId: 327692, + Instance: "", + }, + { + CounterId: 327688, + Instance: "", + }, + { + CounterId: 327695, + Instance: "", + }, + { + CounterId: 327689, + Instance: "", + }, + { + CounterId: 327681, + Instance: "", + }, + { + CounterId: 327696, + Instance: "", + }, + { + CounterId: 327683, + Instance: "", + }, + { + CounterId: 327691, + Instance: "", + }, + { + CounterId: 327690, + Instance: "", + }, + { + CounterId: 327682, + Instance: "", + }, + { + CounterId: 262144, + Instance: "", + }, + { + CounterId: 262145, + Instance: "", + }, + { + CounterId: 262170, + Instance: "", + }, + { + CounterId: 589827, + Instance: "", + }, + { + CounterId: 589826, + Instance: "", + }, +} + +// **************************** Host metrics ********************************* + +var HostMetrics = []types.PerfMetricId{ + { + CounterId: 23, + Instance: "", + }, + { + CounterId: 14, + Instance: "", + }, + { + CounterId: 1, + Instance: "", + }, + { + CounterId: 11, + Instance: "", + }, + { + CounterId: 20, + Instance: "$cpu", + }, + { + CounterId: 13, + Instance: "", + }, + { + CounterId: 5, + Instance: "", + }, + { + CounterId: 32, + Instance: "", + }, + { + CounterId: 26, + Instance: "", + }, + { + CounterId: 24, + Instance: "", + }, + { + CounterId: 16, + Instance: "$cpu", + }, + { + CounterId: 27, + Instance: "", + }, + { + CounterId: 16, + Instance: "", + }, + + { + CounterId: 10, + Instance: "", + }, + { + CounterId: 12, + Instance: "", + }, + { + CounterId: 1, + Instance: "$cpu", + }, + { + CounterId: 12, + Instance: "$cpu", + }, + { + CounterId: 13, + Instance: "$cpu", + }, + { + CounterId: 8, + Instance: "", + }, + { + CounterId: 655380, + Instance: "$physDisk", + }, + { + CounterId: 655370, + Instance: "$physDisk", + }, + { + CounterId: 655377, + Instance: "$physDisk", + }, + { + CounterId: 655379, + Instance: "", + }, + { + CounterId: 655375, + Instance: "$physDisk", + }, + { + CounterId: 655378, + Instance: "$physDisk", + }, + { + CounterId: 655372, + Instance: "$physDisk", + }, + { + CounterId: 655369, + Instance: "$physDisk", + }, + { + CounterId: 655373, + Instance: "$physDisk", + }, + { + CounterId: 655362, + Instance: "$physDisk", + }, + { + CounterId: 655374, + Instance: "$physDisk", + }, + { + CounterId: 655368, + Instance: "$physDisk", + }, + { + CounterId: 655365, + Instance: "$physDisk", + }, + { + CounterId: 655366, + Instance: "$physDisk", + }, + { + CounterId: 655367, + Instance: "$physDisk", + }, + { + CounterId: 655371, + Instance: "$physDisk", + }, + { + CounterId: 655361, + Instance: "$physDisk", + }, + { + CounterId: 655376, + Instance: "$physDisk", + }, + { + CounterId: 655363, + Instance: "$physDisk", + }, + { + CounterId: 655360, + Instance: "$physDisk", + }, + { + CounterId: 655381, + Instance: "$physDisk", + }, + { + CounterId: 131073, + Instance: "", + }, + { + CounterId: 131090, + Instance: "$physDisk", + }, + { + CounterId: 131079, + Instance: "", + }, + { + CounterId: 131086, + Instance: "$physDisk", + }, + { + CounterId: 131098, + Instance: "$physDisk", + }, + { + CounterId: 131081, + Instance: "$physDisk", + }, + { + CounterId: 131082, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131090, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131081, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131086, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131088, + Instance: "$physDisk", + }, + { + CounterId: 131098, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131078, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131079, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131099, + Instance: "$physDisk", + }, + { + CounterId: 131087, + Instance: "$physDisk", + }, + { + CounterId: 131089, + Instance: "$physDisk", + }, + { + CounterId: 131078, + Instance: "$physDisk", + }, + { + CounterId: 131096, + Instance: "$physDisk", + }, + { + CounterId: 131091, + Instance: "$physDisk", + }, + { + CounterId: 131080, + Instance: "$physDisk", + }, + { + CounterId: 131078, + Instance: "", + }, + { + CounterId: 131076, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131092, + Instance: "$physDisk", + }, + { + CounterId: 131080, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131095, + Instance: "", + }, + { + CounterId: 131097, + Instance: "$physDisk", + }, + { + CounterId: 131093, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131092, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131084, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131099, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131079, + Instance: "$physDisk", + }, + { + CounterId: 131085, + Instance: "$physDisk", + }, + { + CounterId: 131083, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131076, + Instance: "$physDisk", + }, + { + CounterId: 131096, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131094, + Instance: "$physDisk", + }, + { + CounterId: 131088, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131089, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131077, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131077, + Instance: "$physDisk", + }, + { + CounterId: 131093, + Instance: "$physDisk", + }, + { + CounterId: 131087, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131085, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131091, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131097, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131082, + Instance: "$physDisk", + }, + { + CounterId: 131094, + Instance: "mpx.vmhba32:C0:T0:L0", + }, + { + CounterId: 131084, + Instance: "$physDisk", + }, + { + CounterId: 131083, + Instance: "$physDisk", + }, + { + CounterId: 786433, + Instance: "", + }, + { + CounterId: 786434, + Instance: "", + }, + { + CounterId: 786432, + Instance: "", + }, + { + CounterId: 65573, + Instance: "", + }, + { + CounterId: 65618, + Instance: "", + }, + { + CounterId: 65632, + Instance: "", + }, + { + CounterId: 65623, + Instance: "", + }, + { + CounterId: 65582, + Instance: "", + }, + { + CounterId: 65611, + Instance: "", + }, + { + CounterId: 65541, + Instance: "", + }, + { + CounterId: 65586, + Instance: "", + }, + { + CounterId: 65621, + Instance: "", + }, + { + CounterId: 65561, + Instance: "", + }, + { + CounterId: 65569, + Instance: "", + }, + { + CounterId: 65580, + Instance: "", + }, + { + CounterId: 65553, + Instance: "", + }, + { + CounterId: 65646, + Instance: "", + }, + { + CounterId: 65603, + Instance: "", + }, + { + CounterId: 65647, + Instance: "", + }, + { + CounterId: 65628, + Instance: "", + }, + { + CounterId: 65557, + Instance: "", + }, + { + CounterId: 65635, + Instance: "", + }, + { + CounterId: 65589, + Instance: "", + }, + { + CounterId: 65643, + Instance: "", + }, + { + CounterId: 65545, + Instance: "", + }, + { + CounterId: 65537, + Instance: "", + }, + { + CounterId: 65622, + Instance: "", + }, + { + CounterId: 65639, + Instance: "", + }, + { + CounterId: 65599, + Instance: "", + }, + { + CounterId: 65633, + Instance: "", + }, + { + CounterId: 65650, + Instance: "", + }, + { + CounterId: 65649, + Instance: "", + }, + { + CounterId: 65615, + Instance: "", + }, + { + CounterId: 65577, + Instance: "", + }, + { + CounterId: 65648, + Instance: "", + }, + { + CounterId: 65619, + Instance: "", + }, + { + CounterId: 65630, + Instance: "", + }, + { + CounterId: 65651, + Instance: "", + }, + { + CounterId: 65620, + Instance: "", + }, + { + CounterId: 65625, + Instance: "", + }, + { + CounterId: 65549, + Instance: "", + }, + { + CounterId: 196616, + Instance: "vmnic0", + }, + { + CounterId: 196612, + Instance: "vmnic0", + }, + { + CounterId: 196621, + Instance: "", + }, + { + CounterId: 196618, + Instance: "vmnic0", + }, + { + CounterId: 196609, + Instance: "vmnic1", + }, + { + CounterId: 196622, + Instance: "", + }, + { + CounterId: 196623, + Instance: "vmnic0", + }, + { + CounterId: 196626, + Instance: "", + }, + { + CounterId: 196614, + Instance: "", + }, + { + CounterId: 196616, + Instance: "vmnic1", + }, + { + CounterId: 196615, + Instance: "vmnic0", + }, + { + CounterId: 196621, + Instance: "vmnic1", + }, + { + CounterId: 196622, + Instance: "vmnic0", + }, + { + CounterId: 196614, + Instance: "vmnic0", + }, + { + CounterId: 196620, + Instance: "", + }, + { + CounterId: 196622, + Instance: "vmnic1", + }, + { + CounterId: 196617, + Instance: "", + }, + { + CounterId: 196616, + Instance: "", + }, + { + CounterId: 196613, + Instance: "vmnic0", + }, + { + CounterId: 196614, + Instance: "vmnic1", + }, + { + CounterId: 196625, + Instance: "", + }, + { + CounterId: 196609, + Instance: "vmnic0", + }, + { + CounterId: 196624, + Instance: "", + }, + { + CounterId: 196619, + Instance: "vmnic1", + }, + { + CounterId: 196625, + Instance: "vmnic0", + }, + { + CounterId: 196617, + Instance: "vmnic1", + }, + { + CounterId: 196619, + Instance: "", + }, + { + CounterId: 196618, + Instance: "vmnic1", + }, + { + CounterId: 196626, + Instance: "vmnic0", + }, + { + CounterId: 196612, + Instance: "vmnic1", + }, + { + CounterId: 196613, + Instance: "", + }, + { + CounterId: 196621, + Instance: "vmnic0", + }, + { + CounterId: 196615, + Instance: "", + }, + { + CounterId: 196620, + Instance: "vmnic1", + }, + { + CounterId: 196612, + Instance: "", + }, + { + CounterId: 196624, + Instance: "vmnic1", + }, + { + CounterId: 196617, + Instance: "vmnic0", + }, + { + CounterId: 196625, + Instance: "vmnic1", + }, + { + CounterId: 196618, + Instance: "", + }, + { + CounterId: 196623, + Instance: "vmnic1", + }, + { + CounterId: 196623, + Instance: "", + }, + { + CounterId: 196609, + Instance: "", + }, + { + CounterId: 196613, + Instance: "vmnic1", + }, + { + CounterId: 196620, + Instance: "vmnic0", + }, + { + CounterId: 196619, + Instance: "vmnic0", + }, + { + CounterId: 196624, + Instance: "vmnic0", + }, + { + CounterId: 196615, + Instance: "vmnic1", + }, + { + CounterId: 196626, + Instance: "vmnic1", + }, + { + CounterId: 720898, + Instance: "", + }, + { + CounterId: 720897, + Instance: "", + }, + { + CounterId: 720896, + Instance: "", + }, + { + CounterId: 327681, + Instance: "", + }, + { + CounterId: 327694, + Instance: "", + }, + { + CounterId: 327689, + Instance: "", + }, + { + CounterId: 327696, + Instance: "", + }, + { + CounterId: 327685, + Instance: "", + }, + { + CounterId: 327680, + Instance: "", + }, + { + CounterId: 327690, + Instance: "", + }, + { + CounterId: 327693, + Instance: "", + }, + { + CounterId: 327683, + Instance: "", + }, + { + CounterId: 327688, + Instance: "", + }, + { + CounterId: 327687, + Instance: "", + }, + { + CounterId: 327684, + Instance: "", + }, + { + CounterId: 327691, + Instance: "", + }, + { + CounterId: 327682, + Instance: "", + }, + { + CounterId: 327695, + Instance: "", + }, + { + CounterId: 327686, + Instance: "", + }, + { + CounterId: 327692, + Instance: "", + }, + { + CounterId: 458755, + Instance: "vmhba64", + }, + { + CounterId: 458755, + Instance: "vmhba1", + }, + { + CounterId: 458756, + Instance: "vmhba1", + }, + { + CounterId: 458757, + Instance: "vmhba32", + }, + { + CounterId: 458753, + Instance: "vmhba1", + }, + { + CounterId: 458754, + Instance: "vmhba1", + }, + { + CounterId: 458752, + Instance: "vmhba0", + }, + { + CounterId: 458755, + Instance: "vmhba32", + }, + { + CounterId: 458757, + Instance: "vmhba64", + }, + { + CounterId: 458753, + Instance: "vmhba64", + }, + { + CounterId: 458754, + Instance: "vmhba64", + }, + { + CounterId: 458752, + Instance: "vmhba64", + }, + { + CounterId: 458759, + Instance: "", + }, + { + CounterId: 458758, + Instance: "vmhba1", + }, + { + CounterId: 458753, + Instance: "vmhba32", + }, + { + CounterId: 458758, + Instance: "vmhba0", + }, + { + CounterId: 458756, + Instance: "vmhba64", + }, + { + CounterId: 458754, + Instance: "vmhba32", + }, + { + CounterId: 458753, + Instance: "vmhba0", + }, + { + CounterId: 458757, + Instance: "vmhba0", + }, + { + CounterId: 458754, + Instance: "vmhba0", + }, + { + CounterId: 458756, + Instance: "vmhba0", + }, + { + CounterId: 458752, + Instance: "vmhba1", + }, + { + CounterId: 458752, + Instance: "vmhba32", + }, + { + CounterId: 458756, + Instance: "vmhba32", + }, + { + CounterId: 458755, + Instance: "vmhba0", + }, + { + CounterId: 458758, + Instance: "vmhba64", + }, + { + CounterId: 458757, + Instance: "vmhba1", + }, + { + CounterId: 458758, + Instance: "vmhba32", + }, + { + CounterId: 524290, + Instance: "$physDisk", + }, + { + CounterId: 524288, + Instance: "$physDisk", + }, + { + CounterId: 524291, + Instance: "$physDisk", + }, + { + CounterId: 524292, + Instance: "$physDisk", + }, + { + CounterId: 524295, + Instance: "", + }, + { + CounterId: 524289, + Instance: "$physDisk", + }, + { + CounterId: 524293, + Instance: "$physDisk", + }, + { + CounterId: 524294, + Instance: "$physDisk", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262168, + Instance: "host/system", + }, + { + CounterId: 262172, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262166, + Instance: "host/system", + }, + { + CounterId: 262157, + Instance: "host/system/svmotion", + }, + { + CounterId: 262157, + Instance: "host/system/drivers", + }, + { + CounterId: 262163, + Instance: "host/system", + }, + { + CounterId: 262156, + Instance: "host/system", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262153, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262161, + Instance: "host/system/vmotion", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262171, + Instance: "host", + }, + { + CounterId: 262156, + Instance: "host", + }, + { + CounterId: 262152, + Instance: "host", + }, + { + CounterId: 262153, + Instance: "host/vim", + }, + { + CounterId: 262151, + Instance: "host/system/drivers", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262172, + Instance: "host/system/kernel", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262153, + Instance: "host/system/ft", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262148, + Instance: "host/system/kernel", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262156, + Instance: "host/system/kernel", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262165, + Instance: "host/system/vmotion", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262171, + Instance: "host/iofilters", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262157, + Instance: "host/system/kernel", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262153, + Instance: "host", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262172, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262151, + Instance: "host/system/kernel", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262172, + Instance: "host/vim", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262148, + Instance: "host/system", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262155, + Instance: "host/system/drivers", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262153, + Instance: "host/system/vmotion", + }, + { + CounterId: 262148, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262152, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262172, + Instance: "host", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262162, + Instance: "host/vim", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262153, + Instance: "host/system", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262155, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262154, + Instance: "host", + }, + { + CounterId: 262157, + Instance: "host/system", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262153, + Instance: "host/vim/vmci", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262148, + Instance: "host/iofilters", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262152, + Instance: "host/system/kernel", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262171, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262151, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262172, + Instance: "host/system/helper", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262154, + Instance: "host/system/helper", + }, + { + CounterId: 262151, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262155, + Instance: "host/system/helper", + }, + { + CounterId: 262156, + Instance: "host/vim/tmp", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262171, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262154, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262157, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262148, + Instance: "host/system/drivers", + }, + { + CounterId: 262152, + Instance: "host/system/helper", + }, + { + CounterId: 262171, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262153, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262154, + Instance: "host/system/svmotion", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262161, + Instance: "host/system", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262152, + Instance: "host/system/svmotion", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262158, + Instance: "host/system", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262148, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262148, + Instance: "host/system/helper", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262171, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262152, + Instance: "host/system/drivers", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262158, + Instance: "host/system/vmotion", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262152, + Instance: "host/vim", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262151, + Instance: "host/system/vmotion", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262144, + Instance: "", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262171, + Instance: "host/vim/vmci", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262151, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262164, + Instance: "host/system", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262163, + Instance: "host/vim", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262171, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262155, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262171, + Instance: "host/system/kernel", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262160, + Instance: "host/system/vmotion", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262151, + Instance: "host/system", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262155, + Instance: "host/user", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262160, + Instance: "host/system", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262148, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262155, + Instance: "host/system/svmotion", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262155, + Instance: "host/system", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262167, + Instance: "host/system", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmci", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262156, + Instance: "host/system/drivers", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262165, + Instance: "host/vim", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262159, + Instance: "host/system", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmci", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262157, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262153, + Instance: "host/system/helper", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262163, + Instance: "host/system/vmotion", + }, + { + CounterId: 262151, + Instance: "host/user", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262155, + Instance: "host/iofilters", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262171, + Instance: "host/vim/tmp", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262154, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262171, + Instance: "host/system", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262153, + Instance: "host/iofilters", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262151, + Instance: "host/vim/tmp", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262148, + Instance: "host/system/vmotion", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262157, + Instance: "host/iofilters", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 262157, + Instance: "host", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262171, + Instance: "host/system/helper", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262156, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/var", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262157, + Instance: "host/system/helper", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262157, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262152, + Instance: "host/vim/tmp", + }, + { + CounterId: 262154, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262168, + Instance: "host/system/vmotion", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262172, + Instance: "host/user", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262152, + Instance: "host/user", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262152, + Instance: "host/system", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262157, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262153, + Instance: "host/system/drivers", + }, + { + CounterId: 262153, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262162, + Instance: "host/system", + }, + { + CounterId: 262154, + Instance: "host/system/drivers", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262172, + Instance: "host/system/ft", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262148, + Instance: "host/system/ft", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262152, + Instance: "host/system/ft", + }, + { + CounterId: 262155, + Instance: "host/system/ft", + }, + { + CounterId: 262156, + Instance: "host/system/ft", + }, + { + CounterId: 262148, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262157, + Instance: "host/system/ft", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262148, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262172, + Instance: "host/system/vmotion", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262152, + Instance: "host/system/vmotion", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262154, + Instance: "host/system/vmotion", + }, + { + CounterId: 262155, + Instance: "host/system/kernel", + }, + { + CounterId: 262155, + Instance: "host/system/vmotion", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 262156, + Instance: "host/system/vmotion", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262157, + Instance: "host/system/vmotion", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262171, + Instance: "host/system/vmotion", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262159, + Instance: "host/system/vmotion", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262164, + Instance: "host/system/vmotion", + }, + { + CounterId: 262167, + Instance: "host/system/vmotion", + }, + { + CounterId: 262153, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262167, + Instance: "host/vim", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262169, + Instance: "host/system/vmotion", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262166, + Instance: "host/system/vmotion", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262172, + Instance: "host/system/svmotion", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262151, + Instance: "host/system/svmotion", + }, + { + CounterId: 262156, + Instance: "host/system/helper", + }, + { + CounterId: 262153, + Instance: "host/system/svmotion", + }, + { + CounterId: 262171, + Instance: "host/system/svmotion", + }, + { + CounterId: 262148, + Instance: "host/vim", + }, + { + CounterId: 262165, + Instance: "host/system", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262151, + Instance: "host/vim", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vsfwd", + }, + { + CounterId: 262154, + Instance: "host/vim", + }, + { + CounterId: 262169, + Instance: "host/system", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262155, + Instance: "host/vim", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262154, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262154, + Instance: "host/system/kernel", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262157, + Instance: "host/vim", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262171, + Instance: "host/vim", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262158, + Instance: "host/vim", + }, + { + CounterId: 262159, + Instance: "host/vim", + }, + { + CounterId: 262160, + Instance: "host/vim", + }, + { + CounterId: 262161, + Instance: "host/vim", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262172, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262164, + Instance: "host/vim", + }, + { + CounterId: 262157, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262166, + Instance: "host/vim", + }, + { + CounterId: 262168, + Instance: "host/vim", + }, + { + CounterId: 262169, + Instance: "host/vim", + }, + { + CounterId: 262153, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262151, + Instance: "host/vim/vmci", + }, + { + CounterId: 262152, + Instance: "host/vim/vmci", + }, + { + CounterId: 262152, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmci", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262155, + Instance: "host/vim/vmci", + }, + { + CounterId: 262157, + Instance: "host/vim/vimuser", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262172, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262148, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262156, + Instance: "host/vim/vmci", + }, + { + CounterId: 262152, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262157, + Instance: "host/vim/vmci", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262155, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262171, + Instance: "host/user", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262171, + Instance: "host/system/ft", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262151, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262156, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262171, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262172, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 262148, + Instance: "host", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262148, + Instance: "host/system/svmotion", + }, + { + CounterId: 262148, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262156, + Instance: "host/system/svmotion", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262151, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262153, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262155, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262155, + Instance: "host", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262151, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262162, + Instance: "host/system/vmotion", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262155, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262154, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262151, + Instance: "host/system/helper", + }, + { + CounterId: 262172, + Instance: "host/vim/tmp", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 262148, + Instance: "host/vim/tmp", + }, + { + CounterId: 262153, + Instance: "host/vim/tmp", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262172, + Instance: "host/system", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262155, + Instance: "host/vim/tmp", + }, + { + CounterId: 262157, + Instance: "host/vim/tmp", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262156, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262171, + Instance: "host/system/drivers", + }, + { + CounterId: 262172, + Instance: "host/iofilters", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262154, + Instance: "host/system", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262151, + Instance: "host/iofilters", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262156, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262156, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262152, + Instance: "host/iofilters", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262155, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 262154, + Instance: "host/iofilters", + }, + { + CounterId: 262156, + Instance: "host/iofilters", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262172, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262154, + Instance: "host/system/ft", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 262151, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262152, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vsanmgmtdWatchdog", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262153, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 262154, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262155, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262157, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262151, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/pktcap-agent", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262153, + Instance: "host/system/kernel", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262152, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262154, + Instance: "host/vim/tmp", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262155, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/vdpi", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262152, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262172, + Instance: "host/system/drivers", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262171, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262153, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262154, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262156, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 262154, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 262156, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 262157, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262171, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 262156, + Instance: "host/vim", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262172, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262152, + Instance: "host/system/kernel/root", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 262152, + Instance: "host/iofilters/spm", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262156, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 262151, + Instance: "host/system/ft", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 262151, + Instance: "host", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 262148, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262148, + Instance: "host/user", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262154, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 262172, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262153, + Instance: "host/user", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262154, + Instance: "host/user", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262156, + Instance: "host/user", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262156, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262172, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 262157, + Instance: "host/user", + }, + { + CounterId: 262157, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262151, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262152, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262153, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262171, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 262155, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 262148, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 851968, + Instance: "vfc", + }, +} + +// ********************************* Resource pool metrics ********************************** +var ResourcePoolMetrics = []types.PerfMetricId{ + { + CounterId: 5, + Instance: "", + }, + { + CounterId: 65586, + Instance: "", + }, + { + CounterId: 65591, + Instance: "", + }, + { + CounterId: 65545, + Instance: "", + }, + { + CounterId: 65553, + Instance: "", + }, + { + CounterId: 65541, + Instance: "", + }, + { + CounterId: 65549, + Instance: "", + }, + { + CounterId: 65582, + Instance: "", + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go new file mode 100644 index 000000000..fbd7876b7 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go @@ -0,0 +1,1202 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +var MetricData = map[string]map[int32][]int64{ + "VirtualMachine": VmMetricData, + "HostSystem": HostMetricData, + "ResourcePool": ResourcePoolMetricData, +} + +var VmMetricData = map[int32][]int64{ + 131078: []int64{105, 91, 90, 120, 103, 65, 84, 486, 377, 483, 268, 3788, 5638, 417, 114, 51, 50, 31, 388, 22, + 19, 24, 83, 69, 22, 21, 47, 9, 68, 22, 12, 34, 137, 94, 68, 82, 53, 88, 73, 24, + 45, 35, 42, 52, 104, 103, 112, 124, 91, 111, 183, 82, 85, 40, 54, 27, 29, 17, 30, 23, + 32, 20, 30, 17, 38, 16, 14, 134, 92, 27, 16, 34, 28, 45, 39, 21, 37, 46, 65, 187, + 122, 551, 295, 121, 130, 84, 207, 128, 57, 34, 18, 38, 25, 25, 42, 21, 16, 117, 78, 20, + }, + 262144: []int64{2953459, 2953479, 2953499, 2953519, 2953539, 2953559, 2953579, 2953599, 2953619, 2953639, 2953659, 2953679, 2953699, 2953719, 2953739, 2953759, 2953779, 2953799, 2953819, 2953839, + 2953859, 2953879, 2953899, 2953919, 2953939, 2953959, 2953979, 2953999, 2954019, 2954039, 2954059, 2954079, 2954099, 2954119, 2954139, 2954159, 2954179, 2954199, 2954219, 2954239, + 2954259, 2954279, 2954299, 2954319, 2954339, 2954359, 2954379, 2954399, 2954419, 2954439, 2954459, 2954479, 2954499, 2954519, 2954539, 2954559, 2954579, 2954599, 2954619, 2954639, + 2954659, 2954679, 2954699, 2954719, 2954739, 2954759, 2954779, 2954799, 2954819, 2954839, 2954859, 2954879, 2954899, 2954919, 2954939, 2954959, 2954979, 2954999, 2955019, 2955039, + 2955059, 2955079, 2955099, 2955119, 2955139, 2955159, 2955179, 2955199, 2955219, 2955239, 2955259, 2955279, 2955299, 2955319, 2955339, 2955359, 2955379, 2955399, 2955419, 2955439, + }, + 589826: []int64{0, 1, 0, 23, 0, 0, 0, 62, 2, 5, 2, 3134, 4717, 81, 3, 0, 2, 0, 73, 0, + 1, 0, 4, 0, 0, 3, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 10, 0, 0, 0, + 0, 3, 5, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 0, 0, 2, 0, + 0, 1, 0, 0, 1, 0, 0, 4, 0, 0, 1, 3, 2, 0, 1, 1, 1, 0, 0, 0, + 0, 352, 62, 0, 0, 0, 17, 1, 0, 1, 1, 0, 0, 0, 0, 2, 0, 5, 0, 0, + }, + 27: []int64{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327684: []int64{2100, 1900, 2100, 2100, 2100, 2100, 2100, 2500, 3900, 4000, 4200, 4500, 4600, 7200, 7200, 7200, 7200, 7200, 7200, 7200, + 7200, 7200, 5700, 5700, 5700, 5700, 5100, 3800, 2300, 1900, 1900, 2100, 2100, 2000, 2000, 2000, 2000, 2000, 2100, 2000, + 2000, 2000, 2000, 2000, 2000, 2000, 1800, 1800, 1800, 1800, 1800, 1800, 1700, 1700, 1800, 1800, 1800, 1800, 1800, 1800, + 1800, 1900, 2000, 2000, 2000, 2000, 2000, 2600, 3700, 3700, 3700, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 4000, 6400, 2200, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 1900, 2100, 2100, 2100, + }, + 589827: []int64{185, 221, 201, 190, 213, 180, 183, 3167, 675, 806, 640, 1307, 1853, 985, 283, 202, 244, 188, 189, 223, + 190, 193, 516, 150, 100, 135, 127, 92, 160, 103, 101, 160, 203, 188, 238, 195, 206, 1006, 215, 168, + 234, 202, 185, 238, 197, 195, 229, 199, 207, 244, 696, 179, 231, 155, 122, 100, 153, 107, 107, 140, + 107, 91, 145, 100, 120, 147, 99, 3340, 2031, 123, 101, 153, 103, 120, 152, 89, 123, 236, 194, 234, + 181, 397, 536, 205, 210, 238, 201, 188, 205, 234, 183, 192, 222, 183, 238, 189, 185, 2573, 269, 168, + }, + 65591: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 262145: []int64{30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + }, + 131095: []int64{0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0, 1, 1, 1, 3, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 13, 0, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, + }, + 327680: []int64{900, 900, 1100, 1200, 1200, 1000, 900, 2100, 3100, 4200, 4000, 4300, 4500, 6200, 5300, 3900, 1400, 1000, 1100, 1100, + 1000, 900, 1100, 1100, 1300, 1000, 1400, 1200, 1400, 1000, 1000, 900, 1000, 1100, 1000, 1000, 900, 1000, 1200, 1100, + 1000, 1200, 1200, 1300, 900, 900, 900, 900, 1100, 1000, 1100, 900, 900, 1200, 1400, 1300, 1300, 1100, 1200, 900, + 1000, 900, 1000, 1100, 1200, 1000, 900, 2600, 4400, 4400, 2600, 1300, 1200, 1300, 1000, 1000, 1000, 900, 1100, 1000, + 1000, 1500, 1700, 1800, 1200, 1000, 1300, 1300, 1400, 1000, 1000, 900, 1000, 1100, 1000, 1000, 900, 1800, 1900, 1900, + }, + 65628: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196612: []int64{2225, 3281, 1618, 2063, 1848, 1873, 2184, 7480, 8118, 10104, 10870, 9808, 10400, 13222, 2843, 2012, 3354, 1841, 2146, 1756, + 1978, 2008, 1907, 1994, 2224, 3298, 2051, 2094, 1828, 2006, 2211, 3199, 1709, 1954, 1759, 1851, 2318, 1896, 1896, 2121, + 3276, 1983, 2205, 1779, 1689, 2019, 3311, 1876, 2034, 1907, 1961, 2015, 1749, 1927, 2294, 3313, 2048, 1981, 1967, 1848, + 2192, 3359, 1871, 1895, 1966, 1923, 2129, 3255, 1851, 1869, 3261, 1965, 2286, 1853, 1894, 1937, 3358, 1834, 2190, 1876, + 1949, 2031, 1892, 1787, 2014, 3183, 1621, 1724, 1817, 1774, 2141, 3293, 1798, 2044, 1798, 1832, 2108, 1780, 1946, 2000, + }, + 196619: []int64{338, 541, 275, 276, 274, 277, 338, 518, 546, 597, 677, 545, 606, 600, 305, 280, 542, 274, 351, 275, + 276, 275, 277, 276, 339, 391, 292, 275, 274, 276, 337, 541, 275, 275, 275, 276, 340, 277, 276, 276, + 389, 292, 337, 274, 276, 275, 542, 274, 339, 275, 274, 275, 278, 274, 340, 389, 293, 276, 274, 277, + 339, 543, 289, 274, 277, 275, 337, 280, 274, 274, 390, 290, 339, 276, 274, 277, 542, 276, 339, 275, + 274, 277, 277, 274, 340, 404, 275, 274, 277, 275, 338, 541, 274, 275, 275, 274, 340, 275, 276, 275, + }, + 196628: []int64{346, 555, 281, 282, 280, 283, 347, 528, 557, 609, 691, 554, 618, 611, 312, 286, 556, 280, 360, 281, + 282, 281, 281, 282, 347, 400, 298, 282, 280, 282, 346, 555, 281, 281, 281, 282, 348, 283, 282, 282, + 399, 298, 345, 280, 282, 281, 556, 281, 348, 282, 281, 281, 284, 280, 348, 398, 300, 283, 280, 283, + 347, 557, 295, 280, 284, 282, 345, 286, 280, 280, 399, 297, 347, 282, 280, 283, 556, 282, 347, 281, + 280, 283, 283, 280, 348, 414, 281, 280, 283, 282, 347, 555, 280, 282, 282, 281, 348, 281, 282, 282, + }, + 196613: []int64{1045, 1729, 698, 934, 692, 804, 938, 5133, 5837, 7138, 7639, 7081, 7420, 9237, 1494, 953, 1727, 787, 1039, 739, + 801, 815, 800, 881, 1148, 1807, 970, 803, 770, 845, 1084, 1932, 824, 883, 844, 832, 1204, 818, 873, 810, + 1834, 920, 972, 857, 841, 804, 1671, 793, 1068, 782, 832, 851, 831, 776, 1161, 1701, 922, 809, 777, 765, + 1029, 1893, 788, 772, 790, 815, 1050, 1463, 736, 768, 1782, 864, 1144, 923, 780, 890, 1645, 766, 1146, 827, + 829, 938, 914, 787, 1153, 1815, 786, 735, 752, 821, 1070, 1742, 773, 760, 759, 850, 1071, 798, 809, 788, + }, + 1: []int64{459, 568, 565, 667, 468, 400, 428, 2434, 1844, 1903, 2087, 2129, 2462, 4030, 755, 424, 599, 426, 669, 421, + 421, 458, 761, 611, 443, 740, 651, 400, 594, 441, 430, 545, 481, 579, 452, 435, 462, 584, 708, 389, + 765, 566, 439, 554, 417, 402, 579, 414, 645, 412, 538, 417, 465, 1149, 429, 746, 521, 388, 596, 389, + 445, 556, 566, 592, 488, 399, 457, 3707, 2176, 486, 774, 638, 457, 560, 475, 405, 579, 405, 663, 406, + 388, 1451, 624, 592, 474, 771, 662, 429, 588, 387, 452, 564, 452, 586, 451, 404, 444, 1771, 690, 397, + }, + 196614: []int64{246, 416, 202, 245, 203, 203, 245, 510, 474, 664, 776, 792, 927, 1261, 318, 259, 416, 203, 245, 203, + 217, 245, 218, 218, 246, 309, 216, 245, 203, 203, 246, 415, 203, 245, 203, 203, 260, 204, 203, 245, + 309, 215, 245, 203, 203, 245, 416, 203, 248, 203, 203, 245, 203, 203, 246, 308, 216, 245, 203, 203, + 246, 416, 203, 244, 203, 203, 245, 562, 203, 244, 308, 215, 246, 203, 203, 244, 416, 203, 245, 203, + 203, 245, 204, 203, 245, 320, 203, 244, 203, 203, 245, 416, 203, 245, 203, 203, 245, 203, 203, 245, + }, + 30: []int64{1889, 2375, 2401, 2804, 2005, 1726, 1848, 10236, 7642, 7872, 8787, 8676, 10432, 16327, 3168, 1797, 2525, 1766, 2769, 1788, + 1770, 1909, 3236, 2649, 1853, 3209, 2727, 1711, 2510, 1865, 1802, 2296, 2000, 2470, 1920, 1817, 1960, 2477, 2940, 1641, + 3366, 2229, 1820, 2288, 1733, 1693, 2534, 1742, 2643, 1721, 2257, 1705, 1966, 4724, 1806, 3226, 2100, 1688, 2475, 1648, + 1920, 2305, 2364, 2465, 1997, 1649, 1950, 15409, 8946, 2036, 3316, 2566, 1886, 2273, 2041, 1687, 2450, 1777, 2788, 1725, + 1647, 5924, 2638, 2466, 1963, 3281, 2712, 1828, 2480, 1654, 1898, 2356, 1888, 2469, 1915, 1691, 1840, 7415, 2902, 1648, + }, + 327683: []int64{1000, 1000, 1100, 1100, 1100, 1100, 1100, 1300, 1500, 1700, 1900, 2100, 2400, 2900, 3000, 3000, 3000, 2900, 2900, 2900, + 2900, 2900, 2700, 2500, 2300, 2200, 2000, 1700, 1200, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1000, 1100, 1000, 1100, 1100, 1000, 1100, 1100, 1100, 1100, 1100, 1100, 1100, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1400, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, + 1700, 1800, 1500, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1100, 1200, 1200, 1200, + }, + 65627: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 655379: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196622: []int64{20, 20, 20, 20, 21, 20, 20, 24, 20, 20, 22, 20, 20, 20, 20, 20, 20, 21, 20, 20, + 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 22, 20, 24, 20, 20, + 20, 20, 21, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, 20, 20, 20, 21, 20, + 21, 20, 20, 20, 20, 20, 20, 25, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, + 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 19, 20, 21, 20, 20, 20, 20, 20, 21, 20, + }, + 65603: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327685: []int64{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2700, 2800, 2800, 2800, 2800, 2800, 2800, + 2800, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1100, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, + 1000, 1000, 1100, 1000, 1100, 1000, 1000, 1400, 1600, 1600, 1600, 1600, 1600, 1600, 1700, 1600, 1700, 1600, 1600, 1600, + 1600, 1800, 1400, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1000, 1200, 1200, 1200, + }, + 196615: []int64{338, 541, 275, 276, 274, 277, 338, 518, 546, 597, 677, 545, 606, 600, 305, 280, 542, 274, 351, 275, + 276, 275, 277, 276, 339, 391, 292, 275, 274, 276, 337, 541, 275, 275, 275, 276, 340, 277, 276, 276, + 389, 292, 337, 274, 276, 275, 542, 274, 339, 275, 274, 275, 278, 274, 340, 389, 293, 276, 274, 277, + 339, 543, 289, 274, 277, 275, 337, 280, 274, 274, 390, 290, 339, 276, 274, 277, 542, 276, 339, 275, + 274, 277, 277, 274, 340, 404, 275, 274, 277, 275, 338, 541, 274, 275, 275, 274, 340, 275, 276, 275, + }, + 327689: []int64{1300, 1700, 2000, 2200, 2200, 2200, 1200, 7000, 7000, 7000, 4800, 7500, 7500, 11300, 11300, 11300, 4800, 1800, 2300, 2300, + 2300, 1300, 2600, 2600, 2600, 2200, 3700, 3700, 3700, 1900, 1900, 1900, 1900, 1900, 1800, 1800, 1500, 2100, 2600, 2600, + 2600, 3700, 3700, 3700, 1800, 1800, 1700, 1700, 1900, 1900, 1900, 1500, 1500, 4100, 4100, 4100, 3700, 3700, 3700, 1800, + 1800, 1900, 1900, 1900, 1900, 1700, 1500, 11100, 11100, 11100, 10400, 4000, 4000, 4000, 1800, 1800, 2100, 2100, 2100, 2100, + 2100, 7600, 7600, 7600, 2000, 2000, 3800, 3800, 3800, 1900, 1900, 1900, 1900, 2000, 2000, 2000, 1500, 9100, 9100, 9100, + }, + 196609: []int64{584, 957, 478, 521, 477, 480, 584, 1029, 1020, 1261, 1453, 1337, 1533, 1861, 624, 539, 959, 477, 597, 478, + 494, 520, 496, 494, 585, 700, 508, 521, 477, 480, 583, 957, 478, 520, 478, 479, 600, 481, 479, 521, + 699, 507, 583, 477, 479, 520, 958, 478, 588, 479, 478, 520, 481, 478, 586, 698, 509, 521, 478, 480, + 585, 959, 492, 519, 481, 479, 583, 843, 478, 519, 699, 506, 585, 479, 478, 522, 958, 479, 585, 478, + 478, 522, 481, 478, 585, 724, 478, 518, 480, 479, 584, 958, 478, 520, 479, 478, 586, 478, 480, 520, + }, + 196627: []int64{240, 397, 197, 239, 197, 198, 239, 491, 467, 656, 767, 778, 921, 1255, 312, 253, 398, 197, 239, 197, + 212, 239, 198, 212, 240, 301, 204, 239, 197, 198, 240, 397, 197, 239, 197, 198, 254, 198, 198, 239, + 301, 204, 239, 197, 197, 239, 398, 198, 242, 198, 198, 239, 197, 198, 240, 301, 205, 239, 198, 198, + 240, 398, 198, 238, 198, 198, 239, 547, 198, 238, 301, 204, 240, 197, 198, 238, 398, 197, 239, 198, + 198, 239, 198, 197, 239, 307, 197, 238, 197, 197, 239, 398, 197, 239, 197, 197, 239, 198, 198, 239, + }, + 327691: []int64{1900, 1700, 2000, 2000, 2000, 2000, 2000, 2300, 3600, 3900, 3900, 4200, 4300, 6900, 6900, 6900, 6900, 6900, 6900, 6900, + 6900, 6900, 5200, 5200, 5200, 5200, 4800, 3700, 2200, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + 1900, 1900, 1900, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1700, 1700, 1800, 1800, 1800, 1800, 1800, 1800, + 1800, 1900, 1900, 1900, 1900, 1900, 1900, 2500, 3700, 3700, 3700, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 4000, 6000, 2100, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + }, + 196623: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65549: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327688: []int64{2300, 2300, 2300, 2300, 2300, 2400, 2400, 2400, 2400, 2200, 2100, 1900, 1800, 1700, 1800, 1800, 1800, 1800, 1800, 1800, + 1800, 1800, 1700, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, + 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1500, 1500, 1400, 1400, 1300, 1200, 1000, 1000, + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1100, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, + 1200, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, + }, + 65582: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 32: []int64{25, 24, 26, 25, 30, 27, 29, 68, 43, 51, 54, 65, 48, 46, 30, 24, 28, 26, 25, 29, + 24, 27, 35, 28, 28, 36, 34, 23, 32, 24, 22, 28, 20, 24, 25, 26, 27, 24, 26, 24, + 29, 25, 26, 23, 24, 29, 26, 25, 26, 22, 23, 26, 28, 22, 23, 25, 26, 24, 20, 25, + 31, 25, 19, 21, 22, 21, 30, 35, 32, 29, 27, 27, 24, 25, 24, 24, 23, 24, 25, 24, + 26, 26, 24, 23, 21, 30, 34, 23, 25, 25, 28, 29, 23, 22, 28, 24, 26, 33, 27, 23, + }, + 196616: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 26: []int64{217, 224, 259, 290, 282, 249, 216, 489, 724, 988, 925, 1006, 1057, 1432, 1233, 916, 342, 231, 273, 255, + 244, 208, 264, 269, 299, 239, 325, 290, 323, 235, 240, 228, 238, 259, 249, 239, 221, 242, 286, 273, + 247, 282, 293, 311, 229, 221, 218, 225, 260, 242, 254, 220, 229, 297, 330, 318, 300, 265, 296, 227, + 232, 217, 252, 276, 276, 240, 222, 617, 1020, 1019, 617, 300, 299, 315, 241, 230, 231, 229, 272, 249, + 236, 357, 392, 426, 276, 246, 305, 300, 326, 233, 231, 225, 242, 262, 248, 233, 213, 417, 449, 458, + }, + 31: []int64{43400, 44800, 51800, 58000, 56400, 49800, 43200, 97800, 144800, 197600, 185000, 201200, 211400, 286400, 246600, 183200, 68400, 46200, 54600, 51000, + 48800, 41600, 52800, 53800, 59800, 47800, 65000, 58000, 64600, 47000, 48000, 45600, 47600, 51800, 49800, 47800, 44200, 48400, 57200, 54600, + 49400, 56400, 58600, 62200, 45800, 44200, 43600, 45000, 52000, 48400, 50800, 44000, 45800, 59400, 66000, 63600, 60000, 53000, 59200, 45400, + 46400, 43400, 50400, 55200, 55200, 48000, 44400, 123400, 204000, 203800, 123400, 60000, 59800, 63000, 48200, 46000, 46200, 45800, 54400, 49800, + 47200, 71400, 78400, 85200, 55200, 49200, 61000, 60000, 65200, 46600, 46200, 45000, 48400, 52400, 49600, 46600, 42600, 83400, 89800, 91600, + }, + 25: []int64{50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + }, + 65553: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65607: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 28: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327681: []int64{1400, 1900, 2100, 2200, 2200, 2200, 1300, 7200, 7200, 7200, 5200, 8000, 8000, 11800, 11800, 11800, 5100, 1800, 2300, 2300, + 2300, 1400, 2700, 2700, 2700, 2300, 3800, 3800, 3800, 1900, 1900, 2100, 2100, 2100, 2000, 2000, 1600, 2100, 2700, 2700, + 2700, 4100, 4100, 4100, 1800, 1800, 1700, 1700, 1900, 1900, 1900, 1600, 1600, 4100, 4100, 4100, 3700, 3700, 3700, 1800, + 1800, 2000, 2000, 2000, 2000, 1800, 1600, 11400, 11400, 11400, 10900, 4000, 4000, 4000, 1800, 1800, 2200, 2200, 2200, 2200, + 2200, 7700, 7700, 7700, 2100, 2100, 3800, 3800, 3800, 1900, 1900, 2200, 2200, 2200, 2100, 2100, 1600, 9400, 9400, 9400, + }, + 262170: []int64{2861015, 2861045, 2861045, 2861075, 2861105, 2861105, 2861135, 2861165, 2861165, 2861195, 2861225, 2861225, 2861255, 2861285, 2861285, 2861315, 2861345, 2861345, 2861375, 2861405, + 2861405, 2861435, 2861465, 2861465, 2861495, 2861525, 2861525, 2861555, 2861585, 2861585, 2861615, 2861645, 2861645, 2861675, 2861705, 2861705, 2861735, 2861765, 2861765, 2861795, + 2861825, 2861825, 2861855, 2861885, 2861885, 2861915, 2861945, 2861945, 2861975, 2862005, 2862005, 2862035, 2862065, 2862065, 2862095, 2862125, 2862125, 2862155, 2862185, 2862185, + 2862215, 2862245, 2862245, 2862275, 2862305, 2862305, 2862335, 2862365, 2862365, 2862395, 2862425, 2862425, 2862455, 2862485, 2862485, 2862515, 2862545, 2862545, 2862575, 2862605, + 2862605, 2862635, 2862665, 2862665, 2862695, 2862725, 2862725, 2862755, 2862785, 2862785, 2862815, 2862845, 2862845, 2862875, 2862905, 2862905, 2862935, 2862965, 2862965, 2862995, + }, + 327686: []int64{2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2300, 2200, 2100, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + 1900, 1900, 1800, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, + 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1600, 1600, 1500, 1400, 1400, 1300, 1100, 1100, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1200, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, + 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1400, 1400, 1400, + }, + 327690: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327694: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 720898: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65619: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 5: []int64{211, 261, 260, 307, 215, 184, 197, 1121, 849, 876, 961, 980, 1134, 1856, 347, 195, 276, 196, 308, 193, + 194, 211, 350, 281, 204, 341, 300, 184, 273, 203, 198, 251, 221, 267, 208, 200, 212, 269, 326, 179, + 352, 260, 202, 255, 192, 185, 266, 191, 297, 189, 248, 192, 214, 529, 198, 344, 240, 178, 274, 179, + 205, 256, 260, 273, 225, 183, 210, 1708, 1002, 224, 356, 294, 211, 258, 218, 186, 266, 186, 305, 187, + 179, 668, 287, 273, 218, 355, 305, 197, 271, 178, 208, 260, 208, 270, 208, 186, 204, 816, 317, 183, + }, + 12: []int64{1711, 2153, 2171, 2558, 1771, 1503, 1598, 9515, 7128, 7337, 8062, 8181, 9498, 15824, 2927, 1603, 2297, 1593, 2559, 1573, + 1578, 1731, 2944, 2338, 1647, 2816, 2499, 1511, 2280, 1659, 1629, 2050, 1832, 2202, 1711, 1617, 1743, 2257, 2729, 1455, + 2939, 2164, 1645, 2127, 1545, 1509, 2199, 1561, 2466, 1539, 2068, 1561, 1767, 4473, 1625, 2855, 1997, 1445, 2282, 1465, + 1664, 2104, 2168, 2258, 1855, 1498, 1716, 14725, 8581, 1833, 2979, 2449, 1722, 2119, 1846, 1524, 2224, 1522, 2550, 1509, + 1477, 5683, 2386, 2276, 1781, 2955, 2527, 1618, 2245, 1464, 1687, 2148, 1688, 2238, 1720, 1516, 1656, 6995, 2664, 1458, + }, + 131079: []int64{185, 221, 201, 190, 213, 180, 183, 3168, 675, 806, 641, 1307, 1853, 985, 283, 202, 244, 188, 189, 223, + 190, 193, 516, 150, 100, 135, 127, 92, 160, 103, 101, 160, 203, 188, 238, 195, 206, 1006, 215, 168, + 234, 202, 185, 238, 197, 195, 229, 199, 207, 244, 700, 179, 231, 155, 122, 100, 153, 107, 107, 140, + 107, 91, 145, 100, 120, 147, 99, 3340, 2031, 123, 101, 153, 103, 120, 152, 89, 123, 236, 194, 234, + 181, 397, 544, 197, 221, 227, 201, 188, 205, 234, 183, 192, 222, 183, 238, 189, 185, 2573, 269, 168, + }, + 29: []int64{9, 10, 10, 10, 11, 8, 10, 43, 34, 38, 34, 67, 101, 52, 14, 8, 10, 9, 16, 7, + 8, 7, 14, 9, 8, 11, 12, 6, 9, 8, 7, 8, 10, 8, 9, 10, 9, 11, 11, 7, + 10, 9, 7, 9, 10, 8, 12, 9, 10, 10, 13, 9, 9, 10, 8, 9, 9, 5, 8, 7, + 8, 8, 8, 7, 9, 6, 7, 27, 19, 7, 10, 9, 7, 8, 8, 6, 9, 8, 9, 11, + 9, 19, 15, 10, 10, 11, 13, 10, 9, 9, 7, 8, 9, 7, 8, 7, 8, 18, 10, 7, + }, + 65537: []int64{3500, 3500, 3500, 3199, 3199, 3199, 3699, 3699, 3699, 3799, 3799, 3799, 3799, 3799, 3799, 3500, 3500, 3500, 3299, 3299, + 3299, 3399, 3399, 3399, 3399, 3399, 3399, 3199, 3199, 3199, 3299, 3299, 3299, 3299, 3299, 3299, 3199, 3199, 3199, 3199, + 3199, 3199, 3399, 3399, 3399, 3399, 3399, 3399, 3099, 3099, 3099, 3299, 3299, 3299, 3799, 3799, 3799, 3099, 3099, 3099, + 3500, 3500, 3500, 3399, 3399, 3399, 3399, 3399, 3399, 3699, 3699, 3699, 3699, 3699, 3699, 4000, 4000, 4000, 3899, 3899, + 3899, 3500, 3500, 3500, 3299, 3299, 3299, 3599, 3599, 3599, 3299, 3299, 3299, 3199, 3199, 3199, 3199, 3199, 3199, 3099, + }, + 65635: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65611: []int64{10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + }, + 65622: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 14: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65541: []int64{10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + }, + 327687: []int64{10500, 10500, 10500, 10500, 10500, 10500, 10500, 10500, 10500, 9400, 6400, 4600, 4400, 4400, 4500, 4500, 4500, 4500, 4500, 4500, + 4500, 4500, 4200, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 3900, 3800, 2700, 2600, 2100, 1900, 1800, + 1800, 1900, 1900, 1900, 1900, 1900, 1900, 2000, 2100, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2100, 2100, + 2100, 2200, 2200, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, + }, + 65545: []int64{3670016, 3670016, 3670016, 3355440, 3355440, 3355440, 3879728, 3879728, 3879728, 3984588, 3984588, 3984588, 3984588, 3984588, 3984588, 3670016, 3670016, 3670016, 3460300, 3460300, + 3460300, 3565156, 3565156, 3565156, 3565156, 3565156, 3565156, 3355440, 3355440, 3355440, 3460300, 3460300, 3460300, 3460300, 3460300, 3460300, 3355440, 3355440, 3355440, 3355440, + 3355440, 3355440, 3565156, 3565156, 3565156, 3565156, 3565156, 3565156, 3250584, 3250584, 3250584, 3460300, 3460300, 3460300, 3984588, 3984588, 3984588, 3250584, 3250584, 3250584, + 3670016, 3670016, 3670016, 3565156, 3565156, 3565156, 3565156, 3565156, 3565156, 3879728, 3879728, 3879728, 3879728, 3879728, 3879728, 4194304, 4194304, 4194304, 4089444, 4089444, + 4089444, 3670016, 3670016, 3670016, 3460300, 3460300, 3460300, 3774872, 3774872, 3774872, 3460300, 3460300, 3460300, 3355440, 3355440, 3355440, 3355440, 3355440, 3355440, 3250584, + }, + 65586: []int64{57744, 57744, 57744, 57760, 57760, 57760, 57760, 57760, 57760, 57792, 57792, 57792, 57712, 57712, 57712, 57824, 57824, 57824, 57840, 57840, + 57840, 57856, 57856, 57856, 57776, 57776, 57776, 57888, 57888, 57888, 57696, 57696, 57696, 57712, 57712, 57712, 57824, 57824, 57824, 57856, + 57856, 57856, 57888, 57888, 57888, 57904, 57904, 57904, 57904, 57904, 57904, 57920, 57920, 57920, 57936, 57936, 57936, 57856, 57856, 57856, + 57968, 57968, 57872, 57984, 57984, 57984, 58000, 57904, 57904, 57824, 57824, 57824, 57840, 57840, 57840, 57760, 57760, 57760, 57776, 57888, + 57888, 57696, 57696, 57696, 57808, 57808, 57808, 57712, 57936, 57936, 57840, 57840, 57840, 57840, 57952, 57952, 57760, 57872, 57872, 57872, + }, + 65624: []int64{84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + }, + 65634: []int64{57744, 57744, 57744, 57760, 57760, 57760, 57760, 57760, 57760, 57792, 57792, 57792, 57712, 57712, 57712, 57824, 57824, 57824, 57840, 57840, + 57840, 57856, 57856, 57856, 57776, 57776, 57776, 57888, 57888, 57888, 57696, 57696, 57696, 57712, 57712, 57712, 57824, 57824, 57824, 57856, + 57856, 57856, 57888, 57888, 57888, 57904, 57904, 57904, 57904, 57904, 57904, 57920, 57920, 57920, 57936, 57936, 57936, 57856, 57856, 57856, + 57968, 57968, 57872, 57984, 57984, 57984, 58000, 57904, 57904, 57824, 57824, 57824, 57840, 57840, 57840, 57760, 57760, 57760, 57776, 57888, + 57888, 57696, 57696, 57696, 57808, 57808, 57808, 57712, 57936, 57936, 57840, 57840, 57840, 57840, 57952, 57952, 57760, 57872, 57872, 57872, + }, + 65626: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65629: []int64{10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + }, + 65621: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65623: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327695: []int64{160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + }, + 13: []int64{37978, 37501, 37462, 37066, 37839, 38140, 38011, 29354, 32106, 31822, 30939, 30913, 29139, 23406, 36679, 38089, 37345, 38110, 37061, 38081, + 38120, 37966, 36595, 37207, 38021, 36634, 37109, 38187, 37335, 38029, 38098, 37573, 37880, 37394, 37941, 38053, 37909, 37384, 36931, 38248, + 36492, 37654, 38055, 37596, 38126, 38157, 37319, 38123, 37220, 38150, 37587, 38157, 37893, 32654, 38076, 36665, 37776, 38207, 37424, 38241, + 37941, 37582, 37542, 37439, 37894, 38254, 37917, 24375, 30881, 37834, 36563, 37313, 37999, 37605, 37848, 38206, 37440, 38100, 37089, 38127, + 38208, 33912, 37191, 37407, 37916, 36568, 37091, 38034, 37393, 38237, 37976, 37508, 38001, 37419, 37956, 38192, 38043, 32389, 36953, 38248, + }, + 327682: []int64{800, 900, 1000, 1200, 1100, 1000, 800, 1900, 2900, 4000, 3700, 4000, 4200, 5800, 5000, 3700, 1400, 900, 1100, 1000, + 1000, 800, 1000, 1100, 1200, 900, 1300, 1100, 1300, 900, 900, 900, 900, 1000, 1000, 900, 800, 900, 1100, 1100, + 1000, 1100, 1100, 1200, 900, 900, 900, 900, 1000, 1000, 1000, 900, 900, 1200, 1300, 1300, 1200, 1100, 1200, 900, + 900, 800, 1000, 1100, 1100, 900, 800, 2500, 4200, 4200, 2500, 1200, 1200, 1300, 1000, 900, 900, 900, 1100, 1000, + 900, 1400, 1600, 1700, 1100, 900, 1200, 1200, 1300, 900, 900, 900, 900, 1000, 1000, 900, 800, 1700, 1800, 1900, + }, + 65595: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65618: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196621: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196620: []int64{53, 31, 40, 39, 38, 34, 42, 276, 414, 530, 550, 290, 179, 96, 38, 51, 46, 34, 40, 35, + 43, 38, 42, 31, 47, 47, 34, 43, 42, 39, 39, 36, 35, 42, 42, 41, 42, 47, 43, 41, + 36, 32, 40, 50, 36, 38, 43, 39, 36, 32, 35, 41, 45, 35, 36, 43, 42, 35, 43, 36, + 49, 41, 32, 51, 44, 45, 38, 49, 34, 47, 38, 42, 45, 49, 40, 28, 48, 34, 40, 34, + 47, 34, 48, 43, 33, 39, 34, 39, 39, 46, 36, 49, 38, 34, 33, 44, 40, 37, 51, 36, + }, + 24: []int64{83, 108, 82, 102, 104, 96, 105, 276, 193, 208, 261, 221, 312, 203, 105, 85, 105, 79, 92, 103, + 85, 85, 122, 120, 94, 151, 106, 87, 104, 91, 79, 106, 76, 104, 93, 89, 96, 93, 94, 84, + 150, 54, 83, 77, 85, 88, 130, 83, 84, 79, 82, 74, 89, 97, 81, 132, 65, 97, 82, 84, + 108, 89, 81, 86, 71, 71, 104, 225, 136, 94, 128, 72, 77, 78, 87, 79, 95, 100, 98, 90, + 83, 102, 99, 84, 82, 123, 100, 90, 98, 85, 95, 109, 74, 92, 91, 82, 86, 152, 98, 84, + }, + 65632: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65633: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 131073: []int64{290, 313, 292, 310, 317, 245, 267, 3654, 1052, 1289, 909, 5095, 7491, 1402, 397, 253, 294, 220, 577, 245, + 210, 217, 600, 219, 122, 157, 175, 101, 229, 125, 113, 194, 340, 282, 306, 277, 259, 1095, 289, 192, + 280, 238, 227, 291, 301, 299, 341, 324, 299, 355, 884, 262, 316, 195, 176, 127, 183, 124, 137, 164, + 139, 111, 175, 117, 159, 163, 114, 3475, 2124, 150, 117, 187, 132, 166, 192, 111, 160, 282, 259, 421, + 304, 948, 840, 318, 352, 312, 408, 316, 263, 269, 201, 230, 248, 208, 281, 211, 202, 2690, 347, 189, + }, + 10: []int64{38008, 37528, 37491, 37093, 37873, 38166, 38033, 29492, 32179, 31921, 30994, 31066, 29370, 23484, 36708, 38107, 37359, 38126, 37127, 38097, + 38132, 37979, 36623, 37238, 38032, 36645, 37131, 38194, 37359, 38040, 38105, 37590, 37920, 37431, 37973, 38079, 37929, 37422, 36953, 38261, + 36518, 37666, 38075, 37616, 38170, 38191, 37362, 38155, 37250, 38189, 37648, 38186, 37925, 35180, 38096, 36675, 37795, 38213, 37441, 38251, + 37950, 37594, 37558, 37443, 37914, 38263, 37927, 24447, 30924, 37848, 36574, 37326, 38012, 37623, 37861, 38214, 37454, 38126, 37111, 38178, + 38246, 33970, 37262, 37439, 37949, 36598, 37151, 38072, 37418, 38245, 37985, 37527, 38015, 37441, 37972, 38208, 38054, 32457, 36985, 38260, + }, + 327696: []int64{6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + }, + 196618: []int64{246, 416, 202, 245, 203, 203, 245, 510, 474, 664, 776, 792, 927, 1261, 318, 259, 416, 203, 245, 203, + 217, 245, 218, 218, 246, 309, 216, 245, 203, 203, 246, 415, 203, 245, 203, 203, 260, 204, 203, 245, + 309, 215, 245, 203, 203, 245, 416, 203, 248, 203, 203, 245, 203, 203, 246, 308, 216, 245, 203, 203, + 246, 416, 203, 244, 203, 203, 245, 562, 203, 244, 308, 215, 246, 203, 203, 244, 416, 203, 245, 203, + 203, 245, 204, 203, 245, 320, 203, 244, 203, 203, 245, 416, 203, 245, 203, 203, 245, 203, 203, 245, + }, + 65620: []int64{3145728, 3145728, 3145728, 2831152, 2831152, 2831152, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 2831152, 2831152, 2831152, 2621440, 2621440, + 2621440, 2516580, 2516580, 2516580, 2411724, 2411724, 2516580, 2516580, 2516580, 2516580, 2516580, 2516580, 2516580, 2726296, 2726296, 2726296, 2726296, 2726296, 2726296, 2411724, + 2411724, 2411724, 2621440, 2726296, 2726296, 2831152, 2831152, 2831152, 2411724, 2411724, 2411724, 2516580, 2516580, 2516580, 3040868, 3040868, 3040868, 2411724, 2621440, 2621440, + 2936012, 2936012, 2936012, 2936012, 2936012, 2936012, 2411724, 2411724, 2411724, 2936012, 2936012, 2936012, 2936012, 2936012, 2936012, 2621440, 2621440, 2621440, 2621440, 2621440, + 2621440, 2411724, 2411724, 2411724, 2306864, 2306864, 2306864, 2726296, 2726296, 2726296, 2306864, 2411724, 2621440, 2621440, 2621440, 2621440, 2411724, 2411724, 2411724, 2411724, + }, + 720896: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65599: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327693: []int64{10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 9300, 6200, 4300, 4100, 4100, 4200, 4200, 4200, 4200, 4200, 4200, + 4200, 4200, 3900, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, 3800, + 3800, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3600, 3500, 2600, 2500, 1900, 1800, 1800, + 1800, 1800, 1900, 1800, 1800, 1800, 1800, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 2100, 2100, + 2100, 2100, 2100, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2100, 2100, 2000, + }, + 327692: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196617: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 9: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 11: []int64{102, 98, 107, 101, 122, 108, 120, 272, 175, 206, 218, 262, 194, 187, 120, 97, 115, 108, 103, 117, + 97, 111, 140, 113, 115, 145, 140, 92, 130, 97, 90, 114, 80, 100, 103, 108, 109, 100, 106, 98, + 117, 103, 104, 95, 97, 116, 105, 101, 107, 91, 93, 108, 113, 92, 96, 101, 104, 97, 84, 102, + 127, 102, 80, 87, 91, 88, 123, 143, 128, 116, 109, 109, 98, 104, 99, 99, 95, 97, 101, 96, + 107, 105, 99, 94, 88, 121, 138, 95, 104, 100, 115, 118, 96, 90, 113, 98, 105, 133, 108, 94, + }, +} + +var HostMetricData = map[int32][]int64{ + 786434: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 786433: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196621: []int64{12, 6, 12, 14, 14, 3, 9, 10, 8, 8, 7, 4, 13, 10, 2, 10, 12, 5, 8, 14, + 4, 10, 10, 5, 7, 13, 4, 9, 13, 6, 10, 11, 5, 5, 15, 6, 7, 8, 6, 11, + 11, 3, 6, 16, 4, 5, 9, 11, 9, 9, 6, 10, 14, 4, 4, 13, 11, 4, 14, 7, + 10, 12, 4, 7, 14, 9, 3, 12, 9, 8, 9, 9, 3, 14, 9, 4, 11, 9, 5, 12, + 10, 3, 13, 10, 4, 8, 12, 7, 10, 8, 4, 14, 11, 2, 8, 15, 7, 6, 8, 9, + }, + 65648: []int64{125627793408, 125627793408, 129922760704, 129922760704, 132070244352, 132070244352, 133143986176, 133143986176, 133143986176, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, + 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 134217728000, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, + 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, 135291469824, + 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, + 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, 136365211648, + }, + 196617: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 720897: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 655379: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 786432: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65580: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65553: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327688: []int64{3000, 2800, 2700, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2400, 2300, 2300, 2300, 2300, 2300, 2400, + 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2300, 2400, 2400, 2300, 2400, 2300, 2300, + 2300, 2300, 2300, 2300, 2200, 2200, 2100, 2000, 2000, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1900, 2000, + 2000, 2000, 2000, 2000, 1900, 2000, 1900, 1900, 1900, 1900, 1900, 1900, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, + 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2100, 2000, 2000, 2000, 2000, 2000, 2100, 2100, 2100, 2100, 2000, 2000, + }, + 65569: []int64{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + }, + 65618: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65599: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65651: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65623: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65621: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65545: []int64{5148100, 5152036, 5152036, 5068216, 5066748, 5066748, 4668288, 4667468, 4667532, 4415832, 4414556, 4414556, 4645244, 4643896, 4643832, 4476060, 4477808, 4477328, 4393504, 4394380, + 4394380, 4415352, 4414368, 4414368, 4582080, 4667244, 4709192, 4604396, 4601648, 4601236, 4223616, 4266064, 4308068, 4517720, 4517808, 4517808, 4895296, 4894212, 4894148, 4160148, + 4160652, 4160716, 4496260, 4497200, 4497260, 4895660, 4894568, 4894504, 4160500, 4160176, 4160176, 4789388, 4790264, 4790264, 4517628, 4559080, 4601088, 4601024, 4601032, 4601032, + 4831780, 4833388, 4833324, 4833324, 4831012, 4831076, 5313912, 5314316, 5314316, 4999740, 5003640, 5003544, 4584148, 4622376, 4622376, 4412724, 4580436, 4664320, 5146664, 5147684, + 5147684, 4833048, 4411892, 4453836, 4349040, 4394232, 4394168, 4394168, 4770512, 4770576, 4665656, 4202908, 4202908, 4832052, 5002572, 5002508, 4583080, 4498160, 4498224, 4707940, + }, + 5: []int64{1092, 1227, 1198, 1351, 2006, 529, 356, 461, 353, 508, 352, 354, 418, 546, 477, 362, 521, 476, 472, 467, + 369, 363, 431, 383, 462, 367, 360, 372, 469, 509, 343, 534, 408, 402, 416, 353, 346, 445, 390, 461, + 353, 411, 357, 437, 690, 353, 508, 424, 482, 434, 339, 363, 479, 426, 430, 387, 342, 406, 1875, 1155, + 393, 520, 501, 373, 419, 381, 366, 466, 353, 465, 344, 378, 822, 463, 435, 380, 575, 460, 481, 428, + 342, 409, 444, 367, 427, 374, 386, 366, 982, 485, 364, 584, 411, 372, 568, 374, 341, 454, 345, 445, + }, + 14: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65622: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65628: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65537: []int64{5407, 5407, 5407, 5407, 5411, 5407, 5407, 5407, 5407, 5410, 5407, 5407, 5407, 5407, 5410, 5407, 5407, 5407, 5407, 5407, + 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5409, 5406, 5406, 5406, 5406, 5409, 5406, 5406, 5406, 5406, 5407, 5406, + 5406, 5406, 5406, 5406, 5406, 5406, 5406, 5409, 5406, 5406, 5406, 5406, 5411, 5406, 5406, 5406, 5406, 5408, 5406, 5406, + 5406, 5406, 5406, 5406, 5406, 5406, 5411, 5407, 5407, 5407, 5407, 5412, 5407, 5407, 5407, 5407, 5409, 5407, 5407, 5407, + 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5407, 5409, 5407, 5407, 5407, 5407, 5411, 5407, 5407, 5407, 5407, + }, + 65643: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65649: []int64{35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + }, + 11: []int64{442, 507, 594, 440, 424, 313, 293, 343, 303, 291, 355, 295, 320, 387, 294, 337, 379, 376, 322, 354, + 304, 291, 320, 275, 295, 307, 327, 336, 316, 316, 327, 311, 310, 310, 279, 324, 311, 311, 310, 297, + 280, 279, 313, 325, 283, 316, 303, 305, 340, 324, 308, 342, 322, 292, 292, 287, 278, 332, 401, 322, + 341, 342, 318, 296, 319, 300, 309, 337, 290, 313, 301, 327, 343, 293, 309, 272, 342, 365, 353, 315, + 308, 317, 362, 266, 291, 334, 325, 319, 352, 302, 333, 362, 308, 302, 315, 320, 291, 325, 337, 340, + }, + 24: []int64{201, 234, 226, 256, 192, 156, 146, 161, 149, 153, 164, 147, 150, 169, 162, 154, 186, 161, 153, 162, + 154, 143, 157, 143, 158, 153, 155, 155, 154, 149, 149, 180, 136, 152, 149, 150, 152, 171, 153, 146, + 149, 147, 144, 148, 146, 150, 168, 141, 161, 153, 152, 161, 153, 148, 146, 143, 145, 162, 200, 161, + 151, 169, 143, 145, 149, 150, 148, 158, 159, 152, 156, 152, 154, 155, 149, 148, 168, 157, 159, 158, + 150, 152, 166, 143, 151, 155, 148, 146, 180, 154, 151, 171, 152, 148, 204, 149, 148, 153, 149, 159, + }, + 196620: []int64{527, 555, 283, 168, 82, 35, 43, 38, 26, 32, 28, 39, 25, 32, 29, 37, 37, 29, 36, 28, + 35, 30, 26, 30, 35, 29, 37, 33, 34, 37, 31, 26, 27, 35, 35, 30, 31, 35, 33, 25, + 21, 32, 35, 29, 31, 31, 34, 31, 26, 34, 31, 39, 27, 28, 47, 31, 34, 34, 35, 27, + 37, 26, 38, 38, 35, 31, 25, 36, 25, 32, 25, 38, 32, 33, 34, 29, 28, 25, 34, 27, + 36, 33, 36, 28, 31, 25, 32, 33, 27, 44, 32, 36, 24, 38, 33, 24, 37, 28, 41, 27, + }, + 65586: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 524295: []int64{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65639: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 720898: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196613: []int64{12359, 13847, 11628, 12730, 13984, 5095, 4435, 8374, 4211, 5373, 4141, 4239, 4236, 4183, 4305, 5360, 7261, 5387, 4253, 4244, + 4291, 5295, 8625, 4227, 4310, 4256, 4233, 5376, 4226, 4323, 4232, 6436, 4482, 5155, 4311, 4271, 4243, 8395, 4262, 5290, + 4203, 4287, 4263, 4216, 4202, 5297, 6340, 4482, 4240, 4213, 4195, 5192, 8610, 4389, 4234, 4243, 4247, 5229, 4940, 4221, + 4192, 6390, 4424, 5325, 4357, 4193, 4315, 8399, 4195, 5331, 4307, 4246, 4339, 4309, 4229, 5336, 6628, 4303, 4215, 4213, + 4307, 5349, 8433, 4218, 4244, 4217, 4311, 5227, 4256, 4254, 4257, 7483, 4206, 5174, 4195, 4301, 4249, 8539, 4218, 5243, + }, + 1: []int64{2371, 2663, 2602, 2933, 4356, 1149, 773, 1002, 766, 1103, 764, 769, 908, 1187, 1035, 787, 1132, 1034, 1025, 1014, + 801, 789, 937, 832, 1004, 796, 783, 808, 1018, 1105, 745, 1161, 886, 874, 904, 766, 752, 967, 847, 1002, + 766, 893, 775, 950, 1499, 766, 1102, 920, 1047, 943, 737, 790, 1040, 926, 935, 840, 744, 883, 4070, 2508, + 853, 1129, 1088, 809, 909, 828, 795, 1012, 766, 1010, 748, 820, 1784, 1005, 944, 825, 1248, 1000, 1045, 929, + 743, 888, 965, 796, 927, 813, 838, 795, 2131, 1053, 790, 1269, 892, 807, 1233, 813, 742, 985, 749, 967, + }, + 720896: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65577: []int64{30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, + 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, + 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, + 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, + 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, 30618, + }, + 65620: []int64{4099524, 4103460, 4103460, 4061584, 4060116, 4060116, 3619708, 3618888, 3618952, 3451144, 3449868, 3449868, 3428896, 3427548, 3427484, 3196796, 3282432, 3386808, 3386872, 3387748, + 3387748, 3387748, 3386764, 3386764, 3764188, 3807412, 3807416, 3807480, 3804732, 3804320, 3196012, 3196516, 3238524, 3448176, 3553120, 3553120, 3909636, 3908552, 3908488, 3195456, + 3279848, 3279912, 3384768, 3385708, 3385768, 3826108, 3825016, 3824952, 3237752, 3447144, 3447144, 3887608, 3888484, 3888484, 3720712, 3887992, 3888056, 3363704, 3363712, 3363712, + 3762236, 3763844, 3763780, 3679896, 3677584, 3677648, 3573272, 3573676, 3573676, 3363964, 3367864, 3367768, 3116140, 3280200, 3280200, 3175404, 3343112, 3343112, 3804488, 3805508, + 3805508, 3386012, 3279432, 3489148, 3489212, 3492460, 3492396, 3282680, 3533196, 3533260, 3533196, 3196276, 3196276, 3615704, 3744280, 3744216, 3534504, 3491528, 3596448, 3596448, + }, + 65633: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196625: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196615: []int64{608, 692, 553, 618, 611, 312, 287, 556, 280, 360, 281, 282, 282, 281, 282, 347, 459, 357, 282, 280, + 282, 346, 555, 282, 281, 281, 282, 348, 283, 282, 282, 399, 299, 345, 281, 282, 281, 556, 281, 348, + 282, 281, 281, 284, 280, 348, 398, 300, 283, 280, 283, 347, 557, 296, 280, 284, 282, 345, 287, 281, + 280, 399, 297, 347, 282, 280, 283, 556, 282, 347, 282, 281, 283, 283, 281, 349, 414, 282, 280, 283, + 282, 347, 555, 281, 282, 282, 281, 348, 281, 282, 282, 470, 282, 347, 280, 282, 281, 558, 280, 347, + }, + 65630: []int64{961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, + 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, + 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, + 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, + 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, 961912, + }, + 65541: []int64{14892144, 14892144, 14892144, 14892144, 14892144, 14892144, 14892144, 14892144, 14892144, 14892148, 14892144, 14892132, 14892144, 14892144, 14892144, 14892144, 14892916, 14892208, 14892208, 14892208, + 14892196, 14892208, 14892208, 14892208, 14892196, 14892208, 14892208, 14892208, 14892208, 14890776, 14890304, 14890304, 14890304, 14890292, 14890304, 14890304, 14890304, 14890292, 14890304, 14890304, + 14890304, 14890304, 14890304, 14890304, 14890504, 14890304, 14890292, 14890304, 14890304, 14890304, 14890292, 14890304, 14890304, 14890304, 14890304, 14890304, 14890304, 14890304, 14890304, 14890292, + 14890304, 14890304, 14890304, 14890292, 14890304, 14890304, 14891100, 14893012, 14893012, 14893012, 14893012, 14892932, 14893000, 14893012, 14893012, 14893012, 14893000, 14893012, 14893012, 14893012, + 14893012, 14893012, 14893012, 14893012, 14893012, 14893000, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893012, 14893000, 14893012, + }, + 65647: []int64{268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + }, + 131078: []int64{489, 365, 4041, 5640, 417, 114, 51, 51, 31, 388, 22, 19, 26, 83, 81, 28, 23, 48, 9, 68, + 22, 13, 156, 137, 94, 69, 83, 53, 88, 86, 31, 46, 36, 42, 52, 105, 103, 112, 124, 92, + 111, 183, 82, 87, 55, 60, 27, 29, 18, 30, 23, 32, 20, 31, 17, 38, 16, 15, 136, 104, + 34, 16, 37, 28, 45, 39, 23, 37, 46, 65, 187, 123, 551, 296, 134, 136, 86, 208, 128, 57, + 36, 18, 38, 25, 25, 43, 21, 16, 117, 91, 27, 51, 31, 13, 118, 23, 8, 18, 20, 10, + }, + 65632: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65635: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196609: []int64{1283, 1482, 1350, 1564, 1898, 633, 548, 966, 484, 607, 485, 501, 529, 486, 501, 595, 773, 571, 529, 484, + 487, 593, 965, 485, 528, 485, 486, 610, 487, 487, 529, 709, 509, 593, 484, 486, 528, 966, 485, 598, + 486, 485, 528, 488, 485, 596, 709, 511, 529, 485, 488, 594, 967, 500, 527, 488, 486, 593, 850, 485, + 526, 710, 508, 595, 487, 485, 530, 966, 486, 594, 486, 485, 530, 488, 485, 596, 730, 485, 526, 487, + 486, 594, 965, 485, 529, 486, 485, 595, 485, 487, 528, 791, 486, 594, 484, 486, 528, 967, 485, 593, + }, + 65582: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 26: []int64{1144, 1078, 1165, 1217, 1592, 1383, 1058, 480, 367, 409, 392, 381, 359, 415, 420, 435, 374, 462, 470, 503, + 416, 378, 368, 376, 396, 384, 374, 357, 381, 425, 411, 385, 421, 435, 450, 367, 358, 355, 362, 396, + 379, 391, 358, 367, 434, 465, 452, 436, 446, 477, 407, 369, 354, 390, 414, 413, 375, 358, 755, 1160, + 1158, 755, 437, 438, 454, 380, 367, 368, 367, 411, 388, 373, 493, 529, 564, 415, 384, 444, 486, 512, + 417, 368, 364, 380, 400, 384, 370, 349, 554, 587, 597, 394, 435, 430, 505, 427, 414, 346, 357, 398, + }, + 196616: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65611: []int64{18083012, 18083020, 18082672, 18082320, 18096832, 18082492, 18082612, 18082524, 18082524, 18094536, 18082572, 18082408, 18082572, 18082524, 18091984, 18082412, 18083304, 18082412, 18082488, 18082560, + 18082556, 18082328, 18082328, 18082284, 18082288, 18082452, 18082412, 18082580, 18091268, 18081104, 18080724, 18080880, 18080836, 18088572, 18080924, 18080884, 18080764, 18080712, 18084604, 18080908, + 18080908, 18080864, 18080828, 18080828, 18081120, 18080800, 18080680, 18090892, 18080764, 18080764, 18080556, 18080876, 18095260, 18080768, 18080844, 18080848, 18080800, 18085776, 18080908, 18080480, + 18080556, 18080468, 18080424, 18080408, 18080532, 18080488, 18097776, 18083388, 18083248, 18083168, 18083548, 18099296, 18083164, 18083484, 18083440, 18083264, 18089172, 18083424, 18083264, 18083420, + 18083376, 18083632, 18083432, 18083388, 18083420, 18083300, 18083420, 18083340, 18083400, 18083356, 18091760, 18083240, 18083196, 18083212, 18083080, 18096856, 18083148, 18083208, 18083116, 18083196, + }, + 65557: []int64{26247692, 26247660, 26247884, 26247936, 26247912, 26247896, 26247884, 26248064, 26248056, 26247924, 26247980, 26248084, 26247812, 26247964, 26247916, 26247912, 26247996, 26248112, 26248032, 26248068, + 26248188, 26248088, 26247940, 26248096, 26248200, 26248040, 26248044, 26248052, 26248092, 26248084, 26248036, 26248056, 26248096, 26248080, 26248056, 26248052, 26248104, 26248164, 26248020, 26247996, + 26248016, 26248084, 26247964, 26247956, 26247908, 26247840, 26247932, 26247888, 26247920, 26247812, 26247900, 26247864, 26247840, 26247900, 26247916, 26247768, 26247876, 26247864, 26247660, 26248168, + 26248068, 26248104, 26248184, 26248232, 26248032, 26248144, 26247996, 26248160, 26248172, 26248112, 26248140, 26248100, 26248176, 26248064, 26248072, 26248076, 26248100, 26248084, 26248156, 26248076, + 26248180, 26248100, 26248064, 26248184, 26248076, 26248112, 26248100, 26248164, 26248012, 26248072, 26248100, 26247996, 26248064, 26248116, 26248068, 26248112, 26248084, 26248016, 26248144, 26248148, + }, + 327695: []int64{160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + }, + 27: []int64{0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327690: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65561: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327685: []int64{2400, 2500, 2800, 3000, 3500, 3600, 3600, 3600, 3500, 3500, 3500, 3500, 3500, 3400, 3200, 3000, 2800, 2600, 2400, 1900, + 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, + 1700, 1700, 1700, 1700, 1700, 1800, 1700, 1700, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 2100, 2400, + 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2300, 2400, 2300, 2300, 2500, 2200, 1900, 1800, 1800, 1800, 1900, 1900, + 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1700, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + }, + 23: []int64{114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + }, + 327680: []int64{5200, 4900, 5300, 5600, 7200, 6200, 4800, 2300, 1800, 2000, 1900, 1800, 1700, 2000, 2000, 2100, 1800, 2200, 2300, 2400, + 2000, 1800, 1800, 1800, 1900, 1900, 1800, 1700, 1800, 2000, 2000, 1800, 2000, 2100, 2100, 1800, 1700, 1700, 1800, 1900, + 1800, 1900, 1700, 1800, 2100, 2200, 2100, 2100, 2100, 2200, 1900, 1800, 1700, 1900, 2000, 2000, 1800, 1700, 3500, 5200, + 5200, 3400, 2100, 2100, 2200, 1800, 1800, 1800, 1800, 2000, 1800, 1800, 2300, 2500, 2600, 2000, 1800, 2100, 2300, 2400, + 2000, 1800, 1800, 1800, 1900, 1800, 1800, 1700, 2600, 2700, 2800, 1900, 2100, 2100, 2400, 2000, 2000, 1700, 1700, 1900, + }, + 327682: []int64{4800, 4500, 4900, 5100, 6700, 5800, 4500, 2100, 1600, 1800, 1700, 1600, 1600, 1800, 1900, 1900, 1600, 2000, 2100, 2200, + 1800, 1600, 1600, 1700, 1800, 1700, 1600, 1500, 1600, 1800, 1800, 1700, 1800, 1800, 1900, 1600, 1600, 1600, 1600, 1800, + 1700, 1700, 1600, 1600, 1900, 2000, 2000, 1900, 2000, 2100, 1800, 1600, 1600, 1700, 1800, 1800, 1600, 1500, 3200, 4900, + 4900, 3200, 1900, 1900, 2000, 1700, 1600, 1600, 1600, 1800, 1700, 1600, 2200, 2300, 2400, 1800, 1600, 1900, 2100, 2200, + 1800, 1600, 1600, 1700, 1700, 1700, 1600, 1500, 2400, 2500, 2600, 1700, 1900, 1900, 2200, 1800, 1800, 1500, 1600, 1700, + }, + 13: []int64{30507, 29370, 29577, 28286, 22549, 35395, 36907, 35994, 36930, 35587, 36940, 36931, 36357, 35252, 35857, 36852, 35470, 35858, 35896, 35942, + 36795, 36838, 36254, 36675, 35972, 36812, 36872, 36765, 35918, 35578, 37015, 35361, 36446, 36500, 36382, 36939, 36991, 36129, 36612, 35981, + 36941, 36419, 36901, 36198, 34003, 36927, 35597, 36310, 35809, 36222, 37054, 36835, 35841, 36294, 36256, 36635, 37025, 36485, 23728, 29935, + 36589, 35483, 35638, 36758, 36361, 36690, 36815, 35951, 36933, 35958, 37004, 36727, 32864, 35963, 36220, 36703, 35029, 35973, 35809, 36283, + 37029, 36442, 36143, 36809, 36288, 36751, 36645, 36831, 31459, 35776, 36844, 34924, 36427, 36770, 35067, 36742, 37038, 36052, 37007, 36133, + }, + 327696: []int64{6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + }, + 327684: []int64{5000, 5300, 5500, 5600, 8100, 8100, 8100, 8100, 8100, 8100, 8100, 8100, 8100, 6600, 6600, 6600, 6600, 6300, 5000, 3000, + 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3100, 3000, 3000, 3000, 2800, 2800, 2800, 2800, 2800, 2800, 2800, + 2800, 2800, 2800, 2600, 2600, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 3600, 4800, + 4800, 4800, 5200, 5200, 5200, 5200, 5200, 5200, 5200, 5200, 5200, 5200, 7100, 3300, 2900, 2900, 2900, 2900, 2900, 2900, + 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2800, 2900, 2900, 2900, 2900, 2900, 2800, 3100, 3100, 3100, 3100, 3100, 3100, + }, + 327691: []int64{4900, 4900, 5000, 5200, 7700, 7700, 7700, 7700, 7700, 7700, 7700, 7700, 7700, 6000, 6000, 6000, 6000, 5700, 4800, 2900, + 2800, 2800, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2600, 2600, 2600, 2600, 2600, 2600, 2600, + 2600, 2600, 2600, 2500, 2500, 2600, 2600, 2600, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 3300, 4600, + 4600, 4600, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 6800, 3100, 2700, 2700, 2700, 2700, 2700, 2700, + 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2600, 2700, 2800, 2800, 2800, 2800, 2600, 2900, 2900, 2900, 2900, 2900, 2900, + }, + 327692: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65549: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 10: []int64{70023, 69041, 68994, 67423, 61621, 74879, 76270, 75520, 76292, 75277, 76212, 76328, 75767, 74735, 75448, 76202, 74760, 75242, 75240, 75507, + 76158, 76286, 75747, 76105, 75603, 76122, 76222, 76086, 75538, 75135, 76414, 74674, 75772, 76192, 75750, 76329, 76346, 75522, 76299, 75414, + 76309, 75807, 76331, 76055, 73442, 76254, 74847, 75925, 75240, 75555, 76395, 76106, 75712, 75715, 75632, 76070, 76416, 76057, 62685, 69153, + 75966, 74759, 75466, 76168, 75749, 76032, 76373, 75576, 76225, 75289, 76308, 76384, 72178, 75402, 75594, 76098, 74719, 75249, 75086, 75570, + 76411, 76151, 75617, 76196, 75625, 76105, 76373, 76233, 70604, 75121, 76386, 74489, 75778, 76169, 73856, 76442, 76439, 75576, 76432, 75432, + }, + 196623: []int64{0, 5, 4, 5, 2, 0, 1, 4, 3, 0, 0, 0, 0, 4, 3, 0, 0, 0, 0, 4, + 2, 0, 0, 0, 4, 6, 2, 3, 8, 0, 0, 4, 0, 3, 0, 0, 0, 4, 0, 3, + 0, 0, 0, 4, 0, 2, 7, 1, 0, 5, 0, 1, 2, 0, 0, 4, 0, 0, 10, 0, + 0, 4, 0, 0, 3, 0, 0, 9, 1, 1, 4, 0, 0, 4, 0, 0, 1, 1, 0, 4, + 0, 0, 0, 3, 0, 4, 0, 0, 3, 5, 1, 4, 1, 0, 0, 2, 1, 4, 0, 0, + }, + 65646: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 262144: []int64{2953795, 2953815, 2953835, 2953855, 2953875, 2953895, 2953915, 2953935, 2953955, 2953975, 2953995, 2954015, 2954035, 2954055, 2954075, 2954095, 2954115, 2954135, 2954155, 2954175, + 2954195, 2954215, 2954235, 2954255, 2954275, 2954295, 2954315, 2954335, 2954355, 2954375, 2954395, 2954415, 2954435, 2954455, 2954475, 2954495, 2954515, 2954535, 2954555, 2954575, + 2954595, 2954615, 2954635, 2954655, 2954675, 2954695, 2954715, 2954735, 2954755, 2954775, 2954795, 2954815, 2954835, 2954855, 2954875, 2954895, 2954915, 2954935, 2954955, 2954975, + 2954995, 2955015, 2955035, 2955055, 2955075, 2955095, 2955115, 2955135, 2955155, 2955175, 2955195, 2955215, 2955235, 2955255, 2955275, 2955295, 2955315, 2955335, 2955355, 2955375, + 2955395, 2955415, 2955435, 2955455, 2955475, 2955495, 2955515, 2955535, 2955555, 2955575, 2955595, 2955615, 2955635, 2955655, 2955675, 2955695, 2955715, 2955735, 2955755, 2955775, + }, + 8: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 131079: []int64{807, 777, 1425, 1861, 991, 291, 217, 255, 197, 198, 231, 200, 611, 546, 162, 101, 143, 145, 102, 168, + 126, 113, 166, 213, 189, 245, 205, 206, 1023, 228, 170, 242, 219, 193, 245, 207, 196, 236, 209, 212, + 252, 710, 180, 253, 167, 124, 108, 171, 117, 122, 152, 112, 98, 156, 107, 127, 156, 100, 3353, 2054, + 129, 119, 173, 110, 130, 163, 90, 131, 247, 198, 244, 191, 398, 575, 209, 230, 234, 218, 203, 224, + 251, 188, 199, 233, 185, 250, 199, 186, 2582, 315, 176, 231, 266, 201, 256, 244, 190, 111, 158, 106, + }, + 131073: []int64{1296, 1143, 5467, 7501, 1409, 406, 269, 306, 228, 587, 254, 220, 638, 630, 243, 130, 167, 194, 111, 237, + 148, 126, 323, 350, 283, 315, 288, 259, 1112, 315, 202, 288, 255, 236, 298, 312, 299, 348, 334, 305, + 364, 894, 263, 340, 222, 184, 136, 200, 136, 153, 175, 144, 119, 187, 124, 166, 172, 116, 3489, 2158, + 163, 135, 210, 138, 175, 203, 114, 168, 293, 263, 431, 315, 949, 871, 343, 366, 321, 427, 331, 281, + 287, 206, 237, 258, 211, 294, 221, 203, 2699, 406, 203, 283, 297, 215, 374, 267, 199, 129, 179, 116, + }, + 65589: []int64{131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + }, + 65625: []int64{25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, + 25763, 25763, 25763, 25763, 25764, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, + 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, + 25763, 25763, 25763, 25764, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, + 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, 25763, + }, + 196612: []int64{16073, 18141, 16872, 19194, 25039, 6049, 4761, 7618, 3957, 4738, 3863, 4232, 4595, 3991, 4294, 4812, 7141, 4722, 4705, 3940, + 4134, 4807, 7470, 3830, 4575, 3872, 3968, 5070, 3991, 4036, 4699, 6582, 4164, 4810, 3901, 3809, 4601, 7575, 4003, 4657, + 4015, 4071, 4631, 3860, 4051, 4897, 6622, 4210, 4588, 4105, 4011, 4776, 7653, 3964, 4498, 4075, 4043, 4714, 9240, 3980, + 4452, 6584, 4162, 4865, 3995, 3999, 4528, 7621, 3956, 4759, 3999, 4062, 4604, 4019, 3924, 4620, 6589, 3762, 4330, 3922, + 3887, 4735, 7568, 3912, 4638, 3918, 3941, 4691, 3897, 4093, 4584, 7166, 3790, 4669, 3988, 3857, 4563, 7553, 3992, 4641, + }, + 196619: []int64{608, 692, 553, 618, 611, 312, 287, 556, 280, 360, 281, 282, 282, 281, 282, 347, 459, 357, 282, 280, + 282, 346, 555, 282, 281, 281, 282, 348, 283, 282, 282, 399, 299, 345, 281, 282, 281, 556, 281, 348, + 282, 281, 281, 284, 280, 348, 398, 300, 283, 280, 283, 347, 557, 296, 280, 284, 282, 345, 287, 281, + 280, 399, 297, 347, 282, 280, 283, 556, 282, 347, 282, 281, 283, 283, 281, 349, 414, 282, 280, 283, + 282, 347, 555, 281, 282, 282, 281, 348, 281, 282, 282, 470, 282, 347, 280, 282, 281, 558, 280, 347, + }, + 196622: []int64{65, 61, 48, 47, 49, 52, 55, 36, 53, 43, 38, 36, 60, 53, 67, 50, 53, 59, 58, 39, + 70, 71, 48, 62, 86, 46, 47, 71, 40, 44, 62, 42, 37, 77, 57, 39, 53, 45, 48, 72, + 40, 49, 82, 55, 45, 78, 69, 55, 65, 58, 91, 59, 67, 45, 67, 51, 50, 46, 57, 48, + 54, 41, 40, 47, 71, 39, 53, 39, 46, 52, 55, 41, 51, 61, 38, 51, 60, 53, 54, 37, + 37, 43, 42, 53, 62, 40, 40, 43, 48, 55, 51, 52, 39, 43, 40, 76, 52, 38, 62, 44, + }, + 65603: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 196626: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327689: []int64{8200, 5600, 9100, 9100, 12000, 12000, 12000, 5700, 2700, 2800, 2800, 2800, 2000, 3600, 3600, 3600, 3000, 4800, 4800, 4800, + 2900, 2600, 2900, 2900, 2900, 2400, 2400, 2200, 2900, 3400, 3400, 3400, 4800, 4800, 4800, 2600, 2600, 2700, 2700, 2700, + 2500, 2500, 2300, 2300, 4800, 4800, 4800, 4600, 4600, 4600, 2700, 2500, 2900, 2900, 2900, 2600, 2300, 2200, 11900, 11900, + 11900, 11300, 5000, 5000, 5000, 2600, 2600, 3100, 3100, 3100, 2700, 2700, 8200, 8200, 8200, 2700, 2700, 4700, 4700, 4700, + 2800, 2600, 2900, 2900, 2900, 2600, 2600, 2200, 9900, 9900, 9900, 2900, 4700, 4700, 5100, 5100, 5100, 3000, 3000, 3000, + }, + 16: []int64{1450, 1649, 1581, 1756, 2475, 782, 586, 716, 585, 756, 591, 582, 652, 816, 737, 597, 810, 731, 710, 720, + 604, 594, 686, 614, 715, 606, 595, 611, 711, 756, 571, 803, 651, 642, 653, 580, 580, 710, 629, 698, + 583, 647, 579, 673, 943, 586, 781, 651, 736, 674, 570, 603, 731, 667, 669, 612, 570, 676, 2294, 1460, + 626, 790, 736, 602, 651, 614, 597, 722, 596, 709, 580, 620, 1087, 713, 672, 611, 846, 704, 728, 672, + 572, 647, 693, 602, 666, 605, 615, 599, 1292, 736, 596, 864, 650, 605, 889, 610, 569, 703, 571, 688, + }, + 196624: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65573: []int64{14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + }, + 458759: []int64{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327681: []int64{8600, 6200, 9900, 9900, 12600, 12600, 12600, 6300, 2900, 3000, 3000, 3000, 2200, 3800, 3800, 3800, 3200, 5000, 5000, 5000, + 3000, 2800, 3200, 3200, 3200, 2600, 2600, 2400, 3100, 3600, 3600, 3600, 5300, 5300, 5300, 2800, 2800, 2900, 2900, 2900, + 2600, 2600, 2400, 2400, 4900, 4900, 4900, 4800, 4800, 4800, 2800, 2700, 3100, 3100, 3100, 2800, 2400, 2500, 12200, 12200, + 12200, 12000, 5200, 5200, 5200, 2700, 2700, 3300, 3300, 3300, 2900, 2900, 8400, 8400, 8400, 2900, 2900, 5000, 5000, 5000, + 2900, 2800, 3400, 3400, 3400, 2800, 2800, 2400, 10300, 10300, 10300, 3100, 4900, 4900, 5600, 5600, 5600, 3300, 3300, 3300, + }, + 131095: []int64{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65650: []int64{5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + }, + 65615: []int64{1747308, 1747308, 1746928, 1746884, 1746996, 1746840, 1746928, 1746840, 1746840, 1747020, 1746840, 1746704, 1746884, 1746840, 1746840, 1746884, 1746976, 1746708, 1746752, 1746752, + 1746708, 1746752, 1746752, 1746708, 1746616, 1746752, 1746708, 1746752, 1746752, 1746708, 1746752, 1746796, 1746752, 1746796, 1746796, 1746752, 1746796, 1746660, 1746752, 1746796, + 1746796, 1746752, 1746796, 1746796, 1746884, 1746928, 1746836, 1746928, 1746972, 1746972, 1746792, 1746972, 1746972, 1746928, 1746972, 1746972, 1746928, 1746972, 1746972, 1746572, + 1746752, 1746708, 1746664, 1746664, 1746708, 1746664, 1746912, 1746708, 1746664, 1746664, 1746708, 1746664, 1746528, 1746708, 1746664, 1746664, 1746752, 1746708, 1746708, 1746752, + 1746708, 1746708, 1746752, 1746708, 1746708, 1746616, 1746708, 1746708, 1746752, 1746708, 1746708, 1746752, 1746708, 1746708, 1746752, 1746708, 1746708, 1746752, 1746616, 1746708, + }, + 327694: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 327683: []int64{2600, 2800, 3000, 3200, 3800, 3900, 3900, 3900, 3800, 3800, 3800, 3800, 3900, 3600, 3400, 3200, 3000, 2800, 2600, 2100, + 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1900, 2000, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 2000, 1900, 2000, 1900, 1900, 2300, 2600, + 2600, 2600, 2600, 2600, 2500, 2600, 2600, 2600, 2500, 2500, 2500, 2500, 2700, 2300, 2000, 2000, 2000, 2000, 2100, 2100, + 2100, 2100, 2100, 2100, 2100, 2100, 2100, 1900, 2100, 2100, 2100, 2100, 2100, 2000, 2100, 2100, 2100, 2100, 2100, 2100, + }, + 327693: []int64{10000, 6800, 5200, 4900, 4900, 4900, 4900, 4900, 4900, 4900, 4900, 4900, 4900, 4900, 4700, 4700, 4700, 4700, 4700, 4700, + 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, 4700, + 4700, 4700, 4700, 4500, 4400, 4200, 3600, 3300, 2900, 2700, 2700, 2700, 2700, 2700, 2600, 2600, 2600, 2600, 2700, 2900, + 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2700, 2700, 2700, 2700, 2800, 2800, + 2800, 2800, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, 2900, + }, + 12: []int64{9486, 10654, 10409, 11735, 17425, 4598, 3092, 4011, 3066, 4413, 3059, 3076, 3635, 4749, 4143, 3150, 4531, 4138, 4101, 4058, + 3206, 3159, 3748, 3332, 4018, 3188, 3132, 3236, 4073, 4423, 2984, 4644, 3548, 3498, 3617, 3065, 3011, 3870, 3391, 4010, + 3066, 3575, 3102, 3801, 5998, 3066, 4411, 3683, 4191, 3775, 2950, 3160, 4163, 3706, 3741, 3364, 2977, 3533, 16280, 10036, + 3415, 4519, 4354, 3240, 3639, 3314, 3183, 4051, 3065, 4041, 2994, 3283, 7138, 4024, 3780, 3302, 4995, 4000, 4182, 3719, + 2974, 3554, 3863, 3186, 3710, 3254, 3354, 3184, 8526, 4216, 3161, 5076, 3568, 3231, 4932, 3254, 2968, 3942, 2997, 3871, + }, + 327687: []int64{10200, 7100, 5600, 5300, 5300, 5500, 5500, 5500, 5500, 5500, 5500, 5500, 5500, 5200, 4900, 4900, 4900, 5000, 5000, 5000, + 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, + 5000, 5000, 5000, 4800, 4800, 4700, 3800, 3600, 3000, 2900, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2900, 3100, + 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 2900, 2900, 2900, 2900, 2900, 2900, + 2900, 2900, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, 3100, + }, + 65619: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 32: []int64{55, 63, 74, 55, 53, 39, 36, 42, 37, 36, 44, 36, 40, 48, 36, 42, 47, 47, 40, 44, + 38, 36, 40, 34, 36, 38, 40, 42, 39, 39, 40, 38, 38, 38, 34, 40, 38, 38, 38, 37, + 35, 34, 39, 40, 35, 39, 37, 38, 42, 40, 38, 42, 40, 36, 36, 35, 34, 41, 50, 40, + 42, 42, 39, 37, 39, 37, 38, 42, 36, 39, 37, 40, 42, 36, 38, 34, 42, 45, 44, 39, + 38, 39, 45, 33, 36, 41, 40, 39, 44, 37, 41, 45, 38, 37, 39, 40, 36, 40, 42, 42, + }, + 196618: []int64{674, 789, 796, 945, 1287, 321, 261, 410, 203, 247, 203, 218, 246, 204, 219, 247, 314, 214, 247, 203, + 204, 247, 409, 203, 246, 203, 204, 262, 204, 204, 246, 310, 210, 247, 203, 203, 246, 409, 204, 250, + 204, 204, 246, 204, 204, 247, 310, 211, 246, 204, 204, 247, 410, 204, 246, 204, 204, 247, 563, 204, + 246, 310, 210, 247, 204, 204, 246, 409, 204, 247, 204, 204, 246, 204, 204, 247, 316, 203, 246, 203, + 203, 247, 409, 204, 246, 203, 203, 247, 204, 204, 246, 320, 203, 247, 204, 203, 247, 409, 204, 246, + }, + 196614: []int64{674, 789, 796, 945, 1287, 321, 261, 410, 203, 247, 203, 218, 246, 204, 219, 247, 314, 214, 247, 203, + 204, 247, 409, 203, 246, 203, 204, 262, 204, 204, 246, 310, 210, 247, 203, 203, 246, 409, 204, 250, + 204, 204, 246, 204, 204, 247, 310, 211, 246, 204, 204, 247, 410, 204, 246, 204, 204, 247, 563, 204, + 246, 310, 210, 247, 204, 204, 246, 409, 204, 247, 204, 204, 246, 204, 204, 247, 316, 203, 246, 203, + 203, 247, 409, 204, 246, 203, 203, 247, 204, 204, 246, 320, 203, 247, 204, 203, 247, 409, 204, 246, + }, + 20: []int64{2651, 2993, 2857, 3209, 4556, 1453, 1097, 1315, 1091, 1417, 1095, 1082, 1225, 1503, 1371, 1105, 1499, 1360, 1335, 1345, + 1119, 1109, 1261, 1150, 1332, 1129, 1105, 1138, 1324, 1407, 1063, 1485, 1207, 1186, 1221, 1078, 1082, 1317, 1174, 1316, + 1090, 1213, 1084, 1259, 1786, 1093, 1448, 1209, 1372, 1262, 1070, 1118, 1359, 1244, 1247, 1152, 1066, 1215, 4266, 2733, + 1167, 1466, 1366, 1122, 1225, 1146, 1113, 1333, 1104, 1325, 1076, 1151, 2059, 1314, 1256, 1142, 1566, 1299, 1363, 1257, + 1063, 1205, 1289, 1123, 1250, 1128, 1155, 1119, 2410, 1370, 1113, 1592, 1193, 1122, 1559, 1138, 1063, 1292, 1069, 1281, + }, + 327686: []int64{3200, 3000, 2900, 2700, 2700, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2700, 2600, 2600, 2600, 2600, 2600, 2600, + 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, + 2600, 2600, 2600, 2500, 2400, 2400, 2300, 2200, 2100, 2000, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 2000, 2100, + 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, + 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, + }, +} + +var ResourcePoolMetricData = map[int32][]int64{ + 65586: []int64{100088, 100088, 100088, 100120, 100136, 100136, 100088, 100088, 100088, 99928, 100040, 100040, 100072, 100184, 100184, 99912, 99912, 99912, 100040, 100040, + 100040, 100168, 100168, 100168, 100216, 100328, 100328, 100376, 100376, 100376, 100216, 100328, 100328, 100360, 100360, 100360, 100280, 100280, 100280, 100120, + 100120, 100120, 100040, 100040, 100040, 100152, 100184, 100088, 100120, 100120, 100120, 100056, 100184, 100184, 100104, 100008, 100008, 99960, 100072, 100072, + 100104, 100216, 100120, 100136, 100376, 100376, 100088, 100312, 100312, 100328, 100248, 100248, 100152, 100200, 100200, 100104, 100216, 100216, 100216, 100248, + 100248, 100056, 100184, 100184, 100184, 100024, 100024, 100024, 99864, 99864, 99976, 99992, 100104, 99912, 99944, 99944, 99752, 100008, 100008, 99912, + }, + 65582: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65591: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65545: []int64{4675424, 4674976, 4674976, 4423348, 4422168, 4422168, 4652808, 4652812, 4652812, 4484880, 4484988, 4484988, 4401132, 4401248, 4401248, 4421948, 4421944, 4421944, 4589848, 4673740, + 4715684, 4610952, 4610976, 4610976, 4233536, 4275568, 4317508, 4527272, 4527268, 4527268, 4904596, 4904704, 4904704, 4170736, 4170740, 4170740, 4506204, 4506196, 4506196, 4904496, + 4904508, 4904508, 4170424, 4170416, 4170416, 4799676, 4799708, 4799612, 4527008, 4568956, 4610900, 4610836, 4610956, 4610956, 4841560, 4841508, 4841508, 4841460, 4841536, 4841536, + 5323920, 5324036, 5323940, 5009380, 5009608, 5009608, 4589892, 4632056, 4632056, 4422356, 4590056, 4673940, 5156188, 5156236, 5156236, 4841568, 4422256, 4464200, 4359340, 4401308, + 4401308, 4401116, 4778724, 4778724, 4673868, 4212344, 4212344, 4841488, 5009132, 5009132, 4589816, 4505964, 4506076, 4715600, 4547796, 4547796, 4337888, 4338148, 4338148, 4233192, + }, + 65553: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 65541: []int64{14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, + 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, + 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, + 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, + 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, 14712240, + }, + 65549: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 5: []int64{311, 393, 308, 427, 310, 310, 370, 475, 399, 319, 460, 422, 426, 389, 327, 315, 372, 336, 386, 326, + 316, 328, 391, 446, 296, 489, 366, 319, 372, 308, 302, 386, 304, 417, 309, 367, 311, 340, 646, 307, + 467, 357, 422, 391, 296, 324, 376, 378, 389, 342, 300, 328, 1836, 1120, 349, 471, 419, 327, 374, 338, + 300, 386, 312, 422, 304, 296, 783, 409, 389, 337, 486, 421, 438, 389, 293, 328, 381, 324, 387, 328, + 302, 323, 937, 437, 301, 503, 369, 327, 539, 295, 297, 392, 293, 403, 323, 341, 337, 506, 397, 318, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go new file mode 100644 index 000000000..8364cebba --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go @@ -0,0 +1,154 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "time" + + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// ResourcePool is the default template for ResourcePool properties. +// Capture method: +// +// govc pool.info "*" -dump +var ResourcePool = mo.ResourcePool{ + ManagedEntity: mo.ManagedEntity{ + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "ResourcePool", Value: "ha-root-pool"}, + Value: nil, + AvailableField: nil, + }, + Parent: &types.ManagedObjectReference{Type: "ComputeResource", Value: "ha-compute-res"}, + CustomValue: nil, + OverallStatus: "green", + ConfigStatus: "green", + ConfigIssue: nil, + EffectiveRole: []int32{-1}, + Permission: nil, + Name: "Resources", + DisabledMethod: []string{"CreateVApp", "CreateChildVM_Task"}, + RecentTask: nil, + DeclaredAlarmState: nil, + TriggeredAlarmState: nil, + AlarmActionsEnabled: (*bool)(nil), + Tag: nil, + }, + Summary: &types.ResourcePoolSummary{ + DynamicData: types.DynamicData{}, + Name: "Resources", + Config: types.ResourceConfigSpec{ + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "ResourcePool", Value: "ha-root-pool"}, + ChangeVersion: "", + LastModified: (*time.Time)(nil), + CpuAllocation: types.ResourceAllocationInfo{ + DynamicData: types.DynamicData{}, + Reservation: types.NewInt64(4121), + ExpandableReservation: types.NewBool(false), + Limit: types.NewInt64(4121), + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 9000, + Level: "custom", + }, + OverheadLimit: nil, + }, + MemoryAllocation: types.ResourceAllocationInfo{ + DynamicData: types.DynamicData{}, + Reservation: types.NewInt64(961), + ExpandableReservation: types.NewBool(false), + Limit: types.NewInt64(961), + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 9000, + Level: "custom", + }, + OverheadLimit: nil, + }, + }, + Runtime: types.ResourcePoolRuntimeInfo{ + DynamicData: types.DynamicData{}, + Memory: types.ResourcePoolResourceUsage{ + DynamicData: types.DynamicData{}, + ReservationUsed: 0, + ReservationUsedForVm: 0, + UnreservedForPool: 1007681536, + UnreservedForVm: 1007681536, + OverallUsage: 0, + MaxUsage: 1007681536, + }, + Cpu: types.ResourcePoolResourceUsage{ + DynamicData: types.DynamicData{}, + ReservationUsed: 0, + ReservationUsedForVm: 0, + UnreservedForPool: 4121, + UnreservedForVm: 4121, + OverallUsage: 0, + MaxUsage: 4121, + }, + OverallStatus: "green", + }, + QuickStats: (*types.ResourcePoolQuickStats)(nil), + ConfiguredMemoryMB: 0, + }, + Runtime: types.ResourcePoolRuntimeInfo{ + DynamicData: types.DynamicData{}, + Memory: types.ResourcePoolResourceUsage{ + DynamicData: types.DynamicData{}, + ReservationUsed: 0, + ReservationUsedForVm: 0, + UnreservedForPool: 1007681536, + UnreservedForVm: 1007681536, + OverallUsage: 0, + MaxUsage: 1007681536, + }, + Cpu: types.ResourcePoolResourceUsage{ + DynamicData: types.DynamicData{}, + ReservationUsed: 0, + ReservationUsedForVm: 0, + UnreservedForPool: 4121, + UnreservedForVm: 4121, + OverallUsage: 0, + MaxUsage: 4121, + }, + OverallStatus: "green", + }, + Owner: types.ManagedObjectReference{Type: "ComputeResource", Value: "ha-compute-res"}, + ResourcePool: nil, + Vm: nil, + Config: types.ResourceConfigSpec{ + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "ResourcePool", Value: "ha-root-pool"}, + ChangeVersion: "", + LastModified: (*time.Time)(nil), + CpuAllocation: types.ResourceAllocationInfo{ + DynamicData: types.DynamicData{}, + Reservation: types.NewInt64(4121), + ExpandableReservation: types.NewBool(false), + Limit: types.NewInt64(4121), + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 9000, + Level: "custom", + }, + OverheadLimit: nil, + }, + MemoryAllocation: types.ResourceAllocationInfo{ + DynamicData: types.DynamicData{}, + Reservation: types.NewInt64(961), + ExpandableReservation: types.NewBool(false), + Limit: types.NewInt64(961), + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 9000, + Level: "custom", + }, + OverheadLimit: nil, + }, + }, + ChildConfiguration: nil, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go new file mode 100644 index 000000000..353598c6e --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go @@ -0,0 +1,65 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import ( + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// RootFolder is the default template for the ServiceContent rootFolder property. +// Capture method: +// +// govc folder.info -dump / +var RootFolder = mo.Folder{ + ManagedEntity: mo.ManagedEntity{ + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-root"}, + Value: nil, + AvailableField: nil, + }, + Parent: (*types.ManagedObjectReference)(nil), + CustomValue: nil, + OverallStatus: "green", + ConfigStatus: "green", + ConfigIssue: nil, + EffectiveRole: []int32{-1}, + Permission: []types.Permission{ + { + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-root"}, + Principal: "vpxuser", + Group: false, + RoleId: -1, + Propagate: true, + }, + { + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-root"}, + Principal: "dcui", + Group: false, + RoleId: -1, + Propagate: true, + }, + { + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-root"}, + Principal: "root", + Group: false, + RoleId: -1, + Propagate: true, + }, + }, + Name: "ha-folder-root", + DisabledMethod: nil, + RecentTask: nil, + DeclaredAlarmState: nil, + TriggeredAlarmState: nil, + AlarmActionsEnabled: (*bool)(nil), + Tag: nil, + }, + ChildType: []string{"Datacenter"}, + ChildEntity: nil, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go new file mode 100644 index 000000000..918b2625b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go @@ -0,0 +1,75 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// ServiceContent is the default template for the ServiceInstance content property. +// Capture method: +// +// govc object.collect -s -dump - content +var ServiceContent = types.ServiceContent{ + RootFolder: types.ManagedObjectReference{Type: "Folder", Value: "ha-folder-root"}, + PropertyCollector: types.ManagedObjectReference{Type: "PropertyCollector", Value: "ha-property-collector"}, + ViewManager: &types.ManagedObjectReference{Type: "ViewManager", Value: "ViewManager"}, + About: types.AboutInfo{ + Name: "VMware ESXi", + FullName: "VMware ESXi 6.5.0 build-5969303", + Vendor: "VMware, Inc.", + Version: "6.5.0", + Build: "5969303", + LocaleVersion: "INTL", + LocaleBuild: "000", + OsType: "vmnix-x86", + ProductLineId: "embeddedEsx", + ApiType: "HostAgent", + ApiVersion: "6.5", + InstanceUuid: "", + LicenseProductName: "VMware ESX Server", + LicenseProductVersion: "6.0", + }, + Setting: &types.ManagedObjectReference{Type: "OptionManager", Value: "HostAgentSettings"}, + UserDirectory: &types.ManagedObjectReference{Type: "UserDirectory", Value: "ha-user-directory"}, + SessionManager: &types.ManagedObjectReference{Type: "SessionManager", Value: "ha-sessionmgr"}, + AuthorizationManager: &types.ManagedObjectReference{Type: "AuthorizationManager", Value: "ha-authmgr"}, + ServiceManager: &types.ManagedObjectReference{Type: "ServiceManager", Value: "ha-servicemanager"}, + PerfManager: &types.ManagedObjectReference{Type: "PerformanceManager", Value: "ha-perfmgr"}, + ScheduledTaskManager: (*types.ManagedObjectReference)(nil), + AlarmManager: (*types.ManagedObjectReference)(nil), + EventManager: &types.ManagedObjectReference{Type: "EventManager", Value: "ha-eventmgr"}, + TaskManager: &types.ManagedObjectReference{Type: "TaskManager", Value: "ha-taskmgr"}, + ExtensionManager: (*types.ManagedObjectReference)(nil), + CustomizationSpecManager: (*types.ManagedObjectReference)(nil), + CustomFieldsManager: (*types.ManagedObjectReference)(nil), + AccountManager: &types.ManagedObjectReference{Type: "HostLocalAccountManager", Value: "ha-localacctmgr"}, + DiagnosticManager: &types.ManagedObjectReference{Type: "DiagnosticManager", Value: "ha-diagnosticmgr"}, + LicenseManager: &types.ManagedObjectReference{Type: "LicenseManager", Value: "ha-license-manager"}, + SearchIndex: &types.ManagedObjectReference{Type: "SearchIndex", Value: "ha-searchindex"}, + FileManager: &types.ManagedObjectReference{Type: "FileManager", Value: "ha-nfc-file-manager"}, + DatastoreNamespaceManager: &types.ManagedObjectReference{Type: "DatastoreNamespaceManager", Value: "ha-datastore-namespace-manager"}, + VirtualDiskManager: &types.ManagedObjectReference{Type: "VirtualDiskManager", Value: "ha-vdiskmanager"}, + VirtualizationManager: (*types.ManagedObjectReference)(nil), + SnmpSystem: (*types.ManagedObjectReference)(nil), + VmProvisioningChecker: (*types.ManagedObjectReference)(nil), + VmCompatibilityChecker: (*types.ManagedObjectReference)(nil), + OvfManager: &types.ManagedObjectReference{Type: "OvfManager", Value: "ha-ovf-manager"}, + IpPoolManager: (*types.ManagedObjectReference)(nil), + DvSwitchManager: &types.ManagedObjectReference{Type: "DistributedVirtualSwitchManager", Value: "ha-dvsmanager"}, + HostProfileManager: (*types.ManagedObjectReference)(nil), + ClusterProfileManager: (*types.ManagedObjectReference)(nil), + ComplianceManager: (*types.ManagedObjectReference)(nil), + LocalizationManager: &types.ManagedObjectReference{Type: "LocalizationManager", Value: "ha-l10n-manager"}, + StorageResourceManager: &types.ManagedObjectReference{Type: "StorageResourceManager", Value: "ha-storage-resource-manager"}, + GuestOperationsManager: &types.ManagedObjectReference{Type: "GuestOperationsManager", Value: "ha-guest-operations-manager"}, + OverheadMemoryManager: (*types.ManagedObjectReference)(nil), + CertificateManager: (*types.ManagedObjectReference)(nil), + IoFilterManager: (*types.ManagedObjectReference)(nil), + VStorageObjectManager: &types.ManagedObjectReference{Type: "HostVStorageObjectManager", Value: "ha-vstorage-object-manager"}, + HostSpecManager: (*types.ManagedObjectReference)(nil), + CryptoManager: &types.ManagedObjectReference{Type: "CryptoManager", Value: "ha-crypto-manager"}, + HealthUpdateManager: (*types.ManagedObjectReference)(nil), + FailoverClusterConfigurator: (*types.ManagedObjectReference)(nil), + FailoverClusterManager: (*types.ManagedObjectReference)(nil), +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/setting.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/setting.go new file mode 100644 index 000000000..43b8fcc03 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/setting.go @@ -0,0 +1,28 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// HardwareVersion is the default VirtualMachine.Config.Version +var HardwareVersion = "vmx-13" + +// AdvancedOptions is captured from ESX's HostSystem.configManager.advancedOption +// Capture method: +// +// govc object.collect -s -dump $(govc object.collect -s HostSystem:ha-host configManager.advancedOption) setting +var AdvancedOptions = []types.BaseOptionValue{ + // This list is currently pruned to include a single option for testing + &types.OptionValue{ + Key: "Config.HostAgent.log.level", + Value: "info", + }, +} + +// Setting is captured from ESX's HostSystem.ServiceContent.setting +// Capture method: +// +// govc object.collect -s -dump OptionManager:HostAgentSettings setting +var Setting = []types.BaseOptionValue{} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go new file mode 100644 index 000000000..3b167b0b8 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go @@ -0,0 +1,10401 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// Description is the default template for the TaskManager description property. +// Capture method: +// +// govc object.collect -s -dump TaskManager:ha-taskmgr description +var Description = types.TaskDescription{ + MethodInfo: []types.BaseElementDescription{ + &types.ElementDescription{ + Description: types.Description{ + Label: "Set cluster resource custom value", + Summary: "Sets the value of a custom field for a cluster of objects as a unified compute-resource", + }, + Key: "ClusterComputeResource.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload cluster", + Summary: "Reloads the cluster", + }, + Key: "ClusterComputeResource.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename cluster", + Summary: "Rename the compute-resource", + }, + Key: "ClusterComputeResource.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove cluster", + Summary: "Deletes the cluster compute-resource and removes it from its parent folder (if any)", + }, + Key: "ClusterComputeResource.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the cluster", + }, + Key: "ClusterComputeResource.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Removes a set of tags from the cluster", + }, + Key: "ClusterComputeResource.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ClusterComputeResource.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure cluster", + Summary: "Reconfigures a cluster", + }, + Key: "ClusterComputeResource.reconfigureEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure cluster", + Summary: "Reconfigures a cluster", + }, + Key: "ClusterComputeResource.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply recommendation", + Summary: "Applies a recommendation", + }, + Key: "ClusterComputeResource.applyRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel recommendation", + Summary: "Cancels a recommendation", + }, + Key: "ClusterComputeResource.cancelRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recommended power On hosts", + Summary: "Get recommendations for a location to power on a specific virtual machine", + }, + Key: "ClusterComputeResource.recommendHostsForVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add host", + Summary: "Adds a new host to the cluster", + }, + Key: "ClusterComputeResource.addHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add host and enable lockdown", + Summary: "Adds a new host to the cluster and enables lockdown mode on the host", + }, + Key: "ClusterComputeResource.addHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move host into cluster", + Summary: "Moves a set of existing hosts into the cluster", + }, + Key: "ClusterComputeResource.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move host into cluster", + Summary: "Moves a host into the cluster", + }, + Key: "ClusterComputeResource.moveHostInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh recommendations", + Summary: "Refreshes the list of recommendations", + }, + Key: "ClusterComputeResource.refreshRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve EVC", + Summary: "Retrieve Enhanced vMotion Compatibility information for this cluster", + }, + Key: "ClusterComputeResource.evcManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve transitional EVC manager", + Summary: "Retrieve the transitional EVC manager for this cluster", + }, + Key: "ClusterComputeResource.transitionalEVCManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve DAS advanced runtime information", + Summary: "Retrieve DAS advanced runtime information for this cluster", + }, + Key: "ClusterComputeResource.retrieveDasAdvancedRuntimeInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vShpere HA data for cluster", + Summary: "Retrieves HA data for a cluster", + }, + Key: "ClusterComputeResource.retrieveDasData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check VM admission in vSphere HA cluster", + Summary: "Checks if HA admission control allows a set of virtual machines to be powered on in the cluster", + }, + Key: "ClusterComputeResource.checkDasAdmission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check cluster for vSphere HA configuration", + Summary: "Check how the specified HA config will affect the cluster state if high availability is enabled", + }, + Key: "ClusterComputeResource.checkReconfigureDas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "checkReconfigureDasVmcp", + Summary: "checkReconfigureDasVmcp", + }, + Key: "ClusterComputeResource.checkReconfigureDasVmcp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DRS recommends hosts to evacuate", + Summary: "DRS recommends hosts to evacuate", + }, + Key: "ClusterComputeResource.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find Fault Tolerance compatible hosts for placing secondary VM", + Summary: "Find the set of Fault Tolerance compatible hosts for placing secondary of a given primary virtual machine", + }, + Key: "ClusterComputeResource.queryFaultToleranceCompatibleHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find Fault Tolerance compatible datastores for a VM", + Summary: "Find the set of Fault Tolerance compatible datastores for a given virtual machine", + }, + Key: "ClusterComputeResource.queryFaultToleranceCompatibleDatastores", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Verify FaultToleranceConfigSpec", + Summary: "Verify whether a given FaultToleranceConfigSpec satisfies the requirements for Fault Tolerance", + }, + Key: "ClusterComputeResource.verifyFaultToleranceConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check Fault Tolerance compatibility for VM", + Summary: "Check whether a VM is compatible for turning on Fault Tolerance", + }, + Key: "ClusterComputeResource.queryCompatibilityForFaultTolerance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Call DRS for cross vMotion placement recommendations", + Summary: "Calls vSphere DRS for placement recommendations when migrating a VM across vCenter Server instances and virtual switches", + }, + Key: "ClusterComputeResource.placeVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find rules for VM", + Summary: "Locates all affinity and anti-affinity rules the specified VM participates in", + }, + Key: "ClusterComputeResource.findRulesForVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "stampAllRulesWithUuid", + Summary: "stampAllRulesWithUuid", + }, + Key: "ClusterComputeResource.stampAllRulesWithUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getResourceUsage", + Summary: "getResourceUsage", + }, + Key: "ClusterComputeResource.getResourceUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryDrmDumpHistory", + Summary: "queryDrmDumpHistory", + }, + Key: "ClusterComputeResource.queryDrmDumpHistory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateDrmBundle", + Summary: "generateDrmBundle", + }, + Key: "ClusterComputeResource.generateDrmBundle", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datastore cluster custom value", + Summary: "Sets the value of a custom field of a datastore cluster", + }, + Key: "StoragePod.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datastore cluster", + Summary: "Reloads the datastore cluster", + }, + Key: "StoragePod.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a datastore cluster", + Summary: "Rename a datastore cluster", + }, + Key: "StoragePod.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a datastore cluster", + Summary: "Remove a datastore cluster", + }, + Key: "StoragePod.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tags to datastore cluster", + Summary: "Adds a set of tags to a datastore cluster", + }, + Key: "StoragePod.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tags from datastore cluster", + Summary: "Removes a set of tags from a datastore cluster", + }, + Key: "StoragePod.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "StoragePod.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create folder", + Summary: "Creates a new folder", + }, + Key: "StoragePod.createFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move datastores into a datastore cluster", + Summary: "Move datastores into a datastore cluster", + }, + Key: "StoragePod.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a new virtual machine", + }, + Key: "StoragePod.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this datastore cluster", + }, + Key: "StoragePod.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Creates a new cluster compute-resource in this datastore cluster", + }, + Key: "StoragePod.createCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Creates a new cluster compute-resource in this datastore cluster", + }, + Key: "StoragePod.createClusterEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host", + Summary: "Creates a new single-host compute-resource", + }, + Key: "StoragePod.addStandaloneHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host and enable lockdown mode", + Summary: "Creates a new single-host compute-resource and enables lockdown mode on the host", + }, + Key: "StoragePod.addStandaloneHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datacenter", + Summary: "Create a new datacenter with the given name", + }, + Key: "StoragePod.createDatacenter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister and delete", + Summary: "Recursively deletes all child virtual machine folders and unregisters all virtual machines", + }, + Key: "StoragePod.unregisterAndDestroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vSphere Distributed Switch", + Summary: "Creates a vSphere Distributed Switch", + }, + Key: "StoragePod.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datastore cluster", + Summary: "Creates a new datastore cluster", + }, + Key: "StoragePod.createStoragePod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch set custom value", + Summary: "vSphere Distributed Switch set custom value", + }, + Key: "DistributedVirtualSwitch.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch reload", + Summary: "vSphere Distributed Switch reload", + }, + Key: "DistributedVirtualSwitch.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vSphere Distributed Switch", + Summary: "Rename vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vSphere Distributed Switch", + Summary: "Delete vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch add tag", + Summary: "vSphere Distributed Switch add tag", + }, + Key: "DistributedVirtualSwitch.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch remove tag", + Summary: "vSphere Distributed Switch remove tag", + }, + Key: "DistributedVirtualSwitch.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "DistributedVirtualSwitch.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPort keys", + Summary: "Retrieve dvPort keys", + }, + Key: "DistributedVirtualSwitch.fetchPortKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPorts", + Summary: "Retrieve dvPorts", + }, + Key: "DistributedVirtualSwitch.fetchPorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSphere Distributed Switch used virtual LAN ID", + Summary: "Query vSphere Distributed Switch used virtual LAN ID", + }, + Key: "DistributedVirtualSwitch.queryUsedVlanId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch product specification operation", + Summary: "vSphere Distributed Switch product specification operation", + }, + Key: "DistributedVirtualSwitch.performProductSpecOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Merge vSphere Distributed Switches", + Summary: "Merge vSphere Distributed Switches", + }, + Key: "DistributedVirtualSwitch.merge", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "DistributedVirtualSwitch.addPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move dvPorts", + Summary: "Move dvPorts", + }, + Key: "DistributedVirtualSwitch.movePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch capability", + Summary: "Update vSphere Distributed Switch capability", + }, + Key: "DistributedVirtualSwitch.updateCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure dvPort", + Summary: "Reconfigure dvPort", + }, + Key: "DistributedVirtualSwitch.reconfigurePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh dvPort state", + Summary: "Refresh dvPort state", + }, + Key: "DistributedVirtualSwitch.refreshPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify host in vSphere Distributed Switch", + Summary: "Rectify host in vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network resource pools on vSphere Distributed Switch", + Summary: "Update network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.updateNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add network resource pools on vSphere Distributed Switch", + Summary: "Add network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.addNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network resource pools on vSphere Distributed Switch", + Summary: "Remove network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.removeNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure a network resource pool on a distributed switch", + Summary: "Reconfigures the network resource pool on a distributed switch", + }, + Key: "DistributedVirtualSwitch.reconfigureVmVnicNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network I/O control on vSphere Distributed Switch", + Summary: "Update network I/O control on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.enableNetworkResourceManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get vSphere Distributed Switch configuration spec to rollback", + Summary: "Get vSphere Distributed Switch configuration spec to rollback", + }, + Key: "DistributedVirtualSwitch.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "DistributedVirtualSwitch.addPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update health check configuration on vSphere Distributed Switch", + Summary: "Update health check configuration on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.updateHealthCheckConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "DistributedVirtualSwitch.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datacenter custom value", + Summary: "Sets the value of a custom field of a datacenter", + }, + Key: "Datacenter.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datacenter", + Summary: "Reloads the datacenter", + }, + Key: "Datacenter.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datacenter", + Summary: "Rename the datacenter", + }, + Key: "Datacenter.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datacenter", + Summary: "Deletes the datacenter and removes it from its parent folder (if any)", + }, + Key: "Datacenter.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the datacenter", + }, + Key: "Datacenter.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the datacenter", + }, + Key: "Datacenter.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Datacenter.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query connection information", + Summary: "Gets information of a host that can be used in the connection wizard", + }, + Key: "Datacenter.queryConnectionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConnectionInfoViaSpec", + Summary: "queryConnectionInfoViaSpec", + }, + Key: "Datacenter.queryConnectionInfoViaSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initialize powering On", + Summary: "Initialize tasks for powering on virtual machines", + }, + Key: "Datacenter.powerOnVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration option descriptor", + Summary: "Retrieve the list of configuration option keys available in this datacenter", + }, + Key: "Datacenter.queryConfigOptionDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure datacenter", + Summary: "Reconfigures the datacenter", + }, + Key: "Datacenter.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual machine custom value", + Summary: "Sets the value of a custom field of a virtual machine", + }, + Key: "VirtualMachine.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine", + Summary: "Reloads the virtual machine", + }, + Key: "VirtualMachine.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename virtual machine", + Summary: "Rename the virtual machine", + }, + Key: "VirtualMachine.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine", + Summary: "Delete this virtual machine. Deleting this virtual machine also deletes its contents and removes it from its parent folder (if any).", + }, + Key: "VirtualMachine.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Tag", + Summary: "Add a set of tags to the virtual machine", + }, + Key: "VirtualMachine.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the virtual machine", + }, + Key: "VirtualMachine.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "VirtualMachine.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh virtual machine storage information", + Summary: "Refresh storage information for the virtual machine", + }, + Key: "VirtualMachine.refreshStorageInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual machine backup agent", + Summary: "Retrieves the backup agent for the virtual machine", + }, + Key: "VirtualMachine.retrieveBackupAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine snapshot", + Summary: "Create a new snapshot of this virtual machine", + }, + Key: "VirtualMachine.createSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine snapshot", + Summary: "Create a new snapshot of this virtual machine", + }, + Key: "VirtualMachine.createSnapshotEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revert to current snapshot", + Summary: "Reverts the virtual machine to the current snapshot", + }, + Key: "VirtualMachine.revertToCurrentSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove all snapshots", + Summary: "Remove all the snapshots associated with this virtual machine", + }, + Key: "VirtualMachine.removeAllSnapshots", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate virtual machine disk files", + Summary: "Consolidate disk files of this virtual machine", + }, + Key: "VirtualMachine.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Estimate virtual machine disks consolidation space requirement", + Summary: "Estimate the temporary space required to consolidate disk files.", + }, + Key: "VirtualMachine.estimateStorageRequirementForConsolidate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine", + Summary: "Reconfigure this virtual machine", + }, + Key: "VirtualMachine.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade VM compatibility", + Summary: "Upgrade virtual machine compatibility to the latest version", + }, + Key: "VirtualMachine.upgradeVirtualHardware", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extract OVF environment", + Summary: "Returns the XML document that represents the OVF environment", + }, + Key: "VirtualMachine.extractOvfEnvironment", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power On this virtual machine", + }, + Key: "VirtualMachine.powerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power Off virtual machine", + Summary: "Power Off this virtual machine", + }, + Key: "VirtualMachine.powerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend virtual machine", + Summary: "Suspend virtual machine", + }, + Key: "VirtualMachine.suspend", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset virtual machine", + Summary: "Reset this virtual machine", + }, + Key: "VirtualMachine.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS shutdown", + Summary: "Issues a command to the guest operating system to perform a clean shutdown of all services", + }, + Key: "VirtualMachine.shutdownGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS reboot", + Summary: "Issues a command to the guest operating system asking it to perform a reboot", + }, + Key: "VirtualMachine.rebootGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS standby", + Summary: "Issues a command to the guest operating system to prepare for a suspend operation", + }, + Key: "VirtualMachine.standbyGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Answer virtual machine question", + Summary: "Respond to a question that is blocking this virtual machine", + }, + Key: "VirtualMachine.answer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Customize virtual machine guest OS", + Summary: "Customize a virtual machine's guest operating system", + }, + Key: "VirtualMachine.customize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check customization specification", + Summary: "Check the customization specification against the virtual machine configuration", + }, + Key: "VirtualMachine.checkCustomizationSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Migrate virtual machine", + Summary: "Migrate a virtual machine's execution to a specific resource pool or host", + }, + Key: "VirtualMachine.migrate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate virtual machine", + Summary: "Relocate the virtual machine to a specific location", + }, + Key: "VirtualMachine.relocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone virtual machine", + Summary: "Creates a clone of this virtual machine", + }, + Key: "VirtualMachine.clone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "instantClone", + Summary: "instantClone", + }, + Key: "VirtualMachine.instantClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveInstantCloneChildren", + Summary: "retrieveInstantCloneChildren", + }, + Key: "VirtualMachine.retrieveInstantCloneChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveInstantCloneParent", + Summary: "retrieveInstantCloneParent", + }, + Key: "VirtualMachine.retrieveInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "markAsInstantCloneParent", + Summary: "markAsInstantCloneParent", + }, + Key: "VirtualMachine.markAsInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmarkAsInstantCloneParent", + Summary: "unmarkAsInstantCloneParent", + }, + Key: "VirtualMachine.unmarkAsInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "createForkChild", + Summary: "createForkChild", + }, + Key: "VirtualMachine.createForkChild", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "enableForkParent", + Summary: "enableForkParent", + }, + Key: "VirtualMachine.enableForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "disableForkParent", + Summary: "disableForkParent", + }, + Key: "VirtualMachine.disableForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveForkChildren", + Summary: "retrieveForkChildren", + }, + Key: "VirtualMachine.retrieveForkChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveForkParent", + Summary: "retrieveForkParent", + }, + Key: "VirtualMachine.retrieveForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the virtual machine as an OVF template", + }, + Key: "VirtualMachine.exportVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark virtual machine as template", + Summary: "Virtual machine is marked as a template", + }, + Key: "VirtualMachine.markAsTemplate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark as virtual machine", + Summary: "Reassociate a virtual machine with a host or resource pool", + }, + Key: "VirtualMachine.markAsVirtualMachine", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister virtual machine", + Summary: "Removes this virtual machine from the inventory without removing any of the virtual machine files on disk", + }, + Key: "VirtualMachine.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset guest OS information", + Summary: "Clears cached guest OS information", + }, + Key: "VirtualMachine.resetGuestInformation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools Installer Mount", + Summary: "Mounts the tools CD installer as a CD-ROM for the guest", + }, + Key: "VirtualMachine.mountToolsInstaller", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Connect VMware Tools CD", + Summary: "Connects the VMware Tools CD image to the guest", + }, + Key: "VirtualMachine.mountToolsInstallerImage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount tools installer", + Summary: "Unmounts the tools installer", + }, + Key: "VirtualMachine.unmountToolsInstaller", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools install or upgrade", + Summary: "Issues a command to the guest operating system to install VMware Tools or upgrade to the latest revision", + }, + Key: "VirtualMachine.upgradeTools", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools upgrade", + Summary: "Upgrades VMware Tools in the virtual machine from specified CD image", + }, + Key: "VirtualMachine.upgradeToolsFromImage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire virtual machine Mouse Keyboard Screen Ticket", + Summary: "Establishing a Mouse Keyboard Screen Ticket", + }, + Key: "VirtualMachine.acquireMksTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire virtual machine service ticket", + Summary: "Establishing a specific remote virtual machine connection ticket", + }, + Key: "VirtualMachine.acquireTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set console window screen resolution", + Summary: "Sets the console window's resolution as specified", + }, + Key: "VirtualMachine.setScreenResolution", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Defragment all disks", + Summary: "Defragment all virtual disks attached to this virtual machine", + }, + Key: "VirtualMachine.defragmentAllDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn On Fault Tolerance", + Summary: "Secondary VM created", + }, + Key: "VirtualMachine.createSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn On Fault Tolerance", + Summary: "Creates a secondary VM", + }, + Key: "VirtualMachine.createSecondaryEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn Off Fault Tolerance", + Summary: "Remove all secondaries for this virtual machine and turn off Fault Tolerance", + }, + Key: "VirtualMachine.turnOffFaultTolerance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test failover", + Summary: "Test Fault Tolerance failover by making a Secondary VM in a Fault Tolerance pair the Primary VM", + }, + Key: "VirtualMachine.makePrimary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test restarting Secondary VM", + Summary: "Test restart Secondary VM by stopping a Secondary VM in the Fault Tolerance pair", + }, + Key: "VirtualMachine.terminateFaultTolerantVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend Fault Tolerance", + Summary: "Suspend Fault Tolerance on this virtual machine", + }, + Key: "VirtualMachine.disableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resume Fault Tolerance", + Summary: "Resume Fault Tolerance on this virtual machine", + }, + Key: "VirtualMachine.enableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual machine display topology", + Summary: "Set the display topology for the virtual machine", + }, + Key: "VirtualMachine.setDisplayTopology", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start recording", + Summary: "Start a recording session on this virtual machine", + }, + Key: "VirtualMachine.startRecording", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop recording", + Summary: "Stop a currently active recording session on this virtual machine", + }, + Key: "VirtualMachine.stopRecording", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start replaying", + Summary: "Start a replay session on this virtual machine", + }, + Key: "VirtualMachine.startReplaying", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop replaying", + Summary: "Stop a replay session on this virtual machine", + }, + Key: "VirtualMachine.stopReplaying", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Promote virtual machine disks", + Summary: "Promote disks of the virtual machine that have delta disk backings", + }, + Key: "VirtualMachine.promoteDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Take virtual machine screenshot", + Summary: "Take a screenshot of a virtual machine's guest OS console", + }, + Key: "VirtualMachine.createScreenshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Put USB HID scan codes", + Summary: "Injects a sequence of USB HID scan codes into the keyboard", + }, + Key: "VirtualMachine.putUsbScanCodes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine disk changes", + Summary: "Query for changes to the virtual machine's disks since a given point in the past", + }, + Key: "VirtualMachine.queryChangedDiskAreas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unowned virtual machine files", + Summary: "Query files of the virtual machine not owned by the datastore principal user", + }, + Key: "VirtualMachine.queryUnownedFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine from new configuration", + Summary: "Reloads the virtual machine from a new configuration file", + }, + Key: "VirtualMachine.reloadFromPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Virtual Machine Fault Tolerance Compatibility", + Summary: "Check if virtual machine is compatible for Fault Tolerance", + }, + Key: "VirtualMachine.queryFaultToleranceCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFaultToleranceCompatibilityEx", + Summary: "queryFaultToleranceCompatibilityEx", + }, + Key: "VirtualMachine.queryFaultToleranceCompatibilityEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend and resume the virtual machine", + Summary: "Suspend and resume the virtual machine", + }, + Key: "VirtualMachine.invokeFSR", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Hard stop virtual machine", + Summary: "Hard stop virtual machine", + }, + Key: "VirtualMachine.terminate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get native clone capability", + Summary: "Check if native clone is supported on the virtual machine", + }, + Key: "VirtualMachine.isNativeSnapshotCapable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure quorum file path prefix", + Summary: "Configures the quorum file path prefix for the virtual machine", + }, + Key: "VirtualMachine.configureQuorumFilePathPrefix", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve quorum file path prefix", + Summary: "Retrieves the quorum file path prefix for the virtual machine", + }, + Key: "VirtualMachine.retrieveQuorumFilePathPrefix", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inject OVF Environment into virtual machine", + Summary: "Specifies the OVF Environments to be injected into and returned for a virtual machine", + }, + Key: "VirtualMachine.injectOvfEnvironment", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Wipe a Flex-SE virtual disk", + Summary: "Wipes a Flex-SE virtual disk", + }, + Key: "VirtualMachine.wipeDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Shrink a Flex-SE virtual disk", + Summary: "Shrinks a Flex-SE virtual disk", + }, + Key: "VirtualMachine.shrinkDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send NMI", + Summary: "Sends a non-maskable interrupt (NMI) to the virtual machine", + }, + Key: "VirtualMachine.sendNMI", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine", + Summary: "Reloads the virtual machine", + }, + Key: "VirtualMachine.reloadEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach a virtual disk", + Summary: "Attach an existing virtual disk to the virtual machine", + }, + Key: "VirtualMachine.attachDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach a virtual disk", + Summary: "Detach a virtual disk from the virtual machine", + }, + Key: "VirtualMachine.detachDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply EVC Mode", + Summary: "Apply EVC Mode to a virtual machine", + }, + Key: "VirtualMachine.applyEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vApp custom value", + Summary: "Sets the value of a custom field on a vApp", + }, + Key: "VirtualApp.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload vApp", + Summary: "Reload the vApp", + }, + Key: "VirtualApp.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vApp", + Summary: "Rename the vApp", + }, + Key: "VirtualApp.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vApp", + Summary: "Delete the vApp, including all child vApps and virtual machines", + }, + Key: "VirtualApp.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the vApp", + }, + Key: "VirtualApp.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the vApp", + }, + Key: "VirtualApp.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "VirtualApp.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vApp resource configuration", + Summary: "Updates the resource configuration for the vApp", + }, + Key: "VirtualApp.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move into vApp", + Summary: "Moves a set of entities into this vApp", + }, + Key: "VirtualApp.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update child resource configuration", + Summary: "Change resource configuration of a set of children of the vApp", + }, + Key: "VirtualApp.updateChildResourceConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create resource pool", + Summary: "Creates a new resource pool", + }, + Key: "VirtualApp.createResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vApp children", + Summary: "Deletes all child resource pools recursively", + }, + Key: "VirtualApp.destroyChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vApp", + Summary: "Creates a child vApp of this vApp", + }, + Key: "VirtualApp.createVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine in this vApp", + }, + Key: "VirtualApp.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this vApp", + }, + Key: "VirtualApp.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "VirtualApp.importVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Virtual App resource configuration options", + Summary: "Returns configuration options for a set of resources for a Virtual App", + }, + Key: "VirtualApp.queryResourceConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh Virtual App runtime information", + Summary: "Refreshes the resource usage runtime information for a Virtual App", + }, + Key: "VirtualApp.refreshRuntime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vApp Configuration", + Summary: "Updates the vApp configuration", + }, + Key: "VirtualApp.updateVAppConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update linked children", + Summary: "Updates the list of linked children", + }, + Key: "VirtualApp.updateLinkedChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone vApp", + Summary: "Clone the vApp, including all child entities", + }, + Key: "VirtualApp.clone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the vApp as an OVF template", + }, + Key: "VirtualApp.exportVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start vApp", + Summary: "Starts the vApp", + }, + Key: "VirtualApp.powerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop vApp", + Summary: "Stops the vApp", + }, + Key: "VirtualApp.powerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend vApp", + Summary: "Suspends the vApp", + }, + Key: "VirtualApp.suspend", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister vApp", + Summary: "Unregister all child virtual machines and remove the vApp", + }, + Key: "VirtualApp.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set a custom property to an opaque network", + Summary: "Sets the value of a custom field of an opaque network", + }, + Key: "OpaqueNetwork.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload an opaque network", + Summary: "Reloads the information about the opaque network", + }, + Key: "OpaqueNetwork.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename an opaque network", + Summary: "Renames an opaque network", + }, + Key: "OpaqueNetwork.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete opaque network", + Summary: "Deletes an opaque network if it is not used by any host or virtual machine", + }, + Key: "OpaqueNetwork.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add a tag to an opaque network", + Summary: "Adds a set of tags to the opaque network", + }, + Key: "OpaqueNetwork.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a tag from an opaque network", + Summary: "Removes a set of tags from the opaque network", + }, + Key: "OpaqueNetwork.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "OpaqueNetwork.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an opaque network", + Summary: "Removes an opaque network", + }, + Key: "OpaqueNetwork.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set network custom Value", + Summary: "Sets the value of a custom field of a network", + }, + Key: "Network.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload network", + Summary: "Reload information about the network", + }, + Key: "Network.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename network", + Summary: "Rename network", + }, + Key: "Network.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete network", + Summary: "Deletes a network if it is not used by any host or virtual machine", + }, + Key: "Network.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the network", + }, + Key: "Network.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the network", + }, + Key: "Network.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Network.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network", + Summary: "Remove network", + }, + Key: "Network.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add role", + Summary: "Add a new role", + }, + Key: "AuthorizationManager.addRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove role", + Summary: "Remove a role", + }, + Key: "AuthorizationManager.removeRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update role", + Summary: "Update a role's name and/or privileges", + }, + Key: "AuthorizationManager.updateRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reassign permissions", + Summary: "Reassign all permissions of a role to another role", + }, + Key: "AuthorizationManager.mergePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get role permissions", + Summary: "Gets all the permissions that use a particular role", + }, + Key: "AuthorizationManager.retrieveRolePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get entity permissions", + Summary: "Get permissions defined on an entity", + }, + Key: "AuthorizationManager.retrieveEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get permissions", + Summary: "Get the permissions defined for all users", + }, + Key: "AuthorizationManager.retrieveAllPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrievePermissions", + Summary: "retrievePermissions", + }, + Key: "AuthorizationManager.retrievePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set entity permission rules", + Summary: "Define or update permission rules on an entity", + }, + Key: "AuthorizationManager.setEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset entity permission rules", + Summary: "Reset permission rules on an entity to the provided set", + }, + Key: "AuthorizationManager.resetEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove entity permission", + Summary: "Remove a permission rule from the entity", + }, + Key: "AuthorizationManager.removeEntityPermission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disabled methods", + Summary: "Get the list of source objects that have been disabled on the target entity", + }, + Key: "AuthorizationManager.queryDisabledMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable authorization methods", + Summary: "Gets the set of method names to be disabled", + }, + Key: "AuthorizationManager.disableMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable authorization methods", + Summary: "Gets the set of method names to be enabled", + }, + Key: "AuthorizationManager.enableMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check privileges on a managed entity", + Summary: "Checks whether a session holds a set of privileges on a managed entity", + }, + Key: "AuthorizationManager.hasPrivilegeOnEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check privileges on a set of managed entities", + Summary: "Checks whether a session holds a set of privileges on a set of managed entities", + }, + Key: "AuthorizationManager.hasPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasUserPrivilegeOnEntities", + Summary: "hasUserPrivilegeOnEntities", + }, + Key: "AuthorizationManager.hasUserPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchUserPrivilegeOnEntities", + Summary: "fetchUserPrivilegeOnEntities", + }, + Key: "AuthorizationManager.fetchUserPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check method invocation privileges", + Summary: "Checks whether a session holds a set of privileges required to invoke a specified method", + }, + Key: "AuthorizationManager.checkMethodInvocation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query required permissions", + Summary: "Get the permission requirements for the specified request", + }, + Key: "AuthorizationManager.queryPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performUpgradePreflightCheck", + Summary: "performUpgradePreflightCheck", + }, + Key: "VsanUpgradeSystem.performUpgradePreflightCheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryUpgradeStatus", + Summary: "queryUpgradeStatus", + }, + Key: "VsanUpgradeSystem.queryUpgradeStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performUpgrade", + Summary: "performUpgrade", + }, + Key: "VsanUpgradeSystem.performUpgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual disk", + Summary: "Create the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.createVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual disk", + Summary: "Delete the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.deleteVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk information", + Summary: "Queries information about a virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move virtual disk", + Summary: "Move the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.moveVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy virtual disk", + Summary: "Copy the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.copyVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend virtual disk", + Summary: "Expand the capacity of a virtual disk to the new capacity", + }, + Key: "VirtualDiskManager.extendVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk fragmentation", + Summary: "Return the percentage of fragmentation of the sparse virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskFragmentation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Defragment virtual disk", + Summary: "Defragment a sparse virtual disk", + }, + Key: "VirtualDiskManager.defragmentVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Shrink virtual disk", + Summary: "Shrink a sparse virtual disk", + }, + Key: "VirtualDiskManager.shrinkVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate virtual disk", + Summary: "Inflate a sparse virtual disk up to the full size", + }, + Key: "VirtualDiskManager.inflateVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Zero out virtual disk", + Summary: "Explicitly zero out the virtual disk.", + }, + Key: "VirtualDiskManager.eagerZeroVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fill virtual disk", + Summary: "Overwrite all blocks of the virtual disk with zeros", + }, + Key: "VirtualDiskManager.zeroFillVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Optimally eager zero the virtual disk", + Summary: "Optimally eager zero a VMFS thick virtual disk.", + }, + Key: "VirtualDiskManager.optimizeEagerZeroVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual disk UUID", + Summary: "Set the UUID for the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.setVirtualDiskUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk UUID", + Summary: "Get the virtual disk SCSI inquiry page data", + }, + Key: "VirtualDiskManager.queryVirtualDiskUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk geometry", + Summary: "Get the disk geometry information for the virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskGeometry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reparent disks", + Summary: "Reparent disks", + }, + Key: "VirtualDiskManager.reparentDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a child disk", + Summary: "Create a new disk and attach it to the end of disk chain specified", + }, + Key: "VirtualDiskManager.createChildDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "revertToChildDisk", + Summary: "revertToChildDisk", + }, + Key: "VirtualDiskManager.revertToChildDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate disks", + Summary: "Consolidate a list of disks to the parent most disk", + }, + Key: "VirtualDiskManager.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "importUnmanagedSnapshot", + Summary: "importUnmanagedSnapshot", + }, + Key: "VirtualDiskManager.importUnmanagedSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "releaseManagedSnapshot", + Summary: "releaseManagedSnapshot", + }, + Key: "VirtualDiskManager.releaseManagedSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "enableUPIT", + Summary: "enableUPIT", + }, + Key: "VirtualDiskManager.enableUPIT", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "disableUPIT", + Summary: "disableUPIT", + }, + Key: "VirtualDiskManager.disableUPIT", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryObjectInfo", + Summary: "queryObjectInfo", + }, + Key: "VirtualDiskManager.queryObjectInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryObjectTypes", + Summary: "queryObjectTypes", + }, + Key: "VirtualDiskManager.queryObjectTypes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage I/O Control on datastore", + Summary: "Configure Storage I/O Control on datastore", + }, + Key: "StorageResourceManager.ConfigureDatastoreIORM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage I/O Control on datastore", + Summary: "Configure Storage I/O Control on datastore", + }, + Key: "StorageResourceManager.ConfigureDatastoreIORMOnHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Storage I/O Control configuration options", + Summary: "Query Storage I/O Control configuration options", + }, + Key: "StorageResourceManager.QueryIORMConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get storage I/O resource management device model", + Summary: "Returns the device model computed for a given datastore by storage DRS", + }, + Key: "StorageResourceManager.GetStorageIORMDeviceModel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore performance summary", + Summary: "Query datastore performance metrics in summary form", + }, + Key: "StorageResourceManager.queryDatastorePerformanceSummary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply a Storage DRS recommendation", + Summary: "Apply a Storage DRS recommendation", + }, + Key: "StorageResourceManager.applyRecommendationToPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply Storage DRS recommendations", + Summary: "Apply Storage DRS recommendations", + }, + Key: "StorageResourceManager.applyRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel storage DRS recommendation", + Summary: "Cancels a storage DRS recommendation", + }, + Key: "StorageResourceManager.cancelRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh storage DRS recommendation", + Summary: "Refreshes the storage DRS recommendations on the specified datastore cluster", + }, + Key: "StorageResourceManager.refreshRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "refreshRecommendationsForPod", + Summary: "refreshRecommendationsForPod", + }, + Key: "StorageResourceManager.refreshRecommendationsForPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage DRS", + Summary: "Configure Storage DRS on a datastore cluster", + }, + Key: "StorageResourceManager.configureStorageDrsForPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Invoke storage DRS for placement recommendations", + Summary: "Invokes storage DRS for placement recommendations", + }, + Key: "StorageResourceManager.recommendDatastores", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rankForPlacement", + Summary: "rankForPlacement", + }, + Key: "StorageResourceManager.rankForPlacement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryStorageStatisticsByProfile", + Summary: "queryStorageStatisticsByProfile", + }, + Key: "StorageResourceManager.queryStorageStatisticsByProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute client service", + Summary: "Execute the client service", + }, + Key: "SimpleCommand.Execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update global message", + Summary: "Updates the system global message", + }, + Key: "SessionManager.updateMessage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by token", + Summary: "Logs on to the server through token representing principal identity", + }, + Key: "SessionManager.loginByToken", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login", + Summary: "Create a login session", + }, + Key: "SessionManager.login", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by SSPI", + Summary: "Log on to the server using SSPI passthrough authentication", + }, + Key: "SessionManager.loginBySSPI", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by SSL thumbprint", + Summary: "Log on to the server using SSL thumbprint authentication", + }, + Key: "SessionManager.loginBySSLThumbprint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by session ticket", + Summary: "Log on to the server using a session ticket", + }, + Key: "SessionManager.loginBySessionTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire session ticket", + Summary: "Acquire a ticket for authenticating to a remote service", + }, + Key: "SessionManager.acquireSessionTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Logout", + Summary: "Logout and end the current session", + }, + Key: "SessionManager.logout", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire local ticket", + Summary: "Acquire one-time ticket for authenticating server-local client", + }, + Key: "SessionManager.acquireLocalTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire generic service ticket", + Summary: "Acquire a one-time credential that may be used to make the specified request", + }, + Key: "SessionManager.acquireGenericServiceTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Terminate session", + Summary: "Logout and end the provided list of sessions", + }, + Key: "SessionManager.terminate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set locale", + Summary: "Set the session locale for determining the languages used for messages and formatting data", + }, + Key: "SessionManager.setLocale", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension", + Summary: "Creates a privileged login session for an extension", + }, + Key: "SessionManager.loginExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension", + Summary: "Invalid subject name", + }, + Key: "SessionManager.loginExtensionBySubjectName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension by certificate", + Summary: "Login extension by certificate", + }, + Key: "SessionManager.loginExtensionByCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Impersonate user", + Summary: "Convert session to impersonate specified user", + }, + Key: "SessionManager.impersonateUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Session active query", + Summary: "Validates that a currently active session exists", + }, + Key: "SessionManager.sessionIsActive", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire clone ticket", + Summary: "Acquire a session-specific ticket string that can be used to clone the current session", + }, + Key: "SessionManager.acquireCloneTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone session", + Summary: "Clone the specified session and associate it with the current connection", + }, + Key: "SessionManager.cloneSession", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add end point", + Summary: "Add a service whose connections are to be proxied", + }, + Key: "ProxyService.addEndpoint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove end point", + Summary: "End point to be detached", + }, + Key: "ProxyService.removeEndpoint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host for OVF package compatibility", + Summary: "Validates if a host is compatible with the requirements in an OVF package", + }, + Key: "OvfManager.validateHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Parse OVF descriptor", + Summary: "Parses and validates an OVF descriptor", + }, + Key: "OvfManager.parseDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert OVF descriptor", + Summary: "Convert OVF descriptor to entity specification", + }, + Key: "OvfManager.createImportSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create an OVF descriptor", + Summary: "Creates an OVF descriptor from either a VM or vApp", + }, + Key: "OvfManager.createDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Parse OVF Descriptor at URL", + Summary: "Parses and validates an OVF descriptor at a given URL", + }, + Key: "OvfManager.parseDescriptorAtUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys an OVF template from a URL", + }, + Key: "OvfManager.importOvfAtUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export as OVF template", + Summary: "Uploads OVF template to a remote server", + }, + Key: "OvfManager.exportOvfToUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download overhead computation script", + Summary: "Download overhead computation scheme script", + }, + Key: "OverheadService.downloadScript", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download host configuration", + Summary: "Download host configuration consumed by overhead computation script", + }, + Key: "OverheadService.downloadHostConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download VM configuration", + Summary: "Download VM configuration consumed by overhead computation script", + }, + Key: "OverheadService.downloadVMXConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "lookupVmOverheadMemory", + Summary: "lookupVmOverheadMemory", + }, + Key: "OverheadMemoryManager.lookupVmOverheadMemory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open remote disk for read/write", + Summary: "Opens a disk on a virtual machine for read/write access", + }, + Key: "NfcService.randomAccessOpen", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open remote disk for read", + Summary: "Opens a disk on a virtual machine for read access", + }, + Key: "NfcService.randomAccessOpenReadonly", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "randomAccessFileOpen", + Summary: "randomAccessFileOpen", + }, + Key: "NfcService.randomAccessFileOpen", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read virtual machine files", + Summary: "Read files associated with a virtual machine", + }, + Key: "NfcService.getVmFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Write virtual machine files", + Summary: "Write files associated with a virtual machine", + }, + Key: "NfcService.putVmFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Manipulate file paths", + Summary: "Permission to manipulate file paths", + }, + Key: "NfcService.fileManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Manipulate system-related file paths", + Summary: "Permission to manipulate all system related file paths", + }, + Key: "NfcService.systemManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getServerNfcLibVersion", + Summary: "getServerNfcLibVersion", + }, + Key: "NfcService.getServerNfcLibVersion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve associated License Data objects", + Summary: "Retrieves all the associated License Data objects", + }, + Key: "LicenseDataManager.queryEntityLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve license data associated with managed entity", + Summary: "Retrieves the license data associated with a specified managed entity", + }, + Key: "LicenseDataManager.queryAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update entity license container", + Summary: "Updates the license container associated with a specified managed entity", + }, + Key: "LicenseDataManager.updateAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply associated license data to managed entity", + Summary: "Applies associated license data to a managed entity", + }, + Key: "LicenseDataManager.applyAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network protocol profiles", + Summary: "Queries the list of network protocol profiles for a datacenter", + }, + Key: "IpPoolManager.queryIpPools", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create network protocol profile", + Summary: "Creates a new network protocol profile", + }, + Key: "IpPoolManager.createIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network protocol profile", + Summary: "Updates a network protocol profile on a datacenter", + }, + Key: "IpPoolManager.updateIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Destroy network protocol profile", + Summary: "Destroys a network protocol profile on the given datacenter", + }, + Key: "IpPoolManager.destroyIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocates an IPv4 address", + Summary: "Allocates an IPv4 address from an IP pool", + }, + Key: "IpPoolManager.allocateIpv4Address", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocates an IPv6 address", + Summary: "Allocates an IPv6 address from an IP pool", + }, + Key: "IpPoolManager.allocateIpv6Address", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Releases an IP allocation", + Summary: "Releases an IP allocation back to an IP pool", + }, + Key: "IpPoolManager.releaseIpAllocation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query IP allocations", + Summary: "Query IP allocations by IP pool and extension key", + }, + Key: "IpPoolManager.queryIPAllocations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install IO Filter", + Summary: "Installs an IO Filter on a compute resource", + }, + Key: "IoFilterManager.installIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall IO Filter", + Summary: "Uninstalls an IO Filter from a compute resource", + }, + Key: "IoFilterManager.uninstallIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade IO Filter", + Summary: "Upgrades an IO Filter on a compute resource", + }, + Key: "IoFilterManager.upgradeIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query IO Filter installation issues", + Summary: "Queries IO Filter installation issues on a compute resource", + }, + Key: "IoFilterManager.queryIssue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryIoFilterInfo", + Summary: "queryIoFilterInfo", + }, + Key: "IoFilterManager.queryIoFilterInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve IO Filter installation errors on host", + Summary: "Resolves IO Filter installation errors on a host", + }, + Key: "IoFilterManager.resolveInstallationErrorsOnHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve IO Filter installation errors on cluster", + Summary: "Resolves IO Filter installation errors on a cluster", + }, + Key: "IoFilterManager.resolveInstallationErrorsOnCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query information about virtual disks using IO Filter", + Summary: "Queries information about virtual disks that use an IO Filter installed on a compute resource", + }, + Key: "IoFilterManager.queryDisksUsingFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IO Filter policy", + Summary: "Updates the policy to IO Filter mapping in vCenter Server", + }, + Key: "IoFilterManager.updateIoFilterPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add an image library", + Summary: "Register an image library server with vCenter", + }, + Key: "ImageLibraryManager.addLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update image library", + Summary: "Update image library information", + }, + Key: "ImageLibraryManager.updateLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an image library", + Summary: "Unregister an image library server from vCenter", + }, + Key: "ImageLibraryManager.removeLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import from image library", + Summary: "Import files from the image library", + }, + Key: "ImageLibraryManager.importLibraryMedia", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export to image library", + Summary: "Export files to the image library", + }, + Key: "ImageLibraryManager.exportMediaToLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Publish to image library", + Summary: "Publish files from datastore to image library", + }, + Key: "ImageLibraryManager.publishMediaToLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get lease download manifest", + Summary: "Gets the download manifest for this lease", + }, + Key: "HttpNfcLease.getManifest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete the lease", + Summary: "The lease completed successfully", + }, + Key: "HttpNfcLease.complete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "End the lease", + Summary: "The lease has ended", + }, + Key: "HttpNfcLease.abort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update lease progress", + Summary: "Updates lease progress", + }, + Key: "HttpNfcLease.progress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set latest page size", + Summary: "Set the last page viewed size and contain at most maxCount items in the page", + }, + Key: "HistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind", + Summary: "Move the scroll position to the oldest item", + }, + Key: "HistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset", + Summary: "Move the scroll position to the item just above the last page viewed", + }, + Key: "HistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove collector", + Summary: "Remove the collector from server", + }, + Key: "HistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable replication of virtual machine", + Summary: "Enable replication of virtual machine", + }, + Key: "HbrManager.enableReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable replication of virtual machine", + Summary: "Disable replication of virtual machine", + }, + Key: "HbrManager.disableReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure replication for virtual machine", + Summary: "Reconfigure replication for virtual machine", + }, + Key: "HbrManager.reconfigureReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve replication configuration of virtual machine", + Summary: "Retrieve replication configuration of virtual machine", + }, + Key: "HbrManager.retrieveReplicationConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pause replication of virtual machine", + Summary: "Pause replication of virtual machine", + }, + Key: "HbrManager.pauseReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resume replication of virtual machine", + Summary: "Resume replication of virtual machine", + }, + Key: "HbrManager.resumeReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start a replication resynchronization for virtual machine", + Summary: "Start a replication resynchronization for virtual machine", + }, + Key: "HbrManager.fullSync", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start new replication instance for virtual machine", + Summary: "Start extraction and transfer of a new replication instance for virtual machine", + }, + Key: "HbrManager.createInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replicate powered-off virtual machine", + Summary: "Transfer a replication instance for powered-off virtual machine", + }, + Key: "HbrManager.startOfflineInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop replication of powered-off virtual machine", + Summary: "Stop replication of powered-off virtual machine", + }, + Key: "HbrManager.stopOfflineInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine replication state", + Summary: "Qureies the current state of a replicated virtual machine", + }, + Key: "HbrManager.queryReplicationState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryReplicationCapabilities", + Summary: "queryReplicationCapabilities", + }, + Key: "HbrManager.queryReplicationCapabilities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister extension", + Summary: "Unregisters an extension", + }, + Key: "ExtensionManager.unregisterExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find extension", + Summary: "Find an extension", + }, + Key: "ExtensionManager.findExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register extension", + Summary: "Registers an extension", + }, + Key: "ExtensionManager.registerExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update extension", + Summary: "Updates extension information", + }, + Key: "ExtensionManager.updateExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get server public key", + Summary: "Get vCenter Server's public key", + }, + Key: "ExtensionManager.getPublicKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extension public key", + Summary: "Set public key of the extension", + }, + Key: "ExtensionManager.setPublicKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extension certificate", + Summary: "Update the stored authentication certificate for a specified extension", + }, + Key: "ExtensionManager.setCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update extension data", + Summary: "Updates extension-specific data associated with an extension", + }, + Key: "ExtensionManager.updateExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data", + Summary: "Retrieves extension-specific data associated with an extension", + }, + Key: "ExtensionManager.queryExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data keys", + Summary: "Retrieves extension-specific data keys associated with an extension", + }, + Key: "ExtensionManager.queryExtensionDataKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear extension data", + Summary: "Clears extension-specific data associated with an extension", + }, + Key: "ExtensionManager.clearExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data usage", + Summary: "Retrieves statistics about the amount of data being stored by extensions registered with vCenter Server", + }, + Key: "ExtensionManager.queryExtensionDataUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query entities managed by extension", + Summary: "Finds entities managed by an extension", + }, + Key: "ExtensionManager.queryManagedBy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query statistics about IP allocation usage", + Summary: "Query statistics about IP allocation usage, system-wide or for specified extensions", + }, + Key: "ExtensionManager.queryExtensionIpAllocationUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create directory", + Summary: "Creates a top-level directory on the specified datastore", + }, + Key: "DatastoreNamespaceManager.CreateDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete directory", + Summary: "Deletes the specified top-level directory from the datastore", + }, + Key: "DatastoreNamespaceManager.DeleteDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "ConvertNamespacePathToUuidPath", + Summary: "ConvertNamespacePathToUuidPath", + }, + Key: "DatastoreNamespaceManager.ConvertNamespacePathToUuidPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual disk digest", + Summary: "Controls the configuration of the digests for the virtual disks", + }, + Key: "CbrcManager.configureDigest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recompute virtual disk digest", + Summary: "Recomputes the digest for the given virtual disks, if necessary", + }, + Key: "CbrcManager.recomputeDigest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk digest configuration", + Summary: "Returns the current configuration of the digest for the given digest-enabled virtual disks", + }, + Key: "CbrcManager.queryDigestInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk digest runtime information", + Summary: "Returns the status of runtime digest usage for the given digest-enabled virtual disks", + }, + Key: "CbrcManager.queryDigestRuntimeInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare to upgrade", + Summary: "Deletes the content of the temporary directory on the host", + }, + Key: "AgentManager.prepareToUpgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade", + Summary: "Validates and executes the installer/uninstaller executable uploaded to the temporary directory", + }, + Key: "AgentManager.upgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Estimate database size", + Summary: "Estimates the database size required to store VirtualCenter data", + }, + Key: "ResourcePlanningManager.estimateDatabaseSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerProvider", + Summary: "registerProvider", + }, + Key: "HealthUpdateManager.registerProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unregisterProvider", + Summary: "unregisterProvider", + }, + Key: "HealthUpdateManager.unregisterProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryProviderList", + Summary: "queryProviderList", + }, + Key: "HealthUpdateManager.queryProviderList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasProvider", + Summary: "hasProvider", + }, + Key: "HealthUpdateManager.hasProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryProviderName", + Summary: "queryProviderName", + }, + Key: "HealthUpdateManager.queryProviderName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHealthUpdateInfos", + Summary: "queryHealthUpdateInfos", + }, + Key: "HealthUpdateManager.queryHealthUpdateInfos", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addMonitoredEntities", + Summary: "addMonitoredEntities", + }, + Key: "HealthUpdateManager.addMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeMonitoredEntities", + Summary: "removeMonitoredEntities", + }, + Key: "HealthUpdateManager.removeMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMonitoredEntities", + Summary: "queryMonitoredEntities", + }, + Key: "HealthUpdateManager.queryMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasMonitoredEntity", + Summary: "hasMonitoredEntity", + }, + Key: "HealthUpdateManager.hasMonitoredEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryUnmonitoredHosts", + Summary: "queryUnmonitoredHosts", + }, + Key: "HealthUpdateManager.queryUnmonitoredHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "postHealthUpdates", + Summary: "postHealthUpdates", + }, + Key: "HealthUpdateManager.postHealthUpdates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHealthUpdates", + Summary: "queryHealthUpdates", + }, + Key: "HealthUpdateManager.queryHealthUpdates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addFilter", + Summary: "addFilter", + }, + Key: "HealthUpdateManager.addFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterList", + Summary: "queryFilterList", + }, + Key: "HealthUpdateManager.queryFilterList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterName", + Summary: "queryFilterName", + }, + Key: "HealthUpdateManager.queryFilterName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterInfoIds", + Summary: "queryFilterInfoIds", + }, + Key: "HealthUpdateManager.queryFilterInfoIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterEntities", + Summary: "queryFilterEntities", + }, + Key: "HealthUpdateManager.queryFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addFilterEntities", + Summary: "addFilterEntities", + }, + Key: "HealthUpdateManager.addFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeFilterEntities", + Summary: "removeFilterEntities", + }, + Key: "HealthUpdateManager.removeFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeFilter", + Summary: "removeFilter", + }, + Key: "HealthUpdateManager.removeFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by UUID", + Summary: "Finds a virtual machine or host by UUID", + }, + Key: "SearchIndex.findByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find virtual machine by datastore path", + Summary: "Finds a virtual machine by its location on a datastore", + }, + Key: "SearchIndex.findByDatastorePath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by DNS", + Summary: "Finds a virtual machine or host by its DNS name", + }, + Key: "SearchIndex.findByDnsName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by IP", + Summary: "Finds a virtual machine or host by IP address", + }, + Key: "SearchIndex.findByIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by inventory path", + Summary: "Finds a virtual machine or host based on its location in the inventory", + }, + Key: "SearchIndex.findByInventoryPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find folder child", + Summary: "Finds an immediate child of a folder", + }, + Key: "SearchIndex.findChild", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by UUID", + Summary: "Find entities based on their UUID", + }, + Key: "SearchIndex.findAllByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by DNS name", + Summary: "Find by DNS name", + }, + Key: "SearchIndex.findAllByDnsName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by IP address", + Summary: "Find entities based on their IP address", + }, + Key: "SearchIndex.findAllByIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "findAllInstantCloneParentInGroup", + Summary: "findAllInstantCloneParentInGroup", + }, + Key: "SearchIndex.findAllInstantCloneParentInGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "findAllInstantCloneChildrenOfGroup", + Summary: "findAllInstantCloneChildrenOfGroup", + }, + Key: "SearchIndex.findAllInstantCloneChildrenOfGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchRelocatedMACAddress", + Summary: "fetchRelocatedMACAddress", + }, + Key: "NetworkManager.fetchRelocatedMACAddress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check MAC addresses in use", + Summary: "Checks the MAC addresses used by this vCenter Server instance", + }, + Key: "NetworkManager.checkIfMACAddressInUse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reclaim MAC addresses", + Summary: "Reclaims the MAC addresses that are not used by remote vCenter Server instances", + }, + Key: "NetworkManager.reclaimMAC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check group membership", + Summary: "Check whether a user is a member of a given list of groups", + }, + Key: "UserDirectory.checkGroupMembership", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get user groups", + Summary: "Searches for users and groups", + }, + Key: "UserDirectory.retrieveUserGroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set task custom value", + Summary: "Sets the value of a custom field of a task", + }, + Key: "Task.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel", + Summary: "Cancels a running/queued task", + }, + Key: "Task.cancel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update progress", + Summary: "Update task progress", + }, + Key: "Task.UpdateProgress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set task state", + Summary: "Sets task state", + }, + Key: "Task.setState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update task description", + Summary: "Updates task description with the current phase of the task", + }, + Key: "Task.UpdateDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration option descriptor", + Summary: "Get the list of configuration option keys available in this browser", + }, + Key: "EnvironmentBrowser.queryConfigOptionDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure option query", + Summary: "Search for a specific configuration option", + }, + Key: "EnvironmentBrowser.queryConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConfigOptionEx", + Summary: "queryConfigOptionEx", + }, + Key: "EnvironmentBrowser.queryConfigOptionEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration target", + Summary: "Search for a specific configuration target", + }, + Key: "EnvironmentBrowser.queryConfigTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query target capabilities", + Summary: "Query for compute-resource capabilities associated with this browser", + }, + Key: "EnvironmentBrowser.queryTargetCapabilities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine provisioning operation policy", + Summary: "Query environment browser for information about the virtual machine provisioning operation policy", + }, + Key: "EnvironmentBrowser.queryProvisioningPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConfigTargetSpec", + Summary: "queryConfigTargetSpec", + }, + Key: "EnvironmentBrowser.queryConfigTargetSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set snapshot custom value", + Summary: "Sets the value of a custom field of a virtual machine snapshot", + }, + Key: "vm.Snapshot.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revert snapshot", + Summary: "Change the execution state of the virtual machine to the state of this snapshot", + }, + Key: "vm.Snapshot.revert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove snapshot", + Summary: "Remove snapshot and delete its associated storage", + }, + Key: "vm.Snapshot.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename snapshot", + Summary: "Rename the snapshot", + }, + Key: "vm.Snapshot.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Linked Clone", + Summary: "Create a linked clone from this snapshot", + }, + Key: "vm.Snapshot.createLinkedClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Export the snapshot as an OVF template", + }, + Key: "vm.Snapshot.exportSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pause", + Summary: "Pauses a virtual machine", + }, + Key: "vm.PauseManager.pause", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unpause", + Summary: "Unpauses a virtual machine", + }, + Key: "vm.PauseManager.unpause", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power on and pause", + Summary: "Powers on a virtual machine and pauses it immediately", + }, + Key: "vm.PauseManager.powerOnPaused", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create namespace", + Summary: "Create a virtual machine namespace", + }, + Key: "vm.NamespaceManager.createNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete namespace", + Summary: "Delete the virtual machine namespace", + }, + Key: "vm.NamespaceManager.deleteNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete all namespaces", + Summary: "Delete all namespaces associated with the virtual machine", + }, + Key: "vm.NamespaceManager.deleteAllNamespaces", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update namespace", + Summary: "Reconfigure the virtual machine namespace", + }, + Key: "vm.NamespaceManager.updateNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query namespace", + Summary: "Retrieve detailed information about the virtual machine namespace", + }, + Key: "vm.NamespaceManager.queryNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List namespaces", + Summary: "Retrieve the list of all namespaces for a virtual machine", + }, + Key: "vm.NamespaceManager.listNamespaces", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send event to the virtual machine", + Summary: "Queue event for delivery to the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.sendEventToGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch events from the virtual machine", + Summary: "Retrieve events sent by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.fetchEventsFromGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update data", + Summary: "Update key/value pairs accessible by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.updateData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve data", + Summary: "Retrieve key/value pairs set by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.retrieveData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "", + Summary: "", + }, + Key: "ServiceDirectory.queryServiceEndpointList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register service endpoint", + Summary: "Registers a service endpoint", + }, + Key: "ServiceDirectory.registerService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister service endpoint", + Summary: "Unregisters a service endpoint", + }, + Key: "ServiceDirectory.unregisterService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Annotate OVF section tree", + Summary: "Annotates the given OVF section tree with configuration choices for this OVF consumer", + }, + Key: "OvfConsumer.annotateOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate instantiation OVF section tree", + Summary: "Validates that this OVF consumer can accept an instantiation OVF section tree", + }, + Key: "OvfConsumer.validateInstantiationOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Request registration of OVF section tree nodes", + Summary: "Notifies the OVF consumer that the specified OVF section tree nodes should be registered", + }, + Key: "OvfConsumer.registerEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Request managed entities unregistration from OVF consumer", + Summary: "Notifies the OVF consumer that the specified managed entities should be unregistered", + }, + Key: "OvfConsumer.unregisterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify OVF consumer for cloned entities", + Summary: "Notifies the OVF consumer that the specified entities have been cloned", + }, + Key: "OvfConsumer.cloneEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Populate entity OVF section tree", + Summary: "Create OVF sections for the given managed entities and populate the entity OVF section tree", + }, + Key: "OvfConsumer.populateEntityOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve public OVF environment sections for virtual machine ", + Summary: "Retrieves the public OVF environment sections that this OVF consumer has for a given virtual machine", + }, + Key: "OvfConsumer.retrievePublicOvfEnvironmentSections", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify OVF consumer for virtual machine power on", + Summary: "Notifies the OVF consumer that a virtual machine is about to be powered on", + }, + Key: "OvfConsumer.notifyPowerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Specification exists", + Summary: "Check the existence of a specification", + }, + Key: "CustomizationSpecManager.exists", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get specification", + Summary: "Gets a specification", + }, + Key: "CustomizationSpecManager.get", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create new specification", + Summary: "Create a new specification", + }, + Key: "CustomizationSpecManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Overwrite specification", + Summary: "Overwrite an existing specification", + }, + Key: "CustomizationSpecManager.overwrite", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete specification", + Summary: "Delete a specification", + }, + Key: "CustomizationSpecManager.delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Duplicate specification", + Summary: "Duplicate a specification", + }, + Key: "CustomizationSpecManager.duplicate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename specification", + Summary: "Rename a specification", + }, + Key: "CustomizationSpecManager.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert specification item", + Summary: "Convert a specification item to XML text", + }, + Key: "CustomizationSpecManager.specItemToXml", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert XML item", + Summary: "Convert an XML string to a specification item", + }, + Key: "CustomizationSpecManager.xmlToSpecItem", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate required resources", + Summary: "Validate that required resources are available on the server to customize a particular guest operating system", + }, + Key: "CustomizationSpecManager.checkResources", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query supported features", + Summary: "Searches the current license source for licenses available from this system", + }, + Key: "LicenseManager.querySupportedFeatures", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query license source", + Summary: "Searches the current license source for licenses available for each feature known to this system", + }, + Key: "LicenseManager.querySourceAvailability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query license usage", + Summary: "Returns the list of features and the number of licenses that have been reserved", + }, + Key: "LicenseManager.queryUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set product edition", + Summary: "Defines the product edition", + }, + Key: "LicenseManager.setEdition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check feature", + Summary: "Checks if a feature is enabled", + }, + Key: "LicenseManager.checkFeature", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable license", + Summary: "Enable a feature that is marked as user-configurable", + }, + Key: "LicenseManager.enable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable license", + Summary: "Release licenses for a user-configurable feature", + }, + Key: "LicenseManager.disable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure license source", + Summary: "Allows reconfiguration of the License Manager license source", + }, + Key: "LicenseManager.configureSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Installing license", + Summary: "Installing license", + }, + Key: "LicenseManager.updateLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add license", + Summary: "Adds a new license to the license inventory", + }, + Key: "LicenseManager.addLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove license", + Summary: "Removes a license from the license inventory", + }, + Key: "LicenseManager.removeLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Decode license", + Summary: "Decodes the license to return the properties of that license key", + }, + Key: "LicenseManager.decodeLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update license label", + Summary: "Update a license's label", + }, + Key: "LicenseManager.updateLabel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove license label", + Summary: "Removes a license's label", + }, + Key: "LicenseManager.removeLabel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get License Data Manager", + Summary: "Gets the License Data Manager", + }, + Key: "LicenseManager.queryLicenseDataManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Activate remote hard enforcement", + Summary: "Activates the remote hard enforcement", + }, + Key: "LicenseManager.activateRemoteHardEnforcement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datastore custom value", + Summary: "Sets the value of a custom field of a datastore", + }, + Key: "Datastore.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datastore", + Summary: "Reload information about the datastore", + }, + Key: "Datastore.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datastore", + Summary: "Renames a datastore", + }, + Key: "Datastore.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastore", + Summary: "Removes a datastore if it is not used by any host or virtual machine", + }, + Key: "Datastore.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Tag", + Summary: "Add a set of tags to the datastore", + }, + Key: "Datastore.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the datastore", + }, + Key: "Datastore.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Datastore.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh datastore", + Summary: "Refreshes free space on this datastore", + }, + Key: "Datastore.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh storage information", + Summary: "Refresh the storage information of the datastore", + }, + Key: "Datastore.refreshStorageInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual machine files", + Summary: "Update virtual machine files on the datastore", + }, + Key: "Datastore.updateVirtualMachineFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datastore", + Summary: "Rename the datastore", + }, + Key: "Datastore.renameDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete datastore", + Summary: "Delete datastore", + }, + Key: "Datastore.destroyDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replace embedded file paths", + Summary: "Replace embedded file paths on the datastore", + }, + Key: "Datastore.replaceEmbeddedFilePaths", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter SDRS maintenance mode", + Summary: "Virtual machine evacuation recommendations from the selected datastore are generated for SDRS maintenance mode", + }, + Key: "Datastore.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit SDRS maintenance mode", + Summary: "Exit SDRS maintenance mode", + }, + Key: "Datastore.exitMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get native clone capability", + Summary: "Check if the datastore supports native clone", + }, + Key: "Datastore.isNativeCloneCapable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cleanup locks", + Summary: "Cleanup lock files on NFSV3 datastore", + }, + Key: "Datastore.cleanupLocks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateVVolVirtualMachineFiles", + Summary: "updateVVolVirtualMachineFiles", + }, + Key: "Datastore.updateVVolVirtualMachineFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get current time", + Summary: "Returns the current time on the server", + }, + Key: "ServiceInstance.currentTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve content", + Summary: "Get the properties of the service instance", + }, + Key: "ServiceInstance.retrieveContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve internal properties", + Summary: "Retrieves the internal properties of the service instance", + }, + Key: "ServiceInstance.retrieveInternalContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate migration", + Summary: "Checks for errors and warnings of virtual machines migrated from one host to another", + }, + Key: "ServiceInstance.validateMigration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vMotion compatibility", + Summary: "Validates the vMotion compatibility of a set of hosts", + }, + Key: "ServiceInstance.queryVMotionCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve product components", + Summary: "Component information for bundled products", + }, + Key: "ServiceInstance.retrieveProductComponents", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh the CA certificates on the host", + Summary: "Refreshes the CA certificates on the host", + }, + Key: "CertificateManager.refreshCACertificatesAndCRLs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh the subject certificate on the host", + Summary: "Refreshes the subject certificate on the host", + }, + Key: "CertificateManager.refreshCertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revoke the subject certificate of a host", + Summary: "Revokes the subject certificate of a host", + }, + Key: "CertificateManager.revokeCertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query service list", + Summary: "Location information that needs to match a service", + }, + Key: "ServiceManager.queryServiceList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Creates a registry key", + Summary: "Creates a registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.createRegistryKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Lists all registry subkeys for a specified registry key", + Summary: "Lists all registry subkeys for a specified registry key in the Windows guest operating system.", + }, + Key: "vm.guest.WindowsRegistryManager.listRegistryKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deletes a registry key", + Summary: "Deletes a registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.deleteRegistryKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sets and creates a registry value", + Summary: "Sets and creates a registry value in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.setRegistryValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Lists all registry values for a specified registry key", + Summary: "Lists all registry values for a specified registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.listRegistryValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deletes a registry value", + Summary: "Deletes a registry value in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.deleteRegistryValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start a program in the guest", + Summary: "Start a program in the guest operating system", + }, + Key: "vm.guest.ProcessManager.startProgram", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List processes in the guest", + Summary: "List processes in the guest operating system", + }, + Key: "vm.guest.ProcessManager.listProcesses", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Terminate a process in the guest", + Summary: "Terminate a process in the guest operating system", + }, + Key: "vm.guest.ProcessManager.terminateProcess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read an environment variable in the guest", + Summary: "Read an environment variable in the guest operating system", + }, + Key: "vm.guest.ProcessManager.readEnvironmentVariable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disabled guest operations", + Summary: "Returns a list of guest operations not supported by a virtual machine", + }, + Key: "vm.guest.GuestOperationsManager.queryDisabledMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a directory in the guest", + Summary: "Create a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.makeDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a file in the guest", + Summary: "Delete a file in the guest operating system", + }, + Key: "vm.guest.FileManager.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a directory in the guest", + Summary: "Delete a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.deleteDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move or rename a directory in the guest", + Summary: "Move or rename a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.moveDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move or rename a file in the guest", + Summary: "Move or rename a file in the guest operating system", + }, + Key: "vm.guest.FileManager.moveFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a temporary file in the guest", + Summary: "Create a temporary file in the guest operating system", + }, + Key: "vm.guest.FileManager.createTemporaryFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a temporary directory in the guest", + Summary: "Create a temporary directory in the guest operating system", + }, + Key: "vm.guest.FileManager.createTemporaryDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List files or directories in the guest", + Summary: "List files or directories in the guest operating system", + }, + Key: "vm.guest.FileManager.listFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change the attributes of a file in the guest", + Summary: "Change the attributes of a file in the guest operating system", + }, + Key: "vm.guest.FileManager.changeFileAttributes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiates an operation to transfer a file from the guest", + Summary: "Initiates an operation to transfer a file from the guest operating system", + }, + Key: "vm.guest.FileManager.initiateFileTransferFromGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiates an operation to transfer a file to the guest", + Summary: "Initiates an operation to transfer a file to the guest operating system", + }, + Key: "vm.guest.FileManager.initiateFileTransferToGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add an alias to the alias store in the guest", + Summary: "Add an alias to the alias store in the guest operating system", + }, + Key: "vm.guest.AliasManager.addAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an alias from the alias store in the guest", + Summary: "Remove an alias from the alias store in the guest operating system", + }, + Key: "vm.guest.AliasManager.removeAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove all aliases associated with a SSO Server certificate from the guest", + Summary: "Remove all aliases associated with a SSO Server certificate from the guest operating system", + }, + Key: "vm.guest.AliasManager.removeAliasByCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all aliases for a user in the guest", + Summary: "List all aliases for a user in the guest operating system", + }, + Key: "vm.guest.AliasManager.listAliases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all mapped aliases in the guest", + Summary: "List all mapped aliases in the guest operating system", + }, + Key: "vm.guest.AliasManager.listMappedAliases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure workload model calculation parameters for datastore", + Summary: "Configures calculation parameters used for computation of workload model for a datastore", + }, + Key: "DrsStatsManager.configureWorkloadCharacterization", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query current workload model calculation parameters", + Summary: "Queries a host for the current workload model calculation parameters", + }, + Key: "DrsStatsManager.queryWorkloadCharacterization", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure datastore correlation detector", + Summary: "Configures datastore correlation detector with datastore to datastore cluster mappings", + }, + Key: "DrsStatsManager.configureCorrelationDetector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore correlation result", + Summary: "Queries correlation detector for a list of datastores correlated to a given datastore", + }, + Key: "DrsStatsManager.queryCorrelationResult", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set firewall custom value", + Summary: "Sets the value of a custom field of a host firewall system", + }, + Key: "host.FirewallSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update default firewall policy", + Summary: "Updates the default firewall policy", + }, + Key: "host.FirewallSystem.updateDefaultPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open firewall ports", + Summary: "Open the firewall ports belonging to the specified ruleset", + }, + Key: "host.FirewallSystem.enableRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Block firewall ports", + Summary: "Block the firewall ports belonging to the specified ruleset", + }, + Key: "host.FirewallSystem.disableRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update allowed IP list of the firewall ruleset", + Summary: "Update the allowed IP list of the specified ruleset", + }, + Key: "host.FirewallSystem.updateRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh firewall information", + Summary: "Refresh the firewall information and settings to detect any changes made directly on the host", + }, + Key: "host.FirewallSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update local swap datastore", + Summary: "Changes the datastore for virtual machine swap files", + }, + Key: "host.DatastoreSystem.updateLocalSwapDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve disks for VMFS datastore", + Summary: "Retrieves the list of disks that can be used to contain VMFS datastore extents", + }, + Key: "host.DatastoreSystem.queryAvailableDisksForVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore create options", + Summary: "Queries options for creating a new VMFS datastore for a disk", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreCreateOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create VMFS datastore", + Summary: "Creates a new VMFS datastore", + }, + Key: "host.DatastoreSystem.createVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore extend options", + Summary: "Queries options for extending an existing VMFS datastore for a disk", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreExtendOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query VMFS datastore expand options", + Summary: "Query the options available for expanding the extents of a VMFS datastore", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreExpandOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend datastore", + Summary: "Extends an existing VMFS datastore", + }, + Key: "host.DatastoreSystem.extendVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Expand VMFS datastore", + Summary: "Expand the capacity of a VMFS datastore extent", + }, + Key: "host.DatastoreSystem.expandVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "processVmfsDatastoreUpdate", + Summary: "processVmfsDatastoreUpdate", + }, + Key: "host.DatastoreSystem.processVmfsDatastoreUpdate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create NAS datastore", + Summary: "Creates a new Network Attached Storage (NAS) datastore", + }, + Key: "host.DatastoreSystem.createNasDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create local datastore", + Summary: "Creates a new local datastore", + }, + Key: "host.DatastoreSystem.createLocalDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Virtual Volume datastore", + Summary: "Updates the Virtual Volume datastore configuration according to the provided settings", + }, + Key: "host.DatastoreSystem.UpdateVvolDatastoreInternal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a datastore backed by a Virtual Volume storage container", + }, + Key: "host.DatastoreSystem.createVvolDatastoreInternal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a Virtuial Volume datastore", + }, + Key: "host.DatastoreSystem.createVvolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastore", + Summary: "Removes a datastore from a host", + }, + Key: "host.DatastoreSystem.removeDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastores", + Summary: "Removes one or more datastores from a host", + }, + Key: "host.DatastoreSystem.removeDatastoreEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure datastore principal", + Summary: "Configures datastore principal user for the host", + }, + Key: "host.DatastoreSystem.configureDatastorePrincipal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unbound VMFS volumes", + Summary: "Gets the list of unbound VMFS volumes", + }, + Key: "host.DatastoreSystem.queryUnresolvedVmfsVolumes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resignature unresolved VMFS volume", + Summary: "Resignature unresolved VMFS volume with new VMFS identifier", + }, + Key: "host.DatastoreSystem.resignatureUnresolvedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "NotifyDatastore", + Summary: "NotifyDatastore", + }, + Key: "host.DatastoreSystem.NotifyDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check accessibility", + Summary: "Check if the file objects for the specified virtual machine IDs are accessible", + }, + Key: "host.DatastoreSystem.checkVmFileAccessibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Join Windows Domain", + Summary: "Enables ActiveDirectory authentication on the host", + }, + Key: "host.ActiveDirectoryAuthentication.joinDomain", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Join Windows Domain through vSphere Authentication Proxy service", + Summary: "Enables Active Directory authentication on the host using a vSphere Authentication Proxy server", + }, + Key: "host.ActiveDirectoryAuthentication.joinDomainWithCAM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import the certificate of vSphere Authentication Proxy server", + Summary: "Import the certificate of vSphere Authentication Proxy server to ESXi's authentication store", + }, + Key: "host.ActiveDirectoryAuthentication.importCertificateForCAM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Leave Windows Domain", + Summary: "Disables ActiveDirectory authentication on the host", + }, + Key: "host.ActiveDirectoryAuthentication.leaveCurrentDomain", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable Smart Card Authentication", + Summary: "Enables smart card authentication of ESXi Direct Console UI users", + }, + Key: "host.ActiveDirectoryAuthentication.enableSmartCardAuthentication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install a Smart Card Trust Anchor", + Summary: "Installs a smart card trust anchor on the host", + }, + Key: "host.ActiveDirectoryAuthentication.installSmartCardTrustAnchor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "replaceSmartCardTrustAnchors", + Summary: "replaceSmartCardTrustAnchors", + }, + Key: "host.ActiveDirectoryAuthentication.replaceSmartCardTrustAnchors", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a Smart Card Trust Anchor", + Summary: "Removes an installed smart card trust anchor from the host", + }, + Key: "host.ActiveDirectoryAuthentication.removeSmartCardTrustAnchor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Smart Card Trust Anchor", + Summary: "Removes the installed smart card trust anchor from the host", + }, + Key: "host.ActiveDirectoryAuthentication.removeSmartCardTrustAnchorByFingerprint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List Smart Card Trust Anchors", + Summary: "Lists the smart card trust anchors installed on the host", + }, + Key: "host.ActiveDirectoryAuthentication.listSmartCardTrustAnchors", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable Smart Card Authentication", + Summary: "Disables smart card authentication of ESXi Direct Console UI users", + }, + Key: "host.ActiveDirectoryAuthentication.disableSmartCardAuthentication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMCI access rights", + Summary: "Updates VMCI (Virtual Machine Communication Interface) access rights for one or more virtual machines", + }, + Key: "host.VmciAccessManager.updateAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve VMCI service rights granted to virtual machine", + Summary: "Retrieve VMCI (Virtual Machine Communication Interface) service rights granted to a VM", + }, + Key: "host.VmciAccessManager.retrieveGrantedServices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machines with access to VMCI service", + Summary: "Gets the VMs with granted access to a service", + }, + Key: "host.VmciAccessManager.queryAccessToService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create new identity binding", + Summary: "Creates a new identity binding between the host and vCenter Server", + }, + Key: "host.TpmManager.requestIdentity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Verify authenticity of credential", + Summary: "Verifies the authenticity and correctness of the supplied attestation credential", + }, + Key: "host.TpmManager.verifyCredential", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate integrity report", + Summary: "Generates an integrity report for the selected components", + }, + Key: "host.TpmManager.generateReport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure SNMP agent", + Summary: "Reconfigure the SNMP agent", + }, + Key: "host.SnmpSystem.reconfigureSnmpAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send test notification", + Summary: "Send test notification", + }, + Key: "host.SnmpSystem.sendTestNotification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set service custom value", + Summary: "Sets the value of a custom field of a host service system.", + }, + Key: "host.ServiceSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update service activation policy", + Summary: "Updates the activation policy of the service", + }, + Key: "host.ServiceSystem.updatePolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start service", + Summary: "Starts the service", + }, + Key: "host.ServiceSystem.start", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop service", + Summary: "Stops the service", + }, + Key: "host.ServiceSystem.stop", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restart service", + Summary: "Restarts the service", + }, + Key: "host.ServiceSystem.restart", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall service", + Summary: "Uninstalls the service", + }, + Key: "host.ServiceSystem.uninstall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh service information", + Summary: "Refresh the service information and settings to detect any changes made directly on the host", + }, + Key: "host.ServiceSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check", + Summary: "Check for dependencies, conflicts, and obsolete updates", + }, + Key: "host.PatchManager.Check", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan", + Summary: "Scan the host for patch status", + }, + Key: "host.PatchManager.Scan", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan", + Summary: "Scan the host for patch status", + }, + Key: "host.PatchManager.ScanV2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stage", + Summary: "Stage the updates to the host", + }, + Key: "host.PatchManager.Stage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install", + Summary: "Install the patch", + }, + Key: "host.PatchManager.Install", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install", + Summary: "Install the patch", + }, + Key: "host.PatchManager.InstallV2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall", + Summary: "Uninstall the patch", + }, + Key: "host.PatchManager.Uninstall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query", + Summary: "Query the host for installed bulletins", + }, + Key: "host.PatchManager.Query", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "createEntry", + Summary: "createEntry", + }, + Key: "host.OperationCleanupManager.createEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntry", + Summary: "updateEntry", + }, + Key: "host.OperationCleanupManager.updateEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryEntry", + Summary: "queryEntry", + }, + Key: "host.OperationCleanupManager.queryEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set memory manager custom value", + Summary: "Sets the value of a custom field of a host memory manager system", + }, + Key: "host.MemoryManagerSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set console memory reservation", + Summary: "Set the configured service console memory reservation", + }, + Key: "host.MemoryManagerSystem.reconfigureServiceConsoleReservation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine reservation", + Summary: "Updates the virtual machine reservation information", + }, + Key: "host.MemoryManagerSystem.reconfigureVirtualMachineReservation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "promoteDisks", + Summary: "promoteDisks", + }, + Key: "host.LowLevelProvisioningManager.promoteDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine on disk", + }, + Key: "host.LowLevelProvisioningManager.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine", + Summary: "Deletes a virtual machine on disk", + }, + Key: "host.LowLevelProvisioningManager.deleteVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine without deleting its virtual disks", + Summary: "Deletes a virtual machine from its storage, all virtual machine files are deleted except its associated virtual disks", + }, + Key: "host.LowLevelProvisioningManager.deleteVmExceptDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual machine recovery information", + Summary: "Retrieves virtual machine recovery information", + }, + Key: "host.LowLevelProvisioningManager.retrieveVmRecoveryInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve last virtual machine migration status", + Summary: "Retrieves the last virtual machine migration status if available", + }, + Key: "host.LowLevelProvisioningManager.retrieveLastVmMigrationStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine", + Summary: "Reconfigures the virtual machine", + }, + Key: "host.LowLevelProvisioningManager.reconfigVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload disks", + Summary: "Reloads virtual disk information", + }, + Key: "host.LowLevelProvisioningManager.reloadDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate disks", + Summary: "Consolidates virtual disks", + }, + Key: "host.LowLevelProvisioningManager.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update snapshot layout information", + Summary: "Updates the snapshot layout information of a virtual machine and reloads its snapshots", + }, + Key: "host.LowLevelProvisioningManager.relayoutSnapshots", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reserve files for provisioning", + Summary: "Reserves files or directories on a datastore to be used for a provisioning", + }, + Key: "host.LowLevelProvisioningManager.reserveFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete files", + Summary: "Deletes a list of files from a datastore", + }, + Key: "host.LowLevelProvisioningManager.deleteFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extract NVRAM content", + Summary: "Extracts the NVRAM content from a checkpoint file", + }, + Key: "host.LowLevelProvisioningManager.extractNvramContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set resource pool custom value", + Summary: "Sets the value of a custom field of a resource pool of physical resources", + }, + Key: "ResourcePool.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload resource pool", + Summary: "Reload the resource pool", + }, + Key: "ResourcePool.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename resource pool", + Summary: "Rename the resource pool", + }, + Key: "ResourcePool.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete resource pool", + Summary: "Delete the resource pool, which also deletes its contents and removes it from its parent folder (if any)", + }, + Key: "ResourcePool.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the resource pool", + }, + Key: "ResourcePool.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the resource pool", + }, + Key: "ResourcePool.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ResourcePool.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update resource pool configuration", + Summary: "Updates the resource pool configuration", + }, + Key: "ResourcePool.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move into resource pool", + Summary: "Moves a set of resource pools or virtual machines into this pool", + }, + Key: "ResourcePool.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update child resource configuration", + Summary: "Change the resource configuration of a set of children of the resource pool", + }, + Key: "ResourcePool.updateChildResourceConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create resource pool", + Summary: "Creates a new resource pool", + }, + Key: "ResourcePool.createResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete resource pool children", + Summary: "Removes all child resource pools recursively", + }, + Key: "ResourcePool.destroyChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vApp", + Summary: "Creates a child vApp of this resource pool", + }, + Key: "ResourcePool.createVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine in this resource pool", + }, + Key: "ResourcePool.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this resource pool", + }, + Key: "ResourcePool.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "ResourcePool.importVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query resource pool resource configuration options", + Summary: "Returns configuration options for a set of resources for a resource pool", + }, + Key: "ResourcePool.queryResourceConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh resource runtime information", + Summary: "Refreshes the resource usage runtime information", + }, + Key: "ResourcePool.refreshRuntime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create user", + Summary: "Creates a local user account", + }, + Key: "host.LocalAccountManager.createUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update user", + Summary: "Updates a local user account", + }, + Key: "host.LocalAccountManager.updateUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create group", + Summary: "Creates a local group account", + }, + Key: "host.LocalAccountManager.createGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete user", + Summary: "Removes a local user account", + }, + Key: "host.LocalAccountManager.removeUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove group", + Summary: "Removes a local group account", + }, + Key: "host.LocalAccountManager.removeGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Assign user to group", + Summary: "Assign user to group", + }, + Key: "host.LocalAccountManager.assignUserToGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unassign user from group", + Summary: "Unassigns a user from a group", + }, + Key: "host.LocalAccountManager.unassignUserFromGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query whether virtual NIC is used by iSCSI multi-pathing", + Summary: "Query whether virtual NIC is used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryVnicStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query whether physical NIC is used by iSCSI multi-pathing", + Summary: "Query whether physical NIC is used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryPnicStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query all the virtual NICs used by iSCSI multi-pathing", + Summary: "Query all the virtual NICs used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryBoundVnics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query candidate virtual NICs that can be used for iSCSI multi-pathing", + Summary: "Query candidate virtual NICs that can be used for iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryCandidateNics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual NIC to iSCSI Adapter", + Summary: "Add virtual NIC to iSCSI Adapter", + }, + Key: "host.IscsiManager.bindVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual NIC from iSCSI Adapter", + Summary: "Remove virtual NIC from iSCSI Adapter", + }, + Key: "host.IscsiManager.unbindVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query migration dependencies for migrating the physical and virtual NICs", + Summary: "Query migration dependencies for migrating the physical and virtual NICs", + }, + Key: "host.IscsiManager.queryMigrationDependencies", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get acceptance level for host image configuration", + Summary: "Get acceptance level settings for host image configuration", + }, + Key: "host.ImageConfigManager.queryHostAcceptanceLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host image profile", + Summary: "Queries the current host image profile information", + }, + Key: "host.ImageConfigManager.queryHostImageProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update acceptance level", + Summary: "Updates the acceptance level of a host", + }, + Key: "host.ImageConfigManager.updateAcceptanceLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchSoftwarePackages", + Summary: "fetchSoftwarePackages", + }, + Key: "host.ImageConfigManager.fetchSoftwarePackages", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "installDate", + Summary: "installDate", + }, + Key: "host.ImageConfigManager.installDate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve access entries", + Summary: "Retrieves the access mode for each user or group with access permissions on the host", + }, + Key: "host.HostAccessManager.retrieveAccessEntries", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change access mode", + Summary: "Changes the access mode for a user or group on the host", + }, + Key: "host.HostAccessManager.changeAccessMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve special DCUI access users", + Summary: "Retrieves the list of users with special access to DCUI", + }, + Key: "host.HostAccessManager.queryDcuiAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update special DCUI access users", + Summary: "Updates the list of users with special access to DCUI", + }, + Key: "host.HostAccessManager.updateDcuiAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve system users", + Summary: "Retrieve the list of special system users on the host", + }, + Key: "host.HostAccessManager.querySystemUsers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system users", + Summary: "Updates the list of special system users on the host", + }, + Key: "host.HostAccessManager.updateSystemUsers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query lockdown exceptions", + Summary: "Queries the current list of user exceptions for lockdown mode", + }, + Key: "host.HostAccessManager.queryLockdownExceptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update lockdown exceptions", + Summary: "Updates the current list of user exceptions for lockdown mode", + }, + Key: "host.HostAccessManager.updateLockdownExceptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change lockdown mode", + Summary: "Changes lockdown mode on the host", + }, + Key: "host.HostAccessManager.changeLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset to factory default", + Summary: "Reset the configuration to factory default", + }, + Key: "host.FirmwareSystem.resetToFactoryDefaults", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Backup configuration", + Summary: "Backup the configuration of the host", + }, + Key: "host.FirmwareSystem.backupConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration upload URL", + Summary: "Host configuration must be uploaded for a restore operation", + }, + Key: "host.FirmwareSystem.queryConfigUploadURL", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restore configuration", + Summary: "Restore configuration of the host", + }, + Key: "host.FirmwareSystem.restoreConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Flush firmware configuration", + Summary: "Writes the configuration of the firmware system to persistent storage", + }, + Key: "host.FirmwareSystem.syncConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryQuantumMinutes", + Summary: "queryQuantumMinutes", + }, + Key: "host.FirmwareSystem.queryQuantumMinutes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "querySyncsPerQuantum", + Summary: "querySyncsPerQuantum", + }, + Key: "host.FirmwareSystem.querySyncsPerQuantum", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update ESX agent configuration", + Summary: "Updates the ESX agent configuration of a host", + }, + Key: "host.EsxAgentHostManager.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Renew disk lease", + Summary: "Renew a lease to prevent it from timing out", + }, + Key: "host.DiskManager.Lease.renew", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Release disk lease", + Summary: "End the lease if it is still active", + }, + Key: "host.DiskManager.Lease.release", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocate blocks", + Summary: "Prepare for writing to blocks", + }, + Key: "host.DiskManager.Lease.allocateBlocks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear lazy zero", + Summary: "Honor the contents of a block range", + }, + Key: "host.DiskManager.Lease.clearLazyZero", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Map disk region", + Summary: "Mapping a specified region of a virtual disk", + }, + Key: "host.DiskManager.Lease.MapDiskRegion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire disk lease", + Summary: "Acquire a lease for the files associated with the virtual disk referenced by the given datastore path", + }, + Key: "host.DiskManager.acquireLease", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire lease extension", + Summary: "Acquires a lease for the files associated with the virtual disk of a virtual machine", + }, + Key: "host.DiskManager.acquireLeaseExt", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Renew all leases", + Summary: "Resets the watchdog timer and confirms that all the locks for all the disks managed by this watchdog are still valid", + }, + Key: "host.DiskManager.renewAllLeases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update configuration", + Summary: "Update the date and time on the host", + }, + Key: "host.DateTimeSystem.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available time zones", + Summary: "Retrieves the list of available time zones on the host", + }, + Key: "host.DateTimeSystem.queryAvailableTimeZones", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query date and time", + Summary: "Get the current date and time on the host", + }, + Key: "host.DateTimeSystem.queryDateTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update date or time", + Summary: "Update the date/time on the host", + }, + Key: "host.DateTimeSystem.updateDateTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh", + Summary: "Refresh the date and time settings", + }, + Key: "host.DateTimeSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Search datastore", + Summary: "Returns the information for the files that match the given search criteria", + }, + Key: "host.DatastoreBrowser.search", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Search datastore subfolders", + Summary: "Returns the information for the files that match the given search criteria", + }, + Key: "host.DatastoreBrowser.searchSubFolders", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete datastore file", + Summary: "Deletes the specified files from the datastore", + }, + Key: "host.DatastoreBrowser.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set CPU scheduler system custom value", + Summary: "Sets the value of a custom field of a host CPU scheduler", + }, + Key: "host.CpuSchedulerSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable hyperthreading", + Summary: "Enable hyperthreads as schedulable resources", + }, + Key: "host.CpuSchedulerSystem.enableHyperThreading", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable hyperthreading", + Summary: "Disable hyperthreads as schedulable resources", + }, + Key: "host.CpuSchedulerSystem.disableHyperThreading", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate a certificate signing request", + Summary: "Generates a certificate signing request (CSR) for the host", + }, + Key: "host.CertificateManager.generateCertificateSigningRequest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate a certificate signing request using the specified Distinguished Name", + Summary: "Generates a certificate signing request (CSR) for the host using the specified Distinguished Name", + }, + Key: "host.CertificateManager.generateCertificateSigningRequestByDn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install a server certificate", + Summary: "Installs a server certificate for the host", + }, + Key: "host.CertificateManager.installServerCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replace CA certificates and certificate revocation lists", + Summary: "Replaces the CA certificates and certificate revocation lists (CRLs) on the host", + }, + Key: "host.CertificateManager.replaceCACertificatesAndCRLs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify services affected by SSL credentials change", + Summary: "Notifies the host services affected by SSL credentials change", + }, + Key: "host.CertificateManager.notifyAffectedServices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List CA certificates", + Summary: "Lists the CA certificates on the host", + }, + Key: "host.CertificateManager.listCACertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List CA certificate revocation lists", + Summary: "Lists the CA certificate revocation lists (CRLs) on the host", + }, + Key: "host.CertificateManager.listCACertificateRevocationLists", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get boot devices", + Summary: "Get available boot devices for the host system", + }, + Key: "host.BootDeviceSystem.queryBootDevices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update boot device", + Summary: "Update the boot device on the host system", + }, + Key: "host.BootDeviceSystem.updateBootDevice", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set latest page size", + Summary: "Set the last page viewed size and contain at most maxCount items in the page", + }, + Key: "TaskHistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind", + Summary: "Move the scroll position to the oldest item", + }, + Key: "TaskHistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset", + Summary: "Move the scroll position to the item just above the last page viewed", + }, + Key: "TaskHistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove collector", + Summary: "Remove the collector from server", + }, + Key: "TaskHistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read next", + Summary: "The scroll position is moved to the next new page after the read", + }, + Key: "TaskHistoryCollector.readNext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read previous", + Summary: "The scroll position is moved to the next older page after the read", + }, + Key: "TaskHistoryCollector.readPrev", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "waitForChanges", + Summary: "waitForChanges", + }, + Key: "cdc.ChangeLogCollector.waitForChanges", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "initializeSequence", + Summary: "initializeSequence", + }, + Key: "cdc.ChangeLogCollector.initializeSequence", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "exchangeSequence", + Summary: "exchangeSequence", + }, + Key: "cdc.ChangeLogCollector.exchangeSequence", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm custom value", + Summary: "Sets the value of a custom field of an alarm", + }, + Key: "alarm.Alarm.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove alarm", + Summary: "Remove the alarm", + }, + Key: "alarm.Alarm.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure alarm", + Summary: "Reconfigure the alarm", + }, + Key: "alarm.Alarm.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove managed object", + Summary: "Remove the managed objects", + }, + Key: "view.ManagedObjectView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create scheduled task", + Summary: "Create a scheduled task", + }, + Key: "scheduler.ScheduledTaskManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve scheduled task", + Summary: "Available scheduled tasks defined on the entity", + }, + Key: "scheduler.ScheduledTaskManager.retrieveEntityScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create scheduled task", + Summary: "Create a scheduled task", + }, + Key: "scheduler.ScheduledTaskManager.createObjectScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve scheduled task", + Summary: "Available scheduled tasks defined on the object", + }, + Key: "scheduler.ScheduledTaskManager.retrieveObjectScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set scheduled task custom value", + Summary: "Sets the value of a custom field of a scheduled task", + }, + Key: "scheduler.ScheduledTask.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove scheduled task", + Summary: "Remove the scheduled task", + }, + Key: "scheduler.ScheduledTask.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure scheduled task", + Summary: "Reconfigure the scheduled task properties", + }, + Key: "scheduler.ScheduledTask.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Run scheduled task", + Summary: "Run the scheduled task immediately", + }, + Key: "scheduler.ScheduledTask.run", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create inventory view", + Summary: "Create a view for browsing the inventory and tracking changes to open folders", + }, + Key: "view.ViewManager.createInventoryView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create container view", + Summary: "Create a view for monitoring the contents of a single container", + }, + Key: "view.ViewManager.createContainerView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create list view", + Summary: "Create a view for getting updates", + }, + Key: "view.ViewManager.createListView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create list view", + Summary: "Create a list view from an existing view", + }, + Key: "view.ViewManager.createListViewFromView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove view", + Summary: "Remove view", + }, + Key: "view.View.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vSphere Distributed Switch", + Summary: "Create vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove vSphere Distributed Switch", + Summary: "Remove vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.removeDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.reconfigureDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPort", + Summary: "Update dvPort", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.updatePorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete ports", + Summary: "Delete ports", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.deletePorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve port state", + Summary: "Retrieve port state", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.fetchPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone port", + Summary: "Clone port", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.clonePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vSphere Distributed Switch configuration specification", + Summary: "Retrieve vSphere Distributed Switch configuration specification", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDvsConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Groups", + Summary: "Update Distributed Port Group", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.updateDVPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve port group keys for vSphere Distributed Switch", + Summary: "Retrieve the list of port group keys on a given vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve distributed virtual port group specification", + Summary: "Retrievs the configuration specification for distributed virtual port groups", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPortgroupConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Load port", + Summary: "Load port", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.loadDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve the list of port keys on the given vSphere Distributed Switch", + Summary: "Retrieve the list of port keys on the given vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPorts", + Summary: "Update dvPort", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Groups", + Summary: "Update Distributed Port Group", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch", + Summary: "Update vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch list", + Summary: "Update vSphere Distributed Switch list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDvsList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Group list", + Summary: "Update Distributed Port Group list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortgroupList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPort list", + Summary: "Update dvPort list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute opaque command", + Summary: "Execute opaque command", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.executeOpaqueCommand", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set compute-resource custom value", + Summary: "Sets the value of a custom field for a unified compute resource", + }, + Key: "ComputeResource.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload resource", + Summary: "Reloads the resource", + }, + Key: "ComputeResource.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename compute-resource", + Summary: "Rename the compute-resource", + }, + Key: "ComputeResource.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove host", + Summary: "Removes the host resource", + }, + Key: "ComputeResource.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to this object", + }, + Key: "ComputeResource.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Removes a set of tags from this object", + }, + Key: "ComputeResource.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ComputeResource.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure compute-resource", + Summary: "Reconfigures a compute-resource", + }, + Key: "ComputeResource.reconfigureEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch set custom value", + Summary: "vSphere Distributed Switch set custom value", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload vSphere Distributed Switch", + Summary: "Reload vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vSphere Distributed Switch", + Summary: "Rename vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove vSphere Distributed Switch", + Summary: "Remove vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch add tag", + Summary: "vSphere Distributed Switch add tag", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch remove tag", + Summary: "vSphere Distributed Switch remove tag", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPort keys", + Summary: "Retrieve dvPort keys", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.fetchPortKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPorts", + Summary: "Retrieve dvPorts", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.fetchPorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query used virtual LAN ID", + Summary: "Query used virtual LAN ID", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.queryUsedVlanId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch product specification operation", + Summary: "vSphere Distributed Switch product specification operation", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.performProductSpecOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Merge vSphere Distributed Switch", + Summary: "Merge vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.merge", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Groups", + Summary: "Add Distributed Port Groups", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move dvPort", + Summary: "Move dvPort", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.movePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch capability", + Summary: "Update vSphere Distributed Switch capability", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure dvPort", + Summary: "Reconfigure dvPort", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigurePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh dvPort state", + Summary: "Refresh dvPort state", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.refreshPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify vSphere Distributed Switch host", + Summary: "Rectify vSphere Distributed Switch host", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network resource pools on vSphere Distributed Switch", + Summary: "Update network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add network resource pools on vSphere Distributed Switch", + Summary: "Add network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network resource pools on vSphere Distributed Switch", + Summary: "Remove network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.removeNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure a network resource pool on a distributed switch", + Summary: "Reconfigures a network resource pool on a distributed switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigureVmVnicNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network I/O control on vSphere Distributed Switch", + Summary: "Update network I/O control on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.enableNetworkResourceManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get vSphere Distributed Switch configuration spec to rollback", + Summary: "Get vSphere Distributed Switch configuration spec to rollback", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update health check configuration on vSphere Distributed Switch", + Summary: "Update health check configuration on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateHealthCheckConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Link Aggregation Control Protocol groups on vSphere Distributed Switch", + Summary: "Update Link Aggregation Control Protocol groups on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateLacpGroupConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion send operation", + Summary: "Prepare a vMotion send operation", + }, + Key: "host.VMotionManager.prepareSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare VMotion send operation asynchronously", + Summary: "Prepares a VMotion send operation asynchronously", + }, + Key: "host.VMotionManager.prepareSourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion receive operation", + Summary: "Prepare a vMotion receive operation", + }, + Key: "host.VMotionManager.prepareDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion receive operation asynchronously", + Summary: "Prepares a vMotion receive operation asynchronously", + }, + Key: "host.VMotionManager.prepareDestinationEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate vMotion receive operation", + Summary: "Initiate a vMotion receive operation", + }, + Key: "host.VMotionManager.initiateDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate vMotion send operation", + Summary: "Initiate a vMotion send operation", + }, + Key: "host.VMotionManager.initiateSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate VMotion send operation", + Summary: "Initiates a VMotion send operation", + }, + Key: "host.VMotionManager.initiateSourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete vMotion source notification", + Summary: "Tell the source that vMotion migration is complete (success or failure)", + }, + Key: "host.VMotionManager.completeSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete vMotion receive notification", + Summary: "Tell the destination that vMotion migration is complete (success or failure)", + }, + Key: "host.VMotionManager.completeDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Commit vMotion destination upgrade", + Summary: "Reparent the disks at destination and commit the redo logs at the end of a vMotion migration", + }, + Key: "host.VMotionManager.upgradeDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMotionManager memory mirror migrate flag", + Summary: "Enables or disables VMotionManager memory mirror migrate", + }, + Key: "host.VMotionManager.updateMemMirrorFlag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMigrationIds", + Summary: "queryMigrationIds", + }, + Key: "host.VMotionManager.queryMigrationIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove list view", + Summary: "Remove the list view object", + }, + Key: "view.ListView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Modify list view", + Summary: "Modify the list view", + }, + Key: "view.ListView.modify", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset list view", + Summary: "Reset the list view", + }, + Key: "view.ListView.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset view", + Summary: "Resets a set of objects in a given view", + }, + Key: "view.ListView.resetFromView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerProvider", + Summary: "registerProvider", + }, + Key: "ExternalStatsManager.registerProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unregisterProvider", + Summary: "unregisterProvider", + }, + Key: "ExternalStatsManager.unregisterProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "isRegistered", + Summary: "isRegistered", + }, + Key: "ExternalStatsManager.isRegistered", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getRegisteredProviders", + Summary: "getRegisteredProviders", + }, + Key: "ExternalStatsManager.getRegisteredProviders", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getEnabledClusters", + Summary: "getEnabledClusters", + }, + Key: "ExternalStatsManager.getEnabledClusters", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateStats", + Summary: "updateStats", + }, + Key: "ExternalStatsManager.updateStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vMotion custom value", + Summary: "Sets the value of a custom field of a host vMotion system", + }, + Key: "host.VMotionSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP configuration", + Summary: "Update the IP configuration of the vMotion virtual NIC", + }, + Key: "host.VMotionSystem.updateIpConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Select vMotion virtual NIC", + Summary: "Select the virtual NIC to be used for vMotion", + }, + Key: "host.VMotionSystem.selectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deselect vMotion virtual NIC", + Summary: "Deselect the virtual NIC to be used for vMotion", + }, + Key: "host.VMotionSystem.deselectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of host or cluster against a profile", + }, + Key: "profile.ComplianceManager.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compliance status", + Summary: "Query compliance status", + }, + Key: "profile.ComplianceManager.queryComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryEntitiesByComplianceStatus", + Summary: "queryEntitiesByComplianceStatus", + }, + Key: "profile.ComplianceManager.queryEntitiesByComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear compliance history", + Summary: "Clear historical compliance data", + }, + Key: "profile.ComplianceManager.clearComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query expression metadata", + Summary: "Query expression metadata", + }, + Key: "profile.ComplianceManager.queryExpressionMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.ContentLibrary.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.ContentLibrary.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.ContentLibrary.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.ContentLibrary.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.ContentLibrary.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.ContentLibrary.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.ContentLibrary.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query entity provider summary", + Summary: "Get information about the performance statistics that can be queried for a particular entity", + }, + Key: "PerformanceManager.queryProviderSummary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available metrics", + Summary: "Gets available performance statistic metrics for the specified managed entity between begin and end times", + }, + Key: "PerformanceManager.queryAvailableMetric", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query counter", + Summary: "Get counter information for the list of counter IDs passed in", + }, + Key: "PerformanceManager.queryCounter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query counter by level", + Summary: "All performance data over 1 year old are deleted from the vCenter database", + }, + Key: "PerformanceManager.queryCounterByLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query performance statistics", + Summary: "Gets the performance statistics for the entity", + }, + Key: "PerformanceManager.queryStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get composite statistics", + Summary: "Get performance statistics for the entity and the breakdown across its child entities", + }, + Key: "PerformanceManager.queryCompositeStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Summarizes performance statistics", + Summary: "Summarizes performance statistics at the specified interval", + }, + Key: "PerformanceManager.summarizeStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create historical interval", + Summary: "Add a new historical interval configuration", + }, + Key: "PerformanceManager.createHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove historical interval", + Summary: "Remove a historical interval configuration", + }, + Key: "PerformanceManager.removeHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update historical interval", + Summary: "Update a historical interval configuration if it exists", + }, + Key: "PerformanceManager.updateHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update counter level mapping", + Summary: "Update counter to level mapping", + }, + Key: "PerformanceManager.updateCounterLevelMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset counter level mapping", + Summary: "Reset counter to level mapping to the default values", + }, + Key: "PerformanceManager.resetCounterLevelMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query internal performance counters", + Summary: "Queries all internal counters, supported by this performance manager", + }, + Key: "PerformanceManager.queryPerfCounterInt", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable performance counters", + Summary: "Enable a counter or a set of counters in the counters collection of this performance manager", + }, + Key: "PerformanceManager.enableStat", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable performance counters", + Summary: "Exclude a counter or a set of counters from the counters collection of this performance manager", + }, + Key: "PerformanceManager.disableStat", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "CreateVRP", + Summary: "CreateVRP", + }, + Key: "VRPResourceManager.CreateVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "UpdateVRP", + Summary: "UpdateVRP", + }, + Key: "VRPResourceManager.UpdateVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DeleteVRP", + Summary: "DeleteVRP", + }, + Key: "VRPResourceManager.DeleteVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DeployVM", + Summary: "DeployVM", + }, + Key: "VRPResourceManager.DeployVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "UndeployVM", + Summary: "UndeployVM", + }, + Key: "VRPResourceManager.UndeployVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "SetManagedByVDC", + Summary: "SetManagedByVDC", + }, + Key: "VRPResourceManager.SetManagedByVDC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetAllVRPIds", + Summary: "GetAllVRPIds", + }, + Key: "VRPResourceManager.GetAllVRPIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetRPSettings", + Summary: "GetRPSettings", + }, + Key: "VRPResourceManager.GetRPSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPSettings", + Summary: "GetVRPSettings", + }, + Key: "VRPResourceManager.GetVRPSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPUsage", + Summary: "GetVRPUsage", + }, + Key: "VRPResourceManager.GetVRPUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPofVM", + Summary: "GetVRPofVM", + }, + Key: "VRPResourceManager.GetVRPofVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetChildRPforHub", + Summary: "GetChildRPforHub", + }, + Key: "VRPResourceManager.GetChildRPforHub", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set PCI passthrough system custom value", + Summary: "Set PCI Passthrough system custom value", + }, + Key: "host.PciPassthruSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh PCI passthrough device information", + Summary: "Refresh the available PCI passthrough device information", + }, + Key: "host.PciPassthruSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update PCI passthrough configuration", + Summary: "Update PCI passthrough device configuration", + }, + Key: "host.PciPassthruSystem.updatePassthruConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check virtual machine's compatibility on host", + Summary: "Checks whether a virtual machine is compatible on a host", + }, + Key: "vm.check.CompatibilityChecker.checkCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compatibility of a VM specification on a host", + Summary: "Checks compatibility of a VM specification on a host", + }, + Key: "vm.check.CompatibilityChecker.checkVMCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance of host against profile", + Summary: "Checks compliance of a host against a profile", + }, + Key: "profile.host.profileEngine.ComplianceManager.checkHostCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query expression metadata", + Summary: "Queries the metadata for the given expression names", + }, + Key: "profile.host.profileEngine.ComplianceManager.queryExpressionMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get the default compliance from host configuration subprofiles", + Summary: "Get the default compliance from host configuration subprofiles", + }, + Key: "profile.host.profileEngine.ComplianceManager.getDefaultCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update specific metadata", + Summary: "Update specific metadata for the given owner and list of virtual machine IDs", + }, + Key: "vm.MetadataManager.updateMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve specific metadata", + Summary: "Retrieve specific metadata for the given owner and list of virtual machine IDs", + }, + Key: "vm.MetadataManager.retrieveMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve all metadata", + Summary: "Retrieve all metadata for the given owner and datastore", + }, + Key: "vm.MetadataManager.retrieveAllMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear metadata", + Summary: "Clear all metadata for the given owner and datastore", + }, + Key: "vm.MetadataManager.clearMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.AntiAffinityGroup.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.AntiAffinityGroup.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.AntiAffinityGroup.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.AntiAffinityGroup.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.AntiAffinityGroup.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.AntiAffinityGroup.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.AntiAffinityGroup.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validate", + Summary: "validate", + }, + Key: "vdcs.NicManager.validate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "bind", + Summary: "bind", + }, + Key: "vdcs.NicManager.bind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unbind", + Summary: "unbind", + }, + Key: "vdcs.NicManager.unbind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "executeStep", + Summary: "executeStep", + }, + Key: "modularity.WorkflowStepHandler.executeStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "undoStep", + Summary: "undoStep", + }, + Key: "modularity.WorkflowStepHandler.undoStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "finalizeStep", + Summary: "finalizeStep", + }, + Key: "modularity.WorkflowStepHandler.finalizeStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add key", + Summary: "Add the specified key to the current host", + }, + Key: "encryption.CryptoManager.addKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add keys", + Summary: "Add the specified keys to the current host", + }, + Key: "encryption.CryptoManager.addKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove key", + Summary: "Remove the specified key from the current host", + }, + Key: "encryption.CryptoManager.removeKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove keys", + Summary: "Remove the specified keys from the current host", + }, + Key: "encryption.CryptoManager.removeKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all keys", + Summary: "List all the keys registered on the current host", + }, + Key: "encryption.CryptoManager.listKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vCenter HA cluster mode", + Summary: "Set vCenter HA cluster mode", + }, + Key: "vcha.FailoverClusterManager.setClusterMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getClusterMode", + Summary: "getClusterMode", + }, + Key: "vcha.FailoverClusterManager.getClusterMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getClusterHealth", + Summary: "getClusterHealth", + }, + Key: "vcha.FailoverClusterManager.getClusterHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate failover", + Summary: "Initiate a failover from active vCenter Server node to the passive node", + }, + Key: "vcha.FailoverClusterManager.initiateFailover", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query proxy information", + Summary: "Query the common message bus proxy service information", + }, + Key: "host.MessageBusProxy.retrieveInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure proxy", + Summary: "Configure the common message bus proxy service", + }, + Key: "host.MessageBusProxy.configure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove proxy configuration", + Summary: "Remove the common message proxy service configuration and disable the service", + }, + Key: "host.MessageBusProxy.unconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start proxy", + Summary: "Start the common message bus proxy service", + }, + Key: "host.MessageBusProxy.start", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop proxy", + Summary: "Stop the common message bus proxy service", + }, + Key: "host.MessageBusProxy.stop", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload proxy", + Summary: "Reload the common message bus proxy service and enable any configuration changes", + }, + Key: "host.MessageBusProxy.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a virtual disk object", + Summary: "Create a virtual disk object", + }, + Key: "vslm.host.VStorageObjectManager.createDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register a legacy disk to be a virtual disk object", + Summary: "Register a legacy disk to be a virtual disk object", + }, + Key: "vslm.host.VStorageObjectManager.registerDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend a virtual disk to the new capacity", + Summary: "Extend a virtual disk to the new capacity", + }, + Key: "vslm.host.VStorageObjectManager.extendDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate a thin virtual disk", + Summary: "Inflate a thin virtual disk", + }, + Key: "vslm.host.VStorageObjectManager.inflateDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a virtual storage object", + Summary: "Rename a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.renameVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update storage policy on a virtual storage object", + Summary: "Update storage policy on a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.updateVStorageObjectPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a virtual storage object", + Summary: "Delete a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.deleteVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a virtual storage object", + Summary: "Retrieve a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.retrieveVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveVStorageObjectState", + Summary: "retrieveVStorageObjectState", + }, + Key: "vslm.host.VStorageObjectManager.retrieveVStorageObjectState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List virtual storage objects on a datastore", + Summary: "List virtual storage objects on a datastore", + }, + Key: "vslm.host.VStorageObjectManager.listVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone a virtual storage object", + Summary: "Clone a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.cloneVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate a virtual storage object", + Summary: "Relocate a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.relocateVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconcile datastore inventory", + Summary: "Reconcile datastore inventory", + }, + Key: "vslm.host.VStorageObjectManager.reconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Schedule reconcile datastore inventory", + Summary: "Schedule reconcile datastore inventory", + }, + Key: "vslm.host.VStorageObjectManager.scheduleReconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve cluster profile description", + Summary: "Retrieve cluster profile description", + }, + Key: "profile.cluster.ClusterProfile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete cluster profile", + Summary: "Delete cluster profile", + }, + Key: "profile.cluster.ClusterProfile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach cluster profile", + Summary: "Attach cluster profile to cluster", + }, + Key: "profile.cluster.ClusterProfile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach cluster profile", + Summary: "Detach cluster profile from cluster", + }, + Key: "profile.cluster.ClusterProfile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of a cluster against a cluster profile", + }, + Key: "profile.cluster.ClusterProfile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export cluster profile", + Summary: "Export cluster profile to a file", + }, + Key: "profile.cluster.ClusterProfile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update cluster profile", + Summary: "Update configuration of cluster profile", + }, + Key: "profile.cluster.ClusterProfile.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create task collector", + Summary: "Creates a task collector to retrieve all tasks that have executed on the server based on a filter", + }, + Key: "TaskManager.createCollector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create task", + Summary: "Create a task", + }, + Key: "TaskManager.createTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "createTaskWithEntityName", + Summary: "createTaskWithEntityName", + }, + Key: "TaskManager.createTaskWithEntityName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disks for use in vSAN cluster", + Summary: "Queries disk eligibility for use in the vSAN cluster", + }, + Key: "host.VsanSystem.queryDisksForVsan", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add disks to vSAN", + Summary: "Adds the selected disks to the vSAN cluster", + }, + Key: "host.VsanSystem.addDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initialize disks in the vSAN cluster", + Summary: "Initializes the selected disks to be used in the vSAN cluster", + }, + Key: "host.VsanSystem.initializeDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove disk from vSAN", + Summary: "Removes the disks that are used in the vSAN cluster", + }, + Key: "host.VsanSystem.removeDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove disk group from vSAN", + Summary: "Removes the selected disk group from the vSAN cluster", + }, + Key: "host.VsanSystem.removeDiskMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmountDiskMapping", + Summary: "unmountDiskMapping", + }, + Key: "host.VsanSystem.unmountDiskMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSAN configuration", + Summary: "Updates the vSAN configuration for this host", + }, + Key: "host.VsanSystem.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vSAN runtime information", + Summary: "Retrieves the current vSAN runtime information for this host", + }, + Key: "host.VsanSystem.queryHostStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evacuate this host from vSAN cluster", + Summary: "Evacuates the specified host from the vSAN cluster", + }, + Key: "host.VsanSystem.evacuateNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recommission this host back to vSAN cluster", + Summary: "Recommissions the host back to vSAN cluster", + }, + Key: "host.VsanSystem.recommissionNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a ticket to register the vSAN VASA Provider", + Summary: "Retrieves a ticket to register the VASA Provider for vSAN in the Storage Monitoring Service", + }, + Key: "host.VsanSystem.fetchVsanSharedSecret", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.TagPolicy.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.TagPolicy.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.TagPolicy.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.TagPolicy.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.TagPolicy.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.TagPolicy.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.TagPolicy.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create alarm", + Summary: "Create a new alarm", + }, + Key: "alarm.AlarmManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve alarm", + Summary: "Get available alarms defined on the entity", + }, + Key: "alarm.AlarmManager.getAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get alarm actions enabled", + Summary: "Checks if alarm actions are enabled for an entity", + }, + Key: "alarm.AlarmManager.getAlarmActionsEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm actions enabled", + Summary: "Enables or disables firing alarm actions for an entity", + }, + Key: "alarm.AlarmManager.setAlarmActionsEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get alarm state", + Summary: "The state of instantiated alarms on the entity", + }, + Key: "alarm.AlarmManager.getAlarmState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acknowledge alarm", + Summary: "Stops alarm actions from firing until the alarm next triggers on an entity", + }, + Key: "alarm.AlarmManager.acknowledgeAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm status", + Summary: "Sets the status of an alarm for an entity", + }, + Key: "alarm.AlarmManager.setAlarmStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "clearTriggeredAlarms", + Summary: "clearTriggeredAlarms", + }, + Key: "alarm.AlarmManager.clearTriggeredAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "testSMTPSetup", + Summary: "testSMTPSetup", + }, + Key: "alarm.AlarmManager.testSMTPSetup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create private alarm on managed entity", + Summary: "Creates a Private (trigger-only) Alarm on a managed entity", + }, + Key: "alarm.AlarmManager.createPrivateAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query private alarms on managed entity", + Summary: "Retrieves all of the Private (trigger-only) Alarms defined on the specified managed entity", + }, + Key: "alarm.AlarmManager.queryPrivateAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sync triggered alarms list", + Summary: "Retrieves the full list of currently-triggered Alarms, as a list of triggers", + }, + Key: "alarm.AlarmManager.syncTriggeredAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve queued-up alarm triggers", + Summary: "Retrieves any queued-up alarm triggers representing Alarm state changes since the last time this method was called", + }, + Key: "alarm.AlarmManager.retrieveTriggers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group set custom value", + Summary: "Distributed Port Group set custom value", + }, + Key: "dvs.DistributedVirtualPortgroup.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload Distributed Port Group", + Summary: "Reload Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename Distributed Port Group", + Summary: "Rename Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Distributed Port Group", + Summary: "Delete Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag to Distributed Port Group", + Summary: "Add tag to Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group remove tag", + Summary: "Distributed Port Group remove tag", + }, + Key: "dvs.DistributedVirtualPortgroup.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "dvs.DistributedVirtualPortgroup.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group delete network", + Summary: "Distributed Port Group delete network", + }, + Key: "dvs.DistributedVirtualPortgroup.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure Distributed Port Group", + Summary: "Reconfigure Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get Distributed Port Group configuration spec to rollback", + Summary: "Get Distributed Port Group configuration spec to rollback", + }, + Key: "dvs.DistributedVirtualPortgroup.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query CMMDS", + Summary: "Queries CMMDS contents in the vSAN cluster", + }, + Key: "host.VsanInternalSystem.queryCmmds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query physical vSAN disks", + Summary: "Queries the physical vSAN disks", + }, + Key: "host.VsanInternalSystem.queryPhysicalVsanDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects", + Summary: "Queries the vSAN objects in the cluster", + }, + Key: "host.VsanInternalSystem.queryVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects on physical disks", + Summary: "Queries the vSAN objects that have at least one component on the current set of physical disks", + }, + Key: "host.VsanInternalSystem.queryObjectsOnPhysicalVsanDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Drop ownership of DOM objects", + Summary: "Drop ownership of the DOM objects that are owned by this host", + }, + Key: "host.VsanInternalSystem.abdicateDomOwnership", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN statistics", + Summary: "Gathers low level statistic counters from the vSAN cluster", + }, + Key: "host.VsanInternalSystem.queryVsanStatistics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigures vSAN objects", + Summary: "Reconfigures the vSAN objects in the cluster", + }, + Key: "host.VsanInternalSystem.reconfigureDomObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects that are currently synchronizing data", + Summary: "Queries vSAN objects that are updating stale components or synchronizing new replicas", + }, + Key: "host.VsanInternalSystem.querySyncingVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Run diagnostics on vSAN disks", + Summary: "Runs diagnostic tests on vSAN physical disks and verifies if objects are successfully created on the disks", + }, + Key: "host.VsanInternalSystem.runVsanPhysicalDiskDiagnostics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attributes of vSAN objects", + Summary: "Shows the extended attributes of the vSAN objects", + }, + Key: "host.VsanInternalSystem.getVsanObjExtAttrs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configurable vSAN objects", + Summary: "Identifies the vSAN objects that can be reconfigured using the assigned storage policy in the current cluster", + }, + Key: "host.VsanInternalSystem.reconfigurationSatisfiable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN objects available for provisioning", + Summary: "Identifies the vSAN objects that are available for provisioning using the assigned storage policy in the current cluster", + }, + Key: "host.VsanInternalSystem.canProvisionObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteVsanObjects", + Summary: "deleteVsanObjects", + }, + Key: "host.VsanInternalSystem.deleteVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vSAN object format", + Summary: "Upgrade vSAN object format, to fit in vSAN latest features", + }, + Key: "host.VsanInternalSystem.upgradeVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryVsanObjectUuidsByFilter", + Summary: "queryVsanObjectUuidsByFilter", + }, + Key: "host.VsanInternalSystem.queryVsanObjectUuidsByFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN entities available for decommissioning", + Summary: "Identifies the vSAN entities that are available for decommissioning in the current cluster", + }, + Key: "host.VsanInternalSystem.canDecommission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getNetworkIpSettings", + Summary: "getNetworkIpSettings", + }, + Key: "vdcs.IpManager.getNetworkIpSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "allocate", + Summary: "allocate", + }, + Key: "vdcs.IpManager.allocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "release", + Summary: "release", + }, + Key: "vdcs.IpManager.release", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "releaseAll", + Summary: "releaseAll", + }, + Key: "vdcs.IpManager.releaseAll", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryAll", + Summary: "queryAll", + }, + Key: "vdcs.IpManager.queryAll", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile description", + Summary: "Retrieve profile description", + }, + Key: "profile.Profile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove profile", + Summary: "Remove profile", + }, + Key: "profile.Profile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Associate entities", + Summary: "Associate entities with the profile", + }, + Key: "profile.Profile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Dissociate entities", + Summary: "Dissociate entities from the profile", + }, + Key: "profile.Profile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance against the profile", + }, + Key: "profile.Profile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export profile", + Summary: "Export profile to a file", + }, + Key: "profile.Profile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Authenticate credentials in guest", + Summary: "Authenticate credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.validateCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire credentials in guest", + Summary: "Acquire credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.acquireCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Release credentials in guest", + Summary: "Release credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.releaseCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.TagPolicyOption.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.TagPolicyOption.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.TagPolicyOption.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.TagPolicyOption.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.TagPolicyOption.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.TagPolicyOption.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.TagPolicyOption.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update assigned license", + Summary: "Updates the license assigned to an entity", + }, + Key: "LicenseAssignmentManager.updateAssignedLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove assigned license", + Summary: "Removes an assignment of a license to an entity", + }, + Key: "LicenseAssignmentManager.removeAssignedLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query assigned licenses", + Summary: "Queries for all the licenses assigned to an entity or all entities", + }, + Key: "LicenseAssignmentManager.queryAssignedLicenses", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check feature availability", + Summary: "Checks if the corresponding features are licensed for a list of entities", + }, + Key: "LicenseAssignmentManager.isFeatureAvailable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update in-use status of a licensed feature", + Summary: "Updates in-use status of a licensed feature", + }, + Key: "LicenseAssignmentManager.updateFeatureInUse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register licenseable entity", + Summary: "Registers a licenseable entity", + }, + Key: "LicenseAssignmentManager.registerEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister licenseable entity", + Summary: "Unregisters an existing licenseable entity and releases any serial numbers assigned to it.", + }, + Key: "LicenseAssignmentManager.unregisterEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update license entity usage count", + Summary: "Updates the usage count of a license entity", + }, + Key: "LicenseAssignmentManager.updateUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upload license file", + Summary: "Uploads a license file to vCenter Server", + }, + Key: "LicenseAssignmentManager.uploadLicenseFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryAssignedLicensesEx", + Summary: "queryAssignedLicensesEx", + }, + Key: "LicenseAssignmentManager.queryAssignedLicensesEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntity", + Summary: "updateEntity", + }, + Key: "LicenseAssignmentManager.updateEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntitiesProperties", + Summary: "updateEntitiesProperties", + }, + Key: "LicenseAssignmentManager.updateEntitiesProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.VirtualDatacenter.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.VirtualDatacenter.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.VirtualDatacenter.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.VirtualDatacenter.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.VirtualDatacenter.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.VirtualDatacenter.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.VirtualDatacenter.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query options view", + Summary: "Returns nodes in the option hierarchy", + }, + Key: "option.OptionManager.queryView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update option values", + Summary: "Updates one or more properties", + }, + Key: "option.OptionManager.updateValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get diagnostic files", + Summary: "Gets the list of diagnostic files for a given system", + }, + Key: "DiagnosticManager.queryDescriptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Browse diagnostic manager", + Summary: "Returns part of a log file", + }, + Key: "DiagnosticManager.browse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate system logs bundles", + Summary: "Instructs the server to generate system logs bundles", + }, + Key: "DiagnosticManager.generateLogBundles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query file hash", + Summary: "Queries file integrity information", + }, + Key: "DiagnosticManager.queryFileHash", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.ContentLibraryItem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.ContentLibraryItem.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.ContentLibraryItem.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.ContentLibraryItem.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.ContentLibraryItem.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.ContentLibraryItem.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.ContentLibraryItem.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a host profile", + Summary: "Create a host profile", + }, + Key: "profile.host.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.host.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.host.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply host configuration", + Summary: "Apply host configuration", + }, + Key: "profile.host.ProfileManager.applyHostConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMetadata", + Summary: "queryMetadata", + }, + Key: "profile.host.ProfileManager.queryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate configuration task list for host profile", + Summary: "Generates a list of configuration tasks to be performed when applying a host profile", + }, + Key: "profile.host.ProfileManager.generateConfigTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate task list", + Summary: "Generate task list", + }, + Key: "profile.host.ProfileManager.generateTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile metadata", + Summary: "Query profile metadata", + }, + Key: "profile.host.ProfileManager.queryProfileMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query metadata for profile categories", + Summary: "Retrieves the metadata for a set of profile categories", + }, + Key: "profile.host.ProfileManager.queryProfileCategoryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query metadata for profile components", + Summary: "Retrieves the metadata for a set of profile components", + }, + Key: "profile.host.ProfileManager.queryProfileComponentMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile structure", + Summary: "Gets information about the structure of a profile", + }, + Key: "profile.host.ProfileManager.queryProfileStructure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create default profile", + Summary: "Create default profile", + }, + Key: "profile.host.ProfileManager.createDefaultProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host customizations", + Summary: "Update host customizations for host", + }, + Key: "profile.host.ProfileManager.updateAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host customizations", + Summary: "Validate host customizations for host", + }, + Key: "profile.host.ProfileManager.validateAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host customizations", + Summary: "Returns the host customization data associated with a particular host", + }, + Key: "profile.host.ProfileManager.retrieveAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveAnswerFileForProfile", + Summary: "retrieveAnswerFileForProfile", + }, + Key: "profile.host.ProfileManager.retrieveAnswerFileForProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host customizations", + Summary: "Export host customizations for host", + }, + Key: "profile.host.ProfileManager.exportAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check host customizations status", + Summary: "Check the status of the host customizations against associated profile", + }, + Key: "profile.host.ProfileManager.checkAnswerFileStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host customization status", + Summary: "Returns the status of the host customization data associated with the specified hosts", + }, + Key: "profile.host.ProfileManager.queryAnswerFileStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host customizations", + Summary: "Update host customizations", + }, + Key: "profile.host.ProfileManager.updateHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validateHostCustomizations", + Summary: "validateHostCustomizations", + }, + Key: "profile.host.ProfileManager.validateHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostCustomizations", + Summary: "retrieveHostCustomizations", + }, + Key: "profile.host.ProfileManager.retrieveHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostCustomizationsForProfile", + Summary: "retrieveHostCustomizationsForProfile", + }, + Key: "profile.host.ProfileManager.retrieveHostCustomizationsForProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host customizations", + Summary: "Export host customizations", + }, + Key: "profile.host.ProfileManager.exportCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import host customizations", + Summary: "Import host customizations", + }, + Key: "profile.host.ProfileManager.importCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pre-check Remediation", + Summary: "Checks customization data and host state is valid for remediation", + }, + Key: "profile.host.ProfileManager.generateHostConfigTaskSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Batch apply host configuration", + Summary: "Batch apply host configuration", + }, + Key: "profile.host.ProfileManager.applyEntitiesConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare validation of settings to be copied", + Summary: "Generate differences between source and target host profile to validate settings to be copied", + }, + Key: "profile.host.ProfileManager.validateComposition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy settings to host profiles", + Summary: "Copy settings to host profiles", + }, + Key: "profile.host.ProfileManager.compositeProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update the VASA provider state", + Summary: "Updates the VASA provider state for the specified datastores", + }, + Key: "VasaVvolManager.updateVasaProviderState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a new Virtual Volume datastore", + }, + Key: "VasaVvolManager.createVVolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Virtual Volume datastore", + Summary: "Remove Virtual Volume datastore from specified hosts", + }, + Key: "VasaVvolManager.removeVVolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update the VASA client context", + Summary: "Updates the VASA client context on the host", + }, + Key: "VasaVvolManager.updateVasaClientContext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate vMotion migration of VMs to hosts", + Summary: "Checks whether the specified VMs can be migrated with vMotion to all the specified hosts", + }, + Key: "vm.check.ProvisioningChecker.queryVMotionCompatibilityEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate migration of VM to destination", + Summary: "Checks whether the VM can be migrated to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkMigrate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate relocation of VM to destination", + Summary: "Checks whether the VM can be relocated to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkRelocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate cloning VM to destination", + Summary: "Checks whether the VM can be cloned to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "checkInstantClone", + Summary: "checkInstantClone", + }, + Key: "vm.check.ProvisioningChecker.checkInstantClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove inventory view", + Summary: "Remove the inventory view object", + }, + Key: "view.InventoryView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open inventory view folder", + Summary: "Adds the child objects of a given managed entity to the view", + }, + Key: "view.InventoryView.openFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Close inventory view", + Summary: "Notify the server that folders have been closed", + }, + Key: "view.InventoryView.closeFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete container view", + Summary: "Remove a list view object from current contents of this view", + }, + Key: "view.ContainerView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create profile", + Summary: "Create profile", + }, + Key: "profile.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set event history latest page size", + Summary: "Set the last page viewed size of event history", + }, + Key: "event.EventHistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind event history", + Summary: "Moves view to the oldest item of event history", + }, + Key: "event.EventHistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset event history", + Summary: "Moves view to the newest item of event history", + }, + Key: "event.EventHistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove event history", + Summary: "Removes the event history collector", + }, + Key: "event.EventHistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read next event history", + Summary: "Reads view from current position of event history, and then the position is moved to the next newer page", + }, + Key: "event.EventHistoryCollector.readNext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read previous event history", + Summary: "Reads view from current position of event history and moves the position to the next older page", + }, + Key: "event.EventHistoryCollector.readPrev", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecificationByFile", + Summary: "updateHostSubSpecificationByFile", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.updateHostSubSpecificationByFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecificationByData", + Summary: "updateHostSubSpecificationByData", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.updateHostSubSpecificationByData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostSpecification", + Summary: "retrieveHostSpecification", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.retrieveHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSubSpecification", + Summary: "deleteHostSubSpecification", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.deleteHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual NIC custom value", + Summary: "Set the value of a custom filed of a host's virtual NIC manager", + }, + Key: "host.VirtualNicManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network configuration", + Summary: "Gets the network configuration for the specified NIC type", + }, + Key: "host.VirtualNicManager.queryNetConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Select virtual NIC", + Summary: "Select the virtual NIC to be used for the specified NIC type", + }, + Key: "host.VirtualNicManager.selectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deselect virtual NIC", + Summary: "Deselect the virtual NIC used for the specified NIC type", + }, + Key: "host.VirtualNicManager.deselectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query latest statistics for a virtual machine", + Summary: "Queries the latest values of performance statistics of a virtual machine", + }, + Key: "InternalStatsCollector.queryLatestVmStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure host power management policy", + Summary: "Configure host power management policy", + }, + Key: "host.PowerSystem.configurePolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set a custom value for EVC manager", + Summary: "Sets a value in the custom field for Enhanced vMotion Compatibility manager", + }, + Key: "cluster.EVCManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable/reconfigure EVC", + Summary: "Enable/reconfigure Enhanced vMotion Compatibility in a cluster", + }, + Key: "cluster.EVCManager.configureEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable cluster EVC", + Summary: "Disable Enhanced vMotion Compatibility in a cluster", + }, + Key: "cluster.EVCManager.disableEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate EVC configuration", + Summary: "Validates the configuration of Enhanced vMotion Compatibility mode in the managed cluster", + }, + Key: "cluster.EVCManager.checkConfigureEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate hosts in EVC", + Summary: "Validates new hosts in the Enhanced vMotion Compatibility cluster", + }, + Key: "cluster.EVCManager.checkAddHostEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash resource", + Summary: "Configures virtual flash resource on a list of SSD devices", + }, + Key: "host.VFlashManager.configureVFlashResourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash resource", + Summary: "Configures virtual flash resource on a host", + }, + Key: "host.VFlashManager.configureVFlashResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual flash resource", + Summary: "Removes virtual flash resource from a host", + }, + Key: "host.VFlashManager.removeVFlashResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash host swap cache", + Summary: "Configures virtual flash host swap cache", + }, + Key: "host.VFlashManager.configureHostVFlashCache", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual flash module configuration options from a host", + Summary: "Retrieves virtual flash module configuration options from a host", + }, + Key: "host.VFlashManager.getVFlashModuleDefaultConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set managed entity custom value", + Summary: "Sets the value of a custom field of a managed entity", + }, + Key: "ManagedEntity.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload managed entity", + Summary: "Reload the entity state", + }, + Key: "ManagedEntity.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename managed entity", + Summary: "Rename this entity", + }, + Key: "ManagedEntity.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove entity", + Summary: "Deletes the entity and removes it from parent folder", + }, + Key: "ManagedEntity.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the entity", + }, + Key: "ManagedEntity.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the entity", + }, + Key: "ManagedEntity.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ManagedEntity.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host profile description", + Summary: "Retrieve host profile description", + }, + Key: "profile.host.HostProfile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete host profile", + Summary: "Delete host profile", + }, + Key: "profile.host.HostProfile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach host profile", + Summary: "Attach host profile to host or cluster", + }, + Key: "profile.host.HostProfile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach host profile", + Summary: "Detach host profile from host or cluster", + }, + Key: "profile.host.HostProfile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of a host or cluster against a host profile", + }, + Key: "profile.host.HostProfile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host profile", + Summary: "Export host profile to a file", + }, + Key: "profile.host.HostProfile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update reference host", + Summary: "Update reference host", + }, + Key: "profile.host.HostProfile.updateReferenceHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host profile", + Summary: "Update host profile", + }, + Key: "profile.host.HostProfile.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validate", + Summary: "validate", + }, + Key: "profile.host.HostProfile.validate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute profile", + Summary: "Execute profile", + }, + Key: "profile.host.HostProfile.execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure AutoStart Manager", + Summary: "Changes the power on or power off sequence", + }, + Key: "host.AutoStartManager.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Auto power On", + Summary: "Powers On virtual machines according to the current AutoStart configuration", + }, + Key: "host.AutoStartManager.autoPowerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Auto power Off", + Summary: "Powers Off virtual machines according to the current AutoStart configuration", + }, + Key: "host.AutoStartManager.autoPowerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register Fault Tolerant Secondary VM", + Summary: "Registers a Secondary VM with a Fault Tolerant Primary VM", + }, + Key: "host.FaultToleranceManager.registerSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister Fault Tolerant Secondary VM", + Summary: "Unregister a Secondary VM from the associated Primary VM", + }, + Key: "host.FaultToleranceManager.unregisterSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make Primary VM", + Summary: "Test Fault Tolerance failover by making a Secondary VM in a Fault Tolerance pair the Primary VM", + }, + Key: "host.FaultToleranceManager.makePrimary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make peer VM primary", + Summary: "Makes the peer VM primary and terminates the local virtual machine", + }, + Key: "host.FaultToleranceManager.goLivePeerVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop Fault Tolerant virtual machine", + Summary: "Stop a specified virtual machine in a Fault Tolerant pair", + }, + Key: "host.FaultToleranceManager.terminateFaultTolerantVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable Secondary VM", + Summary: "Disable Fault Tolerance on a specified Secondary VM", + }, + Key: "host.FaultToleranceManager.disableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable Secondary VM", + Summary: "Enable Fault Tolerance on a specified Secondary VM", + }, + Key: "host.FaultToleranceManager.enableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start Fault Tolerant Secondary VM", + Summary: "Start Fault Tolerant Secondary VM on remote host", + }, + Key: "host.FaultToleranceManager.startSecondaryOnRemoteHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister Fault Tolerance", + Summary: "Unregister the Fault Tolerance service", + }, + Key: "host.FaultToleranceManager.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set local VM component health", + Summary: "Sets the component health information of the specified local virtual machine", + }, + Key: "host.FaultToleranceManager.setLocalVMComponentHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get peer VM component health", + Summary: "Gets component health information of the FT peer of the specified local virtual machine", + }, + Key: "host.FaultToleranceManager.getPeerVMComponentHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add custom field", + Summary: "Creates a new custom property", + }, + Key: "CustomFieldsManager.addFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove custom field", + Summary: "Removes a custom property", + }, + Key: "CustomFieldsManager.removeFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename custom property", + Summary: "Renames a custom property", + }, + Key: "CustomFieldsManager.renameFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set custom field", + Summary: "Assigns a value to a custom property", + }, + Key: "CustomFieldsManager.setField", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get ManagedEntities", + Summary: "Get the list of ManagedEntities that the name is a Substring of the custom field name and the value is a Substring of the field value.", + }, + Key: "CustomFieldsManager.getEntitiesWithCustomFieldAndValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomFields", + Summary: "retrieveCustomFields", + }, + Key: "CustomFieldsManager.retrieveCustomFields", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update agent virtual machine information", + Summary: "Updates agent virtual machine information", + }, + Key: "EsxAgentConfigManager.updateAgentVmInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query agent virtual machine information", + Summary: "Returns the state for each of the specified agent virtual machines", + }, + Key: "EsxAgentConfigManager.queryAgentVmInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update compute resource agent information", + Summary: "Updates the number of required agent virtual machines for one or more compute resources", + }, + Key: "EsxAgentConfigManager.updateComputeResourceAgentInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compute resource agent information", + Summary: "Retrieves the agent information for one or more compute resources", + }, + Key: "EsxAgentConfigManager.queryComputeResourceAgentInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set folder custom value", + Summary: "Sets the value of a custom field of a folder", + }, + Key: "Folder.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload folder", + Summary: "Reloads the folder", + }, + Key: "Folder.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename folder", + Summary: "Rename the folder", + }, + Key: "Folder.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete folder", + Summary: "Delete this object, deleting its contents and removing it from its parent folder (if any)", + }, + Key: "Folder.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the folder", + }, + Key: "Folder.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the folder", + }, + Key: "Folder.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Folder.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create folder", + Summary: "Creates a new folder", + }, + Key: "Folder.createFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move entities", + Summary: "Moves a set of managed entities into this folder", + }, + Key: "Folder.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Create a new virtual machine", + }, + Key: "Folder.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to the folder", + }, + Key: "Folder.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Create a new cluster compute-resource in this folder", + }, + Key: "Folder.createCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Create a new cluster compute-resource in this folder", + }, + Key: "Folder.createClusterEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host", + Summary: "Create a new single-host compute-resource", + }, + Key: "Folder.addStandaloneHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host and enable lockdown", + Summary: "Create a new single-host compute-resource and enable lockdown mode on the host", + }, + Key: "Folder.addStandaloneHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datacenter", + Summary: "Create a new datacenter with the given name", + }, + Key: "Folder.createDatacenter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister and Delete", + Summary: "Recursively deletes all child virtual machine folders and unregisters all virtual machines", + }, + Key: "Folder.unregisterAndDestroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a vSphere Distributed Switch", + Summary: "Create a vSphere Distributed Switch", + }, + Key: "Folder.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a datastore cluster", + Summary: "Create a datastore cluster", + }, + Key: "Folder.createStoragePod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSpecification", + Summary: "updateHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.updateHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecification", + Summary: "updateHostSubSpecification", + }, + Key: "profile.host.HostSpecificationManager.updateHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostSpecification", + Summary: "retrieveHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.retrieveHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSubSpecification", + Summary: "deleteHostSubSpecification", + }, + Key: "profile.host.HostSpecificationManager.deleteHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSpecification", + Summary: "deleteHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.deleteHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getUpdatedHosts", + Summary: "getUpdatedHosts", + }, + Key: "profile.host.HostSpecificationManager.getUpdatedHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster profile", + Summary: "Create cluster profile", + }, + Key: "profile.cluster.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.cluster.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.cluster.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host kernel modules", + Summary: "Retrieves information about the kernel modules on the host", + }, + Key: "host.KernelModuleSystem.queryModules", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update kernel module option", + Summary: "Specifies the options to be passed to the kernel module when loaded", + }, + Key: "host.KernelModuleSystem.updateModuleOptionString", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query kernel module options", + Summary: "Retrieves the options configured to be passed to a kernel module when loaded", + }, + Key: "host.KernelModuleSystem.queryConfiguredModuleOptionString", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set storage custom value", + Summary: "Sets the value of a custom field of a host storage system", + }, + Key: "host.StorageSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve disk partition information", + Summary: "Gets the partition information for the disks named by the device names", + }, + Key: "host.StorageSystem.retrieveDiskPartitionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Compute disk partition information", + Summary: "Computes the disk partition information given the desired disk layout", + }, + Key: "host.StorageSystem.computeDiskPartitionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Compute disk partition information for resize", + Summary: "Compute disk partition information for resizing a partition", + }, + Key: "host.StorageSystem.computeDiskPartitionInfoForResize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update disk partitions", + Summary: "Change the partitions on the disk by supplying a partition specification and the device name", + }, + Key: "host.StorageSystem.updateDiskPartitions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Format VMFS", + Summary: "Formats a new VMFS on a disk partition", + }, + Key: "host.StorageSystem.formatVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mount VMFS volume", + Summary: "Mounts an unmounted VMFS volume", + }, + Key: "host.StorageSystem.mountVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount VMFS volume", + Summary: "Unmount a mounted VMFS volume", + }, + Key: "host.StorageSystem.unmountVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount VMFS volumes", + Summary: "Unmounts one or more mounted VMFS volumes", + }, + Key: "host.StorageSystem.unmountVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "mountVmfsVolumeEx", + Summary: "mountVmfsVolumeEx", + }, + Key: "host.StorageSystem.mountVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmapVmfsVolumeEx", + Summary: "unmapVmfsVolumeEx", + }, + Key: "host.StorageSystem.unmapVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for unmounted VMFS volume", + Summary: "Removes the state information for a previously unmounted VMFS volume", + }, + Key: "host.StorageSystem.deleteVmfsVolumeState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan VMFS", + Summary: "Rescan for new VMFS volumes", + }, + Key: "host.StorageSystem.rescanVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend VMFS", + Summary: "Extend a VMFS by attaching a disk partition", + }, + Key: "host.StorageSystem.attachVmfsExtent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Expand VMFS extent", + Summary: "Expand the capacity of the VMFS extent", + }, + Key: "host.StorageSystem.expandVmfsExtent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade VMFS", + Summary: "Upgrade the VMFS to the current VMFS version", + }, + Key: "host.StorageSystem.upgradeVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate virtual machine disks", + Summary: "Relocate the disks for all virtual machines into directories if stored in the ROOT", + }, + Key: "host.StorageSystem.upgradeVmLayout", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unbound VMFS volumes", + Summary: "Query for the list of unbound VMFS volumes", + }, + Key: "host.StorageSystem.queryUnresolvedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve VMFS volumes", + Summary: "Resolve the detected copies of VMFS volumes", + }, + Key: "host.StorageSystem.resolveMultipleUnresolvedVmfsVolumes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve VMFS volumes", + Summary: "Resolves the detected copies of VMFS volumes", + }, + Key: "host.StorageSystem.resolveMultipleUnresolvedVmfsVolumesEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount force mounted VMFS", + Summary: "Unmounts a force mounted VMFS volume", + }, + Key: "host.StorageSystem.unmountForceMountedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan HBA", + Summary: "Rescan a specific storage adapter for new storage devices", + }, + Key: "host.StorageSystem.rescanHba", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan all HBAs", + Summary: "Rescan all storage adapters for new storage devices", + }, + Key: "host.StorageSystem.rescanAllHba", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change Software Internet SCSI Status", + Summary: "Enables or disables Software Internet SCSI", + }, + Key: "host.StorageSystem.updateSoftwareInternetScsiEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI discovery properties", + Summary: "Updates the discovery properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiDiscoveryProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI authentication properties", + Summary: "Updates the authentication properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiAuthenticationProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI digest properties", + Summary: "Update the digest properties of an Internet SCSI host bus adapter or target", + }, + Key: "host.StorageSystem.updateInternetScsiDigestProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI advanced options", + Summary: "Update the advanced options of an Internet SCSI host bus adapter or target", + }, + Key: "host.StorageSystem.updateInternetScsiAdvancedOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI IP properties", + Summary: "Updates the IP properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiIPProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI name", + Summary: "Updates the name of an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI alias", + Summary: "Updates the alias of an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Internet SCSI send targets", + Summary: "Adds send target entries to the host bus adapter discovery list", + }, + Key: "host.StorageSystem.addInternetScsiSendTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Internet SCSI send targets", + Summary: "Removes send target entries from the host bus adapter discovery list", + }, + Key: "host.StorageSystem.removeInternetScsiSendTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Internet SCSI static targets ", + Summary: "Adds static target entries to the host bus adapter discovery list", + }, + Key: "host.StorageSystem.addInternetScsiStaticTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Internet SCSI static targets", + Summary: "Removes static target entries from the host bus adapter discovery list", + }, + Key: "host.StorageSystem.removeInternetScsiStaticTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable multiple path", + Summary: "Enable a path for a logical unit", + }, + Key: "host.StorageSystem.enableMultipathPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable multiple path", + Summary: "Disable a path for a logical unit", + }, + Key: "host.StorageSystem.disableMultipathPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set logical unit policy", + Summary: "Set the multipath policy for a logical unit ", + }, + Key: "host.StorageSystem.setMultipathLunPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query path selection policy options", + Summary: "Queries the set of path selection policy options", + }, + Key: "host.StorageSystem.queryPathSelectionPolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query storage array type policy options", + Summary: "Queries the set of storage array type policy options", + }, + Key: "host.StorageSystem.queryStorageArrayTypePolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update SCSI LUN display name", + Summary: "Updates the display name of a SCSI LUN", + }, + Key: "host.StorageSystem.updateScsiLunDisplayName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach SCSI LUN", + Summary: "Blocks I/O operations to the attached SCSI LUN", + }, + Key: "host.StorageSystem.detachScsiLun", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach SCSI LUNs", + Summary: "Blocks I/O operations to one or more attached SCSI LUNs", + }, + Key: "host.StorageSystem.detachScsiLunEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for detached SCSI LUN", + Summary: "Removes the state information for a previously detached SCSI LUN", + }, + Key: "host.StorageSystem.deleteScsiLunState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach SCSI LUN", + Summary: "Allow I/O issue to the specified detached SCSI LUN", + }, + Key: "host.StorageSystem.attachScsiLun", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach SCSI LUNs", + Summary: "Enables I/O operations to one or more detached SCSI LUNs", + }, + Key: "host.StorageSystem.attachScsiLunEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh host storage system", + Summary: "Refresh the storage information and settings to pick up any changes that have occurred", + }, + Key: "host.StorageSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Discover FCOE storage", + Summary: "Discovers new storage using FCOE", + }, + Key: "host.StorageSystem.discoverFcoeHbas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update FCOE HBA state", + Summary: "Mark or unmark the specified FCOE HBA for removal from the host system", + }, + Key: "host.StorageSystem.markForRemoval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Format VFFS", + Summary: "Formats a new VFFS on a SSD disk", + }, + Key: "host.StorageSystem.formatVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend VFFS", + Summary: "Extends a VFFS by attaching a SSD disk", + }, + Key: "host.StorageSystem.extendVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete VFFS", + Summary: "Deletes a VFFS from the host", + }, + Key: "host.StorageSystem.destroyVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mounts VFFS volume", + Summary: "Mounts an unmounted VFFS volume", + }, + Key: "host.StorageSystem.mountVffsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmounts VFFS volume", + Summary: "Unmounts a mounted VFFS volume", + }, + Key: "host.StorageSystem.unmountVffsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for unmounted VFFS volume", + Summary: "Removes the state information for a previously unmounted VFFS volume", + }, + Key: "host.StorageSystem.deleteVffsVolumeState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan VFFS", + Summary: "Rescans for new VFFS volumes", + }, + Key: "host.StorageSystem.rescanVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available SSD disks", + Summary: "Queries available SSD disks", + }, + Key: "host.StorageSystem.queryAvailableSsds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set NFS user", + Summary: "Sets an NFS user", + }, + Key: "host.StorageSystem.setNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change NFS user password", + Summary: "Changes the password of an NFS user", + }, + Key: "host.StorageSystem.changeNFSUserPassword", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query NFS user", + Summary: "Queries an NFS user", + }, + Key: "host.StorageSystem.queryNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear NFS user", + Summary: "Deletes an NFS user", + }, + Key: "host.StorageSystem.clearNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn on disk locator LEDs", + Summary: "Turns on one or more disk locator LEDs", + }, + Key: "host.StorageSystem.turnDiskLocatorLedOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn off locator LEDs", + Summary: "Turns off one or more disk locator LEDs", + }, + Key: "host.StorageSystem.turnDiskLocatorLedOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a flash disk", + Summary: "Marks the disk as a flash disk", + }, + Key: "host.StorageSystem.markAsSsd", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a HDD disk", + Summary: "Marks the disk as a HDD disk", + }, + Key: "host.StorageSystem.markAsNonSsd", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a local disk", + Summary: "Marks the disk as a local disk", + }, + Key: "host.StorageSystem.markAsLocal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a remote disk", + Summary: "Marks the disk as a remote disk", + }, + Key: "host.StorageSystem.markAsNonLocal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "QueryIoFilterProviderId", + Summary: "QueryIoFilterProviderId", + }, + Key: "host.StorageSystem.QueryIoFilterProviderId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "FetchIoFilterSharedSecret", + Summary: "FetchIoFilterSharedSecret", + }, + Key: "host.StorageSystem.FetchIoFilterSharedSecret", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMFS unmap priority", + Summary: "Updates the priority of VMFS space reclamation operation", + }, + Key: "host.StorageSystem.updateVmfsUnmapPriority", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query VMFS config option", + Summary: "Query VMFS config option", + }, + Key: "host.StorageSystem.queryVmfsConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set EVC manager custom value", + Summary: "Sets the value of a custom field for an Enhanced vMotion Compatibility manager", + }, + Key: "cluster.TransitionalEVCManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure cluster EVC", + Summary: "Enable/reconfigure Enhanced vMotion Compatibility for a cluster", + }, + Key: "cluster.TransitionalEVCManager.configureEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable cluster EVC", + Summary: "Disable Enhanced vMotion Compatibility for a cluster", + }, + Key: "cluster.TransitionalEVCManager.disableEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate EVC mode for cluster", + Summary: "Test the validity of configuring Enhanced vMotion Compatibility mode on the managed cluster", + }, + Key: "cluster.TransitionalEVCManager.checkConfigureEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host for EVC cluster", + Summary: "Tests the validity of adding a host into the Enhanced vMotion Compatibility cluster", + }, + Key: "cluster.TransitionalEVCManager.checkAddHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve argument description for event type", + Summary: "Retrieves the argument meta-data for a given event type", + }, + Key: "event.EventManager.retrieveArgumentDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create event collector", + Summary: "Creates an event collector to retrieve all server events based on a filter", + }, + Key: "event.EventManager.createCollector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Log user event", + Summary: "Logs a user-defined event", + }, + Key: "event.EventManager.logUserEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get events", + Summary: "Provides the events selected by the specified filter", + }, + Key: "event.EventManager.QueryEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query events by IDs", + Summary: "Returns the events specified by a list of IDs", + }, + Key: "event.EventManager.queryEventsById", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Post event", + Summary: "Posts the specified event", + }, + Key: "event.EventManager.postEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query latest events in event filter", + Summary: "Query the latest events in the specified filter", + }, + Key: "event.EventManager.queryLastEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create default host profile of specified type", + Summary: "Creates a default host profile of the specified type", + }, + Key: "profile.host.profileEngine.HostProfileManager.createDefaultProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile policy option metadata", + Summary: "Gets the profile policy option metadata for the specified policy names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile metadata", + Summary: "Gets the profile metadata for the specified profile names and profile types", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile category metadata", + Summary: "Gets the profile category metadata for the specified category names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileCategoryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile component metadata", + Summary: "Gets the profile component metadata for the specified component names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileComponentMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute host profile manager engine", + Summary: "Executes the host profile manager engine", + }, + Key: "profile.host.profileEngine.HostProfileManager.execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Bookkeep host profile", + Summary: "Bookkeep host profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.bookKeep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile description", + Summary: "Retrieves description of a profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.retrieveProfileDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update configuration tasks from host configuration", + Summary: "Update configuration tasks from host configuration", + }, + Key: "profile.host.profileEngine.HostProfileManager.updateTaskConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateTaskList", + Summary: "generateTaskList", + }, + Key: "profile.host.profileEngine.HostProfileManager.generateTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateHostConfigTaskSpec", + Summary: "generateHostConfigTaskSpec", + }, + Key: "profile.host.profileEngine.HostProfileManager.generateHostConfigTaskSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile from host configuration", + Summary: "Retrieves a profile from the host's configuration", + }, + Key: "profile.host.profileEngine.HostProfileManager.retrieveProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare host profile for export", + Summary: "Prepares a host profile for export", + }, + Key: "profile.host.profileEngine.HostProfileManager.prepareExport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query user input policy options", + Summary: "Gets a list of policy options that are set to require user inputs", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryUserInputPolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile structure", + Summary: "Gets information about the structure of a profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileStructure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply host configuration", + Summary: "Applies the specified host configuration to the host", + }, + Key: "profile.host.profileEngine.HostProfileManager.applyHostConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host profile manager state", + Summary: "Gets the current state of the host profile manager and plug-ins on a host", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set backup agent custom value", + Summary: "Set backup agent custom value", + }, + Key: "vm.BackupAgent.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start virtual machine backup", + Summary: "Start a backup operation inside the virtual machine guest", + }, + Key: "vm.BackupAgent.startBackup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop virtual machine backup", + Summary: "Stop a backup operation in a virtual machine", + }, + Key: "vm.BackupAgent.abortBackup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify virtual machine snapshot completion", + Summary: "Notify the virtual machine when a snapshot operation is complete", + }, + Key: "vm.BackupAgent.notifySnapshotCompletion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Wait for guest event", + Summary: "Wait for an event delivered by the virtual machine guest", + }, + Key: "vm.BackupAgent.waitForEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh hardware information", + Summary: "Refresh hardware information", + }, + Key: "host.HealthStatusSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset system health sensors", + Summary: "Resets the state of the sensors of the IPMI subsystem", + }, + Key: "host.HealthStatusSystem.resetSystemHealthInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear hardware IPMI System Event Log", + Summary: "Clear hardware IPMI System Event Log", + }, + Key: "host.HealthStatusSystem.clearSystemEventLog", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh hardware IPMI System Event Log", + Summary: "Refresh hardware IPMI System Event Log", + }, + Key: "host.HealthStatusSystem.FetchSystemEventLog", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a virtual disk object", + Summary: "Create a virtual disk object", + }, + Key: "vslm.vcenter.VStorageObjectManager.createDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register a legacy disk to be a virtual disk object", + Summary: "Register a legacy disk to be a virtual disk object", + }, + Key: "vslm.vcenter.VStorageObjectManager.registerDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend a virtual disk to the new capacity", + Summary: "Extend a virtual disk to the new capacity", + }, + Key: "vslm.vcenter.VStorageObjectManager.extendDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate a thin virtual disk", + Summary: "Inflate a thin virtual disk", + }, + Key: "vslm.vcenter.VStorageObjectManager.inflateDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a virtual storage object", + Summary: "Rename a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.renameVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update storage policy on a virtual storage object", + Summary: "Update storage policy on a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.updateVStorageObjectPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a virtual storage object", + Summary: "Delete a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.deleteVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a virtual storage object", + Summary: "Retrieve a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.retrieveVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveVStorageObjectState", + Summary: "retrieveVStorageObjectState", + }, + Key: "vslm.vcenter.VStorageObjectManager.retrieveVStorageObjectState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List virtual storage objects on a datastore", + Summary: "List virtual storage objects on a datastore", + }, + Key: "vslm.vcenter.VStorageObjectManager.listVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone a virtual storage object", + Summary: "Clone a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.cloneVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate a virtual storage object", + Summary: "Relocate a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.relocateVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "attachTagToVStorageObject", + Summary: "attachTagToVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.attachTagToVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "detachTagFromVStorageObject", + Summary: "detachTagFromVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.detachTagFromVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listVStorageObjectsAttachedToTag", + Summary: "listVStorageObjectsAttachedToTag", + }, + Key: "vslm.vcenter.VStorageObjectManager.listVStorageObjectsAttachedToTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listTagsAttachedToVStorageObject", + Summary: "listTagsAttachedToVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.listTagsAttachedToVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconcile datastore inventory", + Summary: "Reconcile datastore inventory", + }, + Key: "vslm.vcenter.VStorageObjectManager.reconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Schedule reconcile datastore inventory", + Summary: "Schedule reconcile datastore inventory", + }, + Key: "vslm.vcenter.VStorageObjectManager.scheduleReconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare a vCenter HA setup", + Summary: "Prepare vCenter HA setup on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.prepare", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy a vCenter HA cluster", + Summary: "Deploy and configure vCenter HA on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.deploy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure a vCenter HA cluster", + Summary: "Configure vCenter HA on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.configure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create passive node", + Summary: "Create a passive node in a vCenter HA Cluster", + }, + Key: "vcha.FailoverClusterConfigurator.createPassiveNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create witness node", + Summary: "Create a witness node in a vCenter HA Cluster", + }, + Key: "vcha.FailoverClusterConfigurator.createWitnessNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getConfig", + Summary: "getConfig", + }, + Key: "vcha.FailoverClusterConfigurator.getConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Destroy the vCenter HA cluster", + Summary: "Destroy the vCenter HA cluster setup and remove all configuration files", + }, + Key: "vcha.FailoverClusterConfigurator.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set graphics manager custom value", + Summary: "Sets the value of a custom field of the graphics manager", + }, + Key: "host.GraphicsManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh graphics information", + Summary: "Refresh graphics device information", + }, + Key: "host.GraphicsManager.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check if shared graphics is active", + Summary: "Check if shared graphics is active on the host", + }, + Key: "host.GraphicsManager.isSharedGraphicsActive", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateGraphicsConfig", + Summary: "updateGraphicsConfig", + }, + Key: "host.GraphicsManager.updateGraphicsConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addKey", + Summary: "addKey", + }, + Key: "encryption.CryptoManagerKmip.addKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addKeys", + Summary: "addKeys", + }, + Key: "encryption.CryptoManagerKmip.addKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKey", + Summary: "removeKey", + }, + Key: "encryption.CryptoManagerKmip.removeKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKeys", + Summary: "removeKeys", + }, + Key: "encryption.CryptoManagerKmip.removeKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listKeys", + Summary: "listKeys", + }, + Key: "encryption.CryptoManagerKmip.listKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerKmipServer", + Summary: "registerKmipServer", + }, + Key: "encryption.CryptoManagerKmip.registerKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "markDefault", + Summary: "markDefault", + }, + Key: "encryption.CryptoManagerKmip.markDefault", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateKmipServer", + Summary: "updateKmipServer", + }, + Key: "encryption.CryptoManagerKmip.updateKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKmipServer", + Summary: "removeKmipServer", + }, + Key: "encryption.CryptoManagerKmip.removeKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listKmipServers", + Summary: "listKmipServers", + }, + Key: "encryption.CryptoManagerKmip.listKmipServers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveKmipServersStatus", + Summary: "retrieveKmipServersStatus", + }, + Key: "encryption.CryptoManagerKmip.retrieveKmipServersStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateKey", + Summary: "generateKey", + }, + Key: "encryption.CryptoManagerKmip.generateKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveKmipServerCert", + Summary: "retrieveKmipServerCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveKmipServerCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uploadKmipServerCert", + Summary: "uploadKmipServerCert", + }, + Key: "encryption.CryptoManagerKmip.uploadKmipServerCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateSelfSignedClientCert", + Summary: "generateSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.generateSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateClientCsr", + Summary: "generateClientCsr", + }, + Key: "encryption.CryptoManagerKmip.generateClientCsr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveSelfSignedClientCert", + Summary: "retrieveSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveClientCsr", + Summary: "retrieveClientCsr", + }, + Key: "encryption.CryptoManagerKmip.retrieveClientCsr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveClientCert", + Summary: "retrieveClientCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateSelfSignedClientCert", + Summary: "updateSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.updateSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateKmsSignedCsrClientCert", + Summary: "updateKmsSignedCsrClientCert", + }, + Key: "encryption.CryptoManagerKmip.updateKmsSignedCsrClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uploadClientCert", + Summary: "uploadClientCert", + }, + Key: "encryption.CryptoManagerKmip.uploadClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set host custom value", + Summary: "Sets the value of a custom field of an host", + }, + Key: "HostSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload host system", + Summary: "Reloads the host system", + }, + Key: "HostSystem.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename host", + Summary: "Rename this host", + }, + Key: "HostSystem.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove host", + Summary: "Removes the host", + }, + Key: "HostSystem.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the host", + }, + Key: "HostSystem.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the host", + }, + Key: "HostSystem.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "HostSystem.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query TPM attestation information", + Summary: "Provides details of the secure boot and TPM status", + }, + Key: "HostSystem.queryTpmAttestationReport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query connection information", + Summary: "Connection information about a host", + }, + Key: "HostSystem.queryConnectionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve internal host capabilities", + Summary: "Retrieves vCenter Server-specific internal host capabilities", + }, + Key: "HostSystem.retrieveInternalCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "", + Summary: "", + }, + Key: "HostSystem.retrieveInternalConfigManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system resources", + Summary: "Update the configuration of the system resource hierarchy", + }, + Key: "HostSystem.updateSystemResources", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system swap configuration", + Summary: "Update the configuration of the system swap", + }, + Key: "HostSystem.updateSystemSwapConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconnect host", + Summary: "Reconnects to a host", + }, + Key: "HostSystem.reconnect", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disconnect host", + Summary: "Disconnects from a host", + }, + Key: "HostSystem.disconnect", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter maintenance mode", + Summary: "Puts the host in maintenance mode", + }, + Key: "HostSystem.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit maintenance mode", + Summary: "Disables maintenance mode", + }, + Key: "HostSystem.exitMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate host reboot", + Summary: "Initiates a host reboot", + }, + Key: "HostSystem.reboot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate host shutdown", + Summary: "Initiates a host shutdown", + }, + Key: "HostSystem.shutdown", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter standby mode", + Summary: "Puts this host into standby mode", + }, + Key: "HostSystem.enterStandbyMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit standby mode", + Summary: "Brings this host out of standby mode", + }, + Key: "HostSystem.exitStandbyMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host overhead", + Summary: "Determines the amount of memory overhead necessary to power on a virtual machine with the specified characteristics", + }, + Key: "HostSystem.queryOverhead", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query memory overhead", + Summary: "Query memory overhead", + }, + Key: "HostSystem.queryOverheadEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere HA host", + Summary: "Reconfigures the host for vSphere HA", + }, + Key: "HostSystem.reconfigureDAS", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Patch Manager", + Summary: "Retrieves a reference to Patch Manager", + }, + Key: "HostSystem.retrievePatchManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host system flags", + Summary: "Update the flags of the host system", + }, + Key: "HostSystem.updateFlags", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send Wake-on-LAN packet", + Summary: "Send Wake-on-LAN packets to the physical NICs specified", + }, + Key: "HostSystem.sendWakeOnLanPacket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable lockdown mode", + Summary: "Enable lockdown mode on this host", + }, + Key: "HostSystem.disableAdmin", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable lockdown mode", + Summary: "Disable lockdown mode on this host", + }, + Key: "HostSystem.enableAdmin", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable lockdown mode", + Summary: "Enable lockdown mode on this host", + }, + Key: "HostSystem.enterLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable lockdown mode", + Summary: "Disable lockdown mode on this host", + }, + Key: "HostSystem.exitLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update management server IP", + Summary: "Update information about the vCenter Server managing this host", + }, + Key: "HostSystem.updateManagementServerIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire CIM service", + Summary: "Establish a remote connection to a CIM interface", + }, + Key: "HostSystem.acquireCimServicesTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IPMI or ILO information used by DPM", + Summary: "Update IPMI or ILO information for this host used by DPM", + }, + Key: "HostSystem.updateIpmi", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update SSL thumbprint registry", + Summary: "Updates the SSL thumbprint registry on the host", + }, + Key: "HostSystem.updateSslThumbprintInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host hardware uptime", + Summary: "Retrieves the hardware uptime for the host in seconds", + }, + Key: "HostSystem.retrieveHardwareUptime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Dynamic Type Manager", + Summary: "Retrieves a reference to Dynamic Type Manager", + }, + Key: "HostSystem.retrieveDynamicTypeManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Managed Method Executer", + Summary: "Retrieves a reference to Managed Method Executer", + }, + Key: "HostSystem.retrieveManagedMethodExecuter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine memory overhead", + Summary: "Query memory overhead for a virtual machine power on", + }, + Key: "HostSystem.queryOverheadEx2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test EVC mode", + Summary: "Test an EVC mode on a host", + }, + Key: "HostSystem.testEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply EVC mode", + Summary: "Applies an EVC mode to a host", + }, + Key: "HostSystem.applyEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check whether the certificate is trusted by vCenter Server", + Summary: "Checks whether the certificate matches the host certificate that vCenter Server trusts", + }, + Key: "HostSystem.checkCertificateTrusted", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare host", + Summary: "Prepare host for encryption", + }, + Key: "HostSystem.prepareCrypto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable encryption", + Summary: "Enable encryption on the current host", + }, + Key: "HostSystem.enableCrypto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure the host key", + Summary: "Configure the encryption key on the current host", + }, + Key: "HostSystem.configureCryptoKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query supported switch specification", + Summary: "Query supported switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.querySupportedSwitchSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible hosts for a vSphere Distributed Switch specification", + Summary: "Returns a list of hosts that are compatible with a given vSphere Distributed Switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostForNewDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible hosts for existing vSphere Distributed Switch", + Summary: "Returns a list of hosts that are compatible with an existing vSphere Distributed Switch", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostForExistingDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible host specification", + Summary: "Query compatible host specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query feature capabilities for vSphere Distributed Switch specification", + Summary: "Queries feature capabilities available for a given vSphere Distributed Switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryFeatureCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query switch by UUID", + Summary: "Query switch by UUID", + }, + Key: "dvs.DistributedVirtualSwitchManager.querySwitchByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration target", + Summary: "Query configuration target", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryDvsConfigTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compatibility of hosts against a vSphere Distributed Switch version", + Summary: "Check compatibility of hosts against a vSphere Distributed Switch version", + }, + Key: "dvs.DistributedVirtualSwitchManager.checkCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update opaque data for set of entities", + Summary: "Update opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.updateOpaqueData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update opaque data for set of entities", + Summary: "Update opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.updateOpaqueDataEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch opaque data for set of entities", + Summary: "Fetch opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.fetchOpaqueData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch opaque data for set of entities", + Summary: "Fetch opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.fetchOpaqueDataEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute opaque command for set of entities", + Summary: "Execute opaque command for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.executeOpaqueCommand", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify vNetwork Distributed Switch host", + Summary: "Rectify vNetwork Distributed Switch host", + }, + Key: "dvs.DistributedVirtualSwitchManager.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export configuration of the entity", + Summary: "Export configuration of the entity", + }, + Key: "dvs.DistributedVirtualSwitchManager.exportEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import configuration of the entity", + Summary: "Import configuration of the entity", + }, + Key: "dvs.DistributedVirtualSwitchManager.importEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "dvs.DistributedVirtualSwitchManager.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query uplink team information", + Summary: "Query uplink team information", + }, + Key: "dvs.DistributedVirtualSwitchManager.QueryDvpgUplinkTeam", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHostNetworkResource", + Summary: "queryHostNetworkResource", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryHostNetworkResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryVwirePort", + Summary: "queryVwirePort", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryVwirePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move file", + Summary: "Move the file, folder, or disk from source datacenter to destination datacenter", + }, + Key: "FileManager.move", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move file", + Summary: "Move the source file or folder to destination datacenter", + }, + Key: "FileManager.moveFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy file", + Summary: "Copy the file, folder, or disk from source datacenter to destination datacenter", + }, + Key: "FileManager.copy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy file", + Summary: "Copy the source file or folder to destination datacenter", + }, + Key: "FileManager.copyFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete file", + Summary: "Delete the file, folder, or disk from source datacenter", + }, + Key: "FileManager.delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete file", + Summary: "Delete the source file or folder from the datastore", + }, + Key: "FileManager.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make Directory", + Summary: "Create a directory using the specified name", + }, + Key: "FileManager.makeDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change owner", + Summary: "Change the owner of the specified file to the specified user", + }, + Key: "FileManager.changeOwner", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query process information", + Summary: "Retrieves information regarding processes", + }, + Key: "host.SystemDebugManager.queryProcessInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set network custom value", + Summary: "Sets the value of a custom field of a host network system", + }, + Key: "host.NetworkSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network configuration", + Summary: "Network configuration information", + }, + Key: "host.NetworkSystem.updateNetworkConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update DNS configuration", + Summary: "Update the DNS configuration for the host", + }, + Key: "host.NetworkSystem.updateDnsConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP route configuration", + Summary: "Update IP route configuration", + }, + Key: "host.NetworkSystem.updateIpRouteConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update console IP route configuration", + Summary: "Update console IP route configuration", + }, + Key: "host.NetworkSystem.updateConsoleIpRouteConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP route table configuration", + Summary: "Applies the IP route table configuration for the host", + }, + Key: "host.NetworkSystem.updateIpRouteTableConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual switch", + Summary: "Add a new virtual switch to the system", + }, + Key: "host.NetworkSystem.addVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual switch", + Summary: "Remove an existing virtual switch from the system", + }, + Key: "host.NetworkSystem.removeVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual switch", + Summary: "Updates the properties of the virtual switch", + }, + Key: "host.NetworkSystem.updateVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add port group", + Summary: "Add a port group to the virtual switch", + }, + Key: "host.NetworkSystem.addPortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove port group", + Summary: "Remove a port group from the virtual switch", + }, + Key: "host.NetworkSystem.removePortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure port group", + Summary: "Reconfigure a port group on the virtual switch", + }, + Key: "host.NetworkSystem.updatePortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update physical NIC link speed", + Summary: "Configure link speed and duplexity", + }, + Key: "host.NetworkSystem.updatePhysicalNicLinkSpeed", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network hint", + Summary: "Request network hint information for a physical NIC", + }, + Key: "host.NetworkSystem.queryNetworkHint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual NIC", + Summary: "Add a virtual host or service console NIC", + }, + Key: "host.NetworkSystem.addVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual NIC", + Summary: "Remove a virtual host or service console NIC", + }, + Key: "host.NetworkSystem.removeVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual NIC", + Summary: "Configure virtual host or VMkernel NIC", + }, + Key: "host.NetworkSystem.updateVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add service console virtual NIC", + Summary: "Add a virtual service console NIC", + }, + Key: "host.NetworkSystem.addServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove service console virtual NIC", + Summary: "Remove a virtual service console NIC", + }, + Key: "host.NetworkSystem.removeServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update service console virtual NIC", + Summary: "Update IP configuration for a service console virtual NIC", + }, + Key: "host.NetworkSystem.updateServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restart virtual network adapter interface", + Summary: "Restart the service console virtual network adapter interface", + }, + Key: "host.NetworkSystem.restartServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh network information", + Summary: "Refresh the network information and settings to detect any changes that have occurred", + }, + Key: "host.NetworkSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Invoke API call on host with transactionId", + Summary: "Invoke API call on host with transactionId", + }, + Key: "host.NetworkSystem.invokeHostTransactionCall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Commit transaction to confirm that host is connected to vCenter Server", + Summary: "Commit transaction to confirm that host is connected to vCenter Server", + }, + Key: "host.NetworkSystem.commitTransaction", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performHostOpaqueNetworkDataOperation", + Summary: "performHostOpaqueNetworkDataOperation", + }, + Key: "host.NetworkSystem.performHostOpaqueNetworkDataOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve available diagnostic partitions", + Summary: "Retrieves a list of available diagnostic partitions", + }, + Key: "host.DiagnosticSystem.queryAvailablePartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change active diagnostic partition", + Summary: "Changes the active diagnostic partition to a different partition", + }, + Key: "host.DiagnosticSystem.selectActivePartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve diagnostic partitionable disks", + Summary: "Retrieves a list of disks that can be used to contain a diagnostic partition", + }, + Key: "host.DiagnosticSystem.queryPartitionCreateOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve diagnostic partition creation description", + Summary: "Retrieves the diagnostic partition creation description for a disk", + }, + Key: "host.DiagnosticSystem.queryPartitionCreateDesc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create diagnostic partition", + Summary: "Creates a diagnostic partition according to the provided creation specification", + }, + Key: "host.DiagnosticSystem.createDiagnosticPartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure host cache performance enhancement", + Summary: "Configures host cache by allocating space on a low latency device (usually a solid state drive) for enhanced system performance", + }, + Key: "host.CacheConfigurationManager.configureCache", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure host update proxy", + Summary: "Reconfigure host update proxy", + }, + Key: "host.HostUpdateProxyManager.reconfigureHostUpdateProxy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve configuration of the host update proxy", + Summary: "Retrieve configuration of the host update proxy", + }, + Key: "host.HostUpdateProxyManager.retrieveHostUpdateProxyConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extensible custom value", + Summary: "Sets the value of a custom field of an extensible managed object", + }, + Key: "ExtensibleManagedObject.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configuring vSphere HA", + Summary: "Configuring vSphere HA", + }, + Key: "DasConfig.ConfigureHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unconfiguring vSphere HA", + Summary: "Unconfiguring vSphere HA", + }, + Key: "DasConfig.UnconfigureHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Migrate virtual machine", + Summary: "Migrates a virtual machine from one host to another", + }, + Key: "Drm.ExecuteVMotionLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power on this virtual machine", + }, + Key: "Drm.ExecuteVmPowerOnLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter standby mode", + Summary: "Puts this host into standby mode", + }, + Key: "Drm.EnterStandbyLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit standby mode", + Summary: "Brings this host out of standby mode", + }, + Key: "Drm.ExitStandbyLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power On this virtual machine", + }, + Key: "Datacenter.ExecuteVmPowerOnLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vCenter Agent", + Summary: "Upgrade the vCenter Agent", + }, + Key: "Upgrade.UpgradeAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vCenter Agents on cluster hosts", + Summary: "Upgrade the vCenter Agents on all cluster hosts", + }, + Key: "ClusterUpgrade.UpgradeAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "ResourcePool.ImportVAppLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set cluster suspended state", + Summary: "Set suspended state of the cluster", + }, + Key: "ClusterComputeResource.setSuspendedState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the virtual machine as an OVF template", + }, + Key: "VirtualMachine.ExportVmLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the vApp as an OVF template", + }, + Key: "VirtualApp.ExportVAppLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start Fault Tolerance Secondary VM", + Summary: "Start Secondary VM as the Primary VM is powered on", + }, + Key: "FaultTolerance.PowerOnSecondaryLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute Storage vMotion for Storage DRS", + Summary: "Execute Storage vMotion migrations for Storage DRS", + }, + Key: "Drm.ExecuteStorageVmotionLro", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply recommendations for SDRS maintenance mode", + Summary: "Apply recommendations to enter into SDRS maintenance mode", + }, + Key: "Drm.ExecuteMaintenanceRecommendationsLro", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter SDRS maintenance mode monitor task", + Summary: "Task that monitors the SDRS maintenance mode activity", + }, + Key: "Drm.TrackEnterMaintenanceLro", + }, + }, + State: []types.BaseElementDescription{ + &types.ElementDescription{ + Description: types.Description{ + Label: "Queued", + Summary: "Task is queued", + }, + Key: "queued", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Running", + Summary: "Task is in progress", + }, + Key: "running", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Success", + Summary: "Task completed successfully", + }, + Key: "success", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Error", + Summary: "Task completed with a failure", + }, + Key: "error", + }, + }, + Reason: []types.BaseTypeDescription{ + &types.TypeDescription{ + Description: types.Description{ + Label: "Alarm task", + Summary: "Task started by an alarm", + }, + Key: "TaskReasonAlarm", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "System task", + Summary: "Task started by the server", + }, + Key: "TaskReasonSystem", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "User task", + Summary: "Task started by a specific user", + }, + Key: "TaskReasonUser", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "Scheduled task", + Summary: "Task started by a scheduled task", + }, + Key: "TaskReasonSchedule", + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/type_info.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/type_info.go new file mode 100644 index 000000000..e4d319553 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/type_info.go @@ -0,0 +1,3412 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/internal" + +// TypeInfo generated via `govc host.esxcli.model -dump` +var TypeInfo = internal.DynamicTypeMgrAllTypeInfo{ + ManagedTypeInfo: []internal.DynamicTypeMgrManagedTypeInfo{ + { + Name: "vim.EsxCLI.hardware.clock", + WsdlName: "VimEsxCLIhardwareclock", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIhardwareclockget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLIhardwareclockset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "day", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "hour", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "min", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "month", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "sec", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "year", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.hardware.platform", + WsdlName: "VimEsxCLIhardwareplatform", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIhardwareplatformget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.hardware.platform.get.PlatformGet", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.iscsi.software", + WsdlName: "VimEsxCLIiscsisoftware", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIiscsisoftwareget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLIiscsisoftwareset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "enabled", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + { + Name: "name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.allowedip", + WsdlName: "VimEsxCLInetworkfirewallrulesetallowedip", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "add", + WsdlName: "VimEsxCLInetworkfirewallrulesetallowedipadd", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "ipaddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "list", + WsdlName: "VimEsxCLInetworkfirewallrulesetallowediplist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.firewall.ruleset.allowedip.list.FirewallRulesetAllowedip[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "remove", + WsdlName: "VimEsxCLInetworkfirewallrulesetallowedipremove", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "ipaddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.client", + WsdlName: "VimEsxCLInetworkfirewallrulesetclient", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "add", + WsdlName: "VimEsxCLInetworkfirewallrulesetclientadd", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "get", + WsdlName: "VimEsxCLInetworkfirewallrulesetclientget", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.firewall.ruleset.client.get.FirewallRulesetClientGet", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "remove", + WsdlName: "VimEsxCLInetworkfirewallrulesetclientremove", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.rule", + WsdlName: "VimEsxCLInetworkfirewallrulesetrule", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "list", + WsdlName: "VimEsxCLInetworkfirewallrulesetrulelist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.firewall.ruleset.rule.list.FirewallPortRule[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset", + WsdlName: "VimEsxCLInetworkfirewallruleset", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "list", + WsdlName: "VimEsxCLInetworkfirewallrulesetlist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.firewall.ruleset.list.Ruleset[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLInetworkfirewallrulesetset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "allowedall", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "enabled", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "rulesetid", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall", + WsdlName: "VimEsxCLInetworkfirewall", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLInetworkfirewallget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.firewall.get.Firewall", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "load", + WsdlName: "VimEsxCLInetworkfirewallload", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "refresh", + WsdlName: "VimEsxCLInetworkfirewallrefresh", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLInetworkfirewallset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "defaultaction", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "enabled", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "unload", + WsdlName: "VimEsxCLInetworkfirewallunload", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.ip.connection", + WsdlName: "VimEsxCLInetworkipconnection", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "list", + WsdlName: "VimEsxCLInetworkipconnectionlist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "netstack", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "type", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.ip.connection.list.IpConnection[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.nic.ring.current", + WsdlName: "VimEsxCLInetworknicringcurrent", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLInetworknicringcurrentget", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "nicname", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.nic.ring.current.get.RingInfo", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLInetworknicringcurrentset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "nicname", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "rx", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "rxjumbo", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "rxmini", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "tx", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.nic.ring.preset", + WsdlName: "VimEsxCLInetworknicringpreset", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLInetworknicringpresetget", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "nicname", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.nic.ring.preset.get.RingInfo", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.vm.port", + WsdlName: "VimEsxCLInetworkvmport", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "list", + WsdlName: "VimEsxCLInetworkvmportlist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "worldid", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.vm.port.list.Port[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.vm", + WsdlName: "VimEsxCLInetworkvm", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "list", + WsdlName: "VimEsxCLInetworkvmlist", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.network.vm.list.VM[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.signature", + WsdlName: "VimEsxCLIsoftwarevibsignature", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "verify", + WsdlName: "VimEsxCLIsoftwarevibsignatureverify", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rebootingimage", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.signature.verify.VIBSigVerify[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib", + WsdlName: "VimEsxCLIsoftwarevib", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIsoftwarevibget", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rebootingimage", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "vibname", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.get.VIBExt[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "install", + WsdlName: "VimEsxCLIsoftwarevibinstall", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "depot", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "dryrun", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "force", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "maintenancemode", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "noliveinstall", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "nosigcheck", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "proxy", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "vibname", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "viburl", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.install.InstallationResult", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "list", + WsdlName: "VimEsxCLIsoftwareviblist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "rebootingimage", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.list.VIBSummaryExt[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "remove", + WsdlName: "VimEsxCLIsoftwarevibremove", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "dryrun", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "force", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "maintenancemode", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "noliveinstall", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "vibname", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.remove.InstallationResult", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "update", + WsdlName: "VimEsxCLIsoftwarevibupdate", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "depot", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "dryrun", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "force", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "maintenancemode", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "noliveinstall", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "nosigcheck", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "proxy", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "vibname", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "viburl", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.update.InstallationResult", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.system.hostname", + WsdlName: "VimEsxCLIsystemhostname", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIsystemhostnameget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.system.hostname.get.FullyQualifiedHostName", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLIsystemhostnameset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "domain", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "fqdn", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "host", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.system.settings.advanced", + WsdlName: "VimEsxCLIsystemsettingsadvanced", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "add", + WsdlName: "VimEsxCLIsystemsettingsadvancedadd", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "description", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "hidden", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "hostspecific", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "impact", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "intdefault", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "max", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "min", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "option", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "stringdefault", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "type", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "list", + WsdlName: "VimEsxCLIsystemsettingsadvancedlist", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "delta", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "option", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "tree", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.system.settings.advanced.list.SettingsAdvancedOption[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "remove", + WsdlName: "VimEsxCLIsystemsettingsadvancedremove", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "option", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "set", + WsdlName: "VimEsxCLIsystemsettingsadvancedset", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "default", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "intvalue", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "option", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "stringvalue", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.system.stats.uptime", + WsdlName: "VimEsxCLIsystemstatsuptime", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "get", + WsdlName: "VimEsxCLIsystemstatsuptimeget", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.vm.process", + WsdlName: "VimEsxCLIvmprocess", + Version: "vim.version.version5", + Base: []string{"vmodl.ManagedObject"}, + Property: nil, + Method: []internal.DynamicTypeMgrMethodTypeInfo{ + { + Name: "kill", + WsdlName: "VimEsxCLIvmprocesskill", + Version: "vim.version.version5", + ParamTypeInfo: []internal.DynamicTypeMgrParamTypeInfo{ + { + Name: "type", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + Annotation: nil, + }, + { + Name: "worldid", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + Annotation: nil, + }, + }, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + Annotation: nil, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + { + Name: "list", + WsdlName: "VimEsxCLIvmprocesslist", + Version: "vim.version.version5", + ParamTypeInfo: nil, + ReturnTypeInfo: &internal.DynamicTypeMgrParamTypeInfo{ + Name: "result", + Version: "vim.version.version5", + Type: "vim.EsxCLI.vm.process.list.VirtualMachine[]", + PrivId: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + Fault: []string{"vim.EsxCLI.CLIFault"}, + PrivId: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + }, + EnumTypeInfo: nil, + DataTypeInfo: []internal.DynamicTypeMgrDataTypeInfo{ + { + Name: "vim.EsxCLI.hardware.platform.get.PlatformGet", + WsdlName: "VimEsxCLIhardwareplatformgetPlatformGet", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "BIOSAssetTag", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "EnclosureSerialNumber", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "IPMISupported", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ProductName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "SerialNumber", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "UUID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VendorName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.get.Firewall", + WsdlName: "VimEsxCLInetworkfirewallgetFirewall", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DefaultAction", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Enabled", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Loaded", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.allowedip.list.FirewallRulesetAllowedip", + WsdlName: "VimEsxCLInetworkfirewallrulesetallowediplistFirewallRulesetAllowedip", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "AllowedIPAddresses", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Ruleset", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.client.get.FirewallRulesetClientGet", + WsdlName: "VimEsxCLInetworkfirewallrulesetclientgetFirewallRulesetClientGet", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "RulesetClientCount", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.list.Ruleset", + WsdlName: "VimEsxCLInetworkfirewallrulesetlistRuleset", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "Enabled", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.firewall.ruleset.rule.list.FirewallPortRule", + WsdlName: "VimEsxCLInetworkfirewallrulesetrulelistFirewallPortRule", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "Direction", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "PortBegin", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "PortEnd", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "PortType", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Protocol", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Ruleset", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.ip.connection.list.IpConnection", + WsdlName: "VimEsxCLInetworkipconnectionlistIpConnection", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "CCAlgo", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ForeignAddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "LocalAddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Proto", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RecvQ", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "SendQ", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "State", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "WorldID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "WorldName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.nic.ring.current.get.RingInfo", + WsdlName: "VimEsxCLInetworknicringcurrentgetRingInfo", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "RX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RXJumbo", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RXMini", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "TX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.nic.ring.preset.get.RingInfo", + WsdlName: "VimEsxCLInetworknicringpresetgetRingInfo", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "MaxRX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MaxRXJumbo", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MaxRXMini", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MaxTX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RXJumbo", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RXMini", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "TX", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.vm.list.VM", + WsdlName: "VimEsxCLInetworkvmlistVM", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "Name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Networks", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "NumPorts", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "WorldID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.network.vm.port.list.Port", + WsdlName: "VimEsxCLInetworkvmportlistPort", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "ActiveFilters", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "DVPortID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "IPAddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MACAddress", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "PortID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Portgroup", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "TeamUplink", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "UplinkPortID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "vSwitch", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.get.VIBExt", + WsdlName: "VimEsxCLIsoftwarevibgetVIBExt", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "AcceptanceLevel", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Conflicts", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "CreationDate", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Depends", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Description", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "HardwarePlatformsRequired", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "ID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "InstallDate", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "LiveInstallAllowed", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "LiveRemoveAllowed", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MaintenanceModeRequired", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Overlay", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Payloads", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Platforms", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Provides", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "ReferenceURLs", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Replaces", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "StatelessReady", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Status", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Summary", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Tags", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Type", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Vendor", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Version", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.install.DpuInstallationResult", + WsdlName: "VimEsxCLIsoftwarevibinstallDpuInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.install.InstallationResult", + WsdlName: "VimEsxCLIsoftwarevibinstallInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUResults", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.install.DpuInstallationResult[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.list.VIBSummaryExt", + WsdlName: "VimEsxCLIsoftwareviblistVIBSummaryExt", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "AcceptanceLevel", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "CreationDate", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "InstallDate", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Platforms", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Status", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Vendor", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Version", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.remove.DpuInstallationResult", + WsdlName: "VimEsxCLIsoftwarevibremoveDpuInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.remove.InstallationResult", + WsdlName: "VimEsxCLIsoftwarevibremoveInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUResults", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.remove.DpuInstallationResult[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.signature.verify.VIBSigVerify", + WsdlName: "VimEsxCLIsoftwarevibsignatureverifyVIBSigVerify", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "AcceptanceLevel", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Name", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Platforms", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "SignatureVerification", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Vendor", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Version", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.update.DpuInstallationResult", + WsdlName: "VimEsxCLIsoftwarevibupdateDpuInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.software.vib.update.InstallationResult", + WsdlName: "VimEsxCLIsoftwarevibupdateInstallationResult", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DPUResults", + Version: "vim.version.version5", + Type: "vim.EsxCLI.software.vib.update.DpuInstallationResult[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "Message", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "RebootRequired", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VIBsInstalled", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsRemoved", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + { + Name: "VIBsSkipped", + Version: "vim.version.version5", + Type: "string[]", + PrivId: "", + MsgIdFormat: "", + Annotation: []internal.DynamicTypeMgrAnnotation{ + { + Name: "optional", + Parameter: nil, + }, + }, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.system.hostname.get.FullyQualifiedHostName", + WsdlName: "VimEsxCLIsystemhostnamegetFullyQualifiedHostName", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DomainName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "FullyQualifiedDomainName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "HostName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.system.settings.advanced.list.SettingsAdvancedOption", + WsdlName: "VimEsxCLIsystemsettingsadvancedlistSettingsAdvancedOption", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "DefaultIntValue", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "DefaultStringValue", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Description", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "HostSpecific", + Version: "vim.version.version5", + Type: "boolean", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Impact", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "IntValue", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MaxValue", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "MinValue", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Path", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "StringValue", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "Type", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ValidCharacters", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + { + Name: "vim.EsxCLI.vm.process.list.VirtualMachine", + WsdlName: "VimEsxCLIvmprocesslistVirtualMachine", + Version: "vim.version.version5", + Base: []string{"vmodl.DynamicData"}, + Property: []internal.DynamicTypeMgrPropertyTypeInfo{ + { + Name: "ConfigFile", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "DisplayName", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "ProcessID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "UUID", + Version: "vim.version.version5", + Type: "string", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "VMXCartelID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + { + Name: "WorldID", + Version: "vim.version.version5", + Type: "long", + PrivId: "", + MsgIdFormat: "", + Annotation: nil, + }, + }, + Annotation: nil, + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go new file mode 100644 index 000000000..afdc51a64 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go @@ -0,0 +1,231 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package esx + +import "github.com/vmware/govmomi/vim25/types" + +// VirtualDevice is the default set of VirtualDevice types created for a VirtualMachine +// Capture method: +// +// govc vm.create foo +// govc object.collect -s -dump vm/foo config.hardware.device +var VirtualDevice = []types.BaseVirtualDevice{ + &types.VirtualIDEController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 200, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "IDE 0", + Summary: "IDE 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: (*int32)(nil), + }, + BusNumber: 0, + Device: nil, + }, + }, + &types.VirtualIDEController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 201, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "IDE 1", + Summary: "IDE 1", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: (*int32)(nil), + }, + BusNumber: 1, + Device: nil, + }, + }, + &types.VirtualPS2Controller{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 300, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "PS2 controller 0", + Summary: "PS2 controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: (*int32)(nil), + }, + BusNumber: 0, + Device: []int32{600, 700}, + }, + }, + &types.VirtualPCIController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 100, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "PCI controller 0", + Summary: "PCI controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: (*int32)(nil), + }, + BusNumber: 0, + Device: []int32{500, 12000}, + }, + }, + &types.VirtualSIOController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 400, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "SIO controller 0", + Summary: "SIO controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: (*int32)(nil), + }, + BusNumber: 0, + Device: nil, + }, + }, + &types.VirtualKeyboard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 600, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Keyboard ", + Summary: "Keyboard", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 300, + UnitNumber: types.NewInt32(0), + }, + }, + &types.VirtualPointingDevice{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 700, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Pointing device", + Summary: "Pointing device; Device", + }, + Backing: &types.VirtualPointingDeviceDeviceBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + DeviceName: "", + UseAutoDetect: types.NewBool(false), + }, + HostPointingDevice: "autodetect", + }, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 300, + UnitNumber: types.NewInt32(1), + }, + }, + &types.VirtualMachineVideoCard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 500, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Video card ", + Summary: "Video card", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 100, + UnitNumber: types.NewInt32(0), + }, + VideoRamSizeInKB: 4096, + NumDisplays: 1, + UseAutoDetect: types.NewBool(false), + Enable3DSupport: types.NewBool(false), + Use3dRenderer: "automatic", + GraphicsMemorySizeInKB: 262144, + }, + &types.VirtualMachineVMCIDevice{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 12000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "VMCI device", + Summary: "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 100, + UnitNumber: types.NewInt32(17), + }, + Id: -1, + AllowUnrestrictedCommunication: types.NewBool(false), + FilterEnable: types.NewBool(true), + FilterInfo: (*types.VirtualMachineVMCIDeviceFilterInfo)(nil), + }, +} + +// EthernetCard template for types.VirtualEthernetCard +var EthernetCard = types.VirtualE1000{ + VirtualEthernetCard: types.VirtualEthernetCard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 4000, + Backing: &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + DeviceName: "VM Network", + UseAutoDetect: types.NewBool(false), + }, + Network: (*types.ManagedObjectReference)(nil), + InPassthroughMode: types.NewBool(false), + }, + Connectable: &types.VirtualDeviceConnectInfo{ + DynamicData: types.DynamicData{}, + StartConnected: true, + AllowGuestControl: true, + Connected: false, + Status: "untried", + }, + SlotInfo: &types.VirtualDevicePciBusSlotInfo{ + VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{}, + PciSlotNumber: 32, + }, + ControllerKey: 100, + UnitNumber: types.NewInt32(7), + }, + AddressType: "generated", + MacAddress: "", + WakeOnLanEnabled: types.NewBool(true), + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/esxcli.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/esxcli.go new file mode 100644 index 000000000..1306aa736 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/esxcli.go @@ -0,0 +1,421 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + "fmt" + "reflect" + "strconv" + "strings" + "time" + + esxcli "github.com/vmware/govmomi/cli/esx" + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +type DynamicTypeManager struct { + types.ManagedObjectReference +} + +type ManagedMethodExecuter struct { + types.ManagedObjectReference + + h *HostSystem +} + +var esxcliNotFound = &types.LocalizedMethodFault{ + Fault: new(types.NotFound), + LocalizedMessage: "The object or item referred to could not be found.", +} + +func esxcliFault(msg ...string) *types.LocalizedMethodFault { + return &types.LocalizedMethodFault{ + Fault: &internal.VimEsxCLICLIFault{ErrMsg: msg}, + LocalizedMessage: "EsxCLI.CLIFault.summary", + } +} + +func (h *HostSystem) RetrieveManagedMethodExecuter(ctx *Context, req *internal.RetrieveManagedMethodExecuterRequest) soap.HasFault { + if h.mme == nil { + h.mme = &ManagedMethodExecuter{ + types.ManagedObjectReference{Type: "ManagedMethodExecuter", Value: h.Self.Value}, + h, + } + ctx.Map.Put(h.mme) + } + + return &internal.RetrieveManagedMethodExecuterBody{ + Res: &internal.RetrieveManagedMethodExecuterResponse{ + Returnval: &internal.ReflectManagedMethodExecuter{ + ManagedObjectReference: h.mme.Reference(), + }, + }, + } +} + +func (h *HostSystem) RetrieveDynamicTypeManager(ctx *Context, req *internal.RetrieveDynamicTypeManagerRequest) soap.HasFault { + if h.dtm == nil { + h.dtm = &DynamicTypeManager{ + types.ManagedObjectReference{Type: "DynamicTypeManager", Value: h.Self.Value}, + } + ctx.Map.Put(h.dtm) + } + + return &internal.RetrieveDynamicTypeManagerBody{ + Res: &internal.RetrieveDynamicTypeManagerResponse{ + Returnval: &internal.InternalDynamicTypeManager{ + ManagedObjectReference: h.dtm.Reference(), + }, + }, + } +} + +func (*DynamicTypeManager) DynamicTypeMgrQueryTypeInfo(ctx *Context, req *internal.DynamicTypeMgrQueryTypeInfoRequest) soap.HasFault { + all := esx.TypeInfo + + if spec, ok := req.FilterSpec.(*internal.DynamicTypeMgrTypeFilterSpec); ok { + all = internal.DynamicTypeMgrAllTypeInfo{} + + for _, info := range esx.TypeInfo.DataTypeInfo { + if strings.Contains(info.Name, spec.TypeSubstr) { + all.DataTypeInfo = append(all.DataTypeInfo, info) + } + } + + for _, info := range esx.TypeInfo.EnumTypeInfo { + if strings.Contains(info.Name, spec.TypeSubstr) { + all.EnumTypeInfo = append(all.EnumTypeInfo, info) + } + } + + for _, info := range esx.TypeInfo.ManagedTypeInfo { + if strings.Contains(info.Name, spec.TypeSubstr) { + all.ManagedTypeInfo = append(all.ManagedTypeInfo, info) + } + } + } + + body := &internal.DynamicTypeMgrQueryTypeInfoBody{ + Res: &internal.DynamicTypeMgrQueryTypeInfoResponse{ + Returnval: all, + }, + } + + return body +} + +func (m *DynamicTypeManager) DynamicTypeMgrQueryMoInstances(ctx *Context, req *internal.DynamicTypeMgrQueryMoInstancesRequest) soap.HasFault { + body := &internal.DynamicTypeMgrQueryMoInstancesBody{ + Res: &internal.DynamicTypeMgrQueryMoInstancesResponse{ + Returnval: nil, + }, + } + + return body +} + +func (m *ManagedMethodExecuter) VimCLIInfoFetchCLIInfo(_ *Context, args esxcli.Values) (*esxcli.CommandInfo, *types.LocalizedMethodFault) { + kind := args.Value("typeName") + kind = strings.TrimPrefix(kind, "vim.EsxCLI.") + + for _, info := range esx.CommandInfo { + if info.CommandInfoItem.Name == kind { + return &info, nil + } + } + + return nil, esxcliNotFound +} + +// sample from: govc host.esxcli -dump software vib get +var softwareVib = []esxcli.Values{ + { + "AcceptanceLevel": []string{"VMwareCertified"}, + "CreationDate": []string{"2023-03-22"}, + "Depends": []string{"esx-version >= 5.0.0"}, + "Description": []string{"An embedded web UI for ESXi"}, + "ID": []string{"VMware_bootbank_esx-ui_2.12.0-21482143"}, + "InstallDate": []string{"2023-03-28"}, + "LiveInstallAllowed": []string{"True"}, + "LiveRemoveAllowed": []string{"True"}, + "MaintenanceModeRequired": []string{"False"}, + "Name": []string{"esx-ui"}, + "Overlay": []string{"False"}, + "Payloads": []string{"esx-ui"}, + "Platforms": []string{"host"}, + "StatelessReady": []string{"True"}, + "Status": []string{""}, + "Summary": []string{"VMware Host Client"}, + "Type": []string{"bootbank"}, + "Vendor": []string{"VMware"}, + "Version": []string{"2.12.0-21482143"}, + }, + { + "AcceptanceLevel": []string{"VMwareCertified"}, + "CreationDate": []string{"2023-03-25"}, + "Depends": []string{"vmkapi_2_11_0_0", "vmkapi_incompat_2_11_0_0"}, + "Description": []string{"Intel DW GPIO controller driver"}, + "ID": []string{"VMW_bootbank_intelgpio_0.1-1vmw.801.0.0.21495797"}, + "InstallDate": []string{"2023-03-28"}, + "LiveInstallAllowed": []string{"False"}, + "LiveRemoveAllowed": []string{"False"}, + "MaintenanceModeRequired": []string{"True"}, + "Name": []string{"intelgpio"}, + "Overlay": []string{"False"}, + "Payloads": []string{"intelgpi"}, + "Platforms": []string{"host"}, + "StatelessReady": []string{"True"}, + "Status": []string{""}, + "Summary": []string{"VMware Esx VIB"}, + "Tags": []string{"RestrictStickyFiles", "module", "driver", "sdkname:esx", "sdkversion:8.0.1-21495797"}, + "Type": []string{"bootbank"}, + "Vendor": []string{"VMW"}, + "Version": []string{"0.1-1vmw.801.0.0.21495797"}, + }, +} + +func (m *ManagedMethodExecuter) VimEsxCLISoftwareVibGet(_ *Context, args esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "VIBExt"} + + name := args.Value("vibname") + + if name != "" { + for _, vib := range softwareVib { + if vib.Value("Name") == name { + r.Values = append(r.Values, vib) + return &r, nil + } + } + return nil, esxcliFault("[NoMatchError]", "id="+name) + } + + r.Values = softwareVib + + return &r, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLISoftwareVibList(_ *Context, args esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "SummaryExt"} + + r.Values = softwareVib // TODO: subset of VibGet fields + + return &r, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLIHardwareClockGet(_ *Context, _ esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + return &esxcli.Response{ + Kind: "string", + String: time.Now().UTC().Format(time.RFC3339), + }, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLINetworkFirewallGet(ctx *Context, args esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{ + Kind: "Firewall", + Values: []esxcli.Values{{ + "DefaultAction": []string{"DROP"}, + "Enabled": []string{"false"}, + "Loaded": []string{"true"}, + }}, + } + + return &r, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLINetworkVmList(ctx *Context, _ esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "VM"} + + for _, ref := range m.h.Vm { + vm := ctx.Map.Get(ref).(*VirtualMachine) + + var networks []string + for _, ref := range vm.Network { + name := entityName(ctx.Map.Get(ref).(mo.Entity)) + networks = append(networks, name) + } + + r.Values = append(r.Values, esxcli.Values{ + "Name": []string{vm.Name}, + "Networks": networks, + "NumPorts": []string{strconv.Itoa(len(networks))}, + "WorldID": []string{strconv.Itoa(vm.worldID())}, + }) + } + + return &r, nil +} + +// sample from: govc host.esxcli -dump network ip connection list +var networkIpConnectionList = []esxcli.Values{ + { + "CCAlgo": []string{"newreno"}, + "ForeignAddress": []string{"0.0.0.0:0"}, + "LocalAddress": []string{"0.0.0.0:443"}, + "Proto": []string{"tcp"}, + "RecvQ": []string{"0"}, + "SendQ": []string{"0"}, + "State": []string{"LISTEN"}, + "WorldID": []string{"525276"}, + "WorldName": []string{"envoy"}, + }, + { + "CCAlgo": []string{""}, + "ForeignAddress": []string{"0.0.0.0:0"}, + "LocalAddress": []string{"127.0.0.1:123"}, + "Proto": []string{"udp"}, + "RecvQ": []string{"0"}, + "SendQ": []string{"0"}, + "State": []string{""}, + "WorldID": []string{"530726"}, + "WorldName": []string{"ntpd"}, + }, +} + +func (m *ManagedMethodExecuter) VimEsxCLINetworkIpConnectionList(_ *Context, args esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "IpConnection"} + + kind := args.Value("type") + if kind != "" && kind != "tcp" { // ip, tcp, udp, all + return nil, esxcliFault("Invalid data constraint for parameter 'type'.") + } + + r.Values = networkIpConnectionList + + return &r, nil +} + +// sample from: govc host.esxcli -dump system settings advanced list +var systemSettingsAdvancedList = []esxcli.Values{ + { + "DefaultIntValue": []string{"2"}, + "Description": []string{"PShare salting allows for sharing isolation between multiple VM"}, + "HostSpecific": []string{"false"}, + "Impact": []string{"none"}, + "IntValue": []string{"2"}, + "MaxValue": []string{"2"}, + "MinValue": []string{"0"}, + "Path": []string{"/Mem/ShareForceSalting"}, + "Type": []string{"integer"}, + }, + { + "DefaultIntValue": []string{"0"}, + "Description": []string{"Enable guest arp inspection IOChain to get IP"}, + "HostSpecific": []string{"false"}, + "Impact": []string{"none"}, + "IntValue": []string{"1"}, + "MaxValue": []string{"1"}, + "MinValue": []string{"0"}, + "Path": []string{"/Net/GuestIPHack"}, + "Type": []string{"integer"}, + }, +} + +func (m *ManagedMethodExecuter) VimEsxCLISystemSettingsAdvancedList(_ *Context, args esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "SettingsAdvancedOption"} + + option := args.Value("option") + if option != "" { + for _, s := range systemSettingsAdvancedList { + if s.Value("Path") == option { + r.Values = append(r.Values, s) + return &r, nil + } + } + return nil, esxcliFault("Unable to find option") + } + + r.Values = systemSettingsAdvancedList + + return &r, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLIVmProcessList(ctx *Context, _ esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + r := esxcli.Response{Kind: "VirtualMachine"} + + for _, ref := range m.h.Vm { + vm := ctx.Map.Get(ref).(*VirtualMachine) + + r.Values = append(r.Values, esxcli.Values{ + "ConfigFile": []string{vm.Config.Files.VmPathName}, + "DisplayName": []string{vm.Name}, + "ProcessID": []string{"0"}, + "UUID": []string{vm.uid.String()}, + "VMXCartelID": []string{strconv.Itoa(vm.worldID() + 1)}, + "WorldID": []string{strconv.Itoa(vm.worldID())}, + }) + } + + return &r, nil +} + +func (m *ManagedMethodExecuter) VimEsxCLIIscsiSoftwareGet(_ *Context, _ esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + return &esxcli.Response{Kind: "boolean", String: "false"}, nil +} + +var boot = time.Now() + +func (m *ManagedMethodExecuter) VimEsxCLISystemStatsUptimeGet(_ *Context, _ esxcli.Values) (*esxcli.Response, *types.LocalizedMethodFault) { + uptime := fmt.Sprintf("%d", time.Since(boot)) + return &esxcli.Response{Kind: "long", String: uptime}, nil +} + +func (_ *ManagedMethodExecuter) toXML(v any) string { + var out bytes.Buffer + + err := xml.NewEncoder(&out).Encode(v) + if err != nil { + panic(err) + } + + return out.String() +} + +func (m *ManagedMethodExecuter) ExecuteSoap(ctx *Context, req *internal.ExecuteSoapRequest) soap.HasFault { + res := new(internal.ReflectManagedMethodExecuterSoapResult) + + args := esxcli.Values{} + for _, arg := range req.Argument { + args[arg.Name] = arg.Value() + } + + name := internal.EsxcliName(req.Method) + method := reflect.ValueOf(m).MethodByName(name) + + var val types.AnyType + err := esxcliNotFound + + if method.IsValid() { + ret := method.Call([]reflect.Value{reflect.ValueOf(ctx), reflect.ValueOf(args)}) + val = ret[0].Interface() + err = ret[1].Interface().(*types.LocalizedMethodFault) + } + + if err == nil { + if r, ok := val.(*esxcli.Response); ok { + if r.String == "" { + // DataObject xsi:type has method name prefix + r.Kind = strings.ReplaceAll(ucFirst(req.Method), ".", "") + r.Kind + } + } + res.Response = m.toXML(val) + } else { + res.Fault = &internal.ReflectManagedMethodExecuterSoapFault{ + FaultMsg: err.LocalizedMessage, + FaultDetail: m.toXML(err), + } + } + + return &internal.ExecuteSoapBody{ + Res: &internal.ExecuteSoapResponse{ + Returnval: res, + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/event_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/event_manager.go new file mode 100644 index 000000000..4307cc17d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/event_manager.go @@ -0,0 +1,430 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + "container/list" + "log" + "reflect" + "text/template" + "time" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var ( + logEvents = false +) + +type EventManager struct { + mo.EventManager + + history *history + key int32 + templates map[string]*template.Template +} + +func (m *EventManager) init(r *Registry) { + if len(m.Description.EventInfo) == 0 { + m.Description.EventInfo = esx.EventInfo + } + if m.MaxCollector == 0 { + // In real VC this default can be changed via OptionManager "event.maxCollectors" + m.MaxCollector = maxCollectors + } + + m.history = newHistory() + m.templates = make(map[string]*template.Template) +} + +func (m *EventManager) createCollector(ctx *Context, req *types.CreateCollectorForEvents) (*EventHistoryCollector, *soap.Fault) { + size, err := validatePageSize(req.Filter.MaxCount) + if err != nil { + return nil, err + } + + if len(m.history.collectors) >= int(m.MaxCollector) { + return nil, Fault("Too many event collectors to create", new(types.InvalidState)) + } + + collector := &EventHistoryCollector{ + HistoryCollector: newHistoryCollector(ctx, m.history, size), + } + collector.Filter = req.Filter + + return collector, nil +} + +func (m *EventManager) CreateCollectorForEvents(ctx *Context, req *types.CreateCollectorForEvents) soap.HasFault { + body := new(methods.CreateCollectorForEventsBody) + collector, err := m.createCollector(ctx, req) + if err != nil { + body.Fault_ = err + return body + } + + collector.fill = func(x *Context) { m.fillPage(x, collector) } + collector.fill(ctx) + + body.Res = &types.CreateCollectorForEventsResponse{ + Returnval: m.history.add(ctx, collector), + } + + return body +} + +func (m *EventManager) QueryEvents(ctx *Context, req *types.QueryEvents) soap.HasFault { + if ctx.Map.IsESX() { + return &methods.QueryEventsBody{ + Fault_: Fault("", new(types.NotImplemented)), + } + } + + body := new(methods.QueryEventsBody) + collector, err := m.createCollector(ctx, &types.CreateCollectorForEvents{Filter: req.Filter}) + if err != nil { + body.Fault_ = err + return body + } + + m.fillPage(ctx, collector) + + body.Res = &types.QueryEventsResponse{ + Returnval: collector.GetLatestPage(), + } + + return body +} + +// formatMessage applies the EventDescriptionEventDetail.FullFormat template to the given event's FullFormattedMessage field. +func (m *EventManager) formatMessage(event types.BaseEvent) { + id := reflect.ValueOf(event).Elem().Type().Name() + e := event.GetEvent() + + t, ok := m.templates[id] + if !ok { + for _, info := range m.Description.EventInfo { + if info.Key == id { + t = template.Must(template.New(id).Parse(info.FullFormat)) + m.templates[id] = t + break + } + } + } + + if t != nil { + var buf bytes.Buffer + if err := t.Execute(&buf, event); err != nil { + log.Print(err) + } + e.FullFormattedMessage = buf.String() + } + + if logEvents { + log.Printf("[%s] %s", id, e.FullFormattedMessage) + } +} + +func (m *EventManager) PostEvent(ctx *Context, req *types.PostEvent) soap.HasFault { + m.key++ + event := req.EventToPost.GetEvent() + event.Key = m.key + event.ChainId = event.Key + event.CreatedTime = time.Now() + event.UserName = ctx.Session.UserName + + m.formatMessage(req.EventToPost) + + pushHistory(m.history.page, req.EventToPost) + + for _, hc := range m.history.collectors { + c := hc.(*EventHistoryCollector) + ctx.WithLock(c, func() { + if c.eventMatches(ctx, req.EventToPost) { + pushHistory(c.page, req.EventToPost) + ctx.Update(c, []types.PropertyChange{{Name: "latestPage", Val: c.GetLatestPage()}}) + } + }) + } + + if m := ctx.Map.AlarmManager(); m != nil { + ctx.WithLock(m, func() { m.postEvent(ctx, req.EventToPost) }) + } + + return &methods.PostEventBody{ + Res: new(types.PostEventResponse), + } +} + +type EventHistoryCollector struct { + mo.EventHistoryCollector + + *HistoryCollector +} + +// doEntityEventArgument calls f for each entity argument in the event. +// If f returns true, the iteration stops. +func doEntityEventArgument(event types.BaseEvent, f func(types.ManagedObjectReference, *types.EntityEventArgument) bool) bool { + e := event.GetEvent() + + if arg := e.Vm; arg != nil { + if f(arg.Vm, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.Host; arg != nil { + if f(arg.Host, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.ComputeResource; arg != nil { + if f(arg.ComputeResource, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.Ds; arg != nil { + if f(arg.Datastore, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.Net; arg != nil { + if f(arg.Network, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.Dvs; arg != nil { + if f(arg.Dvs, &arg.EntityEventArgument) { + return true + } + } + + if arg := e.Datacenter; arg != nil { + if f(arg.Datacenter, &arg.EntityEventArgument) { + return true + } + } + + return false +} + +// eventFilterSelf returns true if self is one of the entity arguments in the event. +func eventFilterSelf(event types.BaseEvent, self types.ManagedObjectReference) bool { + if x, ok := event.(*types.EventEx); ok { + if self.Type == x.ObjectType && self.Value == x.ObjectId { + return true + } + } + return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { + return self == ref + }) +} + +// eventFilterChildren returns true if a child of self is one of the entity arguments in the event. +func eventFilterChildren(ctx *Context, root types.ManagedObjectReference, event types.BaseEvent) bool { + return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { + seen := false + + var match func(types.ManagedObjectReference) + + match = func(child types.ManagedObjectReference) { + if child == ref { + seen = true + return + } + + walk(ctx.Map.Get(child), match) + } + + walk(ctx.Map.Get(root), match) + + return seen + }) +} + +// entityMatches returns true if the spec Entity filter matches the event. +func (c *EventHistoryCollector) entityMatches(ctx *Context, event types.BaseEvent, spec *types.EventFilterSpec) bool { + e := spec.Entity + if e == nil { + return true + } + + isRootFolder := c.root == e.Entity + + switch e.Recursion { + case types.EventFilterSpecRecursionOptionSelf: + return isRootFolder || eventFilterSelf(event, e.Entity) + case types.EventFilterSpecRecursionOptionChildren: + return eventFilterChildren(ctx, e.Entity, event) + case types.EventFilterSpecRecursionOptionAll: + if isRootFolder || eventFilterSelf(event, e.Entity) { + return true + } + return eventFilterChildren(ctx, e.Entity, event) + } + + return false +} + +// chainMatches returns true if spec.EventChainId matches the event. +func (c *EventHistoryCollector) chainMatches(_ *Context, event types.BaseEvent, spec *types.EventFilterSpec) bool { + e := event.GetEvent() + if spec.EventChainId != 0 { + if e.ChainId != spec.EventChainId { + return false + } + } + return true +} + +// typeMatches returns true if one of the spec EventTypeId types matches the event. +func (c *EventHistoryCollector) typeMatches(_ *Context, event types.BaseEvent, spec *types.EventFilterSpec) bool { + if len(spec.EventTypeId) == 0 { + return true + } + + matches := func(name string) bool { + for _, id := range spec.EventTypeId { + if id == name { + return true + } + } + return false + } + + if x, ok := event.(*types.EventEx); ok { + return matches(x.EventTypeId) + } + + kind := reflect.ValueOf(event).Elem().Type() + + if matches(kind.Name()) { + return true // concrete type + } + + field, ok := kind.FieldByNameFunc(matches) + if ok { + return field.Anonymous // base type (embedded field) + } + return false +} + +func (c *EventHistoryCollector) timeMatches(_ *Context, event types.BaseEvent, spec *types.EventFilterSpec) bool { + if spec.Time == nil { + return true + } + + created := event.GetEvent().CreatedTime + + if begin := spec.Time.BeginTime; begin != nil { + if created.Before(*begin) { + return false + } + } + + if end := spec.Time.EndTime; end != nil { + if created.After(*end) { + return false + } + } + + return true +} + +// eventMatches returns true one of the filters matches the event. +func (c *EventHistoryCollector) eventMatches(ctx *Context, event types.BaseEvent) bool { + spec := c.Filter.(types.EventFilterSpec) + + matchers := []func(*Context, types.BaseEvent, *types.EventFilterSpec) bool{ + c.chainMatches, + c.typeMatches, + c.timeMatches, + c.entityMatches, + // TODO: spec.UserName, etc + } + + for _, match := range matchers { + if !match(ctx, event, &spec) { + return false + } + } + + return true +} + +// fillPage copies the manager's latest events into the collector's page with Filter applied. +func (m *EventManager) fillPage(ctx *Context, c *EventHistoryCollector) { + m.history.Lock() + defer m.history.Unlock() + + for e := m.history.page.Front(); e != nil; e = e.Next() { + event := e.Value.(types.BaseEvent) + if c.eventMatches(ctx, event) { + c.page.PushBack(event) + } + } +} + +func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNextEvents) soap.HasFault { + body := &methods.ReadNextEventsBody{} + if req.MaxCount <= 0 { + body.Fault_ = Fault("", errInvalidArgMaxCount) + return body + } + body.Res = new(types.ReadNextEventsResponse) + + c.next(req.MaxCount, func(e *list.Element) { + body.Res.Returnval = append(body.Res.Returnval, e.Value.(types.BaseEvent)) + }) + + return body +} + +func (c *EventHistoryCollector) ReadPreviousEvents(ctx *Context, req *types.ReadPreviousEvents) soap.HasFault { + body := &methods.ReadPreviousEventsBody{} + if req.MaxCount <= 0 { + body.Fault_ = Fault("", errInvalidArgMaxCount) + return body + } + body.Res = new(types.ReadPreviousEventsResponse) + + c.prev(req.MaxCount, func(e *list.Element) { + body.Res.Returnval = append(body.Res.Returnval, e.Value.(types.BaseEvent)) + }) + + return body +} + +func (c *EventHistoryCollector) GetLatestPage() []types.BaseEvent { + var latestPage []types.BaseEvent + + e := c.page.Back() + for i := 0; i < c.size; i++ { + if e == nil { + break + } + latestPage = append(latestPage, e.Value.(types.BaseEvent)) + e = e.Prev() + } + + return latestPage +} + +func (c *EventHistoryCollector) Get() mo.Reference { + clone := *c + + clone.LatestPage = clone.GetLatestPage() + + return &clone +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/extension_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/extension_manager.go new file mode 100644 index 000000000..0a89a535b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/extension_manager.go @@ -0,0 +1,158 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "time" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var ExtensionList = []types.Extension{ + { + Description: &types.Description{ + Label: "vcsim", + Summary: "Go vCenter simulator", + }, + Key: "com.vmware.govmomi.simulator", + Company: "VMware, Inc.", + Type: "", + Version: "0.37.0", + SubjectName: "", + Server: nil, + Client: nil, + TaskList: []types.ExtensionTaskTypeInfo{ + { + TaskID: "com.vmware.govmomi.simulator.test", + }, + }, + EventList: nil, + FaultList: nil, + PrivilegeList: nil, + ResourceList: nil, + LastHeartbeatTime: time.Now(), + HealthInfo: (*types.ExtensionHealthInfo)(nil), + OvfConsumerInfo: (*types.ExtensionOvfConsumerInfo)(nil), + ExtendedProductInfo: (*types.ExtExtendedProductInfo)(nil), + ManagedEntityInfo: nil, + ShownInSolutionManager: types.NewBool(false), + SolutionManagerInfo: (*types.ExtSolutionManagerInfo)(nil), + }, +} + +type ExtensionManager struct { + mo.ExtensionManager +} + +func (m *ExtensionManager) init(r *Registry) { + if r.IsVPX() && len(m.ExtensionList) == 0 { + m.ExtensionList = ExtensionList + } +} + +func (m *ExtensionManager) FindExtension(ctx *Context, req *types.FindExtension) soap.HasFault { + body := &methods.FindExtensionBody{ + Res: new(types.FindExtensionResponse), + } + + for _, x := range m.ExtensionList { + if x.Key == req.ExtensionKey { + body.Res.Returnval = &x + break + } + } + + return body +} + +func (m *ExtensionManager) RegisterExtension(ctx *Context, req *types.RegisterExtension) soap.HasFault { + body := &methods.RegisterExtensionBody{} + + for _, x := range m.ExtensionList { + if x.Key == req.Extension.Key { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "extension.key", + }) + return body + } + } + + body.Res = new(types.RegisterExtensionResponse) + m.ExtensionList = append(m.ExtensionList, req.Extension) + + f := mo.Field{Path: "extensionList", Key: req.Extension.Key} + ctx.Update(m, []types.PropertyChange{ + {Name: f.Path, Val: m.ExtensionList}, + {Name: f.String(), Val: req.Extension, Op: types.PropertyChangeOpAdd}, + }) + + return body +} + +func (m *ExtensionManager) UnregisterExtension(ctx *Context, req *types.UnregisterExtension) soap.HasFault { + body := &methods.UnregisterExtensionBody{} + + for i, x := range m.ExtensionList { + if x.Key == req.ExtensionKey { + m.ExtensionList = append(m.ExtensionList[:i], m.ExtensionList[i+1:]...) + + f := mo.Field{Path: "extensionList", Key: req.ExtensionKey} + ctx.Update(m, []types.PropertyChange{ + {Name: f.Path, Val: m.ExtensionList}, + {Name: f.String(), Op: types.PropertyChangeOpRemove}, + }) + + body.Res = new(types.UnregisterExtensionResponse) + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *ExtensionManager) UpdateExtension(ctx *Context, req *types.UpdateExtension) soap.HasFault { + body := &methods.UpdateExtensionBody{} + + for i, x := range m.ExtensionList { + if x.Key == req.Extension.Key { + m.ExtensionList[i] = req.Extension + + f := mo.Field{Path: "extensionList", Key: req.Extension.Key} + ctx.Update(m, []types.PropertyChange{ + {Name: f.Path, Val: m.ExtensionList}, + {Name: f.String(), Val: req.Extension}, + }) + + body.Res = new(types.UpdateExtensionResponse) + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *ExtensionManager) SetExtensionCertificate(ctx *Context, req *types.SetExtensionCertificate) soap.HasFault { + body := &methods.SetExtensionCertificateBody{} + + for _, x := range m.ExtensionList { + if x.Key == req.ExtensionKey { + // TODO: save req.CertificatePem for use with SessionManager.LoginExtensionByCertificate() + + body.Res = new(types.SetExtensionCertificateResponse) + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/file_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/file_manager.go new file mode 100644 index 000000000..775baa7ae --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/file_manager.go @@ -0,0 +1,277 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "io" + "os" + "path/filepath" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vmdk" +) + +type FileManager struct { + mo.FileManager +} + +func (f *FileManager) findDatastore(ctx *Context, ref mo.Reference, name string) (*Datastore, types.BaseMethodFault) { + var refs []types.ManagedObjectReference + + if d, ok := asFolderMO(ref); ok { + refs = d.ChildEntity + } + if p, ok := ref.(*StoragePod); ok { + refs = p.ChildEntity + } + + for _, ref := range refs { + obj := ctx.Map.Get(ref) + + if ds, ok := obj.(*Datastore); ok && ds.Name == name { + return ds, nil + } + if p, ok := obj.(*StoragePod); ok { + ds, _ := f.findDatastore(ctx, p, name) + if ds != nil { + return ds, nil + } + } + if d, ok := asFolderMO(obj); ok { + ds, _ := f.findDatastore(ctx, d, name) + if ds != nil { + return ds, nil + } + } + } + + return nil, &types.InvalidDatastore{Name: name} +} + +func (f *FileManager) resolve(ctx *Context, dc *types.ManagedObjectReference, name string, remove ...bool) (string, types.BaseMethodFault) { + p, fault := parseDatastorePath(name) + if fault != nil { + return "", fault + } + + if dc == nil { + if ctx.Map.IsESX() { + dc = &esx.Datacenter.Self + } else { + return "", &types.InvalidArgument{InvalidProperty: "dc"} + } + } + + folder := ctx.Map.Get(*dc).(*Datacenter).DatastoreFolder + + ds, fault := f.findDatastore(ctx, ctx.Map.Get(folder), p.Datastore) + if fault != nil { + return "", fault + } + + return ds.resolve(ctx, p.Path, remove...), nil +} + +func (f *FileManager) fault(name string, err error, fault types.BaseFileFault) types.BaseMethodFault { + switch { + case os.IsNotExist(err): + fault = new(types.FileNotFound) + case os.IsExist(err): + fault = new(types.FileAlreadyExists) + } + + fault.GetFileFault().File = name + + return fault.(types.BaseMethodFault) +} + +func (f *FileManager) deleteDatastoreFile(ctx *Context, req *types.DeleteDatastoreFile_Task) types.BaseMethodFault { + file, fault := f.resolve(ctx, req.Datacenter, req.Name, true) + if fault != nil { + return fault + } + + _, err := os.Stat(file) + if err != nil { + if os.IsNotExist(err) { + return f.fault(file, err, new(types.CannotDeleteFile)) + } + } + + err = os.RemoveAll(file) + if err != nil { + return f.fault(file, err, new(types.CannotDeleteFile)) + } + + return nil +} + +func (f *FileManager) DiskDescriptor(ctx *Context, dc *types.ManagedObjectReference, name string) (*vmdk.Descriptor, string, types.BaseMethodFault) { + path, fault := f.resolve(ctx, dc, name) + if fault != nil { + return nil, "", fault + } + + file, err := os.Open(path) + if err != nil { + return nil, "", f.fault(name, err, new(types.FileFault)) + } + + defer file.Close() + + desc, err := vmdk.ParseDescriptor(file) + if err != nil { + return nil, "", f.fault(name, err, new(types.FileFault)) + } + + return desc, path, nil +} + +func (f *FileManager) SaveDiskDescriptor(ctx *Context, desc *vmdk.Descriptor, path string) types.BaseMethodFault { + file, err := os.Create(path) + if err != nil { + return f.fault(path, err, new(types.FileFault)) + } + + if err = desc.Write(file); err != nil { + _ = file.Close() + return f.fault(path, err, new(types.FileFault)) + } + + if err = file.Close(); err != nil { + return f.fault(path, err, new(types.FileFault)) + } + + return nil +} + +func (f *FileManager) DeleteDatastoreFileTask(ctx *Context, req *types.DeleteDatastoreFile_Task) soap.HasFault { + task := CreateTask(f, "deleteDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { + return nil, f.deleteDatastoreFile(ctx, req) + }) + + return &methods.DeleteDatastoreFile_TaskBody{ + Res: &types.DeleteDatastoreFile_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (f *FileManager) MakeDirectory(ctx *Context, req *types.MakeDirectory) soap.HasFault { + body := &methods.MakeDirectoryBody{} + + name, fault := f.resolve(ctx, req.Datacenter, req.Name) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + mkdir := os.Mkdir + + if isTrue(req.CreateParentDirectories) { + mkdir = os.MkdirAll + } + + err := mkdir(name, 0700) + if err != nil { + fault = f.fault(req.Name, err, new(types.CannotCreateFile)) + body.Fault_ = Fault(err.Error(), fault) + return body + } + + body.Res = new(types.MakeDirectoryResponse) + return body +} + +func (f *FileManager) moveDatastoreFile(ctx *Context, req *types.MoveDatastoreFile_Task) types.BaseMethodFault { + src, fault := f.resolve(ctx, req.SourceDatacenter, req.SourceName) + if fault != nil { + return fault + } + + dst, fault := f.resolve(ctx, req.DestinationDatacenter, req.DestinationName) + if fault != nil { + return fault + } + + if !isTrue(req.Force) { + _, err := os.Stat(dst) + if err == nil { + return f.fault(dst, nil, new(types.FileAlreadyExists)) + } + } + + err := os.Rename(src, dst) + if err != nil { + return f.fault(src, err, new(types.CannotAccessFile)) + } + + return nil +} + +func (f *FileManager) MoveDatastoreFileTask(ctx *Context, req *types.MoveDatastoreFile_Task) soap.HasFault { + task := CreateTask(f, "moveDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { + return nil, f.moveDatastoreFile(ctx, req) + }) + + return &methods.MoveDatastoreFile_TaskBody{ + Res: &types.MoveDatastoreFile_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (f *FileManager) copyDatastoreFile(ctx *Context, req *types.CopyDatastoreFile_Task) types.BaseMethodFault { + src, fault := f.resolve(ctx, req.SourceDatacenter, req.SourceName) + if fault != nil { + return fault + } + + dst, fault := f.resolve(ctx, req.DestinationDatacenter, req.DestinationName) + if fault != nil { + return fault + } + + if !isTrue(req.Force) { + _, err := os.Stat(dst) + if err == nil { + return f.fault(dst, nil, new(types.FileAlreadyExists)) + } + } + + r, err := os.Open(filepath.Clean(src)) + if err != nil { + return f.fault(dst, err, new(types.CannotAccessFile)) + } + defer r.Close() + + w, err := os.Create(dst) + if err != nil { + return f.fault(dst, err, new(types.CannotCreateFile)) + } + defer w.Close() + + if _, err = io.Copy(w, r); err != nil { + return f.fault(dst, err, new(types.CannotCreateFile)) + } + + return nil +} + +func (f *FileManager) CopyDatastoreFileTask(ctx *Context, req *types.CopyDatastoreFile_Task) soap.HasFault { + task := CreateTask(f, "copyDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { + return nil, f.copyDatastoreFile(ctx, req) + }) + + return &methods.CopyDatastoreFile_TaskBody{ + Res: &types.CopyDatastoreFile_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/folder.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/folder.go new file mode 100644 index 000000000..6ce09f259 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/folder.go @@ -0,0 +1,1146 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "errors" + "fmt" + "math/rand" + "net/url" + "path" + "strings" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type Folder struct { + mo.Folder +} + +func asFolderMO(obj mo.Reference) (*mo.Folder, bool) { + if obj == nil { + return nil, false + } + f, ok := getManagedObject(obj).Addr().Interface().(*mo.Folder) + return f, ok +} + +func folderEventArgument(f *mo.Folder) types.FolderEventArgument { + return types.FolderEventArgument{ + Folder: f.Self, + EntityEventArgument: types.EntityEventArgument{Name: f.Name}, + } +} + +// update references when objects are added/removed from a Folder +func folderUpdate(ctx *Context, f *mo.Folder, o mo.Reference, u func(*Context, mo.Reference, *[]types.ManagedObjectReference, types.ManagedObjectReference)) { + ref := o.Reference() + + if f.Parent == nil { + return // this is the root folder + } + + switch ref.Type { + case "Datacenter", "Folder": + return // nothing to update + } + + dc := ctx.Map.getEntityDatacenter(f) + + switch ref.Type { + case "Network", "DistributedVirtualSwitch", "DistributedVirtualPortgroup": + u(ctx, dc, &dc.Network, ref) + case "Datastore": + u(ctx, dc, &dc.Datastore, ref) + } +} + +func networkSummary(n *mo.Network) types.BaseNetworkSummary { + if n.Summary != nil { + return n.Summary + } + return &types.NetworkSummary{ + Network: &n.Self, + Name: n.Name, + Accessible: true, + } +} + +func folderPutChild(ctx *Context, f *mo.Folder, o mo.Entity) { + ctx.WithLock(f, func() { + ctx.WithLock(o, func() { + // Need to update ChildEntity before Map.Put for ContainerView updates to work properly + f.ChildEntity = append(f.ChildEntity, ctx.Map.reference(o)) + ctx.Map.PutEntity(f, o) + + folderUpdate(ctx, f, o, ctx.Map.AddReference) + + switch e := o.(type) { + case *mo.Network: + e.Summary = networkSummary(e) + case *mo.OpaqueNetwork: + e.Summary = networkSummary(&e.Network) + case *DistributedVirtualPortgroup: + e.Summary = networkSummary(&e.Network) + } + }) + }) +} + +func folderRemoveChild(ctx *Context, f *mo.Folder, o mo.Reference) { + ctx.Map.Remove(ctx, o.Reference()) + folderRemoveReference(ctx, f, o) +} + +func folderRemoveReference(ctx *Context, f *mo.Folder, o mo.Reference) { + ctx.WithLock(f, func() { + RemoveReference(&f.ChildEntity, o.Reference()) + + folderUpdate(ctx, f, o, ctx.Map.RemoveReference) + }) +} + +func folderHasChildType(f *mo.Folder, kind string) bool { + for _, t := range f.ChildType { + if t == kind { + return true + } + } + return false +} + +func (f *Folder) typeNotSupported() *soap.Fault { + return Fault(fmt.Sprintf("%s supports types: %#v", f.Self, f.ChildType), &types.NotSupported{}) +} + +// AddOpaqueNetwork adds an OpaqueNetwork type to the inventory, with default backing to that of an nsx.LogicalSwitch. +// The vSphere API does not have a method to add this directly, so it must either be called directly or via Model.OpaqueNetwork setting. +func (f *Folder) AddOpaqueNetwork(ctx *Context, summary types.OpaqueNetworkSummary) error { + if !folderHasChildType(&f.Folder, "Network") { + return errors.New("not a network folder") + } + + if summary.OpaqueNetworkId == "" { + summary.OpaqueNetworkId = uuid.New().String() + } + if summary.OpaqueNetworkType == "" { + summary.OpaqueNetworkType = "nsx.LogicalSwitch" + } + if summary.Name == "" { + summary.Name = summary.OpaqueNetworkType + "-" + summary.OpaqueNetworkId + } + + net := new(mo.OpaqueNetwork) + if summary.Network == nil { + summary.Network = &net.Self + } else { + net.Self = *summary.Network + } + summary.Accessible = true + net.Network.Name = summary.Name + net.Summary = &summary + + folderPutChild(ctx, &f.Folder, net) + + return nil +} + +type addStandaloneHost struct { + *Folder + ctx *Context + req *types.AddStandaloneHost_Task +} + +func (add *addStandaloneHost) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + host, err := CreateStandaloneHost(add.ctx, add.Folder, add.req.Spec) + if err != nil { + return nil, err + } + + if add.req.AddConnected { + host.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + } + + return host.Reference(), nil +} + +func (f *Folder) AddStandaloneHostTask(ctx *Context, a *types.AddStandaloneHost_Task) soap.HasFault { + r := &methods.AddStandaloneHost_TaskBody{} + + if folderHasChildType(&f.Folder, "ComputeResource") && folderHasChildType(&f.Folder, "Folder") { + r.Res = &types.AddStandaloneHost_TaskResponse{ + Returnval: NewTask(&addStandaloneHost{f, ctx, a}).Run(ctx), + } + } else { + r.Fault_ = f.typeNotSupported() + } + + return r +} + +func (f *Folder) CreateFolder(ctx *Context, c *types.CreateFolder) soap.HasFault { + r := &methods.CreateFolderBody{} + + if folderHasChildType(&f.Folder, "Folder") { + name := escapeSpecialCharacters(c.Name) + + if obj := ctx.Map.FindByName(name, f.ChildEntity); obj != nil { + r.Fault_ = Fault("", &types.DuplicateName{ + Name: name, + Object: obj.Reference(), + }) + + return r + } + + folder := &Folder{} + + folder.Name = name + folder.ChildType = f.ChildType + + folderPutChild(ctx, &f.Folder, folder) + + r.Res = &types.CreateFolderResponse{ + Returnval: folder.Self, + } + } else { + r.Fault_ = f.typeNotSupported() + } + + return r +} + +func escapeSpecialCharacters(name string) string { + name = strings.ReplaceAll(name, `%`, strings.ToLower(url.QueryEscape(`%`))) + name = strings.ReplaceAll(name, `/`, strings.ToLower(url.QueryEscape(`/`))) + name = strings.ReplaceAll(name, `\`, strings.ToLower(url.QueryEscape(`\`))) + return name +} + +// StoragePod aka "Datastore Cluster" +type StoragePod struct { + mo.StoragePod +} + +func (f *Folder) CreateStoragePod(ctx *Context, c *types.CreateStoragePod) soap.HasFault { + r := &methods.CreateStoragePodBody{} + + if folderHasChildType(&f.Folder, "StoragePod") { + if obj := ctx.Map.FindByName(c.Name, f.ChildEntity); obj != nil { + r.Fault_ = Fault("", &types.DuplicateName{ + Name: c.Name, + Object: obj.Reference(), + }) + + return r + } + + pod := &StoragePod{} + + pod.Name = c.Name + pod.ChildType = []string{"Datastore"} + pod.Summary = new(types.StoragePodSummary) + pod.PodStorageDrsEntry = new(types.PodStorageDrsEntry) + pod.PodStorageDrsEntry.StorageDrsConfig.PodConfig.Enabled = true + + folderPutChild(ctx, &f.Folder, pod) + + r.Res = &types.CreateStoragePodResponse{ + Returnval: pod.Self, + } + } else { + r.Fault_ = f.typeNotSupported() + } + + return r +} + +func (p *StoragePod) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault { + task := CreateTask(p, "moveIntoFolder", func(*Task) (types.AnyType, types.BaseMethodFault) { + f := &Folder{Folder: p.Folder} + id := f.MoveIntoFolderTask(ctx, c).(*methods.MoveIntoFolder_TaskBody).Res.Returnval + ftask := ctx.Map.Get(id).(*Task) + ftask.Wait() + if ftask.Info.Error != nil { + return nil, ftask.Info.Error.Fault + } + p.ChildEntity = append(p.ChildEntity, f.ChildEntity...) + return nil, nil + }) + return &methods.MoveIntoFolder_TaskBody{ + Res: &types.MoveIntoFolder_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (f *Folder) CreateDatacenter(ctx *Context, c *types.CreateDatacenter) soap.HasFault { + r := &methods.CreateDatacenterBody{} + + if folderHasChildType(&f.Folder, "Datacenter") && folderHasChildType(&f.Folder, "Folder") { + dc := NewDatacenter(ctx, &f.Folder) + + ctx.Update(dc, []types.PropertyChange{ + {Name: "name", Val: c.Name}, + }) + + r.Res = &types.CreateDatacenterResponse{ + Returnval: dc.Self, + } + + ctx.postEvent(&types.DatacenterCreatedEvent{ + DatacenterEvent: types.DatacenterEvent{ + Event: types.Event{ + Datacenter: datacenterEventArgument(ctx, dc), + }, + }, + Parent: folderEventArgument(&f.Folder), + }) + } else { + r.Fault_ = f.typeNotSupported() + } + + return r +} + +func (f *Folder) CreateClusterEx(ctx *Context, c *types.CreateClusterEx) soap.HasFault { + r := &methods.CreateClusterExBody{} + + if folderHasChildType(&f.Folder, "ComputeResource") && folderHasChildType(&f.Folder, "Folder") { + cluster, err := CreateClusterComputeResource(ctx, f, c.Name, c.Spec) + if err != nil { + r.Fault_ = Fault("", err) + return r + } + + r.Res = &types.CreateClusterExResponse{ + Returnval: cluster.Self, + } + } else { + r.Fault_ = f.typeNotSupported() + } + + return r +} + +type createVM struct { + *Folder + + ctx *Context + req *types.CreateVM_Task + + register bool +} + +// hostsWithDatastore returns hosts that have access to the given datastore path +func hostsWithDatastore(ctx *Context, hosts []types.ManagedObjectReference, path string) []types.ManagedObjectReference { + attached := hosts[:0] + var p object.DatastorePath + p.FromString(path) + + for _, host := range hosts { + h := ctx.Map.Get(host).(*HostSystem) + if ctx.Map.FindByName(p.Datastore, h.Datastore) != nil { + attached = append(attached, host) + } + } + + return attached +} + +func (c *createVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + config := &c.req.Config + // escape special characters in vm name + if config.Name != escapeSpecialCharacters(config.Name) { + deepCopy(c.req.Config, config) + config.Name = escapeSpecialCharacters(config.Name) + } + + vm, err := NewVirtualMachine(c.ctx, c.Folder.Self, &c.req.Config) + if err != nil { + return nil, err + } + + vm.ResourcePool = &c.req.Pool + + if c.req.Host == nil { + pool := c.ctx.Map.Get(c.req.Pool).(mo.Entity) + cr := c.ctx.Map.getEntityComputeResource(pool) + + c.ctx.WithLock(cr, func() { + var hosts []types.ManagedObjectReference + switch cr := cr.(type) { + case *mo.ComputeResource: + hosts = cr.Host + case *ClusterComputeResource: + hosts = cr.Host + } + + hosts = hostsWithDatastore(c.ctx, hosts, c.req.Config.Files.VmPathName) + host := hosts[rand.Intn(len(hosts))] + vm.Runtime.Host = &host + }) + } else { + vm.Runtime.Host = c.req.Host + } + + if cryptoSpec, ok := c.req.Config.Crypto.(*types.CryptoSpecEncrypt); ok { + if cryptoSpec.CryptoKeyId.KeyId == "" { + if cryptoSpec.CryptoKeyId.ProviderId == nil { + providerID, keyID := getDefaultProvider(c.ctx, vm, true) + if providerID == "" { + return nil, &types.InvalidVmConfig{Property: "configSpec.crypto"} + } + vm.Config.KeyId = &types.CryptoKeyId{ + KeyId: keyID, + ProviderId: &types.KeyProviderId{ + Id: providerID, + }, + } + } else { + providerID := cryptoSpec.CryptoKeyId.ProviderId.Id + keyID := generateKeyForProvider(c.ctx, providerID) + vm.Config.KeyId = &types.CryptoKeyId{ + KeyId: keyID, + ProviderId: &types.KeyProviderId{ + Id: providerID, + }, + } + } + } + } + + vm.Guest = &types.GuestInfo{ + ToolsStatus: types.VirtualMachineToolsStatusToolsNotInstalled, + ToolsVersion: "0", + ToolsRunningStatus: string(types.VirtualMachineToolsRunningStatusGuestToolsNotRunning), + } + + vm.Summary.Guest = &types.VirtualMachineGuestSummary{ + ToolsStatus: vm.Guest.ToolsStatus, + } + vm.Summary.Config.VmPathName = vm.Config.Files.VmPathName + vm.Summary.Runtime.Host = vm.Runtime.Host + + err = vm.create(c.ctx, &c.req.Config, c.register) + if err != nil { + folderRemoveChild(c.ctx, &c.Folder.Folder, vm) + return nil, err + } + + host := c.ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + c.ctx.Map.AppendReference(c.ctx, host, &host.Vm, vm.Self) + vm.EnvironmentBrowser = *hostParent(task.ctx, &host.HostSystem).EnvironmentBrowser + + for i := range vm.Datastore { + ds := c.ctx.Map.Get(vm.Datastore[i]).(*Datastore) + c.ctx.Map.AppendReference(c.ctx, ds, &ds.Vm, vm.Self) + } + + pool := c.ctx.Map.Get(*vm.ResourcePool) + // This can be an internal call from VirtualApp.CreateChildVMTask, where pool is already locked. + c.ctx.WithLock(pool, func() { + if rp, ok := asResourcePoolMO(pool); ok { + rp.Vm = append(rp.Vm, vm.Self) + } + if vapp, ok := pool.(*VirtualApp); ok { + vapp.Vm = append(vapp.Vm, vm.Self) + } + }) + + event := vm.event(c.ctx) + c.ctx.postEvent( + &types.VmBeingCreatedEvent{ + VmEvent: event, + ConfigSpec: &c.req.Config, + }, + &types.VmInstanceUuidAssignedEvent{ + VmEvent: event, + InstanceUuid: vm.Config.InstanceUuid, + }, + &types.VmUuidAssignedEvent{ + VmEvent: event, + Uuid: vm.Config.Uuid, + }, + &types.VmCreatedEvent{ + VmEvent: event, + }, + ) + + vm.RefreshStorageInfo(c.ctx, nil) + + c.ctx.Update(vm, []types.PropertyChange{ + {Name: "name", Val: c.req.Config.Name}, + }) + + return vm.Reference(), nil +} + +func (f *Folder) CreateVMTask(ctx *Context, c *types.CreateVM_Task) soap.HasFault { + return &methods.CreateVM_TaskBody{ + Res: &types.CreateVM_TaskResponse{ + Returnval: NewTask(&createVM{f, ctx, c, false}).Run(ctx), + }, + } +} + +type registerVM struct { + *Folder + + ctx *Context + req *types.RegisterVM_Task +} + +func (c *registerVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + host := c.req.Host + pool := c.req.Pool + + if c.req.AsTemplate { + if host == nil { + return nil, &types.InvalidArgument{InvalidProperty: "host"} + } else if pool != nil { + return nil, &types.InvalidArgument{InvalidProperty: "pool"} + } + + pool = hostParent(c.ctx, &c.ctx.Map.Get(*host).(*HostSystem).HostSystem).ResourcePool + } else { + if pool == nil { + return nil, &types.InvalidArgument{InvalidProperty: "pool"} + } + } + + if c.req.Path == "" { + return nil, &types.InvalidArgument{InvalidProperty: "path"} + } + + s := c.ctx.Map.SearchIndex() + r := s.FindByDatastorePath(c.ctx, &types.FindByDatastorePath{ + This: s.Reference(), + Path: c.req.Path, + Datacenter: c.ctx.Map.getEntityDatacenter(c.Folder).Reference(), + }) + + if ref := r.(*methods.FindByDatastorePathBody).Res.Returnval; ref != nil { + return nil, &types.AlreadyExists{Name: ref.Value} + } + + if c.req.Name == "" { + p, err := parseDatastorePath(c.req.Path) + if err != nil { + return nil, err + } + + c.req.Name = path.Dir(p.Path) + } + + create := NewTask(&createVM{ + Folder: c.Folder, + register: true, + ctx: c.ctx, + req: &types.CreateVM_Task{ + This: c.Folder.Reference(), + Config: types.VirtualMachineConfigSpec{ + Name: c.req.Name, + Files: &types.VirtualMachineFileInfo{ + VmPathName: c.req.Path, + }, + }, + Pool: *pool, + Host: host, + }, + }) + + create.RunBlocking(c.ctx) + + if create.Info.Error != nil { + return nil, create.Info.Error.Fault + } + + return create.Info.Result, nil +} + +func (f *Folder) RegisterVMTask(ctx *Context, c *types.RegisterVM_Task) soap.HasFault { + return &methods.RegisterVM_TaskBody{ + Res: &types.RegisterVM_TaskResponse{ + Returnval: NewTask(®isterVM{f, ctx, c}).Run(ctx), + }, + } +} + +func (f *Folder) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault { + task := CreateTask(f, "moveIntoFolder", func(t *Task) (types.AnyType, types.BaseMethodFault) { + for _, ref := range c.List { + obj := ctx.Map.Get(ref).(mo.Entity) + + parent, ok := ctx.Map.Get(*(obj.Entity()).Parent).(*Folder) + + if !ok || !folderHasChildType(&f.Folder, ref.Type) { + return nil, &types.NotSupported{} + } + + folderRemoveReference(ctx, &parent.Folder, ref) + folderPutChild(ctx, &f.Folder, obj) + } + + return nil, nil + }) + + return &methods.MoveIntoFolder_TaskBody{ + Res: &types.MoveIntoFolder_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (f *Folder) CreateDVSTask(ctx *Context, req *types.CreateDVS_Task) soap.HasFault { + task := CreateTask(f, "createDVS", func(t *Task) (types.AnyType, types.BaseMethodFault) { + spec := req.Spec.ConfigSpec.GetDVSConfigSpec() + dvs := &DistributedVirtualSwitch{} + dvs.Name = spec.Name + dvs.Entity().Name = dvs.Name + + if ctx.Map.FindByName(dvs.Name, f.ChildEntity) != nil { + return nil, &types.InvalidArgument{InvalidProperty: "name"} + } + + dvs.Uuid = newUUID(dvs.Name) + + folderPutChild(ctx, &f.Folder, dvs) + + dvs.Summary = types.DVSSummary{ + Name: dvs.Name, + Uuid: dvs.Uuid, + NumPorts: spec.NumStandalonePorts, + ProductInfo: req.Spec.ProductInfo, + Description: spec.Description, + } + + configInfo := &types.VMwareDVSConfigInfo{ + DVSConfigInfo: types.DVSConfigInfo{ + Uuid: dvs.Uuid, + Name: spec.Name, + ConfigVersion: spec.ConfigVersion, + NumStandalonePorts: spec.NumStandalonePorts, + MaxPorts: spec.MaxPorts, + UplinkPortPolicy: spec.UplinkPortPolicy, + UplinkPortgroup: spec.UplinkPortgroup, + DefaultPortConfig: spec.DefaultPortConfig, + ExtensionKey: spec.ExtensionKey, + Description: spec.Description, + Policy: spec.Policy, + VendorSpecificConfig: spec.VendorSpecificConfig, + SwitchIpAddress: spec.SwitchIpAddress, + DefaultProxySwitchMaxNumPorts: spec.DefaultProxySwitchMaxNumPorts, + InfrastructureTrafficResourceConfig: spec.InfrastructureTrafficResourceConfig, + NetworkResourceControlVersion: spec.NetworkResourceControlVersion, + }, + } + + if spec, ok := req.Spec.ConfigSpec.(*types.VMwareDVSConfigSpec); ok { + configInfo.LinkDiscoveryProtocolConfig = spec.LinkDiscoveryProtocolConfig + configInfo.MaxMtu = spec.MaxMtu + configInfo.IpfixConfig = spec.IpfixConfig + configInfo.LacpApiVersion = spec.LacpApiVersion + configInfo.MulticastFilteringMode = spec.MulticastFilteringMode + configInfo.NetworkOffloadSpecId = spec.NetworkOffloadSpecId + } + + if spec.Contact != nil { + configInfo.Contact = *spec.Contact + } + + dvs.Config = configInfo + + if dvs.Summary.ProductInfo == nil { + product := ctx.Map.content().About + dvs.Summary.ProductInfo = &types.DistributedVirtualSwitchProductSpec{ + Name: "DVS", + Vendor: product.Vendor, + Version: product.Version, + Build: product.Build, + ForwardingClass: "etherswitch", + } + } + + ctx.postEvent(&types.DvsCreatedEvent{ + DvsEvent: dvs.event(ctx), + Parent: folderEventArgument(&f.Folder), + }) + + dvs.AddDVPortgroupTask(ctx, &types.AddDVPortgroup_Task{ + Spec: []types.DVPortgroupConfigSpec{{ + Name: dvs.Name + "-DVUplinks" + strings.TrimPrefix(dvs.Self.Value, "dvs"), + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + NumPorts: 1, + DefaultPortConfig: &types.VMwareDVSPortSetting{ + Vlan: &types.VmwareDistributedVirtualSwitchTrunkVlanSpec{ + VlanId: []types.NumericRange{{Start: 0, End: 4094}}, + }, + UplinkTeamingPolicy: &types.VmwareUplinkPortTeamingPolicy{ + Policy: &types.StringPolicy{ + Value: "loadbalance_srcid", + }, + ReversePolicy: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + NotifySwitches: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + RollingOrder: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + }, + }, + }}, + }) + + return dvs.Reference(), nil + }) + + return &methods.CreateDVS_TaskBody{ + Res: &types.CreateDVS_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (f *Folder) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, f, r) +} + +func (f *Folder) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + type destroyer interface { + mo.Reference + DestroyTask(*types.Destroy_Task) soap.HasFault + } + + task := CreateTask(f, "destroy", func(*Task) (types.AnyType, types.BaseMethodFault) { + // Attempt to destroy all children + for _, c := range f.ChildEntity { + obj, ok := ctx.Map.Get(c).(destroyer) + if !ok { + continue + } + + var fault types.BaseMethodFault + ctx.WithLock(obj, func() { + id := obj.DestroyTask(&types.Destroy_Task{ + This: c, + }).(*methods.Destroy_TaskBody).Res.Returnval + + t := ctx.Map.Get(id).(*Task) + t.Wait() + if t.Info.Error != nil { + fault = t.Info.Error.Fault // For example, can't destroy a powered on VM + } + }) + if fault != nil { + return nil, fault + } + } + + // Remove the folder itself + folderRemoveChild(ctx, &ctx.Map.Get(*f.Parent).(*Folder).Folder, f.Self) + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func addPlacementFault(body *methods.PlaceVmsXClusterBody, vmName string, vmRef *types.ManagedObjectReference, poolRef types.ManagedObjectReference) { + faults := types.PlaceVmsXClusterResultPlacementFaults{ + VmName: vmName, + ResourcePool: poolRef, + Vm: vmRef, + Faults: []types.LocalizedMethodFault{ + { + Fault: &types.GenericDrsFault{}, + }, + }, + } + body.Res.Returnval.Faults = append(body.Res.Returnval.Faults, faults) +} + +func generateRelocatePlacementAction(ctx *Context, inputRelocateSpec *types.VirtualMachineRelocateSpec, pool *ResourcePool, + cluster *ClusterComputeResource, hostRequired, datastoreRequired bool) *types.ClusterClusterRelocatePlacementAction { + var relocateSpec *types.VirtualMachineRelocateSpec + + placementAction := types.ClusterClusterRelocatePlacementAction{ + Pool: pool.Self, + } + + if hostRequired { + randomHost := cluster.Host[rand.Intn(len(cluster.Host))] + placementAction.TargetHost = &randomHost + } + + if datastoreRequired { + relocateSpec = inputRelocateSpec + + ds := ctx.Map.Get(cluster.Datastore[rand.Intn(len(cluster.Datastore))]).(*Datastore) + + relocateSpec.Datastore = types.NewReference(ds.Reference()) + + for _, diskLocator := range relocateSpec.Disk { + diskLocator.Datastore = ds.Reference() + } + } + + placementAction.RelocateSpec = relocateSpec + return &placementAction +} + +func generateRecommendationForRelocate(ctx *Context, req *types.PlaceVmsXCluster) *methods.PlaceVmsXClusterBody { + + pools := req.PlacementSpec.ResourcePools + specs := req.PlacementSpec.VmPlacementSpecs + + body := new(methods.PlaceVmsXClusterBody) + body.Res = new(types.PlaceVmsXClusterResponse) + hostRequired := req.PlacementSpec.HostRecommRequired != nil && *req.PlacementSpec.HostRecommRequired + datastoreRequired := req.PlacementSpec.DatastoreRecommRequired != nil && *req.PlacementSpec.DatastoreRecommRequired + + for _, spec := range specs { + + // The RelocateSpec must be set. + if spec.RelocateSpec == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "relocateSpec"}) + return body + } + + // The VM Reference must be set. + if spec.Vm == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vm"}) + return body + } + + vmRef := ctx.Map.Get(*spec.Vm) + if vmRef == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vm"}) + return body + } + + vm := vmRef.(*VirtualMachine) + pool := ctx.Map.Get(pools[rand.Intn(len(pools))]).(*ResourcePool) + cluster := ctx.Map.Get(pool.Owner).(*ClusterComputeResource) + + if len(cluster.Host) == 0 { + addPlacementFault(body, spec.ConfigSpec.Name, &vm.Self, pool.Self) + continue + } + + reco := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXClusterPlacement), + ReasonText: string(types.RecommendationReasonCodeXClusterPlacement), + Target: &cluster.Self, + } + + placementAction := generateRelocatePlacementAction(ctx, spec.RelocateSpec, pool, cluster, hostRequired, datastoreRequired) + + reco.Action = append(reco.Action, placementAction) + + body.Res.Returnval.PlacementInfos = append(body.Res.Returnval.PlacementInfos, + types.PlaceVmsXClusterResultPlacementInfo{ + VmName: vm.Name, + Recommendation: reco, + Vm: &vm.Self, + }, + ) + } + return body +} + +func generateReconfigurePlacementAction(ctx *Context, inputConfigSpec *types.VirtualMachineConfigSpec, pool *ResourcePool, + cluster *ClusterComputeResource, hostRequired, datastoreRequired bool) *types.ClusterClusterReconfigurePlacementAction { + var configSpec *types.VirtualMachineConfigSpec + + placementAction := types.ClusterClusterReconfigurePlacementAction{ + Pool: pool.Self, + } + + if hostRequired { + randomHost := cluster.Host[rand.Intn(len(cluster.Host))] + placementAction.TargetHost = &randomHost + } + + if datastoreRequired { + configSpec = inputConfigSpec + + ds := ctx.Map.Get(cluster.Datastore[rand.Intn(len(cluster.Datastore))]).(*Datastore) + + fillConfigSpecWithDatastore(ctx, inputConfigSpec, configSpec, ds) + } + + placementAction.ConfigSpec = configSpec + return &placementAction +} + +func generateRecommendationForReconfigure(ctx *Context, req *types.PlaceVmsXCluster) *methods.PlaceVmsXClusterBody { + + pools := req.PlacementSpec.ResourcePools + specs := req.PlacementSpec.VmPlacementSpecs + + body := new(methods.PlaceVmsXClusterBody) + body.Res = new(types.PlaceVmsXClusterResponse) + hostRequired := req.PlacementSpec.HostRecommRequired != nil && *req.PlacementSpec.HostRecommRequired + datastoreRequired := req.PlacementSpec.DatastoreRecommRequired != nil && *req.PlacementSpec.DatastoreRecommRequired + + for _, spec := range specs { + + // Only a single pool must be set + if len(pools) != 1 { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "resourcePools"}) + return body + } + + // The RelocateSpec must not be set. + if spec.RelocateSpec != nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "relocateSpec"}) + return body + } + + // The VM Reference must be set. + if spec.Vm == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vm"}) + return body + } + + vmRef := ctx.Map.Get(*spec.Vm) + if vmRef == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vm"}) + return body + } + + vm := vmRef.(*VirtualMachine) + + // Use VM's current host + host := ctx.Map.Get(vm.Runtime.Host.Reference()).(*HostSystem) + + if host.Parent.Type != "ClusterComputeResource" { + addPlacementFault(body, spec.ConfigSpec.Name, &vm.Self, host.Self) + continue + } + + cluster := ctx.Map.Get(*host.Parent).(*ClusterComputeResource) + pool := ctx.Map.Get(*cluster.ResourcePool).(*ResourcePool) + + reco := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXClusterPlacement), + ReasonText: string(types.RecommendationReasonCodeXClusterPlacement), + Target: &cluster.Self, + } + + placementAction := generateReconfigurePlacementAction(ctx, &spec.ConfigSpec, pool, cluster, hostRequired, datastoreRequired) + + reco.Action = append(reco.Action, placementAction) + + body.Res.Returnval.PlacementInfos = append(body.Res.Returnval.PlacementInfos, + types.PlaceVmsXClusterResultPlacementInfo{ + VmName: vm.Name, + Recommendation: reco, + Vm: &vm.Self, + }, + ) + } + return body +} + +func fillConfigSpecWithDatastore(ctx *Context, inputConfigSpec, configSpec *types.VirtualMachineConfigSpec, ds *Datastore) { + if configSpec.Files == nil { + configSpec.Files = new(types.VirtualMachineFileInfo) + } + configSpec.Files.VmPathName = fmt.Sprintf("[%[1]s] %[2]s/%[2]s.vmx", ds.Name, inputConfigSpec.Name) + + for _, change := range configSpec.DeviceChange { + dspec := change.GetVirtualDeviceConfigSpec() + + if dspec.FileOperation != types.VirtualDeviceConfigSpecFileOperationCreate { + continue + } + + switch dspec.Operation { + case types.VirtualDeviceConfigSpecOperationAdd: + device := dspec.Device + d := device.GetVirtualDevice() + + switch device.(type) { + case *types.VirtualDisk: + switch b := d.Backing.(type) { + case types.BaseVirtualDeviceFileBackingInfo: + info := b.GetVirtualDeviceFileBackingInfo() + info.Datastore = types.NewReference(ds.Reference()) + + var dsPath object.DatastorePath + if dsPath.FromString(info.FileName) { + dsPath.Datastore = ds.Name + info.FileName = dsPath.String() + } + } + } + } + } +} + +func generateInitialPlacementAction(ctx *Context, inputConfigSpec *types.VirtualMachineConfigSpec, pool *ResourcePool, + cluster *ClusterComputeResource, hostRequired, datastoreRequired bool) *types.ClusterClusterInitialPlacementAction { + var configSpec *types.VirtualMachineConfigSpec + + placementAction := types.ClusterClusterInitialPlacementAction{ + Pool: pool.Self, + } + + if hostRequired { + randomHost := cluster.Host[rand.Intn(len(cluster.Host))] + placementAction.TargetHost = &randomHost + } + + if datastoreRequired { + configSpec = inputConfigSpec + + // TODO: This is just an initial implementation aimed at returning some data but it is not + // necessarily fully consistent, like we should ensure the host, if also required, has the + // datastore mounted. + ds := ctx.Map.Get(cluster.Datastore[rand.Intn(len(cluster.Datastore))]).(*Datastore) + + fillConfigSpecWithDatastore(ctx, inputConfigSpec, configSpec, ds) + } + + placementAction.ConfigSpec = configSpec + return &placementAction +} + +func generateRecommendationForCreateAndPowerOn(ctx *Context, req *types.PlaceVmsXCluster) *methods.PlaceVmsXClusterBody { + + pools := req.PlacementSpec.ResourcePools + specs := req.PlacementSpec.VmPlacementSpecs + + body := new(methods.PlaceVmsXClusterBody) + body.Res = new(types.PlaceVmsXClusterResponse) + hostRequired := req.PlacementSpec.HostRecommRequired != nil && *req.PlacementSpec.HostRecommRequired + datastoreRequired := req.PlacementSpec.DatastoreRecommRequired != nil && *req.PlacementSpec.DatastoreRecommRequired + + for _, spec := range specs { + + // The RelocateSpec must not be set. + if spec.RelocateSpec != nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "relocateSpec"}) + return body + } + + // The name in the ConfigSpec must set. + if spec.ConfigSpec.Name == "" { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "configSpec.name"}) + return body + } + + pool := ctx.Map.Get(pools[rand.Intn(len(pools))]).(*ResourcePool) + cluster := ctx.Map.Get(pool.Owner).(*ClusterComputeResource) + + if len(cluster.Host) == 0 { + addPlacementFault(body, spec.ConfigSpec.Name, nil, pool.Self) + continue + } + + reco := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXClusterPlacement), + ReasonText: string(types.RecommendationReasonCodeXClusterPlacement), + Target: &cluster.Self, + } + + placementAction := generateInitialPlacementAction(ctx, &spec.ConfigSpec, pool, cluster, hostRequired, datastoreRequired) + + reco.Action = append(reco.Action, placementAction) + + body.Res.Returnval.PlacementInfos = append(body.Res.Returnval.PlacementInfos, + types.PlaceVmsXClusterResultPlacementInfo{ + VmName: spec.ConfigSpec.Name, + Recommendation: reco, + }, + ) + } + return body +} + +func (f *Folder) PlaceVmsXCluster(ctx *Context, req *types.PlaceVmsXCluster) soap.HasFault { + body := new(methods.PlaceVmsXClusterBody) + + // Reject the request if it is against any folder other than the root folder. + if req.This != ctx.Map.content().RootFolder { + body.Fault_ = Fault("", new(types.InvalidRequest)) + return body + } + + pools := req.PlacementSpec.ResourcePools + specs := req.PlacementSpec.VmPlacementSpecs + + if len(pools) == 0 { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "resourcePools"}) + return body + } + + // Do not allow duplicate clusters. + clusters := map[mo.Reference]struct{}{} + for _, obj := range pools { + o := ctx.Map.Get(obj) + pool, ok := o.(*ResourcePool) + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "resourcePool"}) + return body + } + if _, exists := clusters[pool.Owner]; exists { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "clusters"}) + return body + } + clusters[pool.Owner] = struct{}{} + } + + // MVP: Only a single VM placement spec is supported. + if len(specs) != 1 { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vmPlacementSpecs"}) + return body + } + + placementType := types.PlaceVmsXClusterSpecPlacementType(req.PlacementSpec.PlacementType) + + // An empty placement type defaults to CreateAndPowerOn. + if req.PlacementSpec.PlacementType == "" { + placementType = types.PlaceVmsXClusterSpecPlacementTypeCreateAndPowerOn + } + + switch placementType { + case types.PlaceVmsXClusterSpecPlacementTypeCreateAndPowerOn: + return generateRecommendationForCreateAndPowerOn(ctx, req) + case types.PlaceVmsXClusterSpecPlacementTypeRelocate: + return generateRecommendationForRelocate(ctx, req) + case types.PlaceVmsXClusterSpecPlacementTypeReconfigure: + return generateRecommendationForReconfigure(ctx, req) + } + + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "placementType"}) + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_id.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_id.go new file mode 100644 index 000000000..2870cf00d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_id.go @@ -0,0 +1,10 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import "github.com/vmware/govmomi/vim25/types" + +// GuestID is the list of valid types.VirtualMachineGuestOsIdentifier +var GuestID = types.VirtualMachineGuestOsIdentifier("").Values() diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go new file mode 100644 index 000000000..f3282849a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go @@ -0,0 +1,445 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bufio" + "fmt" + "net/url" + "strings" + "syscall" + "time" + + "github.com/vmware/govmomi/toolbox/process" + "github.com/vmware/govmomi/toolbox/vix" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type GuestOperationsManager struct { + mo.GuestOperationsManager +} + +func (m *GuestOperationsManager) init(r *Registry) { + fm := new(GuestFileManager) + if m.FileManager == nil { + m.FileManager = &types.ManagedObjectReference{ + Type: "GuestFileManager", + Value: "guestOperationsFileManager", + } + } + fm.Self = *m.FileManager + r.Put(fm) + + pm := new(GuestProcessManager) + if m.ProcessManager == nil { + m.ProcessManager = &types.ManagedObjectReference{ + Type: "GuestProcessManager", + Value: "guestOperationsProcessManager", + } + } + pm.Self = *m.ProcessManager + pm.Manager = process.NewManager() + r.Put(pm) +} + +type GuestFileManager struct { + mo.GuestFileManager +} + +func guestURL(ctx *Context, vm *VirtualMachine, path string) string { + return (&url.URL{ + Scheme: ctx.svc.Listen.Scheme, + Host: "*", // See guest.FileManager.TransferURL + Path: guestPrefix + strings.TrimPrefix(path, "/"), + RawQuery: url.Values{ + "id": []string{vm.svm.c.id}, + "token": []string{ctx.Session.Key}, + }.Encode(), + }).String() +} + +func (m *GuestFileManager) InitiateFileTransferToGuest(ctx *Context, req *types.InitiateFileTransferToGuest) soap.HasFault { + body := new(methods.InitiateFileTransferToGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + err := vm.svm.prepareGuestOperation(req.Auth) + if err != nil { + body.Fault_ = Fault("", err) + return body + } + + body.Res = &types.InitiateFileTransferToGuestResponse{ + Returnval: guestURL(ctx, vm, req.GuestFilePath), + } + + return body +} + +func (m *GuestFileManager) InitiateFileTransferFromGuest(ctx *Context, req *types.InitiateFileTransferFromGuest) soap.HasFault { + body := new(methods.InitiateFileTransferFromGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + err := vm.svm.prepareGuestOperation(req.Auth) + if err != nil { + body.Fault_ = Fault("", err) + return body + } + + body.Res = &types.InitiateFileTransferFromGuestResponse{ + Returnval: types.FileTransferInformation{ + Attributes: nil, // TODO + Size: 0, // TODO + Url: guestURL(ctx, vm, req.GuestFilePath), + }, + } + + return body +} + +type GuestProcessManager struct { + mo.GuestProcessManager + *process.Manager +} + +func (m *GuestProcessManager) StartProgramInGuest(ctx *Context, req *types.StartProgramInGuest) soap.HasFault { + body := new(methods.StartProgramInGuestBody) + + spec := req.Spec.(*types.GuestProgramSpec) + auth := req.Auth.(*types.NamePasswordAuthentication) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + fault := vm.svm.prepareGuestOperation(auth) + if fault != nil { + body.Fault_ = Fault("", fault) + } + + args := []string{"exec"} + + if spec.WorkingDirectory != "" { + args = append(args, "-w", spec.WorkingDirectory) + } + + for _, e := range spec.EnvVariables { + args = append(args, "-e", e) + } + + args = append(args, vm.svm.c.id, spec.ProgramPath, spec.Arguments) + + spec.ProgramPath = "docker" + spec.Arguments = strings.Join(args, " ") + + start := &vix.StartProgramRequest{ + ProgramPath: spec.ProgramPath, + Arguments: spec.Arguments, + } + + proc := process.New() + proc.Owner = auth.Username + + pid, err := m.Start(start, proc) + if err != nil { + panic(err) // only happens if LookPath("docker") fails, which it should't at this point + } + + body.Res = &types.StartProgramInGuestResponse{ + Returnval: pid, + } + + return body +} + +func (m *GuestProcessManager) ListProcessesInGuest(ctx *Context, req *types.ListProcessesInGuest) soap.HasFault { + body := &methods.ListProcessesInGuestBody{ + Res: new(types.ListProcessesInGuestResponse), + } + + procs := m.List(req.Pids) + + for _, proc := range procs { + var end *time.Time + if proc.EndTime != 0 { + end = types.NewTime(time.Unix(proc.EndTime, 0)) + } + + body.Res.Returnval = append(body.Res.Returnval, types.GuestProcessInfo{ + Name: proc.Name, + Pid: proc.Pid, + Owner: proc.Owner, + CmdLine: proc.Name + " " + proc.Args, + StartTime: time.Unix(proc.StartTime, 0), + EndTime: end, + ExitCode: proc.ExitCode, + }) + } + + return body +} + +func (m *GuestProcessManager) TerminateProcessInGuest(ctx *Context, req *types.TerminateProcessInGuest) soap.HasFault { + body := new(methods.TerminateProcessInGuestBody) + + if m.Kill(req.Pid) { + body.Res = new(types.TerminateProcessInGuestResponse) + } else { + body.Fault_ = Fault("", &types.GuestProcessNotFound{Pid: req.Pid}) + } + + return body +} + +func (m *GuestFileManager) mktemp(ctx *Context, req *types.CreateTemporaryFileInGuest, dir bool) (string, types.BaseMethodFault) { + args := []string{"mktemp", fmt.Sprintf("--tmpdir=%s", req.DirectoryPath), req.Prefix + "vcsim-XXXXX" + req.Suffix} + if dir { + args = append(args, "-d") + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + return vm.svm.exec(ctx, req.Auth, args) +} + +func (m *GuestFileManager) CreateTemporaryFileInGuest(ctx *Context, req *types.CreateTemporaryFileInGuest) soap.HasFault { + body := new(methods.CreateTemporaryFileInGuestBody) + + res, fault := m.mktemp(ctx, req, false) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = &types.CreateTemporaryFileInGuestResponse{Returnval: res} + + return body +} + +func (m *GuestFileManager) CreateTemporaryDirectoryInGuest(ctx *Context, req *types.CreateTemporaryDirectoryInGuest) soap.HasFault { + body := new(methods.CreateTemporaryDirectoryInGuestBody) + + dir := types.CreateTemporaryFileInGuest(*req) + res, fault := m.mktemp(ctx, &dir, true) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = &types.CreateTemporaryDirectoryInGuestResponse{Returnval: res} + + return body +} + +func listFiles(req *types.ListFilesInGuest) []string { + args := []string{"find", req.FilePath} + if req.MatchPattern != "" { + args = append(args, "-name", req.MatchPattern) + } + return append(args, "-maxdepth", "1", "-exec", "stat", "-c", "%s %u %g %f %X %Y %n", "{}", "+") +} + +func toFileInfo(s string) []types.GuestFileInfo { + var res []types.GuestFileInfo + + scanner := bufio.NewScanner(strings.NewReader(s)) + + for scanner.Scan() { + var mode, atime, mtime int64 + attr := &types.GuestPosixFileAttributes{OwnerId: new(int32), GroupId: new(int32)} + info := types.GuestFileInfo{Attributes: attr} + + _, err := fmt.Sscanf(scanner.Text(), "%d %d %d %x %d %d %s", + &info.Size, attr.OwnerId, attr.GroupId, &mode, &atime, &mtime, &info.Path) + if err != nil { + panic(err) + } + + attr.AccessTime = types.NewTime(time.Unix(atime, 0)) + attr.ModificationTime = types.NewTime(time.Unix(mtime, 0)) + attr.Permissions = mode & 0777 + + switch mode & syscall.S_IFMT { + case syscall.S_IFDIR: + info.Type = string(types.GuestFileTypeDirectory) + case syscall.S_IFLNK: + info.Type = string(types.GuestFileTypeSymlink) + default: + info.Type = string(types.GuestFileTypeFile) + } + + res = append(res, info) + } + + return res +} + +func (m *GuestFileManager) ListFilesInGuest(ctx *Context, req *types.ListFilesInGuest) soap.HasFault { + body := new(methods.ListFilesInGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + if req.FilePath == "" { + body.Fault_ = Fault("", new(types.InvalidArgument)) + return body + } + + res, fault := vm.svm.exec(ctx, req.Auth, listFiles(req)) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.ListFilesInGuestResponse) + body.Res.Returnval.Files = toFileInfo(res) + + return body +} + +func (m *GuestFileManager) DeleteFileInGuest(ctx *Context, req *types.DeleteFileInGuest) soap.HasFault { + body := new(methods.DeleteFileInGuestBody) + + args := []string{"rm", req.FilePath} + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.DeleteFileInGuestResponse) + + return body +} + +func (m *GuestFileManager) DeleteDirectoryInGuest(ctx *Context, req *types.DeleteDirectoryInGuest) soap.HasFault { + body := new(methods.DeleteDirectoryInGuestBody) + + args := []string{"rmdir", req.DirectoryPath} + if req.Recursive { + args = []string{"rm", "-rf", req.DirectoryPath} + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.DeleteDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) MakeDirectoryInGuest(ctx *Context, req *types.MakeDirectoryInGuest) soap.HasFault { + body := new(methods.MakeDirectoryInGuestBody) + + args := []string{"mkdir", req.DirectoryPath} + if req.CreateParentDirectories { + args = []string{"mkdir", "-p", req.DirectoryPath} + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MakeDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) MoveFileInGuest(ctx *Context, req *types.MoveFileInGuest) soap.HasFault { + body := new(methods.MoveFileInGuestBody) + + args := []string{"mv"} + if !req.Overwrite { + args = append(args, "-n") + } + args = append(args, req.SrcFilePath, req.DstFilePath) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MoveFileInGuestResponse) + + return body +} + +func (m *GuestFileManager) MoveDirectoryInGuest(ctx *Context, req *types.MoveDirectoryInGuest) soap.HasFault { + body := new(methods.MoveDirectoryInGuestBody) + + args := []string{"mv", req.SrcDirectoryPath, req.DstDirectoryPath} + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MoveDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) ChangeFileAttributesInGuest(ctx *Context, req *types.ChangeFileAttributesInGuest) soap.HasFault { + body := new(methods.ChangeFileAttributesInGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + attr, ok := req.FileAttributes.(*types.GuestPosixFileAttributes) + if !ok { + body.Fault_ = Fault("", new(types.OperationNotSupportedByGuest)) + return body + } + + if attr.Permissions != 0 { + args := []string{"chmod", fmt.Sprintf("%#o", attr.Permissions), req.GuestFilePath} + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + } + + change := []struct { + cmd string + id *int32 + }{ + {"chown", attr.OwnerId}, + {"chgrp", attr.GroupId}, + } + + for _, c := range change { + if c.id != nil { + args := []string{c.cmd, fmt.Sprintf("%d", *c.id), req.GuestFilePath} + + _, fault := vm.svm.exec(ctx, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + } + } + + body.Res = new(types.ChangeFileAttributesInGuestResponse) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/history_collector.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/history_collector.go new file mode 100644 index 000000000..3e890120d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/history_collector.go @@ -0,0 +1,169 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "container/list" + "sync" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var ( + maxPageSize = 1000 + maxCollectors int32 = 32 // the VC default limit + defaultPageSize = 10 + + errInvalidArgMaxCount = &types.InvalidArgument{InvalidProperty: "maxCount"} +) + +type HistoryCollector struct { + parent *history + root types.ManagedObjectReference + size int + + fill func(*Context) + page *list.List + pos *list.Element +} + +type history struct { + sync.Mutex + + page *list.List + collectors map[types.ManagedObjectReference]mo.Reference +} + +func newHistory() *history { + return &history{ + page: list.New(), + collectors: make(map[types.ManagedObjectReference]mo.Reference), + } +} + +func (c *history) add(ctx *Context, collector mo.Reference) types.ManagedObjectReference { + ref := ctx.Session.Put(collector).Reference() + + c.Lock() + c.collectors[ref] = collector + c.Unlock() + + return ref +} + +func (c *history) remove(ctx *Context, ref types.ManagedObjectReference) { + ctx.Session.Remove(ctx, ref) + + c.Lock() + delete(c.collectors, ref) + c.Unlock() +} + +func newHistoryCollector(ctx *Context, h *history, size int) *HistoryCollector { + return &HistoryCollector{ + parent: h, + root: ctx.Map.content().RootFolder, + size: size, + page: list.New(), + } +} + +func (c *HistoryCollector) SetCollectorPageSize(ctx *Context, req *types.SetCollectorPageSize) soap.HasFault { + body := new(methods.SetCollectorPageSizeBody) + size, err := validatePageSize(req.MaxCount) + if err != nil { + body.Fault_ = err + return body + } + + c.size = size + c.page = list.New() + c.fill(ctx) + + body.Res = new(types.SetCollectorPageSizeResponse) + return body +} + +func (c *HistoryCollector) ResetCollector(ctx *Context, req *types.ResetCollector) soap.HasFault { + c.pos = c.page.Back() + + return &methods.ResetCollectorBody{ + Res: new(types.ResetCollectorResponse), + } +} + +func (c *HistoryCollector) RewindCollector(ctx *Context, req *types.RewindCollector) soap.HasFault { + c.pos = c.page.Front() + + return &methods.RewindCollectorBody{ + Res: new(types.RewindCollectorResponse), + } +} + +func (c *HistoryCollector) DestroyCollector(ctx *Context, req *types.DestroyCollector) soap.HasFault { + ctx.Session.Remove(ctx, req.This) + + c.parent.remove(ctx, req.This) + + return &methods.DestroyCollectorBody{ + Res: new(types.DestroyCollectorResponse), + } +} + +func (c *HistoryCollector) read(max int32, next func() *list.Element, take func(*list.Element)) { + for i := 0; i < int(max); i++ { + e := next() + if e == nil { + break + } + + take(e) + c.pos = e + } +} + +func (c *HistoryCollector) next(max int32, take func(*list.Element)) { + next := func() *list.Element { + if c.pos != nil { + return c.pos.Next() + } + return c.page.Front() + } + + c.read(max, next, take) +} + +func (c *HistoryCollector) prev(max int32, take func(*list.Element)) { + next := func() *list.Element { + if c.pos != nil { + return c.pos.Prev() + } + return c.page.Back() + } + + c.read(max, next, take) +} + +func pushHistory(l *list.List, item types.AnyType) { + if l.Len() > maxPageSize { + l.Remove(l.Front()) // Prune history + } + l.PushBack(item) +} + +func validatePageSize(count int32) (int, *soap.Fault) { + size := int(count) + + if size == 0 { + size = defaultPageSize + } else if size < 0 || size > maxPageSize { + return -1, Fault("", errInvalidArgMaxCount) + } + + return size, nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_certificate_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_certificate_manager.go new file mode 100644 index 000000000..c5def3aca --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_certificate_manager.go @@ -0,0 +1,99 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "net" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostCertificateManager struct { + mo.HostCertificateManager + + Host *mo.HostSystem +} + +func (m *HostCertificateManager) init(r *Registry) { + for _, obj := range r.objects { + if h, ok := obj.(*HostSystem); ok { + if h.ConfigManager.CertificateManager.Value == m.Self.Value { + m.Host = &h.HostSystem + } + } + } +} + +func NewHostCertificateManager(ctx *Context, h *mo.HostSystem) *HostCertificateManager { + m := &HostCertificateManager{Host: h} + + _ = m.InstallServerCertificate(ctx, &types.InstallServerCertificate{ + Cert: string(m.Host.Config.Certificate), + }) + + return m +} + +func (m *HostCertificateManager) InstallServerCertificate(ctx *Context, req *types.InstallServerCertificate) soap.HasFault { + body := new(methods.InstallServerCertificateBody) + + var info object.HostCertificateInfo + cert := []byte(req.Cert) + _, err := info.FromPEM(cert) + if err != nil { + body.Fault_ = Fault(err.Error(), new(types.HostConfigFault)) + return body + } + + m.CertificateInfo = info.HostCertificateManagerCertificateInfo + + m.Host.Config.Certificate = cert + + body.Res = new(types.InstallServerCertificateResponse) + + return body +} + +func (m *HostCertificateManager) GenerateCertificateSigningRequest(ctx *Context, req *types.GenerateCertificateSigningRequest) soap.HasFault { + block, _ := pem.Decode(m.Host.Config.Certificate) + cert, err := x509.ParseCertificate(block.Bytes) + if err != nil { + panic(err) + } + + csr := x509.CertificateRequest{ + Subject: cert.Subject, + SignatureAlgorithm: x509.SHA256WithRSA, + } + + if req.UseIpAddressAsCommonName { + csr.IPAddresses = []net.IP{net.ParseIP(m.Host.Summary.ManagementServerIp)} + } else { + csr.DNSNames = []string{m.Host.Name} + } + + key, _ := rsa.GenerateKey(rand.Reader, 2048) + der, _ := x509.CreateCertificateRequest(rand.Reader, &csr, key) + var buf bytes.Buffer + err = pem.Encode(&buf, &pem.Block{Type: "CERTIFICATE REQUEST", Bytes: der}) + if err != nil { + panic(err) + } + + return &methods.GenerateCertificateSigningRequestBody{ + Res: &types.GenerateCertificateSigningRequestResponse{ + Returnval: buf.String(), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go new file mode 100644 index 000000000..b3eb9914e --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go @@ -0,0 +1,264 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "os" + "path" + "strings" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostDatastoreBrowser struct { + mo.HostDatastoreBrowser +} + +type searchDatastore struct { + *HostDatastoreBrowser + + DatastorePath string + SearchSpec *types.HostDatastoreBrowserSearchSpec + + res []types.HostDatastoreBrowserSearchResults + + recurse bool +} + +func (s *searchDatastore) addFile(fname string, file os.FileInfo, res *types.HostDatastoreBrowserSearchResults) { + details := s.SearchSpec.Details + if details == nil { + details = new(types.FileQueryFlags) + } + + name := file.Name() + + info := types.FileInfo{ + Path: name, + FriendlyName: fname, + } + + var finfo types.BaseFileInfo = &info + + if details.FileSize { + info.FileSize = file.Size() + } + + if details.Modification { + mtime := file.ModTime() + info.Modification = &mtime + } + + if isTrue(details.FileOwner) { + // Assume for now this process created all files in the datastore + user := os.Getenv("USER") + + info.Owner = user + } + + if file.IsDir() { + finfo = &types.FolderFileInfo{FileInfo: info} + } else if details.FileType { + switch path.Ext(name) { + case ".img": + finfo = &types.FloppyImageFileInfo{FileInfo: info} + case ".iso": + finfo = &types.IsoImageFileInfo{FileInfo: info} + case ".log": + finfo = &types.VmLogFileInfo{FileInfo: info} + case ".nvram": + finfo = &types.VmNvramFileInfo{FileInfo: info} + case ".vmdk": + // TODO: lookup device to set other fields + finfo = &types.VmDiskFileInfo{FileInfo: info} + case ".vmx": + finfo = &types.VmConfigFileInfo{FileInfo: info} + } + } + + res.File = append(res.File, finfo) +} + +func (s *searchDatastore) queryMatch(file os.FileInfo) bool { + if len(s.SearchSpec.Query) == 0 { + return true + } + + name := file.Name() + ext := path.Ext(name) + + for _, q := range s.SearchSpec.Query { + switch q.(type) { + case *types.FileQuery: + return true + case *types.FolderFileQuery: + if file.IsDir() { + return true + } + case *types.FloppyImageFileQuery: + if ext == ".img" { + return true + } + case *types.IsoImageFileQuery: + if ext == ".iso" { + return true + } + case *types.VmConfigFileQuery: + if ext == ".vmx" { + // TODO: check Filter and Details fields + return true + } + case *types.VmDiskFileQuery: + if ext == ".vmdk" { + // TODO: check Filter and Details fields + return !strings.HasSuffix(name, "-flat.vmdk") + } + case *types.VmLogFileQuery: + if ext == ".log" { + return strings.HasPrefix(name, "vmware") + } + case *types.VmNvramFileQuery: + if ext == ".nvram" { + return true + } + case *types.VmSnapshotFileQuery: + if ext == ".vmsn" { + return true + } + } + } + + return false +} + +func friendlyName(ctx *Context, root bool, ds *Datastore, p string) string { + if !root || p == "" || !internal.IsDatastoreVSAN(ds.Datastore) { + return "" + } + + unlock := ctx.Map.AcquireLock(ctx, ds.Self) + defer unlock() + + if ds.namespace == nil { + return "" + } + + for name, id := range ds.namespace { + if p == id { + return name + } + } + + return "" +} + +func (s *searchDatastore) search(ctx *Context, ds *Datastore, folder string, dir string, root bool) error { + files, err := os.ReadDir(dir) + if err != nil { + tracef("search %s: %s", dir, err) + return err + } + + res := types.HostDatastoreBrowserSearchResults{ + Datastore: &ds.Self, + FolderPath: folder, + } + + for _, file := range files { + name := file.Name() + info, _ := file.Info() + if s.queryMatch(info) { + for _, m := range s.SearchSpec.MatchPattern { + if ok, _ := path.Match(m, name); ok { + s.addFile(friendlyName(ctx, root, ds, name), info, &res) + break + } + } + } + + if s.recurse && file.IsDir() { + _ = s.search(ctx, ds, path.Join(folder, name), path.Join(dir, name), false) + } + } + + s.res = append(s.res, res) + + return nil +} + +func (s *searchDatastore) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + p, fault := parseDatastorePath(s.DatastorePath) + if fault != nil { + return nil, fault + } + + ref := task.ctx.Map.FindByName(p.Datastore, s.Datastore) + if ref == nil { + return nil, &types.InvalidDatastore{Name: p.Datastore} + } + + ds := ref.(*Datastore) + + task.ctx.WithLock(task, func() { + task.Info.Entity = &ds.Self // TODO: CreateTask() should require mo.Entity, rather than mo.Reference + task.Info.EntityName = ds.Name + }) + + dir := ds.resolve(task.ctx, p.Path) + + err := s.search(task.ctx, ds, s.DatastorePath, dir, p.Path == "") + if err != nil { + ff := types.FileFault{ + File: p.Path, + } + + if os.IsNotExist(err) { + return nil, &types.FileNotFound{FileFault: ff} + } + + return nil, &types.InvalidArgument{InvalidProperty: p.Path} + } + + if s.recurse { + return types.ArrayOfHostDatastoreBrowserSearchResults{ + HostDatastoreBrowserSearchResults: s.res, + }, nil + } + + return s.res[0], nil +} + +func (b *HostDatastoreBrowser) SearchDatastoreTask(ctx *Context, s *types.SearchDatastore_Task) soap.HasFault { + task := NewTask(&searchDatastore{ + HostDatastoreBrowser: b, + DatastorePath: s.DatastorePath, + SearchSpec: s.SearchSpec, + }) + + return &methods.SearchDatastore_TaskBody{ + Res: &types.SearchDatastore_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(ctx *Context, s *types.SearchDatastoreSubFolders_Task) soap.HasFault { + task := NewTask(&searchDatastore{ + HostDatastoreBrowser: b, + DatastorePath: s.DatastorePath, + SearchSpec: s.SearchSpec, + recurse: true, + }) + + return &methods.SearchDatastoreSubFolders_TaskBody{ + Res: &types.SearchDatastoreSubFolders_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go new file mode 100644 index 000000000..f7657417a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go @@ -0,0 +1,225 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "os" + "path" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostDatastoreSystem struct { + mo.HostDatastoreSystem + + Host *mo.HostSystem +} + +var defaultDatastoreCapability = types.DatastoreCapability{ + DirectoryHierarchySupported: true, + RawDiskMappingsSupported: false, + PerFileThinProvisioningSupported: true, + StorageIORMSupported: types.NewBool(false), + NativeSnapshotSupported: types.NewBool(false), + SeSparseSupported: types.NewBool(false), + TopLevelDirectoryCreateSupported: types.NewBool(true), +} + +func (dss *HostDatastoreSystem) add(ctx *Context, ds *Datastore) *soap.Fault { + info := ds.Info.GetDatastoreInfo() + + info.Name = ds.Name + + if e := ctx.Map.FindByName(ds.Name, dss.Datastore); e != nil { + return Fault(e.Reference().Value, &types.DuplicateName{ + Name: ds.Name, + Object: e.Reference(), + }) + } + + fi, err := os.Stat(info.Url) + if err == nil && !fi.IsDir() { + err = os.ErrInvalid + } + + if err != nil { + switch { + case os.IsNotExist(err): + return Fault(err.Error(), &types.NotFound{}) + default: + return Fault(err.Error(), &types.HostConfigFault{}) + } + } + + folder := ctx.Map.getEntityFolder(dss.Host, "datastore") + + found := false + if e := ctx.Map.FindByName(ds.Name, folder.ChildEntity); e != nil { + if e.Reference().Type != "Datastore" { + return Fault(e.Reference().Value, &types.DuplicateName{ + Name: ds.Name, + Object: e.Reference(), + }) + } + + // if datastore already exists, use current reference + found = true + ds = e.(*Datastore) + } else { + ds.Summary.Datastore = &ds.Self + ds.Summary.Name = ds.Name + ds.Summary.Url = info.Url + + // put datastore to folder and generate reference + folderPutChild(ctx, folder, ds) + } + + ds.Host = append(ds.Host, types.DatastoreHostMount{ + Key: dss.Host.Reference(), + MountInfo: types.HostMountInfo{ + AccessMode: string(types.HostMountModeReadWrite), + Mounted: types.NewBool(true), + Accessible: types.NewBool(true), + }, + }) + + _ = ds.RefreshDatastore(ctx, &types.RefreshDatastore{This: ds.Self}) + + dss.Datastore = append(dss.Datastore, ds.Self) + dss.Host.Datastore = dss.Datastore + parent := hostParent(ctx, dss.Host) + ctx.Map.AddReference(ctx, parent, &parent.Datastore, ds.Self) + + // NOTE: browser must be created after ds is appended to dss.Datastore + if !found { + browser := &HostDatastoreBrowser{} + browser.Datastore = dss.Datastore + ds.Browser = ctx.Map.Put(browser).Reference() + } + + return nil +} + +func (dss *HostDatastoreSystem) CreateLocalDatastore(ctx *Context, c *types.CreateLocalDatastore) soap.HasFault { + r := &methods.CreateLocalDatastoreBody{} + + ds := &Datastore{} + ds.Name = c.Name + + ds.Info = &types.LocalDatastoreInfo{ + DatastoreInfo: types.DatastoreInfo{ + Name: c.Name, + Url: c.Path, + }, + Path: c.Path, + } + + ds.Summary.Type = string(types.HostFileSystemVolumeFileSystemTypeOTHER) + ds.Summary.MaintenanceMode = string(types.DatastoreSummaryMaintenanceModeStateNormal) + ds.Summary.Accessible = true + ds.Capability = defaultDatastoreCapability + + if err := dss.add(ctx, ds); err != nil { + r.Fault_ = err + return r + } + + r.Res = &types.CreateLocalDatastoreResponse{ + Returnval: ds.Self, + } + + return r +} + +func (dss *HostDatastoreSystem) CreateNasDatastore(ctx *Context, c *types.CreateNasDatastore) soap.HasFault { + r := &methods.CreateNasDatastoreBody{} + + // validate RemoteHost and RemotePath are specified + if c.Spec.RemoteHost == "" { + r.Fault_ = Fault( + "A specified parameter was not correct: Spec.RemoteHost", + &types.InvalidArgument{InvalidProperty: "RemoteHost"}, + ) + return r + } + if c.Spec.RemotePath == "" { + r.Fault_ = Fault( + "A specified parameter was not correct: Spec.RemotePath", + &types.InvalidArgument{InvalidProperty: "RemotePath"}, + ) + return r + } + + ds := &Datastore{} + ds.Name = path.Base(c.Spec.LocalPath) + + ds.Info = &types.NasDatastoreInfo{ + DatastoreInfo: types.DatastoreInfo{ + Url: c.Spec.LocalPath, + }, + Nas: &types.HostNasVolume{ + HostFileSystemVolume: types.HostFileSystemVolume{ + Name: c.Spec.LocalPath, + Type: c.Spec.Type, + }, + RemoteHost: c.Spec.RemoteHost, + RemotePath: c.Spec.RemotePath, + }, + } + + ds.Summary.Type = c.Spec.Type + ds.Summary.MaintenanceMode = string(types.DatastoreSummaryMaintenanceModeStateNormal) + ds.Summary.Accessible = true + ds.Capability = defaultDatastoreCapability + + if err := dss.add(ctx, ds); err != nil { + r.Fault_ = err + return r + } + + r.Res = &types.CreateNasDatastoreResponse{ + Returnval: ds.Self, + } + + return r +} + +func (dss *HostDatastoreSystem) createVsanDatastore(ctx *Context) types.BaseMethodFault { + ds := &Datastore{} + ds.Name = "vsanDatastore" + + home := ctx.Map.OptionManager().find("vcsim.home").Value + dc := ctx.Map.getEntityDatacenter(dss.Host) + url := fmt.Sprintf("%s/%s-%s", home, dc.Name, ds.Name) + if err := os.MkdirAll(url, 0700); err != nil { + return ctx.Map.FileManager().fault(url, err, new(types.CannotAccessFile)) + } + + ds.Info = &types.VsanDatastoreInfo{ + DatastoreInfo: types.DatastoreInfo{ + Name: ds.Name, + Url: url, + }, + MembershipUuid: uuid.NewString(), + } + + ds.Summary.Type = string(types.HostFileSystemVolumeFileSystemTypeVsan) + ds.Summary.MaintenanceMode = string(types.DatastoreSummaryMaintenanceModeStateNormal) + ds.Summary.Accessible = true + ds.Capability = defaultDatastoreCapability + ds.Capability.TopLevelDirectoryCreateSupported = types.NewBool(false) + + if err := dss.add(ctx, ds); err != nil { + return err.Detail.Fault.(types.BaseMethodFault) + } + + return nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go new file mode 100644 index 000000000..04e180803 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go @@ -0,0 +1,75 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostFirewallSystem struct { + mo.HostFirewallSystem +} + +func NewHostFirewallSystem(_ *mo.HostSystem) *HostFirewallSystem { + info := esx.HostFirewallInfo + + return &HostFirewallSystem{ + HostFirewallSystem: mo.HostFirewallSystem{ + FirewallInfo: &info, + }, + } +} + +func DisableRuleset(info *types.HostFirewallInfo, id string) bool { + for i := range info.Ruleset { + if info.Ruleset[i].Key == id { + info.Ruleset[i].Enabled = false + return true + } + } + + return false +} + +func (s *HostFirewallSystem) DisableRuleset(req *types.DisableRuleset) soap.HasFault { + body := &methods.DisableRulesetBody{} + + if DisableRuleset(s.HostFirewallSystem.FirewallInfo, req.Id) { + body.Res = new(types.DisableRulesetResponse) + return body + } + + body.Fault_ = Fault("", &types.NotFound{}) + + return body +} + +func EnableRuleset(info *types.HostFirewallInfo, id string) bool { + for i := range info.Ruleset { + if info.Ruleset[i].Key == id { + info.Ruleset[i].Enabled = true + return true + } + } + + return false +} + +func (s *HostFirewallSystem) EnableRuleset(req *types.EnableRuleset) soap.HasFault { + body := &methods.EnableRulesetBody{} + + if EnableRuleset(s.HostFirewallSystem.FirewallInfo, req.Id) { + body.Res = new(types.EnableRulesetResponse) + return body + } + + body.Fault_ = Fault("", &types.NotFound{}) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go new file mode 100644 index 000000000..6733b1bbd --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go @@ -0,0 +1,60 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// As of vSphere API 5.1, local groups operations are deprecated, so it's not supported here. + +type HostLocalAccountManager struct { + mo.HostLocalAccountManager +} + +func (h *HostLocalAccountManager) CreateUser(ctx *Context, req *types.CreateUser) soap.HasFault { + spec := req.User.GetHostAccountSpec() + userDirectory := ctx.Map.UserDirectory() + + found := userDirectory.search(true, false, compareFunc(spec.Id, true)) + if len(found) > 0 { + return &methods.CreateUserBody{ + Fault_: Fault("", &types.AlreadyExists{}), + } + } + + userDirectory.addUser(spec.Id) + + return &methods.CreateUserBody{ + Res: &types.CreateUserResponse{}, + } +} + +func (h *HostLocalAccountManager) RemoveUser(ctx *Context, req *types.RemoveUser) soap.HasFault { + userDirectory := ctx.Map.UserDirectory() + + found := userDirectory.search(true, false, compareFunc(req.UserName, true)) + + if len(found) == 0 { + return &methods.RemoveUserBody{ + Fault_: Fault("", &types.UserNotFound{}), + } + } + + userDirectory.removeUser(req.UserName) + + return &methods.RemoveUserBody{ + Res: &types.RemoveUserResponse{}, + } +} + +func (h *HostLocalAccountManager) UpdateUser(req *types.UpdateUser) soap.HasFault { + return &methods.CreateUserBody{ + Res: &types.CreateUserResponse{}, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_network_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_network_system.go new file mode 100644 index 000000000..ffb2e9ef6 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_network_system.go @@ -0,0 +1,200 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostNetworkSystem struct { + mo.HostNetworkSystem + + Host *mo.HostSystem + + types.QueryNetworkHintResponse +} + +func NewHostNetworkSystem(host *mo.HostSystem) *HostNetworkSystem { + return &HostNetworkSystem{ + Host: host, + HostNetworkSystem: mo.HostNetworkSystem{ + NetworkInfo: &types.HostNetworkInfo{ + Vswitch: []types.HostVirtualSwitch{ + { + Name: "vSwitch0", + Portgroup: []string{"VM Network"}, + }, + }, + Portgroup: host.Config.Network.Portgroup, + }, + }, + } +} + +func (s *HostNetworkSystem) init(r *Registry) { + for _, obj := range r.objects { + if h, ok := obj.(*HostSystem); ok { + if h.ConfigManager.NetworkSystem.Value == s.Self.Value { + s.Host = &h.HostSystem + } + } + } +} + +func (s *HostNetworkSystem) folder(ctx *Context) *Folder { + f := ctx.Map.getEntityDatacenter(s.Host).NetworkFolder + return ctx.Map.Get(f).(*Folder) +} + +func (s *HostNetworkSystem) AddVirtualSwitch(c *types.AddVirtualSwitch) soap.HasFault { + r := &methods.AddVirtualSwitchBody{} + + for _, vswitch := range s.NetworkInfo.Vswitch { + if vswitch.Name == c.VswitchName { + r.Fault_ = Fault("", &types.AlreadyExists{Name: c.VswitchName}) + return r + } + } + + s.NetworkInfo.Vswitch = append(s.NetworkInfo.Vswitch, types.HostVirtualSwitch{ + Name: c.VswitchName, + }) + + r.Res = &types.AddVirtualSwitchResponse{} + + return r +} + +func (s *HostNetworkSystem) RemoveVirtualSwitch(c *types.RemoveVirtualSwitch) soap.HasFault { + r := &methods.RemoveVirtualSwitchBody{} + + vs := s.NetworkInfo.Vswitch + + for i, v := range vs { + if v.Name == c.VswitchName { + s.NetworkInfo.Vswitch = append(vs[:i], vs[i+1:]...) + r.Res = &types.RemoveVirtualSwitchResponse{} + return r + } + } + + r.Fault_ = Fault("", &types.NotFound{}) + + return r +} + +func (s *HostNetworkSystem) AddPortGroup(ctx *Context, c *types.AddPortGroup) soap.HasFault { + var vswitch *types.HostVirtualSwitch + + r := &methods.AddPortGroupBody{} + + if c.Portgrp.Name == "" { + r.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "name"}) + return r + } + + for i := range s.NetworkInfo.Vswitch { + if s.NetworkInfo.Vswitch[i].Name == c.Portgrp.VswitchName { + vswitch = &s.NetworkInfo.Vswitch[i] + break + } + } + + if vswitch == nil { + r.Fault_ = Fault("", &types.NotFound{}) + return r + } + + network := &mo.Network{} + network.Name = c.Portgrp.Name + network.Entity().Name = network.Name + + folder := s.folder(ctx) + + if obj := ctx.Map.FindByName(c.Portgrp.Name, folder.ChildEntity); obj != nil { + r.Fault_ = Fault("", &types.DuplicateName{ + Name: c.Portgrp.Name, + Object: obj.Reference(), + }) + + return r + } + + folderPutChild(ctx, &folder.Folder, network) + + vswitch.Portgroup = append(vswitch.Portgroup, c.Portgrp.Name) + + s.NetworkInfo.Portgroup = append(s.NetworkInfo.Portgroup, types.HostPortGroup{ + Key: "key-vim.host.PortGroup-" + c.Portgrp.Name, + Port: nil, + Spec: c.Portgrp, + }) + + r.Res = &types.AddPortGroupResponse{} + + return r +} + +func (s *HostNetworkSystem) RemovePortGroup(ctx *Context, c *types.RemovePortGroup) soap.HasFault { + var vswitch *types.HostVirtualSwitch + + r := &methods.RemovePortGroupBody{} + + for i, v := range s.NetworkInfo.Vswitch { + for j, pg := range v.Portgroup { + if pg == c.PgName { + vswitch = &s.NetworkInfo.Vswitch[i] + vswitch.Portgroup = append(vswitch.Portgroup[:j], vswitch.Portgroup[j+1:]...) + } + } + } + + if vswitch == nil { + r.Fault_ = Fault("", &types.NotFound{}) + return r + } + + folder := s.folder(ctx) + e := ctx.Map.FindByName(c.PgName, folder.ChildEntity) + folderRemoveChild(ctx, &folder.Folder, e.Reference()) + + for i, pg := range s.NetworkInfo.Portgroup { + if pg.Spec.Name == c.PgName { + var portgroup = s.NetworkInfo.Portgroup + s.NetworkInfo.Portgroup = append(portgroup[:i], portgroup[i+1:]...) + } + } + + r.Res = &types.RemovePortGroupResponse{} + + return r +} + +func (s *HostNetworkSystem) UpdateNetworkConfig(req *types.UpdateNetworkConfig) soap.HasFault { + s.NetworkConfig = &req.Config + + return &methods.UpdateNetworkConfigBody{ + Res: &types.UpdateNetworkConfigResponse{ + Returnval: types.HostNetworkConfigResult{}, + }, + } +} + +func (s *HostNetworkSystem) QueryNetworkHint(req *types.QueryNetworkHint) soap.HasFault { + if s.Host.Runtime.ConnectionState != types.HostSystemConnectionStateConnected { + return &methods.QueryNetworkHintBody{ + Fault_: Fault("", &types.HostNotConnected{}), + } + } + + return &methods.QueryNetworkHintBody{ + Res: &types.QueryNetworkHintResponse{ + Returnval: s.QueryNetworkHintResponse.Returnval, + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go new file mode 100644 index 000000000..8a1ccf875 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go @@ -0,0 +1,122 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostStorageSystem struct { + mo.HostStorageSystem + + Host *mo.HostSystem + HBA []types.BaseHostHostBusAdapter +} + +func NewHostStorageSystem(h *mo.HostSystem) *HostStorageSystem { + s := &HostStorageSystem{Host: h} + + s.StorageDeviceInfo = &esx.HostStorageDeviceInfo + + s.HBA = fibreChannelHBA + + return s +} + +// RescanAllHba swaps HostStorageSystem.HBA and StorageDeviceInfo.HostBusAdapter. +// This allows testing HBA with and without Fibre Channel data. +func (s *HostStorageSystem) RescanAllHba(ctx *Context, _ *types.RescanAllHba) soap.HasFault { + hba := s.StorageDeviceInfo.HostBusAdapter + s.StorageDeviceInfo.HostBusAdapter = s.HBA + s.HBA = hba + + ctx.WithLock(s.Host, func() { + s.Host.Config.StorageDevice.HostBusAdapter = s.StorageDeviceInfo.HostBusAdapter + }) + + return &methods.RescanAllHbaBody{ + Res: new(types.RescanAllHbaResponse), + } +} + +func (s *HostStorageSystem) RescanVmfs(*Context, *types.RescanVmfs) soap.HasFault { + return &methods.RescanVmfsBody{Res: new(types.RescanVmfsResponse)} +} + +func (s *HostStorageSystem) RefreshStorageSystem(*Context, *types.RefreshStorageSystem) soap.HasFault { + return &methods.RefreshStorageSystemBody{Res: new(types.RefreshStorageSystemResponse)} +} + +// HBA with FibreChannel data, see RescanAllHba() +var fibreChannelHBA = []types.BaseHostHostBusAdapter{ + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba0", + Device: "vmhba0", + Bus: 0, + Status: "unknown", + Model: "Lewisburg SATA AHCI Controller", + Driver: "vmw_ahci", + Pci: "0000:00:11.5", + }, + }, + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba1", + Device: "vmhba1", + Bus: 0, + Status: "unknown", + Model: "Lewisburg SATA AHCI Controller", + Driver: "vmw_ahci", + Pci: "0000:00:17.0", + }, + }, + &types.HostFibreChannelHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.FibreChannelHba-vmhba2", + Device: "vmhba2", + Bus: 59, + Status: "online", + Model: "Emulex LightPulse LPe32000 PCIe Fibre Channel Adapter", + Driver: "lpfc", + Pci: "0000:3b:00.0", + }, + PortWorldWideName: 1152922127287604726, + NodeWorldWideName: 2305843631894451702, + PortType: "unknown", + Speed: 16, + }, + &types.HostFibreChannelHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.FibreChannelHba-vmhba3", + Device: "vmhba3", + Bus: 95, + Status: "online", + Model: "Emulex LightPulse LPe32000 PCIe Fibre Channel Adapter", + Driver: "lpfc", + Pci: "0000:5f:00.0", + }, + PortWorldWideName: 1152922127287604554, + NodeWorldWideName: 2305843631894451530, + PortType: "unknown", + Speed: 16, + }, + &types.HostSerialAttachedHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.SerialAttachedHba-vmhba4", + Device: "vmhba4", + Bus: 24, + Status: "unknown", + Model: "PERC H330 Adapter", + Driver: "lsi_mr3", + Pci: "0000:18:00.0", + }, + NodeWorldWideName: "5d0946606e78ac00", + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_system.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_system.go new file mode 100644 index 000000000..36f1895d9 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_system.go @@ -0,0 +1,598 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "net" + "os" + "sync" + "time" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var ( + hostPortUnique = os.Getenv("VCSIM_HOST_PORT_UNIQUE") == "true" + + globalLock sync.Mutex + // globalHostCount is used to construct unique hostnames. Should be consumed under globalLock. + globalHostCount = 0 +) + +type HostSystem struct { + mo.HostSystem + + sh *simHost + mme *ManagedMethodExecuter + dtm *DynamicTypeManager + + types.QueryTpmAttestationReportResponse +} + +func asHostSystemMO(obj mo.Reference) (*mo.HostSystem, bool) { + h, ok := getManagedObject(obj).Addr().Interface().(*mo.HostSystem) + return h, ok +} + +func NewHostSystem(ctx *Context, host mo.HostSystem) *HostSystem { + if hostPortUnique { // configure unique port for each host + port := &esx.HostSystem.Summary.Config.Port + *port++ + host.Summary.Config.Port = *port + } + + now := time.Now() + + hs := &HostSystem{ + HostSystem: host, + } + + hs.Name = hs.Summary.Config.Name + hs.Summary.Runtime = &hs.Runtime + hs.Summary.Runtime.BootTime = &now + + // shallow copy Summary.Hardware, as each host will be assigned its own .Uuid + hardware := *host.Summary.Hardware + hs.Summary.Hardware = &hardware + + if hs.Hardware == nil { + // shallow copy Hardware, as each host will be assigned its own .Uuid + info := *esx.HostHardwareInfo + hs.Hardware = &info + } + if hs.Capability == nil { + capability := *esx.HostCapability + hs.Capability = &capability + } + + cfg := new(types.HostConfigInfo) + deepCopy(hs.Config, cfg) + hs.Config = cfg + + // copy over the reference advanced options so each host can have it's own, allowing hosts to be configured for + // container backing individually + deepCopy(esx.AdvancedOptions, &cfg.Option) + + // add a supported option to the AdvancedOption manager + simOption := types.OptionDef{ElementDescription: types.ElementDescription{Key: advOptContainerBackingImage}} + // TODO: how do we enter patterns here? Or should we stick to a list in the value? + // patterns become necessary if we want to enforce correctness on options for RUN.underlay. or allow RUN.port.xxx + hs.Config.OptionDef = append(hs.Config.OptionDef, simOption) + + config := []struct { + ref **types.ManagedObjectReference + obj mo.Reference + }{ + {&hs.ConfigManager.DatastoreSystem, &HostDatastoreSystem{Host: &hs.HostSystem}}, + {&hs.ConfigManager.NetworkSystem, NewHostNetworkSystem(&hs.HostSystem)}, + {&hs.ConfigManager.VirtualNicManager, NewHostVirtualNicManager(&hs.HostSystem)}, + {&hs.ConfigManager.AdvancedOption, NewOptionManager(nil, nil, &hs.Config.Option)}, + {&hs.ConfigManager.FirewallSystem, NewHostFirewallSystem(&hs.HostSystem)}, + {&hs.ConfigManager.StorageSystem, NewHostStorageSystem(&hs.HostSystem)}, + {&hs.ConfigManager.CertificateManager, NewHostCertificateManager(ctx, &hs.HostSystem)}, + } + + for _, c := range config { + ref := ctx.Map.Put(c.obj).Reference() + + *c.ref = &ref + } + + return hs +} + +func (h *HostSystem) configure(ctx *Context, spec types.HostConnectSpec, connected bool) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + if connected { + h.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + } + + // lets us construct non-conflicting hostname automatically if omitted + // does not use the unique port instead to avoid constraints on port, such as >1024 + + globalLock.Lock() + instanceID := globalHostCount + globalHostCount++ + globalLock.Unlock() + + if spec.HostName == "" { + spec.HostName = fmt.Sprintf("esx-%d", instanceID) + } else if net.ParseIP(spec.HostName) != nil { + h.Config.Network.Vnic[0].Spec.Ip.IpAddress = spec.HostName + } + + h.Summary.Config.Name = spec.HostName + h.Name = h.Summary.Config.Name + id := newUUID(h.Name) + h.Summary.Hardware.Uuid = id + h.Hardware.SystemInfo.Uuid = id + + var err error + h.sh, err = createSimulationHost(ctx, h) + if err != nil { + panic("failed to create simulation host and no path to return error: " + err.Error()) + } +} + +// configureContainerBacking sets up _this_ host for simulation using a container backing. +// Args: +// +// image - the container image with which to simulate the host +// mounts - array of mount info that should be translated into /vmfs/volumes/... mounts backed by container volumes +// networks - names of bridges to use for underlays. Will create a pNIC for each. The first will be treated as the management network. +// +// Restrictions adopted from createSimulationHost: +// * no mock of VLAN connectivity +// * only a single vmknic, used for "the management IP" +// * pNIC connectivity does not directly impact VMs/vmks using it as uplink +// +// The pnics will be named using standard pattern, ie. vmnic0, vmnic1, ... +// This will sanity check the NetConfig for "management" nicType to ensure that it maps through PortGroup->vSwitch->pNIC to vmnic0. +func (h *HostSystem) configureContainerBacking(ctx *Context, image string, mounts []types.HostFileSystemMountInfo, networks ...string) error { + option := &types.OptionValue{ + Key: advOptContainerBackingImage, + Value: image, + } + + advOpts := ctx.Map.Get(h.ConfigManager.AdvancedOption.Reference()).(*OptionManager) + fault := advOpts.UpdateOptions(&types.UpdateOptions{ChangedValue: []types.BaseOptionValue{option}}).Fault() + if fault != nil { + panic(fault) + } + + h.Config.FileSystemVolume = nil + if mounts != nil { + h.Config.FileSystemVolume = &types.HostFileSystemVolumeInfo{ + VolumeTypeList: []string{"VMFS", "OTHER"}, + MountInfo: mounts, + } + } + + // force at least a management network + if len(networks) == 0 { + networks = []string{defaultUnderlayBridgeName} + } + + // purge pNICs from the template - it makes no sense to keep them for a sim host + h.Config.Network.Pnic = make([]types.PhysicalNic, len(networks)) + + // purge any IPs and MACs associated with existing NetConfigs for the host + for cfgIdx := range h.Config.VirtualNicManagerInfo.NetConfig { + config := &h.Config.VirtualNicManagerInfo.NetConfig[cfgIdx] + for candidateIdx := range config.CandidateVnic { + candidate := &config.CandidateVnic[candidateIdx] + candidate.Spec.Ip.IpAddress = "0.0.0.0" + candidate.Spec.Ip.SubnetMask = "0.0.0.0" + candidate.Spec.Mac = "00:00:00:00:00:00" + } + } + + // The presence of a pNIC is used to indicate connectivity to a specific underlay. We construct an empty pNIC entry and specify the underly via + // host.ConfigManager.AdvancedOptions. The pNIC will be populated with the MAC (accurate) and IP (divergence - we need to stash it somewhere) for the veth. + // We create a NetConfig "management" entry for the first pNIC - this will be populated with the IP of the "host" container. + + // create a pNIC for each underlay + for i, net := range networks { + name := fmt.Sprintf("vmnic%d", i) + + // we don't have a natural field for annotating which pNIC is connected to which network, so stash it in an adv option. + option := &types.OptionValue{ + Key: advOptPrefixPnicToUnderlayPrefix + name, + Value: net, + } + fault = advOpts.UpdateOptions(&types.UpdateOptions{ChangedValue: []types.BaseOptionValue{option}}).Fault() + if fault != nil { + panic(fault) + } + + h.Config.Network.Pnic[i] = types.PhysicalNic{ + Key: "key-vim.host.PhysicalNic-" + name, + Device: name, + Pci: fmt.Sprintf("0000:%2d:00.0", i+1), + Driver: "vcsim-bridge", + DriverVersion: "1.2.10.0", + FirmwareVersion: "1.57, 0x80000185", + LinkSpeed: &types.PhysicalNicLinkInfo{ + SpeedMb: 10000, + Duplex: true, + }, + ValidLinkSpecification: []types.PhysicalNicLinkInfo{ + { + SpeedMb: 10000, + Duplex: true, + }, + }, + Spec: types.PhysicalNicSpec{ + Ip: &types.HostIpConfig{}, + LinkSpeed: (*types.PhysicalNicLinkInfo)(nil), + EnableEnhancedNetworkingStack: types.NewBool(false), + EnsInterruptEnabled: types.NewBool(false), + }, + WakeOnLanSupported: false, + Mac: "00:00:00:00:00:00", + FcoeConfiguration: &types.FcoeConfig{ + PriorityClass: 3, + SourceMac: "00:00:00:00:00:00", + VlanRange: []types.FcoeConfigVlanRange{ + {}, + }, + Capabilities: types.FcoeConfigFcoeCapabilities{}, + FcoeActive: false, + }, + VmDirectPathGen2Supported: types.NewBool(false), + VmDirectPathGen2SupportedMode: "", + ResourcePoolSchedulerAllowed: types.NewBool(false), + ResourcePoolSchedulerDisallowedReason: nil, + AutoNegotiateSupported: types.NewBool(true), + EnhancedNetworkingStackSupported: types.NewBool(false), + EnsInterruptSupported: types.NewBool(false), + RdmaDevice: "", + DpuId: "", + } + } + + // sanity check that everything's hung together sufficiently well + details, err := h.getNetConfigInterface(ctx, "management") + if err != nil { + return err + } + + if details.uplink == nil || details.uplink.Device != "vmnic0" { + return fmt.Errorf("Config provided for host %s does not result in a consistent 'management' NetConfig that's bound to 'vmnic0'", h.Name) + } + + return nil +} + +// netConfigDetails is used to packaged up all the related network entities associated with a NetConfig binding +type netConfigDetails struct { + nicType string + netconfig *types.VirtualNicManagerNetConfig + vmk *types.HostVirtualNic + netstack *types.HostNetStackInstance + portgroup *types.HostPortGroup + vswitch *types.HostVirtualSwitch + uplink *types.PhysicalNic +} + +// getNetConfigInterface returns the set of constructs active for a given nicType (eg. "management", "vmotion") +// This method is provided because the Config structure held by HostSystem is heavily interconnected but serialized and not cross-linked with pointers. +// As such there's a _lot_ of cross-referencing that needs to be done to navigate. +// The pNIC returned is the uplink associated with the vSwitch for the netconfig +func (h *HostSystem) getNetConfigInterface(ctx *Context, nicType string) (*netConfigDetails, error) { + details := &netConfigDetails{ + nicType: nicType, + } + + for i := range h.Config.VirtualNicManagerInfo.NetConfig { + if h.Config.VirtualNicManagerInfo.NetConfig[i].NicType == nicType { + details.netconfig = &h.Config.VirtualNicManagerInfo.NetConfig[i] + break + } + } + if details.netconfig == nil { + return nil, fmt.Errorf("no matching NetConfig for NicType=%s", nicType) + } + + if details.netconfig.SelectedVnic == nil { + return details, nil + } + + vnicKey := details.netconfig.SelectedVnic[0] + for i := range details.netconfig.CandidateVnic { + if details.netconfig.CandidateVnic[i].Key == vnicKey { + details.vmk = &details.netconfig.CandidateVnic[i] + break + } + } + if details.vmk == nil { + panic(fmt.Sprintf("NetConfig for host %s references non-existant vNIC key %s for %s nicType", h.Name, vnicKey, nicType)) + } + + portgroupName := details.vmk.Portgroup + netstackKey := details.vmk.Spec.NetStackInstanceKey + + for i := range h.Config.Network.NetStackInstance { + if h.Config.Network.NetStackInstance[i].Key == netstackKey { + details.netstack = &h.Config.Network.NetStackInstance[i] + break + } + } + if details.netstack == nil { + panic(fmt.Sprintf("NetConfig for host %s references non-existant NetStack key %s for %s nicType", h.Name, netstackKey, nicType)) + } + + for i := range h.Config.Network.Portgroup { + // TODO: confirm correctness of this - seems weird it references the Spec.Name instead of the key like everything else. + if h.Config.Network.Portgroup[i].Spec.Name == portgroupName { + details.portgroup = &h.Config.Network.Portgroup[i] + break + } + } + if details.portgroup == nil { + panic(fmt.Sprintf("NetConfig for host %s references non-existant PortGroup name %s for %s nicType", h.Name, portgroupName, nicType)) + } + + vswitchKey := details.portgroup.Vswitch + for i := range h.Config.Network.Vswitch { + if h.Config.Network.Vswitch[i].Key == vswitchKey { + details.vswitch = &h.Config.Network.Vswitch[i] + break + } + } + if details.vswitch == nil { + panic(fmt.Sprintf("NetConfig for host %s references non-existant vSwitch key %s for %s nicType", h.Name, vswitchKey, nicType)) + } + + if len(details.vswitch.Pnic) != 1 { + // to change this, look at the Active NIC in the NicTeamingPolicy, but for now not worth it + panic(fmt.Sprintf("vSwitch %s for host %s has multiple pNICs associated which is not supported.", vswitchKey, h.Name)) + } + + pnicKey := details.vswitch.Pnic[0] + for i := range h.Config.Network.Pnic { + if h.Config.Network.Pnic[i].Key == pnicKey { + details.uplink = &h.Config.Network.Pnic[i] + break + } + } + if details.uplink == nil { + panic(fmt.Sprintf("NetConfig for host %s references non-existant pNIC key %s for %s nicType", h.Name, pnicKey, nicType)) + } + + return details, nil +} + +func (h *HostSystem) event(ctx *Context) types.HostEvent { + return types.HostEvent{ + Event: types.Event{ + Datacenter: datacenterEventArgument(ctx, h), + ComputeResource: h.eventArgumentParent(ctx), + Host: h.eventArgument(), + }, + } +} + +func (h *HostSystem) eventArgument() *types.HostEventArgument { + return &types.HostEventArgument{ + Host: h.Self, + EntityEventArgument: types.EntityEventArgument{Name: h.Name}, + } +} + +func (h *HostSystem) eventArgumentParent(ctx *Context) *types.ComputeResourceEventArgument { + parent := hostParent(ctx, &h.HostSystem) + + return &types.ComputeResourceEventArgument{ + ComputeResource: parent.Self, + EntityEventArgument: types.EntityEventArgument{Name: parent.Name}, + } +} + +func hostParent(ctx *Context, host *mo.HostSystem) *mo.ComputeResource { + switch parent := ctx.Map.Get(*host.Parent).(type) { + case *mo.ComputeResource: + return parent + case *ClusterComputeResource: + return &parent.ComputeResource + default: + return nil + } +} + +func addComputeResource(s *types.ComputeResourceSummary, h *HostSystem) { + s.TotalCpu += h.Summary.Hardware.CpuMhz + s.TotalMemory += h.Summary.Hardware.MemorySize + s.NumCpuCores += h.Summary.Hardware.NumCpuCores + s.NumCpuThreads += h.Summary.Hardware.NumCpuThreads + s.EffectiveCpu += h.Summary.Hardware.CpuMhz + s.EffectiveMemory += h.Summary.Hardware.MemorySize + s.NumHosts++ + s.NumEffectiveHosts++ + s.OverallStatus = types.ManagedEntityStatusGreen +} + +// CreateDefaultESX creates a standalone ESX +// Adds objects of type: Datacenter, Network, ComputeResource, ResourcePool and HostSystem +func CreateDefaultESX(ctx *Context, f *Folder) { + dc := NewDatacenter(ctx, &f.Folder) + + host := NewHostSystem(ctx, esx.HostSystem) + + summary := new(types.ComputeResourceSummary) + addComputeResource(summary, host) + + cr := &mo.ComputeResource{ + Summary: summary, + Network: esx.Datacenter.Network, + } + cr.Self = *host.Parent + cr.Name = host.Name + cr.Host = append(cr.Host, host.Reference()) + host.Network = cr.Network + ctx.Map.PutEntity(cr, host) + cr.EnvironmentBrowser = newEnvironmentBrowser(ctx, host.Reference()) + + pool := NewResourcePool(ctx) + cr.ResourcePool = &pool.Self + ctx.Map.PutEntity(cr, pool) + pool.Owner = cr.Self + + folderPutChild(ctx, &ctx.Map.Get(dc.HostFolder).(*Folder).Folder, cr) +} + +// CreateStandaloneHost uses esx.HostSystem as a template, applying the given spec +// and creating the ComputeResource parent and ResourcePool sibling. +func CreateStandaloneHost(ctx *Context, f *Folder, spec types.HostConnectSpec) (*HostSystem, types.BaseMethodFault) { + if spec.HostName == "" { + return nil, &types.NoHost{} + } + + template := esx.HostSystem + network := ctx.Map.getEntityDatacenter(f).defaultNetwork() + + if p := ctx.Map.FindByName(spec.UserName, f.ChildEntity); p != nil { + cr := p.(*mo.ComputeResource) + h := ctx.Map.Get(cr.Host[0]) + // "clone" an existing host from the inventory + template = h.(*HostSystem).HostSystem + template.Vm = nil + network = cr.Network + } + + pool := NewResourcePool(ctx) + host := NewHostSystem(ctx, template) + host.configure(ctx, spec, false) + + summary := new(types.ComputeResourceSummary) + addComputeResource(summary, host) + + cr := &mo.ComputeResource{ + ConfigurationEx: &types.ComputeResourceConfigInfo{ + VmSwapPlacement: string(types.VirtualMachineConfigInfoSwapPlacementTypeVmDirectory), + }, + Summary: summary, + } + + ctx.Map.PutEntity(cr, ctx.Map.NewEntity(host)) + cr.EnvironmentBrowser = newEnvironmentBrowser(ctx, host.Reference()) + + host.Summary.Host = &host.Self + host.Config.Host = host.Self + + ctx.Map.PutEntity(cr, ctx.Map.NewEntity(pool)) + + cr.Name = host.Name + cr.Network = network + cr.Host = append(cr.Host, host.Reference()) + cr.ResourcePool = &pool.Self + + folderPutChild(ctx, &f.Folder, cr) + pool.Owner = cr.Self + host.Network = cr.Network + + return host, nil +} + +func (h *HostSystem) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(h, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if len(h.Vm) > 0 { + return nil, &types.ResourceInUse{} + } + + ctx.postEvent(&types.HostRemovedEvent{HostEvent: h.event(ctx)}) + + f := ctx.Map.getEntityParent(h, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, h.Reference()) + err := h.sh.remove(ctx) + + if err != nil { + return nil, &types.RuntimeFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{Reason: err.Error()}, + LocalizedMessage: err.Error()}}} + } + + // TODO: should there be events on lifecycle operations as with VMs? + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) EnterMaintenanceModeTask(ctx *Context, spec *types.EnterMaintenanceMode_Task) soap.HasFault { + task := CreateTask(h, "enterMaintenanceMode", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.InMaintenanceMode = true + return nil, nil + }) + + return &methods.EnterMaintenanceMode_TaskBody{ + Res: &types.EnterMaintenanceMode_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) ExitMaintenanceModeTask(ctx *Context, spec *types.ExitMaintenanceMode_Task) soap.HasFault { + task := CreateTask(h, "exitMaintenanceMode", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.InMaintenanceMode = false + return nil, nil + }) + + return &methods.ExitMaintenanceMode_TaskBody{ + Res: &types.ExitMaintenanceMode_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) DisconnectHostTask(ctx *Context, spec *types.DisconnectHost_Task) soap.HasFault { + task := CreateTask(h, "disconnectHost", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + return nil, nil + }) + + return &methods.DisconnectHost_TaskBody{ + Res: &types.DisconnectHost_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) ReconnectHostTask(ctx *Context, spec *types.ReconnectHost_Task) soap.HasFault { + task := CreateTask(h, "reconnectHost", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + return nil, nil + }) + + return &methods.ReconnectHost_TaskBody{ + Res: &types.ReconnectHost_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (s *HostSystem) QueryTpmAttestationReport(ctx *Context, req *types.QueryTpmAttestationReport) soap.HasFault { + body := new(methods.QueryTpmAttestationReportBody) + + if ctx.Map.IsVPX() { + body.Res = &s.QueryTpmAttestationReportResponse + } else { + body.Fault_ = Fault("", new(types.NotSupported)) + } + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/host_vnic_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_vnic_manager.go new file mode 100644 index 000000000..d382ae46a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/host_vnic_manager.go @@ -0,0 +1,47 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostVirtualNicManager struct { + mo.HostVirtualNicManager + + Host *mo.HostSystem +} + +func NewHostVirtualNicManager(host *mo.HostSystem) *HostVirtualNicManager { + return &HostVirtualNicManager{ + Host: host, + HostVirtualNicManager: mo.HostVirtualNicManager{ + Info: types.HostVirtualNicManagerInfo{ + NetConfig: esx.VirtualNicManagerNetConfig, + }, + }, + } +} + +func (m *HostVirtualNicManager) QueryNetConfig(req *types.QueryNetConfig) soap.HasFault { + body := new(methods.QueryNetConfigBody) + + for _, c := range m.Info.NetConfig { + if c.NicType == req.NicType { + body.Res = &types.QueryNetConfigResponse{ + Returnval: &c, + } + return body + } + } + + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: req.NicType}) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go new file mode 100644 index 000000000..b9056c574 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go @@ -0,0 +1,205 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "crypto/sha1" + "encoding/hex" + "fmt" + "hash" + "io" + "log" + "net/http" + "net/url" + "os" + "strings" + "sync" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type metadata struct { + sha1 []byte + size int64 +} + +type HttpNfcLease struct { + mo.HttpNfcLease + files map[string]string + metadata map[string]metadata +} + +var ( + nfcLease sync.Map // HTTP access to NFC leases are token based and do not require Session auth + nfcPrefix = "/nfc/" +) + +// ServeNFC handles NFC file upload/download +func ServeNFC(w http.ResponseWriter, r *http.Request) { + p := strings.Split(r.URL.Path, "/") + id, name := p[len(p)-2], p[len(p)-1] + ref := types.ManagedObjectReference{Type: "HttpNfcLease", Value: id} + l, ok := nfcLease.Load(ref) + if !ok { + log.Printf("invalid NFC lease: %s", id) + http.NotFound(w, r) + return + } + lease := l.(*HttpNfcLease) + file, ok := lease.files[name] + if !ok { + log.Printf("invalid NFC device id: %s", name) + http.NotFound(w, r) + return + } + + status := http.StatusOK + var sum hash.Hash + var dst io.Writer = w + var src io.ReadCloser + + switch r.Method { + case http.MethodPut, http.MethodPost: + sum = sha1.New() + dst = sum + src = r.Body + case http.MethodGet: + f, err := os.Open(file) + if err != nil { + http.NotFound(w, r) + return + } + src = f + default: + status = http.StatusMethodNotAllowed + } + + n, err := io.Copy(dst, src) + _ = src.Close() + if sum != nil { + lease.metadata[name] = metadata{ + sha1: sum.Sum(nil), + size: n, + } + } + + msg := fmt.Sprintf("transferred %d bytes", n) + if err != nil { + status = http.StatusInternalServerError + msg = err.Error() + } + tracef("nfc %s %s: %s", r.Method, file, msg) + w.WriteHeader(status) +} + +func (l *HttpNfcLease) error(ctx *Context, err *types.LocalizedMethodFault) { + ctx.WithLock(l, func() { + ctx.Update(l, []types.PropertyChange{ + {Name: "state", Val: types.HttpNfcLeaseStateError}, + {Name: "error", Val: err}, + }) + }) +} + +func (l *HttpNfcLease) ready(ctx *Context, entity types.ManagedObjectReference, urls []types.HttpNfcLeaseDeviceUrl) { + info := &types.HttpNfcLeaseInfo{ + Lease: l.Self, + Entity: entity, + DeviceUrl: urls, + LeaseTimeout: 300, + } + + ctx.WithLock(l, func() { + ctx.Update(l, []types.PropertyChange{ + {Name: "state", Val: types.HttpNfcLeaseStateReady}, + {Name: "info", Val: info}, + }) + }) +} + +func newHttpNfcLease(ctx *Context) *HttpNfcLease { + lease := &HttpNfcLease{ + HttpNfcLease: mo.HttpNfcLease{ + State: types.HttpNfcLeaseStateInitializing, + }, + files: make(map[string]string), + metadata: make(map[string]metadata), + } + + ctx.Session.Put(lease) + nfcLease.Store(lease.Reference(), lease) + + return lease +} + +func leaseURL(ctx *Context) *url.URL { + opt := ctx.Map.OptionManager().find("vcsim.server.url") + + u, _ := url.Parse(opt.Value.(string)) + + // See NfcLease.DeviceUrl doc: + // If a "*" is returned the client must substitute "*" with the + // hostname or IP address used when connecting to the server. + // This is the case when connecting directly to an ESX host. + if ctx.Map.IsESX() { + u.Host = "*" + } + + return u +} + +func (l *HttpNfcLease) HttpNfcLeaseComplete(ctx *Context, req *types.HttpNfcLeaseComplete) soap.HasFault { + ctx.Session.Remove(ctx, req.This) + nfcLease.Delete(req.This) + + return &methods.HttpNfcLeaseCompleteBody{ + Res: new(types.HttpNfcLeaseCompleteResponse), + } +} + +func (l *HttpNfcLease) HttpNfcLeaseAbort(ctx *Context, req *types.HttpNfcLeaseAbort) soap.HasFault { + ctx.Session.Remove(ctx, req.This) + nfcLease.Delete(req.This) + + return &methods.HttpNfcLeaseAbortBody{ + Res: new(types.HttpNfcLeaseAbortResponse), + } +} + +func (l *HttpNfcLease) HttpNfcLeaseProgress(ctx *Context, req *types.HttpNfcLeaseProgress) soap.HasFault { + l.TransferProgress = req.Percent + + return &methods.HttpNfcLeaseProgressBody{ + Res: new(types.HttpNfcLeaseProgressResponse), + } +} + +func (l *HttpNfcLease) getDeviceKey(name string) string { + for _, devUrl := range l.Info.DeviceUrl { + if name == devUrl.TargetId { + return devUrl.Key + } + } + return "unknown" +} + +func (l *HttpNfcLease) HttpNfcLeaseGetManifest(ctx *Context, req *types.HttpNfcLeaseGetManifest) soap.HasFault { + entries := []types.HttpNfcLeaseManifestEntry{} + for name, md := range l.metadata { + entries = append(entries, types.HttpNfcLeaseManifestEntry{ + Key: l.getDeviceKey(name), + Sha1: hex.EncodeToString(md.sha1), + Size: md.size, + }) + } + return &methods.HttpNfcLeaseGetManifestBody{ + Res: &types.HttpNfcLeaseGetManifestResponse{ + Returnval: entries, + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go new file mode 100644 index 000000000..29fec5c46 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go @@ -0,0 +1,90 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package internal + +import ( + "fmt" + "sync" +) + +// SharedLockingContext is used to identify when locks can be shared. In +// practice, simulator code uses the simulator.Context for a request, but in +// principle this could be anything. +type SharedLockingContext any + +// ObjectLock implements a basic "reference-counted" mutex, where a single +// SharedLockingContext can "share" the lock across code paths or child tasks. +type ObjectLock struct { + lock sync.Locker + + stateLock sync.Mutex + heldBy SharedLockingContext + count int64 +} + +// NewObjectLock creates a new ObjectLock. Pass new(sync.Mutex) if you don't +// have a custom sync.Locker. +func NewObjectLock(lock sync.Locker) *ObjectLock { + return &ObjectLock{ + lock: lock, + } +} + +// try returns true if the lock has been acquired; false otherwise +func (l *ObjectLock) try(onBehalfOf SharedLockingContext) bool { + l.stateLock.Lock() + defer l.stateLock.Unlock() + + if l.heldBy == onBehalfOf { + l.count = l.count + 1 + return true + } + + if l.heldBy == nil { + // we expect no contention for this lock (unless the object has a custom Locker) + l.lock.Lock() + l.count = 1 + l.heldBy = onBehalfOf + return true + } + + return false +} + +// wait returns when there's a chance that try() might succeed. +// It is intended to be better than busy-waiting or sleeping. +func (l *ObjectLock) wait() { + l.lock.Lock() + l.lock.Unlock() +} + +// Release decrements the reference count. The caller should pass their +// context, which is used to sanity check that the Unlock() call is valid. If +// this is the last reference to the lock for this SharedLockingContext, the lock +// is Unlocked and can be acquired by another SharedLockingContext. +func (l *ObjectLock) Release(onBehalfOf SharedLockingContext) { + l.stateLock.Lock() + defer l.stateLock.Unlock() + if l.heldBy != onBehalfOf { + panic(fmt.Sprintf("Attempt to unlock on behalf of %#v, but is held by %#v", onBehalfOf, l.heldBy)) + } + l.count = l.count - 1 + if l.count == 0 { + l.heldBy = nil + l.lock.Unlock() + } +} + +// Acquire blocks until it can acquire the lock for onBehalfOf +func (l *ObjectLock) Acquire(onBehalfOf SharedLockingContext) { + acquired := false + for !acquired { + if l.try(onBehalfOf) { + return + } else { + l.wait() + } + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/server.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/server.go new file mode 100644 index 000000000..1e1183632 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/server.go @@ -0,0 +1,341 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package internal + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "log" + "net" + "net/http" + "strings" + "sync" + "time" +) + +// A Server is an HTTP server listening on a system-chosen port on the +// local loopback interface, for use in end-to-end HTTP tests. +type Server struct { + URL string // base URL of form http://ipaddr:port with no trailing slash + Listener net.Listener + + // TLS is the optional TLS configuration, populated with a new config + // after TLS is started. If set on an unstarted server before StartTLS + // is called, existing fields are copied into the new config. + TLS *tls.Config + + // Config may be changed after calling NewUnstartedServer and + // before Start or StartTLS. + Config *http.Server + + // certificate is a parsed version of the TLS config certificate, if present. + certificate *x509.Certificate + + // wg counts the number of outstanding HTTP requests on this server. + // Close blocks until all requests are finished. + wg sync.WaitGroup + + mu sync.Mutex // guards closed and conns + closed bool + conns map[net.Conn]http.ConnState // except terminal states + + // client is configured for use with the server. + // Its transport is automatically closed when Close is called. + client *http.Client +} + +func newLocalListener(serve string) net.Listener { + if serve != "" { + l, err := net.Listen("tcp", serve) + if err != nil { + panic(fmt.Sprintf("httptest: failed to listen on %v: %v", serve, err)) + } + return l + } + l, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + if l, err = net.Listen("tcp6", "[::1]:0"); err != nil { + panic(fmt.Sprintf("httptest: failed to listen on a port: %v", err)) + } + } + return l +} + +// NewServer starts and returns a new Server. +// The caller should call Close when finished, to shut it down. +func NewServer(handler http.Handler) *Server { + ts := NewUnstartedServer(handler, "") + ts.Start() + return ts +} + +// NewUnstartedServer returns a new Server but doesn't start it. +// +// After changing its configuration, the caller should call Start or +// StartTLS. +// +// The caller should call Close when finished, to shut it down. +// serve allows the server's listen address to be specified. +func NewUnstartedServer(handler http.Handler, serve string) *Server { + return &Server{ + Listener: newLocalListener(serve), + Config: &http.Server{Handler: handler}, + } +} + +// Start starts a server from NewUnstartedServer. +func (s *Server) Start() { + if s.URL != "" { + panic("Server already started") + } + if s.client == nil { + s.client = &http.Client{Transport: &http.Transport{}} + } + s.URL = "http://" + s.Listener.Addr().String() + s.wrap() + s.goServe() +} + +// StartTLS starts TLS on a server from NewUnstartedServer. +func (s *Server) StartTLS() { + if s.URL != "" { + panic("Server already started") + } + if s.client == nil { + s.client = &http.Client{Transport: &http.Transport{}} + } + cert, err := tls.X509KeyPair(LocalhostCert, LocalhostKey) + if err != nil { + panic(fmt.Sprintf("httptest: NewTLSServer: %v", err)) + } + + existingConfig := s.TLS + if existingConfig != nil { + s.TLS = existingConfig.Clone() + } else { + s.TLS = new(tls.Config) + } + if s.TLS.NextProtos == nil { + s.TLS.NextProtos = []string{"http/1.1"} + } + if len(s.TLS.Certificates) == 0 { + s.TLS.Certificates = []tls.Certificate{cert} + } + s.certificate, err = x509.ParseCertificate(s.TLS.Certificates[0].Certificate[0]) + if err != nil { + panic(fmt.Sprintf("httptest: NewTLSServer: %v", err)) + } + certpool := x509.NewCertPool() + certpool.AddCert(s.certificate) + s.client.Transport = &http.Transport{ + TLSClientConfig: &tls.Config{ + RootCAs: certpool, + }, + } + s.Listener = tls.NewListener(s.Listener, s.TLS) + s.URL = "https://" + s.Listener.Addr().String() + s.wrap() + s.goServe() +} + +// NewTLSServer starts and returns a new Server using TLS. +// The caller should call Close when finished, to shut it down. +func NewTLSServer(handler http.Handler) *Server { + ts := NewUnstartedServer(handler, "") + ts.StartTLS() + return ts +} + +type closeIdleTransport interface { + CloseIdleConnections() +} + +// Close shuts down the server and blocks until all outstanding +// requests on this server have completed. +func (s *Server) Close() { + s.mu.Lock() + if !s.closed { + s.closed = true + s.Listener.Close() + s.Config.SetKeepAlivesEnabled(false) + for c, st := range s.conns { + // Force-close any idle connections (those between + // requests) and new connections (those which connected + // but never sent a request). StateNew connections are + // super rare and have only been seen (in + // previously-flaky tests) in the case of + // socket-late-binding races from the http Client + // dialing this server and then getting an idle + // connection before the dial completed. There is thus + // a connected connection in StateNew with no + // associated Request. We only close StateIdle and + // StateNew because they're not doing anything. It's + // possible StateNew is about to do something in a few + // milliseconds, but a previous CL to check again in a + // few milliseconds wasn't liked (early versions of + // https://golang.org/cl/15151) so now we just + // forcefully close StateNew. The docs for Server.Close say + // we wait for "outstanding requests", so we don't close things + // in StateActive. + if st == http.StateIdle || st == http.StateNew { + s.closeConn(c) + } + } + // If this server doesn't shut down in 5 seconds, tell the user why. + t := time.AfterFunc(5*time.Second, s.logCloseHangDebugInfo) + defer t.Stop() + } + s.mu.Unlock() + + // Not part of httptest.Server's correctness, but assume most + // users of httptest.Server will be using the standard + // transport, so help them out and close any idle connections for them. + if t, ok := http.DefaultTransport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } + + // Also close the client idle connections. + if s.client != nil { + if t, ok := s.client.Transport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } + } + + s.wg.Wait() +} + +func (s *Server) logCloseHangDebugInfo() { + s.mu.Lock() + defer s.mu.Unlock() + var buf strings.Builder + buf.WriteString("httptest.Server blocked in Close after 5 seconds, waiting for connections:\n") + for c, st := range s.conns { + fmt.Fprintf(&buf, " %T %p %v in state %v\n", c, c, c.RemoteAddr(), st) + } + log.Print(buf.String()) +} + +// CloseClientConnections closes any open HTTP connections to the test Server. +func (s *Server) CloseClientConnections() { + s.mu.Lock() + nconn := len(s.conns) + ch := make(chan struct{}, nconn) + for c := range s.conns { + go s.closeConnChan(c, ch) + } + s.mu.Unlock() + + // Wait for outstanding closes to finish. + // + // Out of paranoia for making a late change in Go 1.6, we + // bound how long this can wait, since golang.org/issue/14291 + // isn't fully understood yet. At least this should only be used + // in tests. + timer := time.NewTimer(5 * time.Second) + defer timer.Stop() + for i := 0; i < nconn; i++ { + select { + case <-ch: + case <-timer.C: + // Too slow. Give up. + return + } + } +} + +// Certificate returns the certificate used by the server, or nil if +// the server doesn't use TLS. +func (s *Server) Certificate() *x509.Certificate { + return s.certificate +} + +// Client returns an HTTP client configured for making requests to the server. +// It is configured to trust the server's TLS test certificate and will +// close its idle connections on Server.Close. +func (s *Server) Client() *http.Client { + return s.client +} + +func (s *Server) goServe() { + s.wg.Add(1) + go func() { + defer s.wg.Done() + s.Config.Serve(s.Listener) + }() +} + +// wrap installs the connection state-tracking hook to know which +// connections are idle. +func (s *Server) wrap() { + oldHook := s.Config.ConnState + s.Config.ConnState = func(c net.Conn, cs http.ConnState) { + s.mu.Lock() + defer s.mu.Unlock() + + switch cs { + case http.StateNew: + if _, exists := s.conns[c]; exists { + panic("invalid state transition") + } + if s.conns == nil { + s.conns = make(map[net.Conn]http.ConnState) + } + // Add c to the set of tracked conns and increment it to the + // waitgroup. + s.wg.Add(1) + s.conns[c] = cs + if s.closed { + // Probably just a socket-late-binding dial from + // the default transport that lost the race (and + // thus this connection is now idle and will + // never be used). + s.closeConn(c) + } + case http.StateActive: + if oldState, ok := s.conns[c]; ok { + if oldState != http.StateNew && oldState != http.StateIdle { + panic("invalid state transition") + } + s.conns[c] = cs + } + case http.StateIdle: + if oldState, ok := s.conns[c]; ok { + if oldState != http.StateActive { + panic("invalid state transition") + } + s.conns[c] = cs + } + if s.closed { + s.closeConn(c) + } + case http.StateHijacked, http.StateClosed: + // Remove c from the set of tracked conns and decrement it from the + // waitgroup, unless it was previously removed. + if _, ok := s.conns[c]; ok { + delete(s.conns, c) + // Keep Close from returning until the user's ConnState hook + // (if any) finishes. + defer s.wg.Done() + } + } + if oldHook != nil { + oldHook(c, cs) + } + } +} + +// closeConn closes c. +// s.mu must be held. +func (s *Server) closeConn(c net.Conn) { s.closeConnChan(c, nil) } + +// closeConnChan is like closeConn, but takes an optional channel to receive a value +// when the goroutine closing c is done. +func (s *Server) closeConnChan(c net.Conn, done chan<- struct{}) { + c.Close() + if done != nil { + done <- struct{}{} + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go new file mode 100644 index 000000000..0903b9d74 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go @@ -0,0 +1,64 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package internal + +// LocalhostCert is a PEM-encoded TLS cert with SAN IPs +// "127.0.0.1" and "[::1]", expiring at Jan 29 16:00:00 2084 GMT. +// generated from src/crypto/tls: +// go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h +// +// Please note the certificate was updated to 2048 bits due to macOS now +// requiring RSA keys of at least 2048 bits. For more information, please see: +// https://developer.apple.com/documentation/security/preventing_insecure_network_connections +var LocalhostCert = []byte(`-----BEGIN CERTIFICATE----- +MIIDOjCCAiKgAwIBAgIRAK6d/JpGL75P2wOSYc6WalEwDQYJKoZIhvcNAQELBQAw +EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 +MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAK9lInM4OAKI4z+wDNkvcZC6S6exFSOysp7NPJyaEAhW93kPY7gO +f6H5aP3V3YU0vYpCSnz/UhyDD+/knBof1J3Do7FVwYtC293vrtXffNtAvygfJodW +1dPllp17ZJbq76ei9oWq1Y5Hox/sVYmNVNztvBfK1mtpS8z8Qrk1LWCyLiDHkvDA +hCy2OjuaopxC6qQejdWT1PxwbqptuLVakQmecpiFrupy8DTG0x0rxxdMdAATywhY +Gm49A/FroagZ6HMz3bm39we/w6VIx3pX1lbUUyrfjvBgfUlRwxyZABBj2STGsOQJ +a451eEcESXcSEWzjGjUQ1Wf+zzxr2GAHmI8CAwEAAaOBiDCBhTAOBgNVHQ8BAf8E +BAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUjtR2VSuxchTxe0UNDVqWDNMR37AwLgYDVR0RBCcwJYILZXhhbXBsZS5j +b22HBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggEBACK7 +1L15IeYPiQHFDml3EgDoRnd/tAaZP9nUZIIPLRgUnQITNAtjFgBvqneQZwlQtco2 +s8YXSivBQiATlBEtGBzVxv36R4tTXldIgJxaCUxxZtqALLwyGqSaI/cwE0pWa6Z0 +Op2wkzUmoQ5rRrJfRM+C6HR/+lWkNtHRzaUFOSlxNJbPo53K53OoDriwEc1PvEYP +wFeUXwTzCZ68pAlWUmDKCyp+lPhjIt2Gznig+BSPCNJqmwKM76oFyywi3HIP56rD +/cwUtoplF68uVuD8HXb1ggGsqtGiAT4GLT8tU5w+BtK8ZIs/LK7mdi7W8aIOhUUH +l1lgeV3oEQue3A7SogA= +-----END CERTIFICATE-----`) + +// LocalhostKey is the private key for localhostCert. +var LocalhostKey = []byte(`-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvZSJzODgCiOM/ +sAzZL3GQukunsRUjsrKezTycmhAIVvd5D2O4Dn+h+Wj91d2FNL2KQkp8/1Icgw/v +5JwaH9Sdw6OxVcGLQtvd767V33zbQL8oHyaHVtXT5Zade2SW6u+novaFqtWOR6Mf +7FWJjVTc7bwXytZraUvM/EK5NS1gsi4gx5LwwIQstjo7mqKcQuqkHo3Vk9T8cG6q +bbi1WpEJnnKYha7qcvA0xtMdK8cXTHQAE8sIWBpuPQPxa6GoGehzM925t/cHv8Ol +SMd6V9ZW1FMq347wYH1JUcMcmQAQY9kkxrDkCWuOdXhHBEl3EhFs4xo1ENVn/s88 +a9hgB5iPAgMBAAECggEAEpeS3knQThx6kk60HfWUgTXuPRldV0pi+shgq2z9VBT7 +6J5EAMewqdfJVFbuQ2eCy/wY70UVTCZscw51qaNEI3EQkgS4Hm345n64tr0Y/BjR +6ovaxq/ivLJyk8D3ubOvscJphWPFfW6EkSa5LnqHy197972tmvcvbMw0unMzmzM7 +DenXdoIJQu1SqLiLUiDXEfkvCReekqhe1jATCwTzIBTCnTWxgI4Ox2qsBaxuwrnl +D1GpWy4sh8NpDB0EBwdrjAOmLDOyvsy2X65DIlHS/k7901tvzyNjRrsr2Ig0sAz4 +w0ke6CUKQ2B+Pqn3p6bvxRYMP08+ZjlQpPuU4RrxGQKBgQDd3HCrZCgUJAGcfzYX +ZzSmSoxB9+sEuVUZGU+ICMPlG0Dd8aEkXIyDjGMWsLFMIvzNBf4wB1FwdLaCJu6y +0PbX3KVfg/Yc4lvYUuQ+1nD/3gm2hE46lZuSfbmExH5SQVLSbSQf9S/5BTHAWQO9 +PNie71AZ8fO5YDBM18tq2V7dBQKBgQDKYk1+Zup5p0BeRyCNnVYnpngO+pAZZmld +gYiRn8095QJ/Y+yV0kYc2+0+5f6St462E+PVH3tX1l9OG3ujVQnWfu2iSsRJRMUf +0blxqTWvqdcGi8SLpVjkrHn30scFNWmojhJv3k42H3nUMC1+WU3rp2f7+W58afyd +NY9x4sqzgwKBgQCoeMq9+3JLyQPIOPl0UBS06gsT1RUMI0gxpPy1yiInich6QRAi +snypMCPWiRo5PKBHd/OLuSLoiFhHARVliDTJum2B2I09Zc5kuJ1F8kUgpxUtGc7l +wdG/LeWAok1iXORtkh9KfT+Ok5kx/OZP/zJnjkZ/TTHMZPSIhZ2cZ7AXmQKBgHMP +HjWNtyKApsSytVwtpgyWxMznQMNgCOkjOoxoCJx2tUvNeHTY/glsM14+DdRFzTnQ +5weEhXAzrS1PzKPYNeafdOR+k0eAdH2Zk09+PspmyZusHIqz72zabeEqEQHyEubE +FtFI1rhIfs/WsBaUGQuvuhtz/I95BiguiiXaJRmXAoGADwcO6YXoWXga07gGRwZP +LYKwt5wBh13LAGbSsUyCSK5FG6ZrTmzaFdAGV1U4wc/wgiIgv33m8BG4Ikxvpa0r +Wg3dbhBx9Oya8QWIMBPk72KKEzsSDfi+Cn52ZmxTkWbBDCnkRhG77Ooi8vJ3dhq4 +fHeAu1F9OwF83SBi1oNySd8= +-----END PRIVATE KEY-----`) diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/types.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/types.go new file mode 100644 index 000000000..bb4279613 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/internal/types.go @@ -0,0 +1,62 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package internal + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// Minimal set of internal types and methods: +// - Fetch() - used by ovftool to collect various managed object properties +// - RetrieveInternalContent() - used by ovftool to obtain a reference to NfcService (which it does not use by default) + +func init() { + types.Add("Fetch", reflect.TypeOf((*Fetch)(nil)).Elem()) +} + +type Fetch struct { + This types.ManagedObjectReference `xml:"_this"` + Prop string `xml:"prop"` +} + +type FetchResponse struct { + Returnval types.AnyType `xml:"returnval,omitempty,typeattr"` +} + +type FetchBody struct { + Req *Fetch `xml:"Fetch,omitempty"` + Res *FetchResponse `xml:"FetchResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FetchBody) Fault() *soap.Fault { return b.Fault_ } + +func init() { + types.Add("RetrieveInternalContent", reflect.TypeOf((*RetrieveInternalContent)(nil)).Elem()) +} + +type RetrieveInternalContent struct { + This types.ManagedObjectReference `xml:"_this"` +} + +type RetrieveInternalContentResponse struct { + Returnval InternalServiceInstanceContent `xml:"returnval"` +} + +type RetrieveInternalContentBody struct { + Res *RetrieveInternalContentResponse `xml:"RetrieveInternalContentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveInternalContentBody) Fault() *soap.Fault { return b.Fault_ } + +type InternalServiceInstanceContent struct { + types.DynamicData + + NfcService types.ManagedObjectReference `xml:"nfcService"` +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go new file mode 100644 index 000000000..2a12c5e9d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go @@ -0,0 +1,375 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "errors" + "fmt" + "net" + "strconv" + "strings" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var ipPool = MustNewIpPool(&types.IpPool{ + Id: 1, + Name: "ip-pool", + AvailableIpv4Addresses: 250, + AvailableIpv6Addresses: 250, + AllocatedIpv6Addresses: 0, + AllocatedIpv4Addresses: 0, + Ipv4Config: &types.IpPoolIpPoolConfigInfo{ + Netmask: "10.10.10.255", + Gateway: "10.10.10.1", + SubnetAddress: "10.10.10.0", + Range: "10.10.10.2#250", + }, + Ipv6Config: &types.IpPoolIpPoolConfigInfo{ + Netmask: "2001:4860:0:2001::ff", + Gateway: "2001:4860:0:2001::1", + SubnetAddress: "2001:4860:0:2001::0", + Range: "2001:4860:0:2001::2#250", + }, +}) + +// IpPoolManager implements a simple IP Pool manager in which all pools are shared +// across different datacenters. +type IpPoolManager struct { + mo.IpPoolManager + + pools map[int32]*IpPool + nextPoolId int32 +} + +func (m *IpPoolManager) init(*Registry) { + m.pools = map[int32]*IpPool{ + 1: ipPool, + } + m.nextPoolId = 2 +} + +func (m *IpPoolManager) CreateIpPool(req *types.CreateIpPool) soap.HasFault { + body := &methods.CreateIpPoolBody{} + id := m.nextPoolId + + var err error + m.pools[id], err = NewIpPool(&req.Pool) + if err != nil { + body.Fault_ = Fault("", &types.RuntimeFault{}) + return body + } + + m.nextPoolId++ + + body.Res = &types.CreateIpPoolResponse{ + Returnval: id, + } + + return body +} + +func (m *IpPoolManager) DestroyIpPool(req *types.DestroyIpPool) soap.HasFault { + delete(m.pools, req.Id) + + return &methods.DestroyIpPoolBody{ + Res: &types.DestroyIpPoolResponse{}, + } +} + +func (m *IpPoolManager) QueryIpPools(req *types.QueryIpPools) soap.HasFault { + pools := []types.IpPool{} + + for i := int32(1); i < m.nextPoolId; i++ { + if p, ok := m.pools[i]; ok { + pools = append(pools, *p.config) + } + } + + return &methods.QueryIpPoolsBody{ + Res: &types.QueryIpPoolsResponse{ + Returnval: pools, + }, + } +} + +func (m *IpPoolManager) UpdateIpPool(req *types.UpdateIpPool) soap.HasFault { + body := &methods.UpdateIpPoolBody{} + + var pool *IpPool + var err error + var ok bool + + if pool, ok = m.pools[req.Pool.Id]; !ok { + body.Fault_ = Fault("", &types.NotFoundFault{}) + return body + } + + if pool.config.AllocatedIpv4Addresses+pool.config.AllocatedIpv6Addresses != 0 { + body.Fault_ = Fault("update a pool has been used is not supported", &types.RuntimeFault{}) + return body + } + + m.pools[req.Pool.Id], err = NewIpPool(&req.Pool) + if err != nil { + body.Fault_ = Fault(err.Error(), &types.RuntimeFault{}) + return body + } + + body.Res = &types.UpdateIpPoolResponse{} + + return body +} + +func (m *IpPoolManager) AllocateIpv4Address(req *types.AllocateIpv4Address) soap.HasFault { + body := &methods.AllocateIpv4AddressBody{} + + pool, ok := m.pools[req.PoolId] + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{}) + return body + } + + ip, err := pool.AllocateIPv4(req.AllocationId) + if err != nil { + body.Fault_ = Fault(err.Error(), &types.RuntimeFault{}) + return body + } + + body.Res = &types.AllocateIpv4AddressResponse{ + Returnval: ip, + } + + return body +} + +func (m *IpPoolManager) AllocateIpv6Address(req *types.AllocateIpv6Address) soap.HasFault { + body := &methods.AllocateIpv6AddressBody{} + + pool, ok := m.pools[req.PoolId] + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{}) + return body + } + + ip, err := pool.AllocateIpv6(req.AllocationId) + if err != nil { + body.Fault_ = Fault(err.Error(), &types.RuntimeFault{}) + return body + } + + body.Res = &types.AllocateIpv6AddressResponse{ + Returnval: ip, + } + + return body +} + +func (m *IpPoolManager) ReleaseIpAllocation(req *types.ReleaseIpAllocation) soap.HasFault { + body := &methods.ReleaseIpAllocationBody{} + + pool, ok := m.pools[req.PoolId] + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{}) + return body + } + + pool.ReleaseIpv4(req.AllocationId) + pool.ReleaseIpv6(req.AllocationId) + + body.Res = &types.ReleaseIpAllocationResponse{} + + return body +} + +func (m *IpPoolManager) QueryIPAllocations(req *types.QueryIPAllocations) soap.HasFault { + body := &methods.QueryIPAllocationsBody{} + + pool, ok := m.pools[req.PoolId] + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{}) + return body + } + + body.Res = &types.QueryIPAllocationsResponse{} + + ipv4, ok := pool.ipv4Allocation[req.ExtensionKey] + if ok { + body.Res.Returnval = append(body.Res.Returnval, types.IpPoolManagerIpAllocation{ + IpAddress: ipv4, + AllocationId: req.ExtensionKey, + }) + } + + ipv6, ok := pool.ipv6Allocation[req.ExtensionKey] + if ok { + body.Res.Returnval = append(body.Res.Returnval, types.IpPoolManagerIpAllocation{ + IpAddress: ipv6, + AllocationId: req.ExtensionKey, + }) + } + + return body +} + +var ( + errNoIpAvailable = errors.New("no ip address available") + errInvalidAllocation = errors.New("allocation id not recognized") +) + +type IpPool struct { + config *types.IpPool + ipv4Allocation map[string]string + ipv6Allocation map[string]string + ipv4Pool []string + ipv6Pool []string +} + +func MustNewIpPool(config *types.IpPool) *IpPool { + pool, err := NewIpPool(config) + if err != nil { + panic(err) + } + + return pool +} + +func NewIpPool(config *types.IpPool) (*IpPool, error) { + pool := &IpPool{ + config: config, + ipv4Allocation: make(map[string]string), + ipv6Allocation: make(map[string]string), + } + + return pool, pool.init() +} + +func (p *IpPool) init() error { + // IPv4 range + if p.config.Ipv4Config != nil { + ranges := strings.Split(p.config.Ipv4Config.Range, ",") + for _, r := range ranges { + sp := strings.Split(r, "#") + if len(sp) != 2 { + return fmt.Errorf("format of range should be ip#number; got %q", r) + } + + ip := net.ParseIP(strings.TrimSpace(sp[0])).To4() + if ip == nil { + return fmt.Errorf("bad ip format: %q", sp[0]) + } + + length, err := strconv.Atoi(sp[1]) + if err != nil { + return err + } + + for i := 0; i < length; i++ { + p.ipv4Pool = append(p.ipv4Pool, net.IPv4(ip[0], ip[1], ip[2], ip[3]+byte(i)).String()) + } + } + } + + // IPv6 range + if p.config.Ipv6Config != nil { + ranges := strings.Split(p.config.Ipv6Config.Range, ",") + for _, r := range ranges { + sp := strings.Split(r, "#") + if len(sp) != 2 { + return fmt.Errorf("format of range should be ip#number; got %q", r) + } + + ip := net.ParseIP(strings.TrimSpace(sp[0])).To16() + if ip == nil { + return fmt.Errorf("bad ip format: %q", sp[0]) + } + + length, err := strconv.Atoi(sp[1]) + if err != nil { + return err + } + + for i := 0; i < length; i++ { + var ipv6 [16]byte + copy(ipv6[:], ip) + ipv6[15] += byte(i) + p.ipv6Pool = append(p.ipv6Pool, net.IP(ipv6[:]).String()) + } + } + } + + return nil +} + +func (p *IpPool) AllocateIPv4(allocation string) (string, error) { + if ip, ok := p.ipv4Allocation[allocation]; ok { + return ip, nil + } + + l := len(p.ipv4Pool) + if l == 0 { + return "", errNoIpAvailable + } + + ip := p.ipv4Pool[l-1] + + p.config.AvailableIpv4Addresses-- + p.config.AllocatedIpv4Addresses++ + p.ipv4Pool = p.ipv4Pool[:l-1] + p.ipv4Allocation[allocation] = ip + + return ip, nil +} + +func (p *IpPool) ReleaseIpv4(allocation string) error { + ip, ok := p.ipv4Allocation[allocation] + if !ok { + return errInvalidAllocation + } + + delete(p.ipv4Allocation, allocation) + p.config.AvailableIpv4Addresses++ + p.config.AllocatedIpv4Addresses-- + p.ipv4Pool = append(p.ipv4Pool, ip) + + return nil +} + +func (p *IpPool) AllocateIpv6(allocation string) (string, error) { + if ip, ok := p.ipv6Allocation[allocation]; ok { + return ip, nil + } + + l := len(p.ipv6Pool) + if l == 0 { + return "", errNoIpAvailable + } + + ip := p.ipv6Pool[l-1] + + p.config.AvailableIpv6Addresses-- + p.config.AllocatedIpv6Addresses++ + p.ipv6Pool = p.ipv6Pool[:l-1] + p.ipv6Allocation[allocation] = ip + + return ip, nil +} + +func (p *IpPool) ReleaseIpv6(allocation string) error { + ip, ok := p.ipv6Allocation[allocation] + if !ok { + return errInvalidAllocation + } + + delete(p.ipv6Allocation, allocation) + p.config.AvailableIpv6Addresses++ + p.config.AllocatedIpv6Addresses-- + p.ipv6Pool = append(p.ipv6Pool, ip) + + return nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/license_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/license_manager.go new file mode 100644 index 000000000..999038c3b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/license_manager.go @@ -0,0 +1,286 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "slices" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// EvalLicense is the default license +var EvalLicense = types.LicenseManagerLicenseInfo{ + LicenseKey: "00000-00000-00000-00000-00000", + EditionKey: "eval", + Name: "Evaluation Mode", + Properties: []types.KeyAnyValue{ + { + Key: "feature", + Value: types.KeyValue{ + Key: "serialuri:2", + Value: "Remote virtual Serial Port Concentrator", + }, + }, + { + Key: "feature", + Value: types.KeyValue{ + Key: "dvs", + Value: "vSphere Distributed Switch", + }, + }, + }, +} + +type LicenseManager struct { + mo.LicenseManager +} + +func (m *LicenseManager) init(r *Registry) { + if len(m.Licenses) == 0 { + about := r.content().About + product := []types.KeyAnyValue{ + { + Key: "ProductName", + Value: about.LicenseProductName, + }, + { + Key: "ProductVersion", + Value: about.LicenseProductVersion, + }, + } + + EvalLicense.Properties = append(EvalLicense.Properties, product...) + + m.Licenses = []types.LicenseManagerLicenseInfo{EvalLicense} + } + + if r.IsVPX() { + if m.LicenseAssignmentManager == nil { + m.LicenseAssignmentManager = &types.ManagedObjectReference{ + Type: "LicenseAssignmentManager", + Value: "LicenseAssignmentManager", + } + } + + lam := new(LicenseAssignmentManager) + lam.Self = *m.LicenseAssignmentManager + lam.QueryAssignedLicensesResponse.Returnval = []types.LicenseAssignmentManagerLicenseAssignment{{ + EntityId: r.content().About.InstanceUuid, + EntityDisplayName: "vcsim", + AssignedLicense: EvalLicense, + }} + r.Put(lam) + r.AddHandler(lam) + } +} + +func (m *LicenseManager) AddLicense(ctx *Context, req *types.AddLicense) soap.HasFault { + body := &methods.AddLicenseBody{ + Res: &types.AddLicenseResponse{}, + } + + for _, license := range m.Licenses { + if license.LicenseKey == req.LicenseKey { + body.Res.Returnval = licenseInfo(license.LicenseKey, license.Labels) + return body + } + } + + m.Licenses = append(m.Licenses, types.LicenseManagerLicenseInfo{ + LicenseKey: req.LicenseKey, + Labels: req.Labels, + }) + + body.Res.Returnval = licenseInfo(req.LicenseKey, req.Labels) + + return body +} + +func (m *LicenseManager) RemoveLicense(ctx *Context, req *types.RemoveLicense) soap.HasFault { + body := &methods.RemoveLicenseBody{ + Res: &types.RemoveLicenseResponse{}, + } + + for i, license := range m.Licenses { + if req.LicenseKey == license.LicenseKey { + m.Licenses = append(m.Licenses[:i], m.Licenses[i+1:]...) + return body + } + } + return body +} + +func (m *LicenseManager) DecodeLicense(ctx *Context, req *types.DecodeLicense) soap.HasFault { + body := &methods.DecodeLicenseBody{ + Res: &types.DecodeLicenseResponse{}, + } + + for _, license := range m.Licenses { + if req.LicenseKey == license.LicenseKey { + body.Res.Returnval = license + break + } + } + + return body +} + +func (m *LicenseManager) UpdateLicenseLabel(ctx *Context, req *types.UpdateLicenseLabel) soap.HasFault { + body := &methods.UpdateLicenseLabelBody{} + + for i := range m.Licenses { + license := &m.Licenses[i] + + if req.LicenseKey != license.LicenseKey { + continue + } + + body.Res = new(types.UpdateLicenseLabelResponse) + + for j := range license.Labels { + label := &license.Labels[j] + + if label.Key == req.LabelKey { + if req.LabelValue == "" { + license.Labels = append(license.Labels[:i], license.Labels[i+1:]...) + } else { + label.Value = req.LabelValue + } + return body + } + } + + license.Labels = append(license.Labels, types.KeyValue{ + Key: req.LabelKey, + Value: req.LabelValue, + }) + + return body + } + + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "licenseKey"}) + return body +} + +type LicenseAssignmentManager struct { + mo.LicenseAssignmentManager + + types.QueryAssignedLicensesResponse +} + +var licensedTypes = []string{"HostSystem", "ClusterComputeResource"} + +// PutObject assigns a license when a host or cluster is created. +func (m *LicenseAssignmentManager) PutObject(ctx *Context, obj mo.Reference) { + ref := obj.Reference() + + if !slices.Contains(licensedTypes, ref.Type) { + return + } + + if slices.ContainsFunc(m.QueryAssignedLicensesResponse.Returnval, + func(am types.LicenseAssignmentManagerLicenseAssignment) bool { + return am.EntityId == ref.Value + }) { + return // via vcsim -load + } + + la := types.LicenseAssignmentManagerLicenseAssignment{ + EntityId: ref.Value, + Scope: ctx.Map.content().About.InstanceUuid, + EntityDisplayName: obj.(mo.Entity).Entity().Name, + AssignedLicense: EvalLicense, + } + + m.QueryAssignedLicensesResponse.Returnval = + append(m.QueryAssignedLicensesResponse.Returnval, la) +} + +// RemoveObject removes the license assignment when a host or cluster is removed. +func (m *LicenseAssignmentManager) RemoveObject(ctx *Context, ref types.ManagedObjectReference) { + if !slices.Contains(licensedTypes, ref.Type) { + return + } + + m.QueryAssignedLicensesResponse.Returnval = + slices.DeleteFunc(m.QueryAssignedLicensesResponse.Returnval, + func(am types.LicenseAssignmentManagerLicenseAssignment) bool { + return am.EntityId == ref.Value + }) +} + +func (*LicenseAssignmentManager) UpdateObject(*Context, mo.Reference, []types.PropertyChange) {} + +func (m *LicenseAssignmentManager) init(r *Registry) { + r.AddHandler(m) +} + +func (m *LicenseAssignmentManager) QueryAssignedLicenses(ctx *Context, req *types.QueryAssignedLicenses) soap.HasFault { + body := &methods.QueryAssignedLicensesBody{ + Res: &types.QueryAssignedLicensesResponse{}, + } + + if req.EntityId == "" { + body.Res = &m.QueryAssignedLicensesResponse + } else { + for _, r := range m.QueryAssignedLicensesResponse.Returnval { + if r.EntityId == req.EntityId { + body.Res.Returnval = append(body.Res.Returnval, r) + } + } + } + + return body +} + +func (m *LicenseAssignmentManager) UpdateAssignedLicense(ctx *Context, req *types.UpdateAssignedLicense) soap.HasFault { + body := new(methods.UpdateAssignedLicenseBody) + + var license *types.LicenseManagerLicenseInfo + lm := ctx.Map.Get(*ctx.Map.content().LicenseManager).(*LicenseManager) + + for i, l := range lm.Licenses { + if l.LicenseKey == req.LicenseKey { + license = &lm.Licenses[i] + } + } + + if license == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "entityId"}) + return body + } + + for i, r := range m.QueryAssignedLicensesResponse.Returnval { + if r.EntityId == req.Entity { + r.AssignedLicense = *license + + if req.EntityDisplayName != "" { + r.EntityDisplayName = req.EntityDisplayName + } + + m.QueryAssignedLicensesResponse.Returnval[i] = r + + body.Res = &types.UpdateAssignedLicenseResponse{ + Returnval: r.AssignedLicense, + } + + break + } + } + + return body +} + +func licenseInfo(key string, labels []types.KeyValue) types.LicenseManagerLicenseInfo { + info := EvalLicense + + info.LicenseKey = key + info.Labels = labels + + return info +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/model.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/model.go new file mode 100644 index 000000000..01fbc52b6 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/model.go @@ -0,0 +1,981 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "context" + "crypto/tls" + "fmt" + "log" + "math/rand" + "os" + "path" + "path/filepath" + "reflect" + "strings" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +type DelayConfig struct { + // Delay specifies the number of milliseconds to delay serving a SOAP call. 0 means no delay. + // This can be used to simulate a poorly performing vCenter or network lag. + Delay int + + // Delay specifies the number of milliseconds to delay serving a specific method. + // Each entry in the map represents the name of a method and its associated delay in milliseconds, + // This can be used to simulate a poorly performing vCenter or network lag. + MethodDelay map[string]int + + // DelayJitter defines the delay jitter as a coefficient of variation (stddev/mean). + // This can be used to simulate unpredictable delay. 0 means no jitter, i.e. all invocations get the same delay. + DelayJitter float64 +} + +// Model is used to populate a Model with an initial set of managed entities. +// This is a simple helper for tests running against a simulator, to populate an inventory +// with commonly used models. +// The inventory names generated by a Model have a string prefix per-type and integer suffix per-instance. +// The names are concatenated with their ancestor names and delimited by '_', making the generated names unique. +type Model struct { + Service *Service `json:"-"` + + ServiceContent types.ServiceContent `json:"-"` + RootFolder mo.Folder `json:"-"` + + // Autostart will power on Model created VMs when true + Autostart bool `json:"-"` + + // Datacenter specifies the number of Datacenter entities to create + // Name prefix: DC, vcsim flag: -dc + Datacenter int `json:"datacenter"` + + // Portgroup specifies the number of DistributedVirtualPortgroup entities to create per Datacenter + // Name prefix: DVPG, vcsim flag: -pg + Portgroup int `json:"portgroup"` + + // PortgroupNSX specifies the number NSX backed DistributedVirtualPortgroup entities to create per Datacenter + // Name prefix: NSXPG, vcsim flag: -nsx-pg + PortgroupNSX int `json:"portgroupNSX"` + + // OpaqueNetwork specifies the number of OpaqueNetwork entities to create per Datacenter, + // with Summary.OpaqueNetworkType set to nsx.LogicalSwitch and Summary.OpaqueNetworkId to a random uuid. + // Name prefix: NSX, vcsim flag: -nsx + OpaqueNetwork int `json:"opaqueNetwork"` + + // Host specifies the number of standalone HostSystems entities to create per Datacenter + // Name prefix: H, vcsim flag: -standalone-host + Host int `json:"host,omitempty"` + + // Cluster specifies the number of ClusterComputeResource entities to create per Datacenter + // Name prefix: C, vcsim flag: -cluster + Cluster int `json:"cluster"` + + // ClusterHost specifies the number of HostSystems entities to create within a Cluster + // Name prefix: H, vcsim flag: -host + ClusterHost int `json:"clusterHost,omitempty"` + + // Pool specifies the number of ResourcePool entities to create per Cluster + // Note that every cluster has a root ResourcePool named "Resources", as real vCenter does. + // For example: /DC0/host/DC0_C0/Resources + // The root ResourcePool is named "RP0" within other object names. + // When Model.Pool is set to 1 or higher, this creates child ResourcePools under the root pool. + // Note that this flag is not effective on standalone hosts. + // For example: /DC0/host/DC0_C0/Resources/DC0_C0_RP1 + // Name prefix: RP, vcsim flag: -pool + Pool int `json:"pool"` + + // Datastore specifies the number of Datastore entities to create + // Each Datastore will have temporary local file storage and will be mounted + // on every HostSystem created by the ModelConfig + // Name prefix: LocalDS, vcsim flag: -ds + Datastore int `json:"datastore"` + + // Machine specifies the number of VirtualMachine entities to create per + // ResourcePool. If the pool flag is specified, the specified number of virtual + // machines will be deployed to each child pool and prefixed with the child + // resource pool name. Otherwise they are deployed into the root resource pool, + // prefixed with RP0. On standalone hosts, machines are always deployed into the + // root resource pool without any prefix. + // Name prefix: VM, vcsim flag: -vm + Machine int `json:"machine"` + + // Folder specifies the number of Datacenter to place within a Folder. + // This includes a folder for the Datacenter itself and its host, vm, network and datastore folders. + // All resources for the Datacenter are placed within these folders, rather than the top-level folders. + // Name prefix: F, vcsim flag: -folder + Folder int `json:"folder"` + + // App specifies the number of VirtualApp to create per Cluster + // Name prefix: APP, vcsim flag: -app + App int `json:"app"` + + // Pod specifies the number of StoragePod to create per Cluster + // Name prefix: POD, vcsim flag: -pod + Pod int `json:"pod"` + + // Delay configurations + DelayConfig DelayConfig `json:"-"` + + // total number of inventory objects, set by Count() + total int + + dir string +} + +// ESX is the default Model for a standalone ESX instance +func ESX() *Model { + return &Model{ + ServiceContent: esx.ServiceContent, + RootFolder: esx.RootFolder, + Autostart: true, + Datastore: 1, + Machine: 2, + DelayConfig: DelayConfig{ + Delay: 0, + DelayJitter: 0, + MethodDelay: nil, + }, + } +} + +// VPX is the default Model for a vCenter instance +func VPX() *Model { + return &Model{ + ServiceContent: vpx.ServiceContent, + RootFolder: vpx.RootFolder, + Autostart: true, + Datacenter: 1, + Portgroup: 1, + Host: 1, + Cluster: 1, + ClusterHost: 3, + Datastore: 1, + Machine: 2, + DelayConfig: DelayConfig{ + Delay: 0, + DelayJitter: 0, + MethodDelay: nil, + }, + } +} + +// Map returns the Model.Service.Context.Map +func (m *Model) Map() *Registry { + return m.Service.Context.Map +} + +// Count returns a Model with total number of each existing type +func (m *Model) Count() Model { + count := Model{} + + for ref, obj := range m.Map().objects { + if _, ok := obj.(mo.Entity); !ok { + continue + } + + count.total++ + + switch ref.Type { + case "Datacenter": + count.Datacenter++ + case "DistributedVirtualPortgroup": + count.Portgroup++ + case "ClusterComputeResource": + count.Cluster++ + case "Datastore": + count.Datastore++ + case "HostSystem": + count.Host++ + case "VirtualMachine": + count.Machine++ + case "ResourcePool": + count.Pool++ + case "VirtualApp": + count.App++ + case "Folder": + count.Folder++ + case "StoragePod": + count.Pod++ + case "OpaqueNetwork": + count.OpaqueNetwork++ + } + } + + return count +} + +func (*Model) fmtName(prefix string, num int) string { + return fmt.Sprintf("%s%d", prefix, num) +} + +// kinds maps managed object types to their vcsim wrapper types +var kinds = map[string]reflect.Type{ + "Alarm": reflect.TypeOf((*Alarm)(nil)).Elem(), + "AlarmManager": reflect.TypeOf((*AlarmManager)(nil)).Elem(), + "AuthorizationManager": reflect.TypeOf((*AuthorizationManager)(nil)).Elem(), + "ClusterComputeResource": reflect.TypeOf((*ClusterComputeResource)(nil)).Elem(), + "CustomFieldsManager": reflect.TypeOf((*CustomFieldsManager)(nil)).Elem(), + "CustomizationSpecManager": reflect.TypeOf((*CustomizationSpecManager)(nil)).Elem(), + "CryptoManagerKmip": reflect.TypeOf((*CryptoManagerKmip)(nil)).Elem(), + "Datacenter": reflect.TypeOf((*Datacenter)(nil)).Elem(), + "Datastore": reflect.TypeOf((*Datastore)(nil)).Elem(), + "DatastoreNamespaceManager": reflect.TypeOf((*DatastoreNamespaceManager)(nil)).Elem(), + "DistributedVirtualPortgroup": reflect.TypeOf((*DistributedVirtualPortgroup)(nil)).Elem(), + "DistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), + "DistributedVirtualSwitchManager": reflect.TypeOf((*DistributedVirtualSwitchManager)(nil)).Elem(), + "EnvironmentBrowser": reflect.TypeOf((*EnvironmentBrowser)(nil)).Elem(), + "EventManager": reflect.TypeOf((*EventManager)(nil)).Elem(), + "ExtensionManager": reflect.TypeOf((*ExtensionManager)(nil)).Elem(), + "FileManager": reflect.TypeOf((*FileManager)(nil)).Elem(), + "Folder": reflect.TypeOf((*Folder)(nil)).Elem(), + "GuestOperationsManager": reflect.TypeOf((*GuestOperationsManager)(nil)).Elem(), + "HostDatastoreBrowser": reflect.TypeOf((*HostDatastoreBrowser)(nil)).Elem(), + "HostLocalAccountManager": reflect.TypeOf((*HostLocalAccountManager)(nil)).Elem(), + "HostNetworkSystem": reflect.TypeOf((*HostNetworkSystem)(nil)).Elem(), + "HostCertificateManager": reflect.TypeOf((*HostCertificateManager)(nil)).Elem(), + "HostSystem": reflect.TypeOf((*HostSystem)(nil)).Elem(), + "IpPoolManager": reflect.TypeOf((*IpPoolManager)(nil)).Elem(), + "LicenseManager": reflect.TypeOf((*LicenseManager)(nil)).Elem(), + "LicenseAssignmentManager": reflect.TypeOf((*LicenseAssignmentManager)(nil)).Elem(), + "OptionManager": reflect.TypeOf((*OptionManager)(nil)).Elem(), + "OvfManager": reflect.TypeOf((*OvfManager)(nil)).Elem(), + "PerformanceManager": reflect.TypeOf((*PerformanceManager)(nil)).Elem(), + "PropertyCollector": reflect.TypeOf((*PropertyCollector)(nil)).Elem(), + "ResourcePool": reflect.TypeOf((*ResourcePool)(nil)).Elem(), + "SearchIndex": reflect.TypeOf((*SearchIndex)(nil)).Elem(), + "SessionManager": reflect.TypeOf((*SessionManager)(nil)).Elem(), + "StoragePod": reflect.TypeOf((*StoragePod)(nil)).Elem(), + "StorageResourceManager": reflect.TypeOf((*StorageResourceManager)(nil)).Elem(), + "TaskManager": reflect.TypeOf((*TaskManager)(nil)).Elem(), + "TenantTenantManager": reflect.TypeOf((*TenantManager)(nil)).Elem(), + "UserDirectory": reflect.TypeOf((*UserDirectory)(nil)).Elem(), + "VcenterVStorageObjectManager": reflect.TypeOf((*VcenterVStorageObjectManager)(nil)).Elem(), + "ViewManager": reflect.TypeOf((*ViewManager)(nil)).Elem(), + "VirtualApp": reflect.TypeOf((*VirtualApp)(nil)).Elem(), + "VirtualDiskManager": reflect.TypeOf((*VirtualDiskManager)(nil)).Elem(), + "VirtualMachine": reflect.TypeOf((*VirtualMachine)(nil)).Elem(), + "VirtualMachineCompatibilityChecker": reflect.TypeOf((*VmCompatibilityChecker)(nil)).Elem(), + "VirtualMachineProvisioningChecker": reflect.TypeOf((*VmProvisioningChecker)(nil)).Elem(), + "VmwareDistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), +} + +func loadObject(ctx *Context, content types.ObjectContent) (mo.Reference, error) { + var obj mo.Reference + id := content.Obj + + kind, ok := kinds[id.Type] + if ok { + obj = reflect.New(kind).Interface().(mo.Reference) + } + + if obj == nil { + // No vcsim wrapper for this type, e.g. IoFilterManager + x, err := mo.ObjectContentToType(content, true) + if err != nil { + return nil, err + } + obj = x.(mo.Reference) + } else { + if len(content.PropSet) == 0 { + // via NewServiceInstance() + ctx.Map.setReference(obj, id) + } else { + // via Model.Load() + dst := getManagedObject(obj).Addr().Interface().(mo.Reference) + err := mo.LoadObjectContent([]types.ObjectContent{content}, dst) + if err != nil { + return nil, err + } + } + + if x, ok := obj.(interface{ init(*Registry) }); ok { + x.init(ctx.Map) + } + } + + return obj, nil +} + +// resolveReferences attempts to resolve any object references that were not included via Load() +// example: Load's dir only contains a single OpaqueNetwork, we need to create a Datacenter and +// place the OpaqueNetwork in the Datacenter's network folder. +func (m *Model) resolveReferences(ctx *Context) error { + dc, ok := ctx.Map.Any("Datacenter").(*Datacenter) + if !ok { + // Need to have at least 1 Datacenter + root := ctx.Map.Get(ctx.Map.content().RootFolder).(*Folder) + ref := root.CreateDatacenter(ctx, &types.CreateDatacenter{ + This: root.Self, + Name: "DC0", + }).(*methods.CreateDatacenterBody).Res.Returnval + dc = ctx.Map.Get(ref).(*Datacenter) + } + + for ref, val := range ctx.Map.objects { + me, ok := val.(mo.Entity) + if !ok { + continue + } + e := me.Entity() + if e.Parent == nil || ref.Type == "Folder" { + continue + } + if ctx.Map.Get(*e.Parent) == nil { + // object was loaded without its parent, attempt to foster with another parent + switch e.Parent.Type { + case "Folder": + folder := dc.folder(ctx, me) + e.Parent = &folder.Self + log.Printf("%s adopted %s", e.Parent, ref) + folderPutChild(ctx, folder, me) + default: + return fmt.Errorf("unable to foster %s with parent type=%s", ref, e.Parent.Type) + } + } + // TODO: resolve any remaining orphan references via mo.References() + } + + return nil +} + +func (m *Model) decode(path string, data any) error { + f, err := os.Open(path) + if err != nil { + return err + } + + dec := xml.NewDecoder(f) + dec.TypeFunc = types.TypeFunc() + err = dec.Decode(data) + _ = f.Close() + return err +} + +func (m *Model) loadMethod(obj mo.Reference, dir string) error { + dir = filepath.Join(dir, obj.Reference().Encode()) + + info, err := os.ReadDir(dir) + if err != nil { + if os.IsNotExist(err) { + return nil + } + return err + } + + zero := reflect.Value{} + for _, x := range info { + name := strings.TrimSuffix(x.Name(), ".xml") + "Response" + path := filepath.Join(dir, x.Name()) + response := reflect.ValueOf(obj).Elem().FieldByName(name) + if response == zero { + return fmt.Errorf("field %T.%s not found", obj, name) + } + if err = m.decode(path, response.Addr().Interface()); err != nil { + return err + } + } + + return nil +} + +// NewContext initializes a Context with a NewRegistry +func NewContext() *Context { + r := NewRegistry() + + return &Context{ + Context: context.Background(), + Session: &Session{ + UserSession: types.UserSession{ + Key: uuid.New().String(), + }, + Registry: NewRegistry(), + Map: r, + }, + Map: r, + } +} + +// Load Model from the given directory, as created by the 'govc object.save' command. +func (m *Model) Load(dir string) error { + ctx := NewContext() + var s *ServiceInstance + + err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + if path == dir { + return nil + } + return filepath.SkipDir + } + if filepath.Ext(path) != ".xml" { + return nil + } + + var content types.ObjectContent + err = m.decode(path, &content) + if err != nil { + return err + } + + if content.Obj == vim25.ServiceInstance { + s = new(ServiceInstance) + s.Self = content.Obj + ctx.Map.Put(s) + return mo.LoadObjectContent([]types.ObjectContent{content}, &s.ServiceInstance) + } + + if s == nil { + ctx, s = NewServiceInstance(ctx, m.ServiceContent, m.RootFolder) + } + + obj, err := loadObject(ctx, content) + if err != nil { + return err + } + + if x, ok := obj.(interface{ model(*Model) error }); ok { + if err = x.model(m); err != nil { + return err + } + } + + return m.loadMethod(ctx.Map.Put(obj), dir) + }) + + if err != nil { + return err + } + + m.Service = New(ctx, s) + + return m.resolveReferences(ctx) +} + +// Create populates the Model with the given ModelConfig +func (m *Model) Create() error { + ctx := NewContext() + m.Service = New(NewServiceInstance(ctx, m.ServiceContent, m.RootFolder)) + if err := m.createRootTempDir(ctx.Map.OptionManager()); err != nil { + return err + } + return m.CreateInfrastructure(ctx) +} + +func (m *Model) CreateInfrastructure(ctx *Context) error { + client := m.Service.client() + root := object.NewRootFolder(client) + + // After all hosts are created, this var is used to mount the host datastores. + var hosts []*object.HostSystem + hostMap := make(map[string][]*object.HostSystem) + + // We need to defer VM creation until after the datastores are created. + var vms []func() error + // 1 DVS per DC, added to all hosts + var dvs *object.DistributedVirtualSwitch + // 1 NIC per VM, backed by a DVPG if Model.Portgroup > 0 + vmnet := esx.EthernetCard.Backing + + // addHost adds a cluster host or a standalone host. + addHost := func(name string, f func(types.HostConnectSpec) (*object.Task, error)) (*object.HostSystem, error) { + spec := types.HostConnectSpec{ + HostName: name, + } + + task, err := f(spec) + if err != nil { + return nil, err + } + + info, err := task.WaitForResult(context.Background(), nil) + if err != nil { + return nil, err + } + + host := object.NewHostSystem(client, info.Result.(types.ManagedObjectReference)) + hosts = append(hosts, host) + + if dvs != nil { + config := &types.DVSConfigSpec{ + Host: []types.DistributedVirtualSwitchHostMemberConfigSpec{{ + Operation: string(types.ConfigSpecOperationAdd), + Host: host.Reference(), + }}, + } + + task, _ = dvs.Reconfigure(ctx, config) + _, _ = task.WaitForResult(context.Background(), nil) + } + + return host, nil + } + + // addMachine returns a func to create a VM. + addMachine := func(prefix string, host *object.HostSystem, pool *object.ResourcePool, folders *object.DatacenterFolders) { + nic := esx.EthernetCard + nic.Backing = vmnet + ds := types.ManagedObjectReference{} + + f := func() error { + for i := 0; i < m.Machine; i++ { + name := m.fmtName(prefix+"_VM", i) + + config := types.VirtualMachineConfigSpec{ + Name: name, + GuestId: string(types.VirtualMachineGuestOsIdentifierOtherGuest), + Files: &types.VirtualMachineFileInfo{ + VmPathName: "[LocalDS_0]", + }, + } + + if pool == nil { + pool, _ = host.ResourcePool(ctx) + } + + var devices object.VirtualDeviceList + + scsi, _ := devices.CreateSCSIController("pvscsi") + ide, _ := devices.CreateIDEController() + cdrom, _ := devices.CreateCdrom(ide.(*types.VirtualIDEController)) + disk := devices.CreateDisk(scsi.(types.BaseVirtualController), ds, + config.Files.VmPathName+" "+path.Join(name, "disk1.vmdk")) + disk.CapacityInKB = int64(units.GB*10) / units.KB + disk.StorageIOAllocation = &types.StorageIOAllocationInfo{Limit: types.NewInt64(-1)} + + devices = append(devices, scsi, cdrom, disk, &nic) + + config.DeviceChange, _ = devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + + task, err := folders.VmFolder.CreateVM(ctx, config, pool, host) + if err != nil { + return err + } + + info, err := task.WaitForResult(ctx, nil) + if err != nil { + return err + } + + vm := object.NewVirtualMachine(client, info.Result.(types.ManagedObjectReference)) + + if m.Autostart { + task, _ = vm.PowerOn(ctx) + _, _ = task.WaitForResult(ctx, nil) + } + } + + return nil + } + + vms = append(vms, f) + } + + nfolder := 0 + + for ndc := 0; ndc < m.Datacenter; ndc++ { + dcName := m.fmtName("DC", ndc) + folder := root + fName := m.fmtName("F", nfolder) + + // If Datacenter > Folder, don't create folders for the first N DCs. + if nfolder < m.Folder && ndc >= (m.Datacenter-m.Folder) { + f, err := folder.CreateFolder(ctx, fName) + if err != nil { + return err + } + folder = f + } + + dc, err := folder.CreateDatacenter(ctx, dcName) + if err != nil { + return err + } + + folders, err := dc.Folders(ctx) + if err != nil { + return err + } + + if m.Pod > 0 { + for pod := 0; pod < m.Pod; pod++ { + _, _ = folders.DatastoreFolder.CreateStoragePod(ctx, m.fmtName(dcName+"_POD", pod)) + } + } + + if folder != root { + // Create sub-folders and use them to create any resources that follow + subs := []**object.Folder{&folders.DatastoreFolder, &folders.HostFolder, &folders.NetworkFolder, &folders.VmFolder} + + for _, sub := range subs { + f, err := (*sub).CreateFolder(ctx, fName) + if err != nil { + return err + } + + *sub = f + } + + nfolder++ + } + + if m.Portgroup > 0 || m.PortgroupNSX > 0 { + var spec types.DVSCreateSpec + spec.ConfigSpec = &types.VMwareDVSConfigSpec{} + spec.ConfigSpec.GetDVSConfigSpec().Name = m.fmtName("DVS", 0) + + task, err := folders.NetworkFolder.CreateDVS(ctx, spec) + if err != nil { + return err + } + + info, err := task.WaitForResult(ctx, nil) + if err != nil { + return err + } + + dvs = object.NewDistributedVirtualSwitch(client, info.Result.(types.ManagedObjectReference)) + } + + for npg := 0; npg < m.Portgroup; npg++ { + name := m.fmtName(dcName+"_DVPG", npg) + spec := types.DVPortgroupConfigSpec{ + Name: name, + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + NumPorts: 1, + } + + task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{spec}) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } + + // Use the 1st DVPG for the VMs eth0 backing + if npg == 0 { + // AddPortgroup_Task does not return the moid, so we look it up by name + net := ctx.Map.Get(folders.NetworkFolder.Reference()).(*Folder) + pg := ctx.Map.FindByName(name, net.ChildEntity) + + vmnet, _ = object.NewDistributedVirtualPortgroup(client, pg.Reference()).EthernetCardBackingInfo(ctx) + } + } + + for npg := 0; npg < m.PortgroupNSX; npg++ { + name := m.fmtName(dcName+"_NSXPG", npg) + spec := types.DVPortgroupConfigSpec{ + Name: name, + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + BackingType: string(types.DistributedVirtualPortgroupBackingTypeNsx), + } + + task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{spec}) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } + } + + // Must use simulator methods directly for OpaqueNetwork + networkFolder := ctx.Map.Get(folders.NetworkFolder.Reference()).(*Folder) + + for i := 0; i < m.OpaqueNetwork; i++ { + var summary types.OpaqueNetworkSummary + summary.Name = m.fmtName(dcName+"_NSX", i) + err := networkFolder.AddOpaqueNetwork(ctx, summary) + if err != nil { + return err + } + } + + for nhost := 0; nhost < m.Host; nhost++ { + name := m.fmtName(dcName+"_H", nhost) + + host, err := addHost(name, func(spec types.HostConnectSpec) (*object.Task, error) { + return folders.HostFolder.AddStandaloneHost(ctx, spec, true, nil, nil) + }) + if err != nil { + return err + } + + addMachine(name, host, nil, folders) + } + + for ncluster := 0; ncluster < m.Cluster; ncluster++ { + clusterName := m.fmtName(dcName+"_C", ncluster) + + cluster, err := folders.HostFolder.CreateCluster(ctx, clusterName, types.ClusterConfigSpecEx{}) + if err != nil { + return err + } + + for nhost := 0; nhost < m.ClusterHost; nhost++ { + name := m.fmtName(clusterName+"_H", nhost) + + _, err = addHost(name, func(spec types.HostConnectSpec) (*object.Task, error) { + return cluster.AddHost(ctx, spec, true, nil, nil) + }) + if err != nil { + return err + } + } + + rootRP, err := cluster.ResourcePool(ctx) + if err != nil { + return err + } + + prefix := clusterName + "_RP" + + // put VMs in cluster RP if no child RP(s) configured + if m.Pool == 0 { + addMachine(prefix+"0", nil, rootRP, folders) + } + + // create child RP(s) with VMs + for childRP := 1; childRP <= m.Pool; childRP++ { + spec := types.DefaultResourceConfigSpec() + + p, err := rootRP.Create(ctx, m.fmtName(prefix, childRP), spec) + addMachine(m.fmtName(prefix, childRP), nil, p, folders) + if err != nil { + return err + } + } + + prefix = clusterName + "_APP" + + for napp := 0; napp < m.App; napp++ { + rspec := types.DefaultResourceConfigSpec() + vspec := NewVAppConfigSpec() + name := m.fmtName(prefix, napp) + + vapp, err := rootRP.CreateVApp(ctx, name, rspec, vspec, nil) + if err != nil { + return err + } + + addMachine(name, nil, vapp.ResourcePool, folders) + } + } + + hostMap[dcName] = hosts + hosts = nil + } + + if m.ServiceContent.RootFolder == esx.RootFolder.Reference() { + // ESX model + host := object.NewHostSystem(client, esx.HostSystem.Reference()) + + dc := object.NewDatacenter(client, esx.Datacenter.Reference()) + folders, err := dc.Folders(ctx) + if err != nil { + return err + } + + hostMap[dc.Reference().Value] = append(hosts, host) + + addMachine(host.Reference().Value, host, nil, folders) + } + + for dc, dchosts := range hostMap { + for i := 0; i < m.Datastore; i++ { + err := m.createLocalDatastore(dc, m.fmtName("LocalDS_", i), dchosts) + if err != nil { + return err + } + } + } + + for _, createVM := range vms { + err := createVM() + if err != nil { + return err + } + } + + // Turn on delay AFTER we're done building the service content + m.Service.delay = &m.DelayConfig + + return nil +} + +func (m *Model) createRootTempDir(opt *OptionManager) error { + var err error + + m.dir, err = os.MkdirTemp("", "govcsim-") + if err != nil { + return err + } + + opt.Setting = append(opt.Setting, &types.OptionValue{ + Key: "vcsim.home", + Value: m.dir, + }) + + return nil +} + +func (m *Model) createTempDir(name ...string) (string, error) { + p := path.Join(m.dir, strings.Join(name, "-")) + return p, os.Mkdir(p, 0700) +} + +func (m *Model) createLocalDatastore(dc string, name string, hosts []*object.HostSystem) error { + ctx := context.Background() + dir, err := m.createTempDir(dc, name) + if err != nil { + return err + } + + for _, host := range hosts { + dss, err := host.ConfigManager().DatastoreSystem(ctx) + if err != nil { + return err + } + + _, err = dss.CreateLocalDatastore(ctx, name, dir) + if err != nil { + return err + } + } + + return nil +} + +// Remove cleans up items created by the Model, such as local datastore directories +func (m *Model) Remove() { + ctx := m.Service.Context + // Remove associated vm containers, if any + ctx.Map.m.Lock() + for _, obj := range ctx.Map.objects { + if vm, ok := obj.(*VirtualMachine); ok { + vm.svm.remove(ctx) + } + } + ctx.Map.m.Unlock() + + _ = os.RemoveAll(m.dir) +} + +// Run calls f with a Client connected to a simulator server instance, which is stopped after f returns. +func (m *Model) Run(f func(context.Context, *vim25.Client) error) error { + defer m.Remove() + + if m.Service == nil { + err := m.Create() + if err != nil { + return err + } + // Only force TLS if the provided model didn't have any Service. + m.Service.TLS = new(tls.Config) + } + + m.Service.RegisterEndpoints = true + + s := m.Service.NewServer() + defer s.Close() + + ctx := m.Service.Context + c, err := govmomi.NewClient(ctx, s.URL, true) + if err != nil { + return err + } + + defer c.Logout(ctx) + + return f(ctx, c.Client) +} + +// Run calls Model.Run for each model and will panic if f returns an error. +// If no model is specified, the VPX Model is used by default. +func Run(f func(context.Context, *vim25.Client) error, model ...*Model) { + m := model + if len(m) == 0 { + m = []*Model{VPX()} + } + + for i := range m { + err := m[i].Run(f) + if err != nil { + panic(err) + } + } +} + +// Test calls Run and expects the caller propagate any errors, via testing.T for example. +func Test(f func(context.Context, *vim25.Client), model ...*Model) { + Run(func(ctx context.Context, c *vim25.Client) error { + f(ctx, c) + return nil + }, model...) +} + +// RunContainer runs a vm container with the given args +func RunContainer(ctx context.Context, c *vim25.Client, vm mo.Reference, args string) error { + obj, ok := vm.(*object.VirtualMachine) + if !ok { + obj = object.NewVirtualMachine(c, vm.Reference()) + } + + task, err := obj.PowerOff(ctx) + if err != nil { + return err + } + _ = task.Wait(ctx) // ignore InvalidPowerState if already off + + task, err = obj.Reconfigure(ctx, types.VirtualMachineConfigSpec{ + ExtraConfig: []types.BaseOptionValue{&types.OptionValue{Key: "RUN.container", Value: args}}, + }) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } + + task, err = obj.PowerOn(ctx) + if err != nil { + return err + } + return task.Wait(ctx) +} + +// delay sleeps according to DelayConfig. If no delay specified, returns immediately. +func (dc *DelayConfig) delay(method string) { + d := 0 + if dc.Delay > 0 { + d = dc.Delay + } + if md, ok := dc.MethodDelay[method]; ok { + d += md + } + if dc.DelayJitter > 0 { + d += int(rand.NormFloat64() * dc.DelayJitter * float64(d)) + } + if d > 0 { + //fmt.Printf("Delaying method %s %d ms\n", method, d) + time.Sleep(time.Duration(d) * time.Millisecond) + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/object.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/object.go new file mode 100644 index 000000000..9e6c381ed --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/object.go @@ -0,0 +1,62 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +func SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault { + body := &methods.SetCustomValueBody{} + + cfm := ctx.Map.CustomFieldsManager() + + _, field := cfm.findByNameType(req.Key, req.This.Type) + if field == nil { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "key"}) + return body + } + + res := cfm.SetField(ctx, &types.SetField{ + This: cfm.Reference(), + Entity: req.This, + Key: field.Key, + Value: req.Value, + }) + + if res.Fault() != nil { + body.Fault_ = res.Fault() + return body + } + + body.Res = &types.SetCustomValueResponse{} + return body +} + +// newUUID returns a stable UUID string based on input s +func newUUID(s string) string { + return internal.OID(s).String() +} + +// deepCopy uses xml encode/decode to copy src to dst +func deepCopy(src, dst any) { + b, err := xml.Marshal(src) + if err != nil { + panic(err) + } + + dec := xml.NewDecoder(bytes.NewReader(b)) + dec.TypeFunc = types.TypeFunc() + err = dec.Decode(dst) + if err != nil { + panic(err) + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/option_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/option_manager.go new file mode 100644 index 000000000..ee4397909 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/option_manager.go @@ -0,0 +1,126 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// OptionManager is used in at least two locations for ESX: +// 1. ServiceContent.setting - this is empty on ESX and //TODO on VC +// 2. ConfigManager.advancedOption - this is where the bulk of the ESX settings are found +type OptionManager struct { + mo.OptionManager + + // mirror is an array to keep in sync with OptionManager.Settings. Necessary because we use append. + // uni-directional - changes made to the mirrored array are not reflected back to Settings + mirror *[]types.BaseOptionValue +} + +// NewOptionManager constructs the type. If mirror is non-nil it takes precedence over settings, and settings is ignored. +// Args: +// - ref - used to set OptionManager.Self if non-nil +// - setting - initial options, may be nil. +// - mirror - options array to keep updated with the OptionManager.Settings, may be nil. +func NewOptionManager(ref *types.ManagedObjectReference, setting []types.BaseOptionValue, mirror *[]types.BaseOptionValue) object.Reference { + s := &OptionManager{} + + s.Setting = setting + if mirror != nil { + s.mirror = mirror + s.Setting = *mirror + } + + if ref != nil { + s.Self = *ref + } + + return s +} + +// init constructs the OptionManager for ServiceContent.setting from the template directories. +// This does _not_ construct the OptionManager for ConfigManager.advancedOption. +func (m *OptionManager) init(r *Registry) { + if len(m.Setting) == 0 { + if r.IsVPX() { + m.Setting = vpx.Setting + } else { + m.Setting = esx.Setting + } + } +} + +func (m *OptionManager) model(model *Model) error { + return model.createRootTempDir(m) +} + +func (m *OptionManager) QueryOptions(req *types.QueryOptions) soap.HasFault { + body := &methods.QueryOptionsBody{} + res := &types.QueryOptionsResponse{} + + for _, opt := range m.Setting { + if strings.HasPrefix(opt.GetOptionValue().Key, req.Name) { + res.Returnval = append(res.Returnval, opt) + } + } + + if len(res.Returnval) == 0 { + body.Fault_ = Fault("", &types.InvalidName{Name: req.Name}) + } else { + body.Res = res + } + + return body +} + +func (m *OptionManager) find(key string) *types.OptionValue { + for _, opt := range m.Setting { + setting := opt.GetOptionValue() + if setting.Key == key { + return setting + } + } + return nil +} + +func (m *OptionManager) UpdateOptions(req *types.UpdateOptions) soap.HasFault { + body := new(methods.UpdateOptionsBody) + + for _, change := range req.ChangedValue { + setting := change.GetOptionValue() + + // We don't currently include the entire list of default settings for ESX and vCenter, + // this prefix is currently used to test the failure path. + // Real vCenter seems to only allow new options if Key has a "config." prefix. + // TODO: consider behaving the same, which would require including 2 long lists of options in vpx.Setting and esx.Setting + if strings.HasPrefix(setting.Key, "ENOENT.") { + body.Fault_ = Fault("", &types.InvalidName{Name: setting.Key}) + return body + } + + opt := m.find(setting.Key) + if opt != nil { + // This is an existing option. + opt.Value = setting.Value + continue + } + + m.Setting = append(m.Setting, change) + if m.mirror != nil { + *m.mirror = m.Setting + } + } + + body.Res = new(types.UpdateOptionsResponse) + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go new file mode 100644 index 000000000..487d5c9d7 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go @@ -0,0 +1,357 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "log" + "math" + "strconv" + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type OvfManager struct { + mo.OvfManager +} + +func ovfDisk(e *ovf.Envelope, diskID string) *ovf.VirtualDiskDesc { + for _, disk := range e.Disk.Disks { + if strings.HasSuffix(diskID, disk.DiskID) { + return &disk + } + } + return nil +} + +func ovfNetwork(ctx *Context, req *types.CreateImportSpec, item ovf.ResourceAllocationSettingData) types.BaseVirtualDeviceBackingInfo { + if len(item.Connection) == 0 { + return nil + } + pool := ctx.Map.Get(req.ResourcePool).(mo.Entity) + ref := ctx.Map.getEntityDatacenter(pool).defaultNetwork()[0] // Default to VM Network + c := item.Connection[0] + + cisp := req.Cisp.GetOvfCreateImportSpecParams() + + for _, net := range cisp.NetworkMapping { + if net.Name == c { + ref = net.Network + break + } + } + + switch obj := ctx.Map.Get(ref).(type) { + case *mo.Network: + return &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: obj.Name, + }, + } + case *DistributedVirtualPortgroup: + dvs := ctx.Map.Get(*obj.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + return &types.VirtualEthernetCardDistributedVirtualPortBackingInfo{ + Port: types.DistributedVirtualSwitchPortConnection{ + PortgroupKey: obj.Key, + SwitchUuid: dvs.Config.GetDVSConfigInfo().Uuid, + }, + } + default: + log.Printf("ovf: unknown network type: %T", ref) + return nil + } +} + +func ovfDiskCapacity(disk *ovf.VirtualDiskDesc) int64 { + b, _ := strconv.ParseUint(disk.Capacity, 10, 64) + if disk.CapacityAllocationUnits == nil { + return int64(b) + } + c := strings.Fields(*disk.CapacityAllocationUnits) + if len(c) == 3 && c[0] == "byte" && c[1] == "*" { // "byte * 2^20" + p := strings.Split(c[2], "^") + x, _ := strconv.ParseUint(p[0], 10, 64) + if len(p) == 2 { + y, _ := strconv.ParseUint(p[1], 10, 64) + b *= uint64(math.Pow(float64(x), float64(y))) + } else { + b *= x + } + } + return int64(b / 1024) +} + +func (m *OvfManager) CreateImportSpec(ctx *Context, req *types.CreateImportSpec) soap.HasFault { + body := new(methods.CreateImportSpecBody) + + env, err := ovf.Unmarshal(strings.NewReader(req.OvfDescriptor)) + if err != nil { + body.Fault_ = Fault(err.Error(), &types.InvalidArgument{InvalidProperty: "ovfDescriptor"}) + return body + } + + cisp := req.Cisp.GetOvfCreateImportSpecParams() + + ds := ctx.Map.Get(req.Datastore).(*Datastore) + path := object.DatastorePath{Datastore: ds.Name} + vapp := &types.VAppConfigSpec{} + spec := &types.VirtualMachineImportSpec{ + ConfigSpec: types.VirtualMachineConfigSpec{ + Name: cisp.EntityName, + Version: esx.HardwareVersion, + GuestId: string(types.VirtualMachineGuestOsIdentifierOtherGuest), + Files: &types.VirtualMachineFileInfo{ + VmPathName: path.String(), + }, + NumCPUs: 1, + NumCoresPerSocket: 1, + MemoryMB: 32, + VAppConfig: vapp, + }, + ResPoolEntity: &req.ResourcePool, + } + + index := 0 + for i, product := range env.VirtualSystem.Product { + vapp.Product = append(vapp.Product, types.VAppProductSpec{ + ArrayUpdateSpec: types.ArrayUpdateSpec{ + Operation: types.ArrayUpdateOperationAdd, + }, + Info: &types.VAppProductInfo{ + Key: int32(i), + ClassId: toString(product.Class), + InstanceId: toString(product.Instance), + Name: product.Product, + Vendor: product.Vendor, + Version: product.Version, + }, + }) + + for _, p := range product.Property { + key := product.Key(p) + val := "" + + for _, m := range cisp.PropertyMapping { + if m.Key == key { + val = m.Value + } + } + + vapp.Property = append(vapp.Property, types.VAppPropertySpec{ + ArrayUpdateSpec: types.ArrayUpdateSpec{ + Operation: types.ArrayUpdateOperationAdd, + }, + Info: &types.VAppPropertyInfo{ + Key: int32(index), + ClassId: toString(product.Class), + InstanceId: toString(product.Instance), + Id: p.Key, + Category: product.Category, + Label: toString(p.Label), + Type: p.Type, + UserConfigurable: p.UserConfigurable, + DefaultValue: toString(p.Default), + Value: val, + Description: toString(p.Description), + }, + }) + index++ + } + } + + if cisp.DeploymentOption == "" && env.DeploymentOption != nil { + for _, c := range env.DeploymentOption.Configuration { + if isTrue(c.Default) { + cisp.DeploymentOption = c.ID + break + } + } + } + + if os := env.VirtualSystem.OperatingSystem; os != nil { + if id := os.OSType; id != nil { + spec.ConfigSpec.GuestId = *id + } + } + + var device object.VirtualDeviceList + result := types.OvfCreateImportSpecResult{ + ImportSpec: spec, + } + + hw := env.VirtualSystem.VirtualHardware[0] + if vmx := hw.System.VirtualSystemType; vmx != nil { + version := strings.Split(*vmx, ",")[0] + spec.ConfigSpec.Version = strings.TrimSpace(version) + } + + ndisk := 0 + ndev := 0 + resources := make(map[string]types.BaseVirtualDevice) + + for _, item := range hw.Item { + if cisp.DeploymentOption != "" && item.Configuration != nil { + if cisp.DeploymentOption != *item.Configuration { + continue + } + } + + kind := func() string { + if item.ResourceSubType == nil { + return "unknown" + } + return strings.ToLower(*item.ResourceSubType) + } + + unsupported := func(err error) { + result.Error = append(result.Error, types.LocalizedMethodFault{ + Fault: &types.OvfUnsupportedType{ + Name: item.ElementName, + InstanceId: item.InstanceID, + DeviceType: int32(*item.ResourceType), + }, + LocalizedMessage: err.Error(), + }) + } + + upload := func(file ovf.File, c types.BaseVirtualDevice, n int) { + result.FileItem = append(result.FileItem, types.OvfFileItem{ + DeviceId: fmt.Sprintf("/%s/%s:%d", cisp.EntityName, device.Type(c), n), + Path: file.Href, + Size: int64(file.Size), + CimType: int32(*item.ResourceType), + }) + } + + switch *item.ResourceType { + case 1: // VMCI + case 3: // Number of Virtual CPUs + spec.ConfigSpec.NumCPUs = int32(*item.VirtualQuantity) + case 4: // Memory Size + spec.ConfigSpec.MemoryMB = int64(*item.VirtualQuantity) + case 5: // IDE Controller + d, _ := device.CreateIDEController() + device = append(device, d) + resources[item.InstanceID] = d + case 6: // SCSI Controller + d, err := device.CreateSCSIController(kind()) + if err == nil { + device = append(device, d) + resources[item.InstanceID] = d + } else { + unsupported(err) + } + case 10: // Virtual Network + net := ovfNetwork(ctx, req, item) + if net != nil { + d, err := device.CreateEthernetCard(kind(), net) + if err == nil { + device = append(device, d) + } else { + unsupported(err) + } + } + case 14: // Floppy Drive + if device.PickController((*types.VirtualSIOController)(nil)) == nil { + c := &types.VirtualSIOController{} + c.Key = device.NewKey() + device = append(device, c) + } + d, err := device.CreateFloppy() + if err == nil { + device = append(device, d) + resources[item.InstanceID] = d + } else { + unsupported(err) + } + case 15: // CD/DVD + c, ok := resources[*item.Parent] + if !ok { + continue // Parent is unsupported() + } + d, _ := device.CreateCdrom(c.(*types.VirtualIDEController)) + if len(item.HostResource) != 0 { + for _, file := range env.References { + if strings.HasSuffix(item.HostResource[0], file.ID) { + path.Path = fmt.Sprintf("%s/_deviceImage%d.iso", cisp.EntityName, ndev) + device.InsertIso(d, path.String()) + upload(file, d, ndev) + break + } + } + } + device = append(device, d) + ndev++ + case 17: // Virtual Disk + c, ok := resources[*item.Parent] + if !ok { + continue // Parent is unsupported() + } + path.Path = fmt.Sprintf("%s/disk-%d.vmdk", cisp.EntityName, ndisk) + d := device.CreateDisk(c.(types.BaseVirtualController), ds.Reference(), path.String()) + + switch types.OvfCreateImportSpecParamsDiskProvisioningType(cisp.DiskProvisioning) { + case "", + types.OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicFlat, + types.OvfCreateImportSpecParamsDiskProvisioningTypeFlat, + types.OvfCreateImportSpecParamsDiskProvisioningTypeEagerZeroedThick, + types.OvfCreateImportSpecParamsDiskProvisioningTypeThin, + types.OvfCreateImportSpecParamsDiskProvisioningTypeThick, + types.OvfCreateImportSpecParamsDiskProvisioningTypeSeSparse: + // OK + case types.OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicSparse: + // results in DeviceUnsupportedForVmPlatform during import + d.VirtualDevice.Backing = new(types.VirtualDiskSparseVer2BackingInfo) + default: + result.Error = append(result.Error, types.LocalizedMethodFault{ + Fault: &types.OvfUnsupportedDiskProvisioning{ + DiskProvisioning: cisp.DiskProvisioning, + }, + LocalizedMessage: "Disk provisioning type not supported: " + cisp.DiskProvisioning, + }) + } + + d.VirtualDevice.DeviceInfo = &types.Description{ + Label: item.ElementName, + } + disk := ovfDisk(env, item.HostResource[0]) + for _, file := range env.References { + if file.ID == *disk.FileRef { + upload(file, d, ndisk) + break + } + } + d.CapacityInKB = ovfDiskCapacity(disk) + device = append(device, d) + ndisk++ + case 23: // USB Controller + case 24: // Video Card + default: + unsupported(fmt.Errorf("unsupported resource type: %d", *item.ResourceType)) + } + } + + spec.ConfigSpec.DeviceChange, _ = device.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + + for _, p := range cisp.PropertyMapping { + spec.ConfigSpec.ExtraConfig = append(spec.ConfigSpec.ExtraConfig, &types.OptionValue{ + Key: p.Key, + Value: p.Value, + }) + } + + body.Res = &types.CreateImportSpecResponse{ + Returnval: result, + } + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/performance_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/performance_manager.go new file mode 100644 index 000000000..4c3b91663 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/performance_manager.go @@ -0,0 +1,284 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "math/rand" + "strconv" + "strings" + "time" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var realtimeProviderSummary = types.PerfProviderSummary{ + CurrentSupported: true, + SummarySupported: true, + RefreshRate: 20, +} + +var historicProviderSummary = types.PerfProviderSummary{ + CurrentSupported: false, + SummarySupported: true, + RefreshRate: -1, +} + +type PerformanceManager struct { + mo.PerformanceManager + vmMetrics []types.PerfMetricId + hostMetrics []types.PerfMetricId + rpMetrics []types.PerfMetricId + clusterMetrics []types.PerfMetricId + datastoreMetrics []types.PerfMetricId + datacenterMetrics []types.PerfMetricId + perfCounterIndex map[int32]types.PerfCounterInfo + metricData map[string]map[int32][]int64 +} + +func (m *PerformanceManager) init(r *Registry) { + if r.IsESX() { + m.PerfCounter = esx.PerfCounter + m.HistoricalInterval = esx.HistoricalInterval + m.hostMetrics = esx.HostMetrics + m.vmMetrics = esx.VmMetrics + m.rpMetrics = esx.ResourcePoolMetrics + m.metricData = esx.MetricData + } else { + m.PerfCounter = vpx.PerfCounter + m.HistoricalInterval = vpx.HistoricalInterval + m.hostMetrics = vpx.HostMetrics + m.vmMetrics = vpx.VmMetrics + m.rpMetrics = vpx.ResourcePoolMetrics + m.clusterMetrics = vpx.ClusterMetrics + m.datastoreMetrics = vpx.DatastoreMetrics + m.datacenterMetrics = vpx.DatacenterMetrics + m.metricData = vpx.MetricData + } + m.perfCounterIndex = make(map[int32]types.PerfCounterInfo, len(m.PerfCounter)) + for _, p := range m.PerfCounter { + m.perfCounterIndex[p.Key] = p + } +} + +func (p *PerformanceManager) QueryPerfCounter(ctx *Context, req *types.QueryPerfCounter) soap.HasFault { + body := new(methods.QueryPerfCounterBody) + body.Res = new(types.QueryPerfCounterResponse) + body.Res.Returnval = make([]types.PerfCounterInfo, len(req.CounterId)) + for i, id := range req.CounterId { + body.Res.Returnval[i] = p.perfCounterIndex[id] + } + return body +} + +func (p *PerformanceManager) QueryPerfProviderSummary(ctx *Context, req *types.QueryPerfProviderSummary) soap.HasFault { + body := new(methods.QueryPerfProviderSummaryBody) + body.Res = new(types.QueryPerfProviderSummaryResponse) + + // The entity must exist + if ctx.Map.Get(req.Entity) == nil { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "Entity", + }) + return body + } + + switch req.Entity.Type { + case "VirtualMachine", "HostSystem", "ResourcePool": + body.Res.Returnval = realtimeProviderSummary + default: + body.Res.Returnval = historicProviderSummary + } + body.Res.Returnval.Entity = req.Entity + return body +} + +func (p *PerformanceManager) buildAvailablePerfMetricsQueryResponse(ids []types.PerfMetricId, numCPU int, datastoreURL string) *types.QueryAvailablePerfMetricResponse { + r := new(types.QueryAvailablePerfMetricResponse) + r.Returnval = make([]types.PerfMetricId, 0, len(ids)) + for _, id := range ids { + switch id.Instance { + case "$cpu": + for i := 0; i < numCPU; i++ { + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: strconv.Itoa(i)}) + } + case "$physDisk": + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: datastoreURL}) + case "$file": + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: "DISKFILE"}) + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: "DELTAFILE"}) + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: "SWAPFILE"}) + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: "OTHERFILE"}) + default: + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: id.Instance}) + } + } + // Add a CounterId without a corresponding PerfCounterInfo entry. See issue #2835 + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: 10042}) + return r +} + +func (p *PerformanceManager) queryAvailablePerfMetric(ctx *Context, entity types.ManagedObjectReference, interval int32) *types.QueryAvailablePerfMetricResponse { + switch entity.Type { + case "VirtualMachine": + vm := ctx.Map.Get(entity).(*VirtualMachine) + return p.buildAvailablePerfMetricsQueryResponse(p.vmMetrics, int(vm.Summary.Config.NumCpu), vm.Datastore[0].Value) + case "HostSystem": + host := ctx.Map.Get(entity).(*HostSystem) + return p.buildAvailablePerfMetricsQueryResponse(p.hostMetrics, int(host.Hardware.CpuInfo.NumCpuThreads), host.Datastore[0].Value) + case "ResourcePool": + return p.buildAvailablePerfMetricsQueryResponse(p.rpMetrics, 0, "") + case "ClusterComputeResource": + if interval != 20 { + return p.buildAvailablePerfMetricsQueryResponse(p.clusterMetrics, 0, "") + } + case "Datastore": + if interval != 20 { + return p.buildAvailablePerfMetricsQueryResponse(p.datastoreMetrics, 0, "") + } + case "Datacenter": + if interval != 20 { + return p.buildAvailablePerfMetricsQueryResponse(p.datacenterMetrics, 0, "") + } + } + + // Don't know how to handle this. Return empty response. + return new(types.QueryAvailablePerfMetricResponse) +} + +func (p *PerformanceManager) QueryAvailablePerfMetric(ctx *Context, req *types.QueryAvailablePerfMetric) soap.HasFault { + body := new(methods.QueryAvailablePerfMetricBody) + body.Res = p.queryAvailablePerfMetric(ctx, req.Entity, req.IntervalId) + + return body +} + +func (p *PerformanceManager) QueryPerf(ctx *Context, req *types.QueryPerf) soap.HasFault { + body := new(methods.QueryPerfBody) + body.Res = new(types.QueryPerfResponse) + body.Res.Returnval = make([]types.BasePerfEntityMetricBase, len(req.QuerySpec)) + + for i, qs := range req.QuerySpec { + // Get metric data for this entity type + metricData, ok := p.metricData[qs.Entity.Type] + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "Entity", + }) + } + var start, end time.Time + if qs.StartTime == nil { + start = time.Now().Add(time.Duration(-365*24) * time.Hour) // Assume we have data for a year + } else { + start = *qs.StartTime + } + if qs.EndTime == nil { + end = time.Now() + } else { + end = *qs.EndTime + } + + // Generate metric series. Divide into n buckets of interval seconds + interval := qs.IntervalId + if interval == -1 || interval == 0 { + interval = 20 // TODO: Determine from entity type + } + n := 1 + int32(end.Sub(start).Seconds())/interval + if qs.MaxSample > 0 && n > qs.MaxSample { + n = qs.MaxSample + } + + metrics := new(types.PerfEntityMetric) + metrics.Entity = qs.Entity + + // Loop through each interval "tick" + metrics.SampleInfo = make([]types.PerfSampleInfo, n) + metrics.Value = make([]types.BasePerfMetricSeries, len(qs.MetricId)) + for tick := int32(0); tick < n; tick++ { + metrics.SampleInfo[tick] = types.PerfSampleInfo{Timestamp: end.Add(time.Duration(-interval*tick) * time.Second), Interval: interval} + } + + series := make([]*types.PerfMetricIntSeries, len(qs.MetricId)) + for j, mid := range qs.MetricId { + // Create list of metrics for this tick + series[j] = &types.PerfMetricIntSeries{Value: make([]int64, n)} + series[j].Id = mid + points := metricData[mid.CounterId] + offset := int64(start.Unix()) / int64(interval) + + for tick := int32(0); tick < n; tick++ { + var p int64 + + // Use sample data if we have it. Otherwise, just send 0. + if len(points) > 0 { + p = points[(offset+int64(tick))%int64(len(points))] + scale := p / 5 + if scale > 0 { + // Add some gaussian noise to make the data look more "real" + p += int64(rand.NormFloat64() * float64(scale)) + if p < 0 { + p = 0 + } + } + } else { + p = 0 + } + series[j].Value[tick] = p + } + metrics.Value[j] = series[j] + } + + if qs.Format == string(types.PerfFormatCsv) { + metricsCsv := new(types.PerfEntityMetricCSV) + metricsCsv.Entity = qs.Entity + + //PerfSampleInfo encoded in the following CSV format: [interval1], [date1], [interval2], [date2], and so on. + metricsCsv.SampleInfoCSV = sampleInfoCSV(metrics) + metricsCsv.Value = make([]types.PerfMetricSeriesCSV, len(qs.MetricId)) + + for j, mid := range qs.MetricId { + seriesCsv := &types.PerfMetricSeriesCSV{Value: ""} + seriesCsv.Id = mid + seriesCsv.Value = valueCSV(series[j]) + metricsCsv.Value[j] = *seriesCsv + } + + body.Res.Returnval[i] = metricsCsv + } else { + body.Res.Returnval[i] = metrics + } + } + return body +} + +// sampleInfoCSV converts the SampleInfo field to a CSV string +func sampleInfoCSV(m *types.PerfEntityMetric) string { + values := make([]string, len(m.SampleInfo)*2) + + i := 0 + for _, s := range m.SampleInfo { + values[i] = strconv.Itoa(int(s.Interval)) + i++ + values[i] = s.Timestamp.Format(time.RFC3339) + i++ + } + + return strings.Join(values, ",") +} + +// valueCSV converts the Value field to a CSV string +func valueCSV(s *types.PerfMetricIntSeries) string { + values := make([]string, len(s.Value)) + + for i := range s.Value { + values[i] = strconv.FormatInt(s.Value[i], 10) + } + + return strings.Join(values, ",") +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/portgroup.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/portgroup.go new file mode 100644 index 000000000..15250acd6 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/portgroup.go @@ -0,0 +1,85 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type DistributedVirtualPortgroup struct { + mo.DistributedVirtualPortgroup +} + +func (p *DistributedVirtualPortgroup) event(ctx *Context) types.DVPortgroupEvent { + dvs := ctx.Map.Get(*p.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + + return types.DVPortgroupEvent{ + Event: types.Event{ + Datacenter: datacenterEventArgument(ctx, p), + Net: &types.NetworkEventArgument{ + EntityEventArgument: types.EntityEventArgument{ + Name: p.Name, + }, + Network: p.Self, + }, + Dvs: dvs.eventArgument(), + }, + } +} + +func (s *DistributedVirtualPortgroup) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault { + canDup := s.DistributedVirtualPortgroup.Config.BackingType == string(types.DistributedVirtualPortgroupBackingTypeNsx) + + return RenameTask(ctx, s, req, canDup) +} + +func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(ctx *Context, req *types.ReconfigureDVPortgroup_Task) soap.HasFault { + task := CreateTask(s, "reconfigureDvPortgroup", func(t *Task) (types.AnyType, types.BaseMethodFault) { + s.Config.DefaultPortConfig = req.Spec.DefaultPortConfig + s.Config.NumPorts = req.Spec.NumPorts + s.Config.AutoExpand = req.Spec.AutoExpand + s.Config.Type = req.Spec.Type + s.Config.Description = req.Spec.Description + s.Config.DynamicData = req.Spec.DynamicData + s.Config.Name = req.Spec.Name + s.Config.Policy = req.Spec.Policy + s.Config.PortNameFormat = req.Spec.PortNameFormat + s.Config.VmVnicNetworkResourcePoolKey = req.Spec.VmVnicNetworkResourcePoolKey + s.Config.LogicalSwitchUuid = req.Spec.LogicalSwitchUuid + s.Config.BackingType = req.Spec.BackingType + + return nil, nil + }) + + return &methods.ReconfigureDVPortgroup_TaskBody{ + Res: &types.ReconfigureDVPortgroup_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (s *DistributedVirtualPortgroup) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(s, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + vswitch := ctx.Map.Get(*s.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + ctx.Map.RemoveReference(ctx, vswitch, &vswitch.Portgroup, s.Reference()) + ctx.Map.removeString(ctx, vswitch, &vswitch.Summary.PortgroupName, s.Name) + + f := ctx.Map.getEntityParent(vswitch, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, s.Reference()) + ctx.postEvent(&types.DVPortgroupDestroyedEvent{DVPortgroupEvent: s.event(ctx)}) + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } + +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/property_collector.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/property_collector.go new file mode 100644 index 000000000..65424c95e --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/property_collector.go @@ -0,0 +1,1080 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "context" + "errors" + "log" + "path" + "reflect" + "strings" + "sync" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type PropertyCollector struct { + mo.PropertyCollector + + nopLocker + pending *types.UpdateSet + updates []types.ObjectUpdate + mu sync.Mutex + cancel context.CancelFunc +} + +func NewPropertyCollector(ref types.ManagedObjectReference) object.Reference { + s := &PropertyCollector{} + s.Self = ref + return s +} + +var errMissingField = errors.New("missing field") +var errEmptyField = errors.New("empty field") +var errInvalidField = errors.New("invalid field") + +func getObject(ctx *Context, ref types.ManagedObjectReference) (reflect.Value, bool) { + var obj mo.Reference + if ctx.Session == nil { + // Even without permissions to access an object or specific fields, RetrieveProperties + // returns an ObjectContent response as long as the object exists. See retrieveResult.add() + obj = ctx.Map.Get(ref) + } else { + obj = ctx.Session.Get(ref) + } + + if obj == nil { + return reflect.Value{}, false + } + + if ctx.Session == nil && ref.Type == "SessionManager" { + // RetrieveProperties on SessionManager without a session always returns empty, + // rather than MissingSet + Fault.NotAuthenticated for each field. + obj = &mo.SessionManager{Self: ref} + } + + // For objects that use internal types that differ from that of the vim25/mo field types. + // See EventHistoryCollector for example. + type get interface { + Get() mo.Reference + } + if o, ok := obj.(get); ok { + obj = o.Get() + } + + return getManagedObject(obj), true +} + +func getManagedObject(obj mo.Reference) reflect.Value { + rval := reflect.ValueOf(obj).Elem() + rtype := rval.Type() + + // PropertyCollector is for Managed Object types only (package mo). + // If the registry object is not in the mo package, assume it is a wrapper + // type where the first field is an embedded mo type. + // We need to dig out the mo type for PropSet.All to work properly and + // for the case where the type has a field of the same name, for example: + // mo.ResourcePool.ResourcePool + for { + if path.Base(rtype.PkgPath()) == "mo" { + break + } + if rtype.Kind() != reflect.Struct || rtype.NumField() == 0 { + log.Panicf("%#v does not have an embedded mo type", obj.Reference()) + } + rval = rval.Field(0) + rtype = rval.Type() + if rtype.Kind() == reflect.Pointer { + rval = rval.Elem() + rtype = rval.Type() + } + } + + return rval +} + +// wrapValue converts slice types to the appropriate ArrayOf type used in property collector responses. +func wrapValue(rval reflect.Value, rtype reflect.Type) any { + pval := rval.Interface() + + if rval.Kind() == reflect.Slice { + // Convert slice to types.ArrayOf* + switch v := pval.(type) { + case []string: + pval = &types.ArrayOfString{ + String: v, + } + case []uint8: + pval = &types.ArrayOfByte{ + Byte: v, + } + case types.ByteSlice: + pval = &types.ArrayOfByte{ + Byte: v, + } + case []int16: + pval = &types.ArrayOfShort{ + Short: v, + } + case []int32: + pval = &types.ArrayOfInt{ + Int: v, + } + case []int64: + pval = &types.ArrayOfLong{ + Long: v, + } + default: + kind := rtype.Elem().Name() + // Remove govmomi interface prefix name + kind = strings.TrimPrefix(kind, "Base") + akind, _ := defaultMapType("ArrayOf" + kind) + a := reflect.New(akind) + a.Elem().FieldByName(kind).Set(rval) + pval = a.Interface() + } + } + + return pval +} + +func fieldValueInterface(f reflect.StructField, rval reflect.Value, keyed ...bool) any { + if rval.Kind() == reflect.Ptr { + rval = rval.Elem() + } + + if len(keyed) == 1 && keyed[0] { + return rval.Interface() // don't wrap keyed fields in ArrayOf* type + } + + return wrapValue(rval, f.Type) +} + +func fieldValue(rval reflect.Value, p string, keyed ...bool) (any, error) { + var value any + fields := strings.Split(p, ".") + + for i, name := range fields { + kind := rval.Type().Kind() + + if kind == reflect.Interface { + if rval.IsNil() { + continue + } + rval = rval.Elem() + kind = rval.Type().Kind() + } + + if kind == reflect.Ptr { + if rval.IsNil() { + continue + } + rval = rval.Elem() + } + + if kind == reflect.Slice { + // field of array field cannot be specified + return nil, errInvalidField + } + + x := ucFirst(name) + val := rval.FieldByName(x) + if !val.IsValid() { + return nil, errMissingField + } + + if isEmpty(val) { + return nil, errEmptyField + } + + if i == len(fields)-1 { + ftype, _ := rval.Type().FieldByName(x) + value = fieldValueInterface(ftype, val, keyed...) + break + } + + rval = val + } + + return value, nil +} + +func fieldValueKey(rval reflect.Value, p mo.Field) (any, error) { + if rval.Kind() != reflect.Slice { + return nil, errInvalidField + } + + zero := reflect.Value{} + + for i := 0; i < rval.Len(); i++ { + item := rval.Index(i) + if item.Kind() == reflect.Interface { + item = item.Elem() + } + if item.Kind() == reflect.Ptr { + item = item.Elem() + } + if item.Kind() != reflect.Struct { + return reflect.Value{}, errInvalidField + } + + field := item.FieldByName("Key") + if field == zero { + return nil, errInvalidField + } + + switch key := field.Interface().(type) { + case string: + s, ok := p.Key.(string) + if !ok { + return nil, errInvalidField + } + if s == key { + return item.Interface(), nil + } + case int32: + s, ok := p.Key.(int32) + if !ok { + return nil, errInvalidField + } + if s == key { + return item.Interface(), nil + } + default: + return nil, errInvalidField + } + } + + return nil, nil +} + +func fieldValueIndex(rval reflect.Value, p mo.Field) (any, error) { + val, err := fieldValueKey(rval, p) + if err != nil || val == nil || p.Item == "" { + return val, err + } + + return fieldValue(reflect.ValueOf(val), p.Item) +} + +func fieldRefs(f any) []types.ManagedObjectReference { + switch fv := f.(type) { + case types.ManagedObjectReference: + return []types.ManagedObjectReference{fv} + case *types.ArrayOfManagedObjectReference: + return fv.ManagedObjectReference + case nil: + // empty field + } + + return nil +} + +func isEmpty(rval reflect.Value) bool { + switch rval.Kind() { + case reflect.Ptr: + return rval.IsNil() + case reflect.String: + return rval.Len() == 0 + } + + return false +} + +func isTrue(v *bool) bool { + return v != nil && *v +} + +func isFalse(v *bool) bool { + return v == nil || !*v +} + +func toString(v *string) string { + if v == nil { + return "" + } + return *v +} + +func lcFirst(s string) string { + if len(s) < 1 { + return s + } + return strings.ToLower(s[:1]) + s[1:] +} + +func ucFirst(s string) string { + if len(s) < 1 { + return s + } + return strings.ToUpper(s[:1]) + s[1:] +} + +type retrieveResult struct { + *types.RetrieveResult + req *types.RetrievePropertiesEx + collected map[types.ManagedObjectReference]bool + specs map[string]*types.TraversalSpec +} + +func (rr *retrieveResult) add(ctx *Context, name string, val types.AnyType, content *types.ObjectContent) { + if ctx.Session != nil { + content.PropSet = append(content.PropSet, types.DynamicProperty{ + Name: name, + Val: val, + }) + return + } + + content.MissingSet = append(content.MissingSet, types.MissingProperty{ + Path: name, + Fault: types.LocalizedMethodFault{Fault: &types.NotAuthenticated{ + NoPermission: types.NoPermission{ + Object: &content.Obj, + PrivilegeId: "System.Read", + }}, + }, + }) +} + +func (rr *retrieveResult) collectAll(ctx *Context, rval reflect.Value, rtype reflect.Type, content *types.ObjectContent) { + for i := 0; i < rval.NumField(); i++ { + val := rval.Field(i) + + f := rtype.Field(i) + + if isEmpty(val) || f.Name == "Self" { + continue + } + + if f.Anonymous { + // recurse into embedded field + rr.collectAll(ctx, val, f.Type, content) + continue + } + + rr.add(ctx, lcFirst(f.Name), fieldValueInterface(f, val), content) + } +} + +func (rr *retrieveResult) collectFields(ctx *Context, rval reflect.Value, fields []string, content *types.ObjectContent) { + seen := make(map[string]bool) + + for i := range content.PropSet { + seen[content.PropSet[i].Name] = true // mark any already collected via embedded field + } + + for _, name := range fields { + if seen[name] { + // rvc 'ls' includes the "name" property twice, then fails with no error message or stack trace + // in RbVmomi::VIM::ObjectContent.to_hash_uncached when it sees the 2nd "name" property. + continue + } + seen[name] = true + + var val any + var err error + var field mo.Field + if field.FromString(name) { + keyed := field.Key != nil + + val, err = fieldValue(rval, field.Path, keyed) + if err == nil && keyed { + val, err = fieldValueIndex(reflect.ValueOf(val), field) + } + } else { + err = errInvalidField + } + + switch err { + case nil, errEmptyField: + rr.add(ctx, name, val, content) + case errMissingField: + content.MissingSet = append(content.MissingSet, types.MissingProperty{ + Path: name, + Fault: types.LocalizedMethodFault{Fault: &types.InvalidProperty{ + Name: name, + }}, + }) + case errInvalidField: + content.MissingSet = append(content.MissingSet, types.MissingProperty{ + Path: name, + Fault: types.LocalizedMethodFault{Fault: &types.InvalidProperty{ + Name: name, + }}, + }) + } + } +} + +func (rr *retrieveResult) collect(ctx *Context, ref types.ManagedObjectReference) { + if rr.collected[ref] { + return + } + + content := types.ObjectContent{ + Obj: ref, + } + + rval, ok := getObject(ctx, ref) + if !ok { + // Possible if a test uses ctx.Map.Remove instead of Destroy_Task + tracef("object %s no longer exists", ref) + return + } + + rtype := rval.Type() + match := false + + for _, spec := range rr.req.SpecSet { + for _, p := range spec.PropSet { + if p.Type != ref.Type && p.Type != rtype.Name() { + // e.g. ManagedEntity, ComputeResource + field, ok := rtype.FieldByName(p.Type) + + if !(ok && field.Anonymous) { + continue + } + } + match = true + if isTrue(p.All) { + rr.collectAll(ctx, rval, rtype, &content) + continue + } + + rr.collectFields(ctx, rval, p.PathSet, &content) + } + } + + if match { + // Copy while content.Obj is locked, as it won't be when final results are encoded. + var dst types.ObjectContent + deepCopy(&content, &dst) + rr.Objects = append(rr.Objects, dst) + } + + rr.collected[ref] = true +} + +func (rr *retrieveResult) selectSet(ctx *Context, obj reflect.Value, s []types.BaseSelectionSpec, refs *[]types.ManagedObjectReference) types.BaseMethodFault { + for _, ss := range s { + ts, ok := ss.(*types.TraversalSpec) + if ok { + if ts.Name != "" { + rr.specs[ts.Name] = ts + } + } + } + + for _, ss := range s { + ts, ok := ss.(*types.TraversalSpec) + if !ok { + ts = rr.specs[ss.GetSelectionSpec().Name] + if ts == nil { + return &types.InvalidArgument{InvalidProperty: "undefined TraversalSpec name"} + } + } + + f, _ := fieldValue(obj, ts.Path) + + for _, ref := range fieldRefs(f) { + if isFalse(ts.Skip) { + *refs = append(*refs, ref) + } + + rval, ok := getObject(ctx, ref) + if ok { + if err := rr.selectSet(ctx, rval, ts.SelectSet, refs); err != nil { + return err + } + } + } + } + + return nil +} + +func collect(ctx *Context, r *types.RetrievePropertiesEx) (*types.RetrieveResult, types.BaseMethodFault) { + var refs []types.ManagedObjectReference + + rr := &retrieveResult{ + RetrieveResult: &types.RetrieveResult{}, + req: r, + collected: make(map[types.ManagedObjectReference]bool), + specs: make(map[string]*types.TraversalSpec), + } + + // Select object references + for _, spec := range r.SpecSet { + for _, o := range spec.ObjectSet { + unlock := ctx.Map.AcquireLock(ctx, o.Obj) + rval, ok := getObject(ctx, o.Obj) + if !ok { + unlock() + if isFalse(spec.ReportMissingObjectsInResults) { + return nil, &types.ManagedObjectNotFound{Obj: o.Obj} + } + continue + } + + if o.SelectSet == nil || isFalse(o.Skip) { + rr.collect(ctx, o.Obj) + } + + err := rr.selectSet(ctx, rval, o.SelectSet, &refs) + unlock() + if err != nil { + return nil, err + } + } + } + + for _, ref := range refs { + ctx.WithLock(ref, func() { rr.collect(ctx, ref) }) + } + + return rr.RetrieveResult, nil +} + +func (pc *PropertyCollector) CreateFilter(ctx *Context, c *types.CreateFilter) soap.HasFault { + body := &methods.CreateFilterBody{} + + filter := &PropertyFilter{ + pc: pc, + refs: make(map[types.ManagedObjectReference]struct{}), + } + filter.PartialUpdates = c.PartialUpdates + filter.Spec = c.Spec + + pc.Filter = append(pc.Filter, ctx.Session.Put(filter).Reference()) + + body.Res = &types.CreateFilterResponse{ + Returnval: filter.Self, + } + + ctx.Map.AddHandler(filter) + + return body +} + +func (pc *PropertyCollector) CreatePropertyCollector(ctx *Context, c *types.CreatePropertyCollector) soap.HasFault { + body := &methods.CreatePropertyCollectorBody{} + + cpc := &PropertyCollector{} + + body.Res = &types.CreatePropertyCollectorResponse{ + Returnval: ctx.Session.Put(cpc).Reference(), + } + + return body +} + +func (pc *PropertyCollector) DestroyPropertyCollector(ctx *Context, c *types.DestroyPropertyCollector) soap.HasFault { + pc.CancelWaitForUpdates(&types.CancelWaitForUpdates{This: c.This}) + + body := &methods.DestroyPropertyCollectorBody{} + + for _, ref := range pc.Filter { + // Same as DestroyPropertyFilter + ctx.Map.RemoveHandler(ctx.Session.Get(ref).(*PropertyFilter)) + ctx.Session.Remove(ctx, ref) + } + + ctx.Map.RemoveHandler(pc) + ctx.Session.Remove(ctx, c.This) + + body.Res = &types.DestroyPropertyCollectorResponse{} + + return body +} + +var retrievePropertiesExBook sync.Map + +type retrievePropertiesExPage struct { + MaxObjects int32 + Objects []types.ObjectContent +} + +func (pc *PropertyCollector) ContinueRetrievePropertiesEx(ctx *Context, r *types.ContinueRetrievePropertiesEx) soap.HasFault { + body := &methods.ContinueRetrievePropertiesExBody{} + + if r.Token == "" { + body.Fault_ = Fault("", &types.InvalidPropertyFault{Name: "token"}) + return body + } + + obj, ok := retrievePropertiesExBook.LoadAndDelete(r.Token) + if !ok { + body.Fault_ = Fault("", &types.InvalidPropertyFault{Name: "token"}) + return body + } + + page := obj.(retrievePropertiesExPage) + + var ( + objsToStore []types.ObjectContent + objsToReturn []types.ObjectContent + ) + for i := range page.Objects { + if page.MaxObjects <= 0 || i < int(page.MaxObjects) { + objsToReturn = append(objsToReturn, page.Objects[i]) + } else { + objsToStore = append(objsToStore, page.Objects[i]) + } + } + + if len(objsToStore) > 0 { + body.Res = &types.ContinueRetrievePropertiesExResponse{} + body.Res.Returnval.Token = uuid.NewString() + retrievePropertiesExBook.Store( + body.Res.Returnval.Token, + retrievePropertiesExPage{ + MaxObjects: page.MaxObjects, + Objects: objsToStore, + }) + } + + if len(objsToReturn) > 0 { + if body.Res == nil { + body.Res = &types.ContinueRetrievePropertiesExResponse{} + } + body.Res.Returnval.Objects = objsToReturn + } + + return body +} + +func (pc *PropertyCollector) RetrievePropertiesEx(ctx *Context, r *types.RetrievePropertiesEx) soap.HasFault { + body := &methods.RetrievePropertiesExBody{} + + res, fault := collect(ctx, r) + + if fault != nil { + switch fault.(type) { + case *types.ManagedObjectNotFound: + body.Fault_ = Fault("The object has already been deleted or has not been completely created", fault) + default: + body.Fault_ = Fault("", fault) + } + } else { + objects := res.Objects[:0] + + var ( + objsToStore []types.ObjectContent + objsToReturn []types.ObjectContent + ) + for i := range res.Objects { + if r.Options.MaxObjects <= 0 || i < int(r.Options.MaxObjects) { + objsToReturn = append(objsToReturn, res.Objects[i]) + } else { + objsToStore = append(objsToStore, res.Objects[i]) + } + } + + if len(objsToStore) > 0 { + res.Token = uuid.NewString() + retrievePropertiesExBook.Store(res.Token, retrievePropertiesExPage{ + MaxObjects: r.Options.MaxObjects, + Objects: objsToStore, + }) + } + + for _, o := range objsToReturn { + propSet := o.PropSet[:0] + for _, p := range o.PropSet { + if p.Val != nil { + propSet = append(propSet, p) + } + } + o.PropSet = propSet + + objects = append(objects, o) + } + res.Objects = objects + body.Res = &types.RetrievePropertiesExResponse{ + Returnval: res, + } + } + + return body +} + +// RetrieveProperties is deprecated, but govmomi is still using it at the moment. +func (pc *PropertyCollector) RetrieveProperties(ctx *Context, r *types.RetrieveProperties) soap.HasFault { + body := &methods.RetrievePropertiesBody{} + + res := pc.RetrievePropertiesEx(ctx, &types.RetrievePropertiesEx{ + This: r.This, + SpecSet: r.SpecSet, + }) + + if res.Fault() != nil { + body.Fault_ = res.Fault() + } else { + body.Res = &types.RetrievePropertiesResponse{ + Returnval: res.(*methods.RetrievePropertiesExBody).Res.Returnval.Objects, + } + } + + return body +} + +func (pc *PropertyCollector) CancelWaitForUpdates(r *types.CancelWaitForUpdates) soap.HasFault { + pc.mu.Lock() + if pc.cancel != nil { + pc.cancel() + } + pc.mu.Unlock() + + return &methods.CancelWaitForUpdatesBody{Res: new(types.CancelWaitForUpdatesResponse)} +} + +func (pc *PropertyCollector) update(u types.ObjectUpdate) { + pc.mu.Lock() + pc.updates = append(pc.updates, u) + pc.mu.Unlock() +} + +func (pc *PropertyCollector) PutObject(_ *Context, o mo.Reference) { + pc.update(types.ObjectUpdate{ + Obj: o.Reference(), + Kind: types.ObjectUpdateKindEnter, + ChangeSet: nil, + }) +} + +func (pc *PropertyCollector) UpdateObject(_ *Context, o mo.Reference, changes []types.PropertyChange) { + pc.update(types.ObjectUpdate{ + Obj: o.Reference(), + Kind: types.ObjectUpdateKindModify, + ChangeSet: changes, + }) +} + +func (pc *PropertyCollector) RemoveObject(_ *Context, ref types.ManagedObjectReference) { + pc.update(types.ObjectUpdate{ + Obj: ref, + Kind: types.ObjectUpdateKindLeave, + ChangeSet: nil, + }) +} + +func (pc *PropertyCollector) apply(ctx *Context, update *types.UpdateSet) types.BaseMethodFault { + for _, ref := range pc.Filter { + filter, ok := ctx.Session.Get(ref).(*PropertyFilter) + if !ok { + continue + } + + res, fault := filter.collect(ctx) + if fault != nil { + return fault + } + + fu := types.PropertyFilterUpdate{ + Filter: ref, + } + + for _, o := range res.Objects { + if _, ok := filter.refs[o.Obj]; ok { + continue + } + filter.refs[o.Obj] = struct{}{} + ou := types.ObjectUpdate{ + Obj: o.Obj, + Kind: types.ObjectUpdateKindEnter, + } + + for _, p := range o.PropSet { + ou.ChangeSet = append(ou.ChangeSet, types.PropertyChange{ + Op: types.PropertyChangeOpAssign, + Name: p.Name, + Val: p.Val, + }) + } + + fu.ObjectSet = append(fu.ObjectSet, ou) + } + + if len(fu.ObjectSet) != 0 { + update.FilterSet = append(update.FilterSet, fu) + } + } + return nil +} + +// pageUpdateSet limits the given UpdateSet to max number of object updates. +// nil is returned when not truncated, otherwise the remaining UpdateSet. +func pageUpdateSet(update *types.UpdateSet, max int) *types.UpdateSet { + for i := range update.FilterSet { + set := update.FilterSet[i].ObjectSet + n := len(set) + if n+1 > max { + update.Truncated = types.NewBool(true) + f := types.PropertyFilterUpdate{ + Filter: update.FilterSet[i].Filter, + ObjectSet: update.FilterSet[i].ObjectSet[max:], + } + update.FilterSet[i].ObjectSet = update.FilterSet[i].ObjectSet[:max] + + pending := &types.UpdateSet{ + Version: "P", + FilterSet: []types.PropertyFilterUpdate{f}, + } + + if len(update.FilterSet) > i { + pending.FilterSet = append(pending.FilterSet, update.FilterSet[i+1:]...) + update.FilterSet = update.FilterSet[:i+1] + } + + return pending + } + max -= n + } + return nil +} + +// WaitOptions.maxObjectUpdates says: +// > PropertyCollector policy may still limit the total count +// > to something less than maxObjectUpdates. +// Seems to be "may" == "will" and the default max is 100. +const defaultMaxObjectUpdates = 100 // vCenter's default + +func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpdatesEx) soap.HasFault { + wait, cancel := context.WithCancel(context.Background()) + oneUpdate := false + maxObject := defaultMaxObjectUpdates + if r.Options != nil { + if max := r.Options.MaxWaitSeconds; max != nil { + // A value of 0 causes WaitForUpdatesEx to do one update calculation and return any results. + oneUpdate = (*max == 0) + if *max > 0 { + wait, cancel = context.WithTimeout(context.Background(), time.Second*time.Duration(*max)) + } + } + if max := r.Options.MaxObjectUpdates; max > 0 && max < defaultMaxObjectUpdates { + maxObject = int(max) + } + } + pc.mu.Lock() + pc.cancel = cancel + pc.mu.Unlock() + + body := &methods.WaitForUpdatesExBody{} + + set := &types.UpdateSet{ + Version: r.Version, + } + + body.Res = &types.WaitForUpdatesExResponse{ + Returnval: set, + } + + if pc.pending != nil { + body.Res.Returnval = pc.pending + pc.pending = pageUpdateSet(body.Res.Returnval, maxObject) + return body + } + + apply := func() bool { + if fault := pc.apply(ctx, set); fault != nil { + body.Fault_ = Fault("", fault) + body.Res = nil + return false + } + return true + } + + if r.Version == "" { + ctx.Map.AddHandler(pc) // Listen for create, update, delete of managed objects + apply() // Collect current state + set.Version = "-" // Next request with Version set will wait via loop below + if body.Res != nil { + pc.pending = pageUpdateSet(body.Res.Returnval, maxObject) + } + return body + } + + ticker := time.NewTicker(20 * time.Millisecond) // allow for updates to accumulate + defer ticker.Stop() + // Start the wait loop, returning on one of: + // - Client calls CancelWaitForUpdates + // - MaxWaitSeconds was specified and has been exceeded + // - We have updates to send to the client + for { + select { + case <-wait.Done(): + body.Res.Returnval = nil + switch wait.Err() { + case context.Canceled: + tracef("%s: WaitForUpdates canceled", pc.Self) + body.Fault_ = Fault("", new(types.RequestCanceled)) // CancelWaitForUpdates was called + body.Res = nil + case context.DeadlineExceeded: + tracef("%s: WaitForUpdates MaxWaitSeconds exceeded", pc.Self) + } + + return body + case <-ticker.C: + pc.mu.Lock() + updates := pc.updates + pc.updates = nil // clear updates collected by the managed object CRUD listeners + pc.mu.Unlock() + if len(updates) == 0 { + if oneUpdate { + body.Res.Returnval = nil + return body + } + continue + } + + tracef("%s: applying %d updates to %d filters", pc.Self, len(updates), len(pc.Filter)) + + for _, f := range pc.Filter { + filter := ctx.Session.Get(f).(*PropertyFilter) + filter.update(ctx) + fu := types.PropertyFilterUpdate{Filter: f} + + for _, update := range updates { + switch update.Kind { + case types.ObjectUpdateKindEnter: // Create + if !apply() { + return body + } + case types.ObjectUpdateKindModify: // Update + tracef("%s has %d changes", update.Obj, len(update.ChangeSet)) + if !apply() { // An update may apply to collector traversal specs + return body + } + if _, ok := filter.refs[update.Obj]; ok { + // This object has already been applied by the filter, + // now check if the property spec applies for this update. + update = filter.apply(ctx, update) + if len(update.ChangeSet) != 0 { + fu.ObjectSet = append(fu.ObjectSet, update) + } + } + case types.ObjectUpdateKindLeave: // Delete + if _, ok := filter.refs[update.Obj]; !ok { + continue + } + delete(filter.refs, update.Obj) + fu.ObjectSet = append(fu.ObjectSet, update) + } + } + + if len(fu.ObjectSet) != 0 { + set.FilterSet = append(set.FilterSet, fu) + } + } + if len(set.FilterSet) != 0 { + pc.pending = pageUpdateSet(body.Res.Returnval, maxObject) + return body + } + if oneUpdate { + body.Res.Returnval = nil + return body + } + } + } +} + +// WaitForUpdates is deprecated, but pyvmomi is still using it at the moment. +func (pc *PropertyCollector) WaitForUpdates(ctx *Context, r *types.WaitForUpdates) soap.HasFault { + body := &methods.WaitForUpdatesBody{} + + res := pc.WaitForUpdatesEx(ctx, &types.WaitForUpdatesEx{ + This: r.This, + Version: r.Version, + }) + + if res.Fault() != nil { + body.Fault_ = res.Fault() + } else { + body.Res = &types.WaitForUpdatesResponse{ + Returnval: *res.(*methods.WaitForUpdatesExBody).Res.Returnval, + } + } + + return body +} + +// Fetch is not documented in the vSphere SDK, but ovftool depends on it. +// A Fetch request is converted to a RetrievePropertiesEx method call by vcsim. +func (pc *PropertyCollector) Fetch(ctx *Context, req *internal.Fetch) soap.HasFault { + body := new(internal.FetchBody) + + if req.This == vim25.ServiceInstance && req.Prop == "content" { + content := ctx.Map.content() + // ovftool uses API version for 6.0 and fails when these fields are non-nil; TODO + content.VStorageObjectManager = nil + content.HostProfileManager = nil + content.HostSpecManager = nil + content.CryptoManager = nil + content.HostProfileManager = nil + content.HealthUpdateManager = nil + content.FailoverClusterConfigurator = nil + content.FailoverClusterManager = nil + body.Res = &internal.FetchResponse{ + Returnval: content, + } + return body + } + + if ctx.Map.Get(req.This) == nil { + // The Fetch method supports use of super class types, this is a quick hack to support the cases used by ovftool + switch req.This.Type { + case "ManagedEntity": + for o := range ctx.Map.objects { + if o.Value == req.This.Value { + req.This.Type = o.Type + break + } + } + case "ComputeResource": + req.This.Type = "Cluster" + req.This.Type + } + } + + res := pc.RetrievePropertiesEx(ctx, &types.RetrievePropertiesEx{ + SpecSet: []types.PropertyFilterSpec{{ + PropSet: []types.PropertySpec{{ + Type: req.This.Type, + PathSet: []string{req.Prop}, + }}, + ObjectSet: []types.ObjectSpec{{ + Obj: req.This, + }}, + }}}) + + if res.Fault() != nil { + return res + } + + obj := res.(*methods.RetrievePropertiesExBody).Res.Returnval.Objects[0] + if len(obj.PropSet) == 0 { + if len(obj.MissingSet) > 0 { + fault := obj.MissingSet[0].Fault + body.Fault_ = Fault(fault.LocalizedMessage, fault.Fault) + return body + } + return res + } + + body.Res = &internal.FetchResponse{ + Returnval: obj.PropSet[0].Val, + } + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/property_filter.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/property_filter.go new file mode 100644 index 000000000..c5e0588d4 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/property_filter.go @@ -0,0 +1,157 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "reflect" + "strings" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type PropertyFilter struct { + mo.PropertyFilter + + pc *PropertyCollector + refs map[types.ManagedObjectReference]struct{} + sync bool +} + +func (f *PropertyFilter) UpdateObject(ctx *Context, o mo.Reference, changes []types.PropertyChange) { + // A PropertyFilter's traversal spec is "applied" on the initial call to WaitForUpdates, + // with matching objects tracked in the `refs` field. + // New and deleted objects matching the filter are accounted for within PropertyCollector. + // But when an object used for the traversal itself is updated (e.g. ListView), + // we need to update the tracked `refs` on the next call to WaitForUpdates. + ref := o.Reference() + + for _, set := range f.Spec.ObjectSet { + if set.Obj == ref && len(set.SelectSet) != 0 { + ctx.WithLock(f, func() { f.sync = true }) + break + } + } +} + +func (_ *PropertyFilter) PutObject(_ *Context, _ mo.Reference) {} + +func (_ *PropertyFilter) RemoveObject(_ *Context, _ types.ManagedObjectReference) {} + +func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPropertyFilter) soap.HasFault { + body := &methods.DestroyPropertyFilterBody{} + + ctx.WithLock(f.pc, func() { + RemoveReference(&f.pc.Filter, c.This) + }) + + ctx.Map.RemoveHandler(f) + ctx.Session.Remove(ctx, c.This) + + body.Res = &types.DestroyPropertyFilterResponse{} + + return body +} + +func (f *PropertyFilter) collect(ctx *Context) (*types.RetrieveResult, types.BaseMethodFault) { + req := &types.RetrievePropertiesEx{ + SpecSet: []types.PropertyFilterSpec{f.Spec}, + } + return collect(ctx, req) +} + +func (f *PropertyFilter) update(ctx *Context) { + ctx.WithLock(f, func() { + if f.sync { + f.sync = false + clear(f.refs) + _, _ = f.collect(ctx) + } + }) +} + +// matches returns true if the change matches one of the filter Spec.PropSet +func (f *PropertyFilter) matches(ctx *Context, ref types.ManagedObjectReference, change *types.PropertyChange) bool { + var kind reflect.Type + + for _, p := range f.Spec.PropSet { + if p.Type != ref.Type { + if kind == nil { + obj := ctx.Map.Get(ref) + if obj == nil { // object may have since been deleted + continue + } + kind = getManagedObject(obj).Type() + } + // e.g. ManagedEntity, ComputeResource + field, ok := kind.FieldByName(p.Type) + if !(ok && field.Anonymous) { + continue + } + } + + if isTrue(p.All) { + return true + } + + for _, name := range p.PathSet { + if name == change.Name { + return true + } + + var field mo.Field + if field.FromString(name) && field.Item != "" { + // "field[key].item" -> "field[key]" + item := field.Item + field.Item = "" + if field.String() == change.Name { + change.Name = name + change.Val, _ = fieldValue(reflect.ValueOf(change.Val), item) + return true + } + } + + if field.FromString(change.Name) && field.Key != nil { + continue // case below does not apply to property index + } + + // strings.HasPrefix("runtime.powerState", "runtime") == parent field matches + if strings.HasPrefix(change.Name, name) { + if obj := ctx.Map.Get(ref); obj != nil { // object may have since been deleted + change.Name = name + change.Val, _ = fieldValue(reflect.ValueOf(obj), name) + } + + return true + } + } + } + + return false +} + +// apply the PropertyFilter.Spec to the given ObjectUpdate +func (f *PropertyFilter) apply(ctx *Context, change types.ObjectUpdate) types.ObjectUpdate { + parents := make(map[string]bool) + set := change.ChangeSet + change.ChangeSet = nil + + for i, p := range set { + if f.matches(ctx, change.Obj, &p) { + if p.Name != set[i].Name { + // update matches a parent field from the spec. + if parents[p.Name] { + continue // only return 1 instance of the parent + } + parents[p.Name] = true + } + change.ChangeSet = append(change.ChangeSet, p) + } + } + + return change +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/registry.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/registry.go new file mode 100644 index 000000000..94035d7ed --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/registry.go @@ -0,0 +1,691 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "context" + "encoding/json" + "fmt" + "log" + "os" + "reflect" + "strings" + "sync" + "sync/atomic" + + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// This is a map from a reference type name to a reference value name prefix. +// It's a convention that VirtualCenter follows. The map is not complete, but +// it should cover the most popular objects. +var refValueMap = map[string]string{ + "DistributedVirtualPortgroup": "dvportgroup", + "EnvironmentBrowser": "envbrowser", + "HostSystem": "host", + "ResourcePool": "resgroup", + "VirtualApp": "resgroup-v", + "VirtualMachine": "vm", + "VirtualMachineSnapshot": "snapshot", + "VmwareDistributedVirtualSwitch": "dvs", + "DistributedVirtualSwitch": "dvs", + "ClusterComputeResource": "domain-c", + "ComputeResource": "domain-s", + "Folder": "group", + "StoragePod": "group-p", +} + +// Map returns simulator.Context.Map from the given ctx +func Map(ctx context.Context) *Registry { + return ctx.(*Context).Map +} + +// RegisterObject interface supports callbacks when objects are created, updated and deleted from the Registry +type RegisterObject interface { + mo.Reference + PutObject(*Context, mo.Reference) + UpdateObject(*Context, mo.Reference, []types.PropertyChange) + RemoveObject(*Context, types.ManagedObjectReference) +} + +// Registry manages a map of mo.Reference objects +type Registry struct { + counter int64 // Keep first to ensure 64-bit alignment + m sync.Mutex + objects map[types.ManagedObjectReference]mo.Reference + handlers map[types.ManagedObjectReference]RegisterObject + locks map[types.ManagedObjectReference]*internal.ObjectLock + + Namespace string + Path string + Handler func(*Context, *Method) (mo.Reference, types.BaseMethodFault) + Cookie func(*Context) string + + tagManager tagManager +} + +// tagManager is an interface to simplify internal interaction with the vapi tag manager simulator. +type tagManager interface { + AttachedObjects(types.VslmTagEntry) ([]types.ManagedObjectReference, types.BaseMethodFault) + AttachedTags(id types.ManagedObjectReference) ([]types.VslmTagEntry, types.BaseMethodFault) + AttachTag(types.ManagedObjectReference, types.VslmTagEntry) types.BaseMethodFault + DetachTag(types.ManagedObjectReference, types.VslmTagEntry) types.BaseMethodFault +} + +// NewRegistry creates a new instances of Registry +func NewRegistry() *Registry { + r := &Registry{ + objects: make(map[types.ManagedObjectReference]mo.Reference), + handlers: make(map[types.ManagedObjectReference]RegisterObject), + locks: make(map[types.ManagedObjectReference]*internal.ObjectLock), + + Namespace: vim25.Namespace, + Path: vim25.Path, + } + + return r +} + +func (r *Registry) typeFunc(name string) (reflect.Type, bool) { + if r.Namespace != "" && r.Namespace != vim25.Namespace { + if kind, ok := defaultMapType(r.Namespace + ":" + name); ok { + return kind, ok + } + } + return defaultMapType(name) +} + +// typeName returns the type of the given object. +func typeName(item mo.Reference) string { + return reflect.TypeOf(item).Elem().Name() +} + +// valuePrefix returns the value name prefix of a given object +func valuePrefix(typeName string) string { + v, ok := refValueMap[typeName] + if ok { + if strings.Contains(v, "-") { + return v + } + } else { + v = strings.ToLower(typeName) + } + + return v + "-" +} + +// newReference returns a new MOR, where Type defaults to type of the given item +// and Value defaults to a unique id for the given type. +func (r *Registry) newReference(item mo.Reference) types.ManagedObjectReference { + ref := item.Reference() + + if ref.Type == "" { + ref.Type = typeName(item) + } + + if ref.Value == "" { + n := atomic.AddInt64(&r.counter, 1) + ref.Value = fmt.Sprintf("%s%d", valuePrefix(ref.Type), n) + } + + return ref +} + +func (r *Registry) setReference(item mo.Reference, ref types.ManagedObjectReference) { + // mo.Reference() returns a value, not a pointer so use reflect to set the Self field + reflect.ValueOf(item).Elem().FieldByName("Self").Set(reflect.ValueOf(ref)) +} + +// AddHandler adds a RegisterObject handler to the Registry. +func (r *Registry) AddHandler(h RegisterObject) { + r.m.Lock() + r.handlers[h.Reference()] = h + r.m.Unlock() +} + +// RemoveHandler removes a RegisterObject handler from the Registry. +func (r *Registry) RemoveHandler(h RegisterObject) { + r.m.Lock() + delete(r.handlers, h.Reference()) + r.m.Unlock() +} + +// NewEntity sets Entity().Self with a new, unique Value. +// Useful for creating object instances from templates. +func (r *Registry) NewEntity(item mo.Entity) mo.Entity { + e := item.Entity() + e.Self.Value = "" + e.Self = r.newReference(item) + return item +} + +// PutEntity sets item.Parent to that of parent.Self before adding item to the Registry. +func (r *Registry) PutEntity(parent mo.Entity, item mo.Entity) mo.Entity { + e := item.Entity() + + if parent != nil { + e.Parent = &parent.Entity().Self + } + + r.Put(item) + + return item +} + +// Get returns the object for the given reference. +func (r *Registry) Get(ref types.ManagedObjectReference) mo.Reference { + r.m.Lock() + defer r.m.Unlock() + + return r.objects[ref] +} + +// Any returns the first instance of entity type specified by kind. +func (r *Registry) Any(kind string) mo.Entity { + r.m.Lock() + defer r.m.Unlock() + + for ref, val := range r.objects { + if ref.Type == kind { + return val.(mo.Entity) + } + } + + return nil +} + +// All returns all entities of type specified by kind. +// If kind is empty - all entities will be returned. +func (r *Registry) All(kind string) []mo.Entity { + r.m.Lock() + defer r.m.Unlock() + + var entities []mo.Entity + for ref, val := range r.objects { + if kind == "" || ref.Type == kind { + if e, ok := val.(mo.Entity); ok { + entities = append(entities, e) + } + } + } + + return entities +} + +// AllReference returns all mo.Reference objects of type specified by kind. +// If kind is empty - all objects will be returned. +func (r *Registry) AllReference(kind string) []mo.Reference { + r.m.Lock() + defer r.m.Unlock() + + var objs []mo.Reference + for ref, val := range r.objects { + if kind == "" || ref.Type == kind { + objs = append(objs, val) + } + } + + return objs +} + +// applyHandlers calls the given func for each r.handlers +func (r *Registry) applyHandlers(f func(o RegisterObject)) { + r.m.Lock() + handlers := make([]RegisterObject, 0, len(r.handlers)) + for _, handler := range r.handlers { + handlers = append(handlers, handler) + } + r.m.Unlock() + + for i := range handlers { + f(handlers[i]) + } +} + +func (r *Registry) reference(item mo.Reference) types.ManagedObjectReference { + ref := item.Reference() + if ref.Type == "" || ref.Value == "" { + ref = r.newReference(item) + r.setReference(item, ref) + } + return ref +} + +// Put adds a new object to Registry, generating a ManagedObjectReference if not already set. +func (r *Registry) Put(item mo.Reference) mo.Reference { + r.m.Lock() + + if me, ok := item.(mo.Entity); ok { + me.Entity().ConfigStatus = types.ManagedEntityStatusGreen + me.Entity().OverallStatus = types.ManagedEntityStatusGreen + me.Entity().EffectiveRole = []int32{-1} // Admin + } + + r.objects[r.reference(item)] = item + + r.m.Unlock() + + ctx := &Context{ + Map: r, + } + + r.applyHandlers(func(o RegisterObject) { + o.PutObject(ctx, item) + }) + + return item +} + +// Remove removes an object from the Registry. +func (r *Registry) Remove(ctx *Context, item types.ManagedObjectReference) { + r.applyHandlers(func(o RegisterObject) { + o.RemoveObject(ctx, item) + }) + + r.m.Lock() + delete(r.objects, item) + delete(r.handlers, item) + delete(r.locks, item) + r.m.Unlock() +} + +// Update dispatches object property changes to RegisterObject handlers, +// such as any PropertyCollector instances with in-progress WaitForUpdates calls. +// The changes are also applied to the given object via mo.ApplyPropertyChange, +// so there is no need to set object fields directly. +func (r *Registry) Update(ctx *Context, obj mo.Reference, changes []types.PropertyChange) { + for i := range changes { + if changes[i].Op == "" { + changes[i].Op = types.PropertyChangeOpAssign + } + if changes[i].Val != nil { + rval := reflect.ValueOf(changes[i].Val) + changes[i].Val = wrapValue(rval, rval.Type()) + } + } + + val := getManagedObject(obj).Addr().Interface().(mo.Reference) + + mo.ApplyPropertyChange(val, changes) + + r.applyHandlers(func(o RegisterObject) { + o.UpdateObject(ctx, val, changes) + }) +} + +func (r *Registry) AtomicUpdate(ctx *Context, obj mo.Reference, changes []types.PropertyChange) { + r.WithLock(ctx, obj, func() { + ctx.Update(obj, changes) + }) +} + +// getEntityParent traverses up the inventory and returns the first object of type kind. +// If no object of type kind is found, the method will panic when it reaches the +// inventory root Folder where the Parent field is nil. +func (r *Registry) getEntityParent(item mo.Entity, kind string) mo.Entity { + var ok bool + for { + parent := item.Entity().Parent + + item, ok = r.Get(*parent).(mo.Entity) + if !ok { + return nil + } + if item.Reference().Type == kind { + return item + } + } +} + +// getEntityDatacenter returns the Datacenter containing the given item +func (r *Registry) getEntityDatacenter(item mo.Entity) *Datacenter { + dc, ok := r.getEntityParent(item, "Datacenter").(*Datacenter) + if ok { + return dc + } + return nil +} + +func (r *Registry) getEntityFolder(item mo.Entity, kind string) *mo.Folder { + dc := r.getEntityDatacenter(item) + + var ref types.ManagedObjectReference + + switch kind { + case "datastore": + ref = dc.DatastoreFolder + } + + folder, _ := asFolderMO(r.Get(ref)) + + // If Model was created with Folder option, use that Folder; else use top-level folder + for _, child := range folder.ChildEntity { + if child.Type == "Folder" { + folder, _ = asFolderMO(r.Get(child)) + break + } + } + + return folder +} + +// getEntityComputeResource returns the ComputeResource parent for the given item. +// A ResourcePool for example may have N Parents of type ResourcePool, but the top +// most Parent pool is always a ComputeResource child. +func (r *Registry) getEntityComputeResource(item mo.Entity) mo.Entity { + for { + parent := item.Entity().Parent + + item = r.Get(*parent).(mo.Entity) + + switch item.Reference().Type { + case "ComputeResource": + return item + case "ClusterComputeResource": + return item + } + } +} + +func entityName(e mo.Entity) string { + name := e.Entity().Name + if name != "" { + return name + } + + obj := getManagedObject(e).Addr().Interface() + + // The types below have their own 'Name' field, so ManagedEntity.Name (me.Name) is empty. + // See also mo.Ancestors + switch x := obj.(type) { + case *mo.Network: + return x.Name + case *mo.DistributedVirtualSwitch: + return x.Name + case *mo.DistributedVirtualPortgroup: + return x.Name + case *mo.OpaqueNetwork: + return x.Name + } + + log.Panicf("%T object %s does not have a Name", obj, e.Reference()) + return name +} + +// FindByName returns the first mo.Entity of the given refs whose Name field is equal to the given name. +// If there is no match, nil is returned. +// This method is useful for cases where objects are required to have a unique name, such as Datastore with +// a HostStorageSystem or HostSystem within a ClusterComputeResource. +func (r *Registry) FindByName(name string, refs []types.ManagedObjectReference) mo.Entity { + for _, ref := range refs { + if e, ok := r.Get(ref).(mo.Entity); ok { + if name == entityName(e) { + return e + } + } + } + + return nil +} + +// FindReference returns the 1st match found in refs, or nil if not found. +func FindReference(refs []types.ManagedObjectReference, match ...types.ManagedObjectReference) *types.ManagedObjectReference { + for _, ref := range refs { + for _, m := range match { + if ref == m { + return &ref + } + } + } + + return nil +} + +// AppendReference appends the given refs to field. +func (r *Registry) AppendReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref ...types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { + *field = append(*field, ref...) + }) +} + +// AddReference appends ref to field if not already in the given field. +func (r *Registry) AddReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { + if FindReference(*field, ref) == nil { + *field = append(*field, ref) + } + }) +} + +// RemoveReference removes ref from the given field. +func RemoveReference(field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { + for i, r := range *field { + if r == ref { + *field = append((*field)[:i], (*field)[i+1:]...) + break + } + } +} + +// RemoveReference removes ref from the given field. +func (r *Registry) RemoveReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { + RemoveReference(field, ref) + }) +} + +func (r *Registry) removeString(ctx *Context, obj mo.Reference, field *[]string, val string) { + r.WithLock(ctx, obj, func() { + for i, name := range *field { + if name == val { + *field = append((*field)[:i], (*field)[i+1:]...) + break + } + } + }) +} + +func (r *Registry) content() types.ServiceContent { + return r.Get(vim25.ServiceInstance).(interface { + ServiceContent() types.ServiceContent + }).ServiceContent() +} + +// IsESX returns true if this Registry maps an ESX model +func (r *Registry) IsESX() bool { + return r.content().About.ApiType == "HostAgent" +} + +// IsVPX returns true if this Registry maps a VPX model +func (r *Registry) IsVPX() bool { + return !r.IsESX() +} + +// SearchIndex returns the SearchIndex singleton +func (r *Registry) SearchIndex() *SearchIndex { + return r.Get(r.content().SearchIndex.Reference()).(*SearchIndex) +} + +// AlarmManager returns the AlarmManager singleton +func (r *Registry) AlarmManager() *AlarmManager { + ref := r.content().AlarmManager + if ref == nil { + return nil // ESX + } + return r.Get(*ref).(*AlarmManager) +} + +// EventManager returns the EventManager singleton +func (r *Registry) EventManager() *EventManager { + return r.Get(r.content().EventManager.Reference()).(*EventManager) +} + +// FileManager returns the FileManager singleton +func (r *Registry) FileManager() *FileManager { + return r.Get(r.content().FileManager.Reference()).(*FileManager) +} + +// CryptoManager returns the CryptoManagerKmip singleton +func (r *Registry) CryptoManager() *CryptoManagerKmip { + return r.Get(r.content().CryptoManager.Reference()).(*CryptoManagerKmip) +} + +type VirtualDiskManagerInterface interface { + mo.Reference + MO() mo.VirtualDiskManager + CreateVirtualDiskTask(*Context, *types.CreateVirtualDisk_Task) soap.HasFault + DeleteVirtualDiskTask(*Context, *types.DeleteVirtualDisk_Task) soap.HasFault + MoveVirtualDiskTask(*Context, *types.MoveVirtualDisk_Task) soap.HasFault + CopyVirtualDiskTask(*Context, *types.CopyVirtualDisk_Task) soap.HasFault + QueryVirtualDiskUuid(*Context, *types.QueryVirtualDiskUuid) soap.HasFault + SetVirtualDiskUuid(*Context, *types.SetVirtualDiskUuid) soap.HasFault +} + +// VirtualDiskManager returns the VirtualDiskManager singleton +func (r *Registry) VirtualDiskManager() VirtualDiskManagerInterface { + return r.Get(r.content().VirtualDiskManager.Reference()).(VirtualDiskManagerInterface) +} + +// ViewManager returns the ViewManager singleton +func (r *Registry) ViewManager() *ViewManager { + return r.Get(r.content().ViewManager.Reference()).(*ViewManager) +} + +// UserDirectory returns the UserDirectory singleton +func (r *Registry) UserDirectory() *UserDirectory { + return r.Get(r.content().UserDirectory.Reference()).(*UserDirectory) +} + +// SessionManager returns the SessionManager singleton +func (r *Registry) SessionManager() *SessionManager { + return r.Get(r.content().SessionManager.Reference()).(*SessionManager) +} + +// OptionManager returns the OptionManager singleton +func (r *Registry) OptionManager() *OptionManager { + return r.Get(r.content().Setting.Reference()).(*OptionManager) +} + +// CustomFieldsManager returns CustomFieldsManager singleton +func (r *Registry) CustomFieldsManager() *CustomFieldsManager { + return r.Get(r.content().CustomFieldsManager.Reference()).(*CustomFieldsManager) +} + +// TenantManager returns TenantManager singleton +func (r *Registry) TenantManager() *TenantManager { + return r.Get(r.content().TenantManager.Reference()).(*TenantManager) +} + +// VmCompatibilityChecker returns VmCompatibilityChecker singleton +func (r *Registry) VmCompatibilityChecker() *VmCompatibilityChecker { + return r.Get(r.content().VmCompatibilityChecker.Reference()).(*VmCompatibilityChecker) +} + +// VmProvisioningChecker returns VmProvisioningChecker singleton +func (r *Registry) VmProvisioningChecker() *VmProvisioningChecker { + return r.Get(r.content().VmProvisioningChecker.Reference()).(*VmProvisioningChecker) +} + +// ExtensionManager returns the ExtensionManager singleton +func (r *Registry) ExtensionManager() *ExtensionManager { + return r.Get(r.content().ExtensionManager.Reference()).(*ExtensionManager) +} + +// VStorageObjectManager returns the VStorageObjectManager singleton +func (r *Registry) VStorageObjectManager() *VcenterVStorageObjectManager { + return r.Get(r.content().VStorageObjectManager.Reference()).(*VcenterVStorageObjectManager) +} + +func (r *Registry) MarshalJSON() ([]byte, error) { + r.m.Lock() + defer r.m.Unlock() + + vars := struct { + Objects int `json:"objects"` + Locks int `json:"locks"` + }{ + len(r.objects), + len(r.locks), + } + + return json.Marshal(vars) +} + +func (r *Registry) locker(obj mo.Reference) *internal.ObjectLock { + var ref types.ManagedObjectReference + + switch x := obj.(type) { + case types.ManagedObjectReference: + ref = x + obj = r.Get(ref) // to check for sync.Locker + case *types.ManagedObjectReference: + ref = *x + obj = r.Get(ref) // to check for sync.Locker + default: + // Use of obj.Reference() may cause a read race, prefer the mo 'Self' field to avoid this + self := reflect.ValueOf(obj).Elem().FieldByName("Self") + if self.IsValid() { + ref = self.Interface().(types.ManagedObjectReference) + } else { + ref = obj.Reference() + } + } + + if mu, ok := obj.(sync.Locker); ok { + // Objects that opt out of default locking are responsible for + // implementing their own lock sharing, if needed. Returning + // nil as heldBy means that WithLock will call Lock/Unlock + // every time. + return internal.NewObjectLock(mu) + } + + r.m.Lock() + mu, ok := r.locks[ref] + if !ok { + mu = internal.NewObjectLock(new(sync.Mutex)) + r.locks[ref] = mu + } + r.m.Unlock() + + return mu +} + +var enableLocker = os.Getenv("VCSIM_LOCKER") != "false" + +// WithLock holds a lock for the given object while then given function is run. +func (r *Registry) WithLock(onBehalfOf *Context, obj mo.Reference, f func()) { + unlock := r.AcquireLock(onBehalfOf, obj) + f() + unlock() +} + +// AcquireLock acquires the lock for onBehalfOf then returns. The lock MUST be +// released by calling the returned function. WithLock should be preferred +// wherever possible. +func (r *Registry) AcquireLock(onBehalfOf *Context, obj mo.Reference) func() { + if onBehalfOf == nil { + panic(fmt.Sprintf("Attempt to lock %v with nil onBehalfOf", obj)) + } + + if !enableLocker { + return func() {} + } + + l := r.locker(obj) + l.Acquire(onBehalfOf) + return func() { + l.Release(onBehalfOf) + } +} + +// nopLocker can be embedded to opt-out of auto-locking (see Registry.WithLock) +type nopLocker struct{} + +func (*nopLocker) Lock() {} +func (*nopLocker) Unlock() {} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/resource_pool.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/resource_pool.go new file mode 100644 index 000000000..02a2cc635 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/resource_pool.go @@ -0,0 +1,521 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "path" + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type ResourcePool struct { + mo.ResourcePool +} + +func asResourcePoolMO(obj mo.Reference) (*mo.ResourcePool, bool) { + rp, ok := getManagedObject(obj).Addr().Interface().(*mo.ResourcePool) + return rp, ok +} + +func resourcePoolHosts(ctx *Context, pool *ResourcePool) []types.ManagedObjectReference { + switch owner := ctx.Map.Get(pool.Owner).(type) { + case *ClusterComputeResource: + return owner.Host + case *mo.ComputeResource: + return owner.Host + default: + return nil + } +} + +func NewResourcePool(ctx *Context) *ResourcePool { + pool := &ResourcePool{ + ResourcePool: esx.ResourcePool, + } + + if ctx.Map.IsVPX() { + pool.DisabledMethod = nil // Enable VApp methods for VC + } + + return pool +} + +func allResourceFieldsSet(info *types.ResourceAllocationInfo) bool { + return info.Reservation != nil && + info.Limit != nil && + info.ExpandableReservation != nil && + info.Shares != nil +} + +func allResourceFieldsValid(info *types.ResourceAllocationInfo) bool { + if info.Reservation != nil { + if *info.Reservation < 0 { + return false + } + } + + if info.Limit != nil { + if *info.Limit < -1 { + return false + } + } + + if info.Shares != nil { + if info.Shares.Level == types.SharesLevelCustom { + if info.Shares.Shares < 0 { + return false + } + } + } + + if info.OverheadLimit != nil { + return false + } + + return true +} + +func (p *ResourcePool) createChild(ctx *Context, name string, spec types.ResourceConfigSpec) (*ResourcePool, *soap.Fault) { + if e := ctx.Map.FindByName(name, p.ResourcePool.ResourcePool); e != nil { + return nil, Fault("", &types.DuplicateName{ + Name: e.Entity().Name, + Object: e.Reference(), + }) + } + + if !(allResourceFieldsSet(&spec.CpuAllocation) && allResourceFieldsValid(&spec.CpuAllocation)) { + return nil, Fault("", &types.InvalidArgument{ + InvalidProperty: "spec.cpuAllocation", + }) + } + + if !(allResourceFieldsSet(&spec.MemoryAllocation) && allResourceFieldsValid(&spec.MemoryAllocation)) { + return nil, Fault("", &types.InvalidArgument{ + InvalidProperty: "spec.memoryAllocation", + }) + } + + child := NewResourcePool(ctx) + + child.Name = name + child.Owner = p.Owner + child.Summary.GetResourcePoolSummary().Name = name + child.Config.CpuAllocation = spec.CpuAllocation + child.Config.MemoryAllocation = spec.MemoryAllocation + child.Config.Entity = spec.Entity + + return child, nil +} + +func (p *ResourcePool) CreateResourcePool(ctx *Context, c *types.CreateResourcePool) soap.HasFault { + body := &methods.CreateResourcePoolBody{} + + child, err := p.createChild(ctx, c.Name, c.Spec) + if err != nil { + body.Fault_ = err + return body + } + + ctx.Map.PutEntity(p, ctx.Map.NewEntity(child)) + + p.ResourcePool.ResourcePool = append(p.ResourcePool.ResourcePool, child.Reference()) + + body.Res = &types.CreateResourcePoolResponse{ + Returnval: child.Reference(), + } + + return body +} + +func updateResourceAllocation(kind string, src, dst *types.ResourceAllocationInfo) types.BaseMethodFault { + if !allResourceFieldsValid(src) { + return &types.InvalidArgument{ + InvalidProperty: fmt.Sprintf("spec.%sAllocation", kind), + } + } + + if src.Reservation != nil { + dst.Reservation = src.Reservation + } + + if src.Limit != nil { + dst.Limit = src.Limit + } + + if src.Shares != nil { + dst.Shares = src.Shares + } + + return nil +} + +func (p *ResourcePool) UpdateConfig(ctx *Context, c *types.UpdateConfig) soap.HasFault { + body := &methods.UpdateConfigBody{} + + if c.Name != "" { + if e := ctx.Map.FindByName(c.Name, p.ResourcePool.ResourcePool); e != nil { + body.Fault_ = Fault("", &types.DuplicateName{ + Name: e.Entity().Name, + Object: e.Reference(), + }) + return body + } + + p.Name = c.Name + } + + spec := c.Config + + if spec != nil { + if err := updateResourceAllocation("memory", &spec.MemoryAllocation, &p.Config.MemoryAllocation); err != nil { + body.Fault_ = Fault("", err) + return body + } + + if err := updateResourceAllocation("cpu", &spec.CpuAllocation, &p.Config.CpuAllocation); err != nil { + body.Fault_ = Fault("", err) + return body + } + } + + body.Res = &types.UpdateConfigResponse{} + + return body +} + +func (a *VirtualApp) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).ImportVApp(ctx, req) +} + +func (p *ResourcePool) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault { + body := new(methods.ImportVAppBody) + + spec, ok := req.Spec.(*types.VirtualMachineImportSpec) + if !ok { + body.Fault_ = Fault(fmt.Sprintf("%T: type not supported", spec), &types.InvalidArgument{InvalidProperty: "spec"}) + return body + } + + dc := ctx.Map.getEntityDatacenter(p) + folder := ctx.Map.Get(dc.VmFolder).(*Folder) + if req.Folder != nil { + if p.Self.Type == "VirtualApp" { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "pool"}) + return body + } + folder = ctx.Map.Get(*req.Folder).(*Folder) + } + + lease := newHttpNfcLease(ctx) + ref := lease.Reference() + + CreateTask(p, "ImportVAppLRO", func(*Task) (types.AnyType, types.BaseMethodFault) { + if vapp, ok := spec.ConfigSpec.VAppConfig.(*types.VAppConfigSpec); ok { + for _, p := range vapp.Property { + if p.Info == nil || isTrue(p.Info.UserConfigurable) { + continue + } + + if p.Info.Value == "" || p.Info.Value == p.Info.DefaultValue { + continue + } + + fault := &types.NotUserConfigurableProperty{ + VAppPropertyFault: types.VAppPropertyFault{ + Id: p.Info.Id, + Category: p.Info.Category, + Label: p.Info.Label, + Type: p.Info.Type, + Value: p.Info.Value, + }, + } + + lease.error(ctx, &types.LocalizedMethodFault{ + LocalizedMessage: fmt.Sprintf("Property %s.%s is not user configurable", p.Info.ClassId, p.Info.Id), + Fault: fault, + }) + + return nil, fault + } + } + + res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ + This: folder.Self, + Config: spec.ConfigSpec, + Pool: p.Self, + Host: req.Host, + }) + + ctask := ctx.Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + + if ctask.Info.Error != nil { + lease.error(ctx, ctask.Info.Error) + return nil, ctask.Info.Error.Fault + } + + mref := ctask.Info.Result.(types.ManagedObjectReference) + vm := ctx.Map.Get(mref).(*VirtualMachine) + device := object.VirtualDeviceList(vm.Config.Hardware.Device) + ndevice := make(map[string]int) + var urls []types.HttpNfcLeaseDeviceUrl + u := leaseURL(ctx) + + for _, d := range device { + info, ok := d.GetVirtualDevice().Backing.(types.BaseVirtualDeviceFileBackingInfo) + if !ok { + continue + } + var file object.DatastorePath + file.FromString(info.GetVirtualDeviceFileBackingInfo().FileName) + name := path.Base(file.Path) + ds := vm.findDatastore(ctx, file.Datastore) + lease.files[name] = ds.resolve(ctx, file.Path) + + _, disk := d.(*types.VirtualDisk) + kind := device.Type(d) + n := ndevice[kind] + ndevice[kind]++ + + u.Path = nfcPrefix + path.Join(ref.Value, name) + urls = append(urls, types.HttpNfcLeaseDeviceUrl{ + Key: fmt.Sprintf("/%s/%s:%d", vm.Self.Value, kind, n), + ImportKey: fmt.Sprintf("/%s/%s:%d", vm.Name, kind, n), + Url: u.String(), + SslThumbprint: "", + Disk: types.NewBool(disk), + TargetId: name, + DatastoreKey: "", + FileSize: 0, + }) + } + + lease.ready(ctx, mref, urls) + + // TODO: keep this task running until lease timeout or marked completed by the client + + return nil, nil + }).Run(ctx) + + body.Res = &types.ImportVAppResponse{ + Returnval: ref, + } + + return body +} + +type VirtualApp struct { + mo.VirtualApp +} + +func NewVAppConfigSpec() types.VAppConfigSpec { + spec := types.VAppConfigSpec{ + Annotation: "vcsim", + VmConfigSpec: types.VmConfigSpec{ + Product: []types.VAppProductSpec{ + { + Info: &types.VAppProductInfo{ + Name: "vcsim", + Vendor: "VMware", + VendorUrl: "http://www.vmware.com/", + Version: "0.1", + }, + ArrayUpdateSpec: types.ArrayUpdateSpec{ + Operation: types.ArrayUpdateOperationAdd, + }, + }, + }, + }, + } + + return spec +} + +func (p *ResourcePool) CreateVApp(ctx *Context, req *types.CreateVApp) soap.HasFault { + body := &methods.CreateVAppBody{} + + pool, err := p.createChild(ctx, req.Name, req.ResSpec) + if err != nil { + body.Fault_ = err + return body + } + + child := &VirtualApp{} + child.ResourcePool = pool.ResourcePool + child.Self.Type = "VirtualApp" + child.ParentFolder = req.VmFolder + + if child.ParentFolder == nil { + folder := ctx.Map.getEntityDatacenter(p).VmFolder + child.ParentFolder = &folder + } + + child.VAppConfig = &types.VAppConfigInfo{ + VmConfigInfo: types.VmConfigInfo{}, + Annotation: req.ConfigSpec.Annotation, + } + + for _, product := range req.ConfigSpec.Product { + child.VAppConfig.Product = append(child.VAppConfig.Product, *product.Info) + } + + ctx.Map.PutEntity(p, ctx.Map.NewEntity(child)) + + p.ResourcePool.ResourcePool = append(p.ResourcePool.ResourcePool, child.Reference()) + + body.Res = &types.CreateVAppResponse{ + Returnval: child.Reference(), + } + + return body +} + +func (a *VirtualApp) CreateChildVMTask(ctx *Context, req *types.CreateChildVM_Task) soap.HasFault { + body := &methods.CreateChildVM_TaskBody{} + + folder := ctx.Map.Get(*a.ParentFolder).(*Folder) + + res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ + This: folder.Self, + Config: req.Config, + Host: req.Host, + Pool: req.This, + }) + + body.Res = &types.CreateChildVM_TaskResponse{ + Returnval: res.(*methods.CreateVM_TaskBody).Res.Returnval, + } + + return body +} + +func (a *VirtualApp) CloneVAppTask(ctx *Context, req *types.CloneVApp_Task) soap.HasFault { + task := CreateTask(a, "cloneVapp", func(t *Task) (types.AnyType, types.BaseMethodFault) { + folder := req.Spec.VmFolder + if folder == nil { + folder = a.ParentFolder + } + + rspec := req.Spec.ResourceSpec + if rspec == nil { + s := types.DefaultResourceConfigSpec() + rspec = &s + } + + res := a.CreateVApp(ctx, &types.CreateVApp{ + This: a.Self, + Name: req.Name, + ResSpec: *rspec, + ConfigSpec: types.VAppConfigSpec{}, + VmFolder: folder, + }) + + if res.Fault() != nil { + return nil, res.Fault().VimFault().(types.BaseMethodFault) + } + + target := res.(*methods.CreateVAppBody).Res.Returnval + + for _, ref := range a.Vm { + vm := ctx.Map.Get(ref).(*VirtualMachine) + + res := vm.CloneVMTask(ctx, &types.CloneVM_Task{ + This: ref, + Folder: *folder, + Name: req.Name, + Spec: types.VirtualMachineCloneSpec{ + Location: types.VirtualMachineRelocateSpec{ + Pool: &target, + Host: req.Spec.Host, + }, + }, + }) + + ctask := ctx.Map.Get(res.(*methods.CloneVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + if ctask.Info.Error != nil { + return nil, ctask.Info.Error.Fault + } + } + + return target, nil + }) + + return &methods.CloneVApp_TaskBody{ + Res: &types.CloneVApp_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (a *VirtualApp) CreateVApp(ctx *Context, req *types.CreateVApp) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).CreateVApp(ctx, req) +} + +func (a *VirtualApp) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).DestroyTask(ctx, req) +} + +func (p *ResourcePool) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(p, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if strings.HasSuffix(p.Parent.Type, "ComputeResource") { + // Can't destroy the root pool + return nil, &types.InvalidArgument{} + } + + parent, _ := asResourcePoolMO(ctx.Map.Get(*p.Parent)) + + // Remove child reference from rp + ctx.WithLock(parent, func() { + RemoveReference(&parent.ResourcePool, req.This) + + // The grandchildren become children of the parent (rp) + for _, ref := range p.ResourcePool.ResourcePool { + child := ctx.Map.Get(ref).(*ResourcePool) + ctx.WithLock(child, func() { child.Parent = &parent.Self }) + parent.ResourcePool = append(parent.ResourcePool, ref) + } + }) + + // And VMs move to the parent + vms := p.ResourcePool.Vm + for _, ref := range vms { + vm := ctx.Map.Get(ref).(*VirtualMachine) + ctx.WithLock(vm, func() { vm.ResourcePool = &parent.Self }) + } + + ctx.WithLock(parent, func() { + parent.Vm = append(parent.Vm, vms...) + }) + + ctx.Map.Remove(ctx, req.This) + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (p *ResourcePool) DestroyChildren(ctx *Context, req *types.DestroyChildren) soap.HasFault { + walk(p, func(child types.ManagedObjectReference) { + if child.Type != "ResourcePool" { + return + } + ctx.Map.Get(child).(*ResourcePool).DestroyTask(ctx, &types.Destroy_Task{This: child}) + }) + + return &methods.DestroyChildrenBody{Res: new(types.DestroyChildrenResponse)} +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/search_index.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/search_index.go new file mode 100644 index 000000000..3509e64c5 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/search_index.go @@ -0,0 +1,261 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type SearchIndex struct { + mo.SearchIndex +} + +func (s *SearchIndex) FindByDatastorePath(ctx *Context, r *types.FindByDatastorePath) soap.HasFault { + res := &methods.FindByDatastorePathBody{Res: new(types.FindByDatastorePathResponse)} + + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + + for ref, obj := range ctx.Map.objects { + vm, ok := asVirtualMachineMO(obj) + if !ok { + continue + } + + if vm.Config.Files.VmPathName == r.Path { + res.Res.Returnval = &ref + break + } + } + + return res +} + +func (s *SearchIndex) FindByInventoryPath(ctx *Context, req *types.FindByInventoryPath) soap.HasFault { + body := &methods.FindByInventoryPathBody{Res: new(types.FindByInventoryPathResponse)} + + root := ctx.Map.content().RootFolder + o := &root + + if req.InventoryPath == "/" { + body.Res.Returnval = o + return body + } + + split := func(c rune) bool { + return c == '/' + } + path := strings.FieldsFunc(req.InventoryPath, split) + if len(path) < 1 { + return body + } + + for _, name := range path { + f := s.FindChild(ctx, &types.FindChild{Entity: *o, Name: name}) + + o = f.(*methods.FindChildBody).Res.Returnval + if o == nil { + break + } + } + + body.Res.Returnval = o + + return body +} + +func (s *SearchIndex) FindChild(ctx *Context, req *types.FindChild) soap.HasFault { + body := &methods.FindChildBody{} + + obj := ctx.Map.Get(req.Entity) + + if obj == nil { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: req.Entity}) + return body + } + + body.Res = new(types.FindChildResponse) + + var children []types.ManagedObjectReference + + switch e := obj.(type) { + case *Datacenter: + children = []types.ManagedObjectReference{e.VmFolder, e.HostFolder, e.DatastoreFolder, e.NetworkFolder} + case *Folder: + children = e.ChildEntity + case *mo.ComputeResource: + children = e.Host + children = append(children, *e.ResourcePool) + case *ClusterComputeResource: + children = e.Host + children = append(children, *e.ResourcePool) + case *ResourcePool: + children = e.ResourcePool.ResourcePool + children = append(children, e.Vm...) + case *VirtualApp: + children = e.ResourcePool.ResourcePool + children = append(children, e.Vm...) + } + + match := ctx.Map.FindByName(req.Name, children) + + if match != nil { + ref := match.Reference() + body.Res.Returnval = &ref + } + + return body +} + +func (s *SearchIndex) FindByUuid(ctx *Context, req *types.FindByUuid) soap.HasFault { + body := &methods.FindByUuidBody{Res: new(types.FindByUuidResponse)} + + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + + if req.VmSearch { + // Find Virtual Machine using UUID + for ref, obj := range ctx.Map.objects { + vm, ok := asVirtualMachineMO(obj) + if !ok { + continue + } + if req.InstanceUuid != nil && *req.InstanceUuid { + if vm.Config.InstanceUuid == req.Uuid { + body.Res.Returnval = &ref + break + } + } else { + if vm.Config.Uuid == req.Uuid { + body.Res.Returnval = &ref + break + } + } + } + } else { + // Find Host System using UUID + for ref, obj := range ctx.Map.objects { + host, ok := asHostSystemMO(obj) + if !ok { + continue + } + if host.Summary.Hardware.Uuid == req.Uuid { + body.Res.Returnval = &ref + break + } + } + } + + return body +} + +func (s *SearchIndex) FindByDnsName(ctx *Context, req *types.FindByDnsName) soap.HasFault { + body := &methods.FindByDnsNameBody{Res: new(types.FindByDnsNameResponse)} + + all := types.FindAllByDnsName(*req) + + switch r := s.FindAllByDnsName(ctx, &all).(type) { + case *methods.FindAllByDnsNameBody: + if len(r.Res.Returnval) > 0 { + body.Res.Returnval = &r.Res.Returnval[0] + } + default: + // no need until FindAllByDnsName below returns a Fault + } + + return body +} + +func (s *SearchIndex) FindAllByDnsName(ctx *Context, req *types.FindAllByDnsName) soap.HasFault { + body := &methods.FindAllByDnsNameBody{Res: new(types.FindAllByDnsNameResponse)} + + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + + if req.VmSearch { + // Find Virtual Machine using DNS name + for ref, obj := range ctx.Map.objects { + vm, ok := asVirtualMachineMO(obj) + if !ok { + continue + } + if vm.Guest.HostName == req.DnsName { + body.Res.Returnval = append(body.Res.Returnval, ref) + } + } + } else { + // Find Host System using DNS name + for ref, obj := range ctx.Map.objects { + host, ok := asHostSystemMO(obj) + if !ok { + continue + } + for _, net := range host.Config.Network.NetStackInstance { + if net.DnsConfig.GetHostDnsConfig().HostName == req.DnsName { + body.Res.Returnval = append(body.Res.Returnval, ref) + } + } + } + } + + return body +} + +func (s *SearchIndex) FindByIp(ctx *Context, req *types.FindByIp) soap.HasFault { + body := &methods.FindByIpBody{Res: new(types.FindByIpResponse)} + + all := types.FindAllByIp(*req) + + switch r := s.FindAllByIp(ctx, &all).(type) { + case *methods.FindAllByIpBody: + if len(r.Res.Returnval) > 0 { + body.Res.Returnval = &r.Res.Returnval[0] + } + default: + // no need until FindAllByIp below returns a Fault + } + + return body +} + +func (s *SearchIndex) FindAllByIp(ctx *Context, req *types.FindAllByIp) soap.HasFault { + body := &methods.FindAllByIpBody{Res: new(types.FindAllByIpResponse)} + + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + + if req.VmSearch { + // Find Virtual Machine using IP + for ref, obj := range ctx.Map.objects { + vm, ok := asVirtualMachineMO(obj) + if !ok { + continue + } + if vm.Guest.IpAddress == req.Ip { + body.Res.Returnval = append(body.Res.Returnval, ref) + } + } + } else { + // Find Host System using IP + for ref, obj := range ctx.Map.objects { + host, ok := asHostSystemMO(obj) + if !ok { + continue + } + for _, net := range host.Config.Network.Vnic { + if net.Spec.Ip.IpAddress == req.Ip { + body.Res.Returnval = append(body.Res.Returnval, ref) + } + } + } + } + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/service_instance.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/service_instance.go new file mode 100644 index 000000000..2027fdd22 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/service_instance.go @@ -0,0 +1,86 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type ServiceInstance struct { + mo.ServiceInstance +} + +func NewServiceInstance(ctx *Context, content types.ServiceContent, folder mo.Folder) (*Context, *ServiceInstance) { + s := &ServiceInstance{} + + s.Self = vim25.ServiceInstance + s.Content = content + + ctx.Map.Put(s) + + f := &Folder{Folder: folder} + ctx.Map.Put(f) + + if content.About.ApiType == "HostAgent" { + CreateDefaultESX(ctx, f) + } else { + content.About.InstanceUuid = uuid.New().String() + } + + refs := mo.References(content) + + for i := range refs { + if ctx.Map.Get(refs[i]) != nil { + continue + } + content := types.ObjectContent{Obj: refs[i]} + o, err := loadObject(ctx, content) + if err != nil { + panic(err) + } + ctx.Map.Put(o) + } + + return ctx, s +} + +func (s *ServiceInstance) ServiceContent() types.ServiceContent { + return s.Content +} + +func (s *ServiceInstance) RetrieveServiceContent(*types.RetrieveServiceContent) soap.HasFault { + return &methods.RetrieveServiceContentBody{ + Res: &types.RetrieveServiceContentResponse{ + Returnval: s.Content, + }, + } +} + +func (*ServiceInstance) CurrentTime(*types.CurrentTime) soap.HasFault { + return &methods.CurrentTimeBody{ + Res: &types.CurrentTimeResponse{ + Returnval: time.Now(), + }, + } +} + +func (s *ServiceInstance) RetrieveInternalContent(*internal.RetrieveInternalContent) soap.HasFault { + return &internal.RetrieveInternalContentBody{ + Res: &internal.RetrieveInternalContentResponse{ + Returnval: internal.InternalServiceInstanceContent{ + NfcService: types.ManagedObjectReference{Type: "NfcService", Value: "NfcService"}, + }, + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/session_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/session_manager.go new file mode 100644 index 000000000..9dc967027 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/session_manager.go @@ -0,0 +1,527 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "context" + "crypto/tls" + "encoding/base64" + "fmt" + "net/http" + "net/url" + "os" + "reflect" + "strings" + "sync" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/session" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type SessionManager struct { + mo.SessionManager + nopLocker + + ServiceHostName string + TLS func() *tls.Config + ValidLogin func(*types.Login) bool + + sessions map[string]Session +} + +func (m *SessionManager) init(*Registry) { + m.sessions = make(map[string]Session) +} + +var ( + sessionMutex sync.Mutex + + // secureCookies enables Set-Cookie.Secure=true + // We can't do this by default as simulator.Service defaults to no TLS by default and + // Go's cookiejar does not send Secure cookies unless the URL scheme is https. + secureCookies = os.Getenv("VCSIM_SECURE_COOKIES") == "true" +) + +func createSession(ctx *Context, name string, locale string) types.UserSession { + now := time.Now().UTC() + + if locale == "" { + locale = session.Locale + } + + session := Session{ + UserSession: types.UserSession{ + Key: uuid.New().String(), + UserName: name, + FullName: name, + LoginTime: now, + LastActiveTime: now, + Locale: locale, + MessageLocale: locale, + ExtensionSession: types.NewBool(false), + }, + Registry: NewRegistry(), + Map: ctx.Map, + } + + ctx.SetSession(session, true) + + return ctx.Session.UserSession +} + +func (m *SessionManager) getSession(id string) (Session, bool) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + s, ok := m.sessions[id] + return s, ok +} + +func (m *SessionManager) findSession(user string) (Session, bool) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + for _, session := range m.sessions { + if session.UserName == user { + return session, true + } + } + return Session{}, false +} + +func (m *SessionManager) delSession(id string) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + delete(m.sessions, id) +} + +func (m *SessionManager) putSession(s Session) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + m.sessions[s.Key] = s +} + +func (s *SessionManager) Authenticate(u url.URL, req *types.Login) bool { + if u.User == nil || u.User == DefaultLogin { + return req.UserName != "" && req.Password != "" + } + + if s.ValidLogin != nil { + return s.ValidLogin(req) + } + + pass, _ := u.User.Password() + return req.UserName == u.User.Username() && req.Password == pass +} + +func (s *SessionManager) TLSCert() string { + if s.TLS == nil { + return "" + } + return base64.StdEncoding.EncodeToString(s.TLS().Certificates[0].Certificate[0]) +} + +func (s *SessionManager) Login(ctx *Context, req *types.Login) soap.HasFault { + body := new(methods.LoginBody) + + if ctx.Session == nil && s.Authenticate(*ctx.svc.Listen, req) { + body.Res = &types.LoginResponse{ + Returnval: createSession(ctx, req.UserName, req.Locale), + } + } else { + body.Fault_ = invalidLogin + } + + return body +} + +func (s *SessionManager) LoginExtensionByCertificate(ctx *Context, req *types.LoginExtensionByCertificate) soap.HasFault { + body := new(methods.LoginExtensionByCertificateBody) + + if ctx.req.TLS == nil || len(ctx.req.TLS.PeerCertificates) == 0 { + body.Fault_ = Fault("", new(types.NoClientCertificate)) + return body + } + + if req.ExtensionKey == "" || ctx.Session != nil { + body.Fault_ = invalidLogin + } else { + body.Res = &types.LoginExtensionByCertificateResponse{ + Returnval: createSession(ctx, req.ExtensionKey, req.Locale), + } + } + + return body +} + +func (s *SessionManager) LoginByToken(ctx *Context, req *types.LoginByToken) soap.HasFault { + body := new(methods.LoginByTokenBody) + + if ctx.Session != nil { + body.Fault_ = invalidLogin + } else { + var subject struct { + ID string `xml:"Assertion>Subject>NameID"` + } + + if s, ok := ctx.Header.Security.(*Element); ok { + _ = s.Decode(&subject) + } + + if subject.ID == "" { + body.Fault_ = invalidLogin + return body + } + + body.Res = &types.LoginByTokenResponse{ + Returnval: createSession(ctx, subject.ID, req.Locale), + } + } + + return body +} + +func (s *SessionManager) Logout(ctx *Context, _ *types.Logout) soap.HasFault { + session := ctx.Session + s.delSession(session.Key) + pc := ctx.Map.content().PropertyCollector + + ctx.Session.Registry.m.Lock() + defer ctx.Session.Registry.m.Unlock() + + for ref, obj := range ctx.Session.Registry.objects { + if ref == pc { + continue // don't unregister the PropertyCollector singleton + } + if _, ok := obj.(RegisterObject); ok { + ctx.Map.Remove(ctx, ref) // Remove RegisterObject handlers + } + } + + ctx.postEvent(&types.UserLogoutSessionEvent{ + IpAddress: session.IpAddress, + UserAgent: session.UserAgent, + SessionId: session.Key, + LoginTime: &session.LoginTime, + }) + + return &methods.LogoutBody{Res: new(types.LogoutResponse)} +} + +func (s *SessionManager) TerminateSession(ctx *Context, req *types.TerminateSession) soap.HasFault { + body := new(methods.TerminateSessionBody) + + for _, id := range req.SessionId { + if id == ctx.Session.Key { + body.Fault_ = Fault("", new(types.InvalidArgument)) + return body + } + if _, ok := s.getSession(id); !ok { + body.Fault_ = Fault("", new(types.NotFound)) + return body + } + s.delSession(id) + } + + body.Res = new(types.TerminateSessionResponse) + return body +} + +func (s *SessionManager) SessionIsActive(ctx *Context, req *types.SessionIsActive) soap.HasFault { + body := new(methods.SessionIsActiveBody) + + if ctx.Map.IsESX() { + body.Fault_ = Fault("", new(types.NotImplemented)) + return body + } + + body.Res = new(types.SessionIsActiveResponse) + + if session, exists := s.getSession(req.SessionID); exists { + body.Res.Returnval = session.UserName == req.UserName + } + + return body +} + +func (s *SessionManager) AcquireCloneTicket(ctx *Context, _ *types.AcquireCloneTicket) soap.HasFault { + session := *ctx.Session + session.Key = uuid.New().String() + s.putSession(session) + + return &methods.AcquireCloneTicketBody{ + Res: &types.AcquireCloneTicketResponse{ + Returnval: session.Key, + }, + } +} + +func (s *SessionManager) CloneSession(ctx *Context, ticket *types.CloneSession) soap.HasFault { + body := new(methods.CloneSessionBody) + + session, exists := s.getSession(ticket.CloneTicket) + + if exists { + s.delSession(ticket.CloneTicket) // A clone ticket can only be used once + session.Key = uuid.New().String() + ctx.SetSession(session, true) + + body.Res = &types.CloneSessionResponse{ + Returnval: session.UserSession, + } + } else { + body.Fault_ = invalidLogin + } + + return body +} + +func (s *SessionManager) ImpersonateUser(ctx *Context, req *types.ImpersonateUser) soap.HasFault { + body := new(methods.ImpersonateUserBody) + + session, exists := s.findSession(req.UserName) + + if exists { + session.Key = uuid.New().String() + ctx.SetSession(session, true) + + body.Res = &types.ImpersonateUserResponse{ + Returnval: session.UserSession, + } + } else { + body.Fault_ = invalidLogin + } + + return body +} + +func (s *SessionManager) AcquireGenericServiceTicket(ticket *types.AcquireGenericServiceTicket) soap.HasFault { + return &methods.AcquireGenericServiceTicketBody{ + Res: &types.AcquireGenericServiceTicketResponse{ + Returnval: types.SessionManagerGenericServiceTicket{ + Id: uuid.New().String(), + HostName: s.ServiceHostName, + }, + }, + } +} + +var invalidLogin = Fault("Login failure", new(types.InvalidLogin)) + +// Context provides per-request Session management. +type Context struct { + req *http.Request + res http.ResponseWriter + svc *Service + + context.Context + Session *Session + Header soap.Header + Caller *types.ManagedObjectReference + Map *Registry +} + +func SOAPCookie(ctx *Context) string { + if cookie := ctx.Header.Cookie; cookie != nil { + return cookie.Value + } + return "" +} + +func HTTPCookie(ctx *Context) string { + if cookie, err := ctx.req.Cookie(soap.SessionCookieName); err == nil { + return cookie.Value + } + return "" +} + +func (c *Context) sessionManager() *SessionManager { + return c.svc.sdk[vim25.Path].SessionManager() +} + +// mapSession maps an HTTP cookie to a Session. +func (c *Context) mapSession() { + cookie := c.Map.Cookie + if cookie == nil { + cookie = HTTPCookie + } + + if val, ok := c.sessionManager().getSession(cookie(c)); ok { + c.SetSession(val, false) + } +} + +func (m *SessionManager) expiredSession(id string, now time.Time, timeout time.Duration) bool { + expired := true + + s, ok := m.getSession(id) + if ok { + expired = now.Sub(s.LastActiveTime) > timeout + if expired { + m.delSession(id) + } + } + + return expired +} + +// SessionIdleWatch starts a goroutine that calls func expired() at timeout intervals. +// The goroutine exits if the func returns true. +func SessionIdleWatch(ctx *Context, id string, expired func(string, time.Time, time.Duration) bool) { + opt := ctx.Map.OptionManager().find("config.vmacore.soap.sessionTimeout") + if opt == nil { + return + } + + timeout, err := time.ParseDuration(opt.Value.(string)) + if err != nil { + panic(err) + } + + go func() { + for t := time.NewTimer(timeout); ; { + select { + case <-ctx.Done(): + return + case now := <-t.C: + if expired(id, now, timeout) { + return + } + t.Reset(timeout) + } + } + }() +} + +// SetSession should be called after successful authentication. +func (c *Context) SetSession(session Session, login bool) { + session.UserAgent = c.req.UserAgent() + session.IpAddress = strings.Split(c.req.RemoteAddr, ":")[0] + session.LastActiveTime = time.Now() + session.CallCount++ + + m := c.sessionManager() + m.putSession(session) + c.Session = &session + + if login { + http.SetCookie(c.res, &http.Cookie{ + Name: soap.SessionCookieName, + Value: session.Key, + Secure: secureCookies, + HttpOnly: true, + }) + + c.postEvent(&types.UserLoginSessionEvent{ + SessionId: session.Key, + IpAddress: session.IpAddress, + UserAgent: session.UserAgent, + Locale: session.Locale, + }) + + SessionIdleWatch(c, session.Key, m.expiredSession) + } +} + +// For returns a Context with Registry Map for the given path. +// This is intended for calling into other namespaces internally, +// such as vslm simulator methods calling vim25 methods for example. +func (c *Context) For(path string) *Context { + clone := *c + clone.Map = c.svc.sdk[path] + return &clone +} + +// WithLock holds a lock for the given object while the given function is run. +// It will skip locking if this context already holds the given object's lock. +func (c *Context) WithLock(obj mo.Reference, f func()) { + // TODO: This is not always going to be correct. An object should + // really be locked by the registry that "owns it", which is not always + // Map. This function will need to take the Registry as an additional + // argument to accomplish this. + // Basic mutex locking will work even if obj doesn't belong to Map, but + // if obj implements sync.Locker, that custom locking will not be used. + c.Map.WithLock(c, obj, f) +} + +func (c *Context) Update(obj mo.Reference, changes []types.PropertyChange) { + c.Map.Update(c, obj, changes) +} + +// postEvent wraps EventManager.PostEvent for internal use, with a lock on the EventManager. +func (c *Context) postEvent(events ...types.BaseEvent) { + m := c.Map.EventManager() + c.WithLock(m, func() { + for _, event := range events { + m.PostEvent(c, &types.PostEvent{EventToPost: event}) + } + }) +} + +// Session combines a UserSession and a Registry for per-session managed objects. +type Session struct { + types.UserSession + *Registry + Map *Registry +} + +func (s *Session) setReference(item mo.Reference) { + ref := item.Reference() + if ref.Value == "" { + ref.Value = fmt.Sprintf("session[%s]%s", s.Key, uuid.New()) + } + if ref.Type == "" { + ref.Type = typeName(item) + } + s.Registry.setReference(item, ref) +} + +// Put wraps Registry.Put, setting the moref value to include the session key. +func (s *Session) Put(item mo.Reference) mo.Reference { + s.setReference(item) + return s.Registry.Put(item) +} + +// Get wraps Registry.Get, session-izing singleton objects such as SessionManager and the root PropertyCollector. +func (s *Session) Get(ref types.ManagedObjectReference) mo.Reference { + obj := s.Registry.Get(ref) + if obj != nil { + return obj + } + + // Return a session "view" of certain singleton objects + switch ref.Type { + case "SessionManager": + // Clone SessionManager so the PropertyCollector can properly report CurrentSession + m := *s.Map.SessionManager() + m.CurrentSession = &s.UserSession + + // TODO: we could maintain SessionList as part of the SessionManager singleton + sessionMutex.Lock() + for _, session := range m.sessions { + m.SessionList = append(m.SessionList, session.UserSession) + } + sessionMutex.Unlock() + + return &m + case "PropertyCollector": + if ref == s.Map.content().PropertyCollector { + // Per-session instance of the PropertyCollector singleton. + // Using reflection here as PropertyCollector might be wrapped with a custom type. + obj = s.Map.Get(ref) + pc := reflect.New(reflect.TypeOf(obj).Elem()) + obj = pc.Interface().(mo.Reference) + s.Registry.setReference(obj, ref) + return s.Put(obj) + } + } + + return s.Map.Get(ref) +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/simulator.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/simulator.go new file mode 100644 index 000000000..c93122d32 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/simulator.go @@ -0,0 +1,998 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + "context" + "crypto/tls" + "crypto/x509" + "encoding/json" + "encoding/pem" + "fmt" + "io" + "log" + "net" + "net/http" + "net/url" + "os" + "path" + "reflect" + "sort" + "strconv" + "strings" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +var ( + // Trace when set to true, writes SOAP traffic to stderr + Trace = false + + // TraceFile is the output file when Trace = true + TraceFile = os.Stderr + + // DefaultLogin for authentication + DefaultLogin = url.UserPassword("user", "pass") +) + +// Method encapsulates a decoded SOAP client request +type Method struct { + Name string + This types.ManagedObjectReference + Header soap.Header + Body types.AnyType +} + +// Service decodes incoming requests and dispatches to a Handler +type Service struct { + sdk map[string]*Registry + funcs []handleFunc + delay *DelayConfig + + readAll func(io.Reader) ([]byte, error) + + Context *Context + Listen *url.URL + TLS *tls.Config + ServeMux *http.ServeMux + // RegisterEndpoints will initialize any endpoints added via RegisterEndpoint + RegisterEndpoints bool +} + +// Server provides a simulator Service over HTTP +type Server struct { + *internal.Server + URL *url.URL + Tunnel int + + caFile string +} + +// New returns an initialized simulator Service instance +func New(ctx *Context, instance *ServiceInstance) *Service { + s := &Service{ + Context: ctx, + readAll: io.ReadAll, + sdk: make(map[string]*Registry), + } + s.Context.svc = s + return s +} + +func (s *Service) client() *vim25.Client { + c, _ := vim25.NewClient(context.Background(), s) + return c +} + +type serverFaultBody struct { + Reason *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *serverFaultBody) Fault() *soap.Fault { return b.Reason } + +func serverFault(msg string) soap.HasFault { + return &serverFaultBody{Reason: Fault(msg, &types.InvalidRequest{})} +} + +// Fault wraps the given message and fault in a soap.Fault +func Fault(msg string, fault types.BaseMethodFault) *soap.Fault { + f := &soap.Fault{ + Code: "ServerFaultCode", + String: msg, + } + + f.Detail.Fault = fault + + return f +} + +func tracef(format string, v ...any) { + if Trace { + log.Printf(format, v...) + } +} + +func (s *Service) call(ctx *Context, method *Method) soap.HasFault { + handler := ctx.Map.Get(method.This) + session := ctx.Session + ctx.Caller = &method.This + + if ctx.Map.Handler != nil { + h, fault := ctx.Map.Handler(ctx, method) + if fault != nil { + return &serverFaultBody{Reason: Fault("", fault)} + } + if h != nil { + handler = h + } + } + + if session == nil { + switch method.Name { + case + "Login", "LoginByToken", "LoginExtensionByCertificate", "CloneSession", // SessionManager + "RetrieveServiceContent", "RetrieveInternalContent", "PbmRetrieveServiceContent", // ServiceContent + "Fetch", "RetrieveProperties", "RetrievePropertiesEx", // PropertyCollector + "List", // lookup service + "GetTrustedCertificates": // ssoadmin + // ok for now, TODO: authz + default: + fault := &types.NotAuthenticated{ + NoPermission: types.NoPermission{ + Object: &method.This, + PrivilegeId: "System.View", + }, + } + return &serverFaultBody{Reason: Fault("", fault)} + } + } else { + // Prefer the Session.Registry, ServiceContent.PropertyCollector filter field for example is per-session + if h := session.Get(method.This); h != nil { + handler = h + } + } + + if handler == nil { + msg := fmt.Sprintf("managed object not found: %s", method.This) + log.Print(msg) + fault := &types.ManagedObjectNotFound{Obj: method.This} + return &serverFaultBody{Reason: Fault(msg, fault)} + } + + // Lowercase methods can't be accessed outside their package + name := strings.Title(method.Name) + + if strings.HasSuffix(name, vTaskSuffix) { + // Make golint happy renaming "Foo_Task" -> "FooTask" + name = name[:len(name)-len(vTaskSuffix)] + sTaskSuffix + } + + m := reflect.ValueOf(handler).MethodByName(name) + if !m.IsValid() { + msg := fmt.Sprintf("%s does not implement: %s", method.This, method.Name) + log.Print(msg) + fault := &types.MethodNotFound{Receiver: method.This, Method: method.Name} + return &serverFaultBody{Reason: Fault(msg, fault)} + } + + if e, ok := handler.(mo.Entity); ok { + for _, dm := range e.Entity().DisabledMethod { + if name == dm { + msg := fmt.Sprintf("%s method is disabled: %s", method.This, method.Name) + fault := &types.MethodDisabled{} + return &serverFaultBody{Reason: Fault(msg, fault)} + } + } + } + + // We have a valid call. Introduce a delay if requested + if s.delay != nil { + s.delay.delay(method.Name) + } + + var args, res []reflect.Value + if m.Type().NumIn() == 2 { + args = append(args, reflect.ValueOf(ctx)) + } + args = append(args, reflect.ValueOf(method.Body)) + ctx.Map.WithLock(ctx, handler, func() { + res = m.Call(args) + }) + + return res[0].Interface().(soap.HasFault) +} + +// internalSession is the session for use by the in-memory client (Service.RoundTrip) +var internalSession = &Session{ + UserSession: types.UserSession{ + Key: uuid.New().String(), + }, + Registry: NewRegistry(), +} + +// RoundTrip implements the soap.RoundTripper interface in process. +// Rather than encode/decode SOAP over HTTP, this implementation uses reflection. +func (s *Service) RoundTrip(ctx context.Context, request, response soap.HasFault) error { + field := func(r soap.HasFault, name string) reflect.Value { + return reflect.ValueOf(r).Elem().FieldByName(name) + } + + // Every struct passed to soap.RoundTrip has "Req" and "Res" fields + req := field(request, "Req") + + // Every request has a "This" field. + this := req.Elem().FieldByName("This") + // Copy request body + body := reflect.New(req.Type().Elem()) + deepCopy(req.Interface(), body.Interface()) + + method := &Method{ + Name: req.Elem().Type().Name(), + This: this.Interface().(types.ManagedObjectReference), + Body: body.Interface(), + } + + res := s.call(&Context{ + Map: s.Context.Map, + Context: ctx, + Session: &Session{ + UserSession: internalSession.UserSession, + Registry: internalSession.Registry, + Map: s.Context.Map, + }, + }, method) + + if err := res.Fault(); err != nil { + return soap.WrapSoapFault(err) + } + + field(response, "Res").Set(field(res, "Res")) + + return nil +} + +// soapEnvelope is a copy of soap.Envelope, with namespace changed to "soapenv", +// and additional namespace attributes required by some client libraries. +// Go still has issues decoding with such a namespace, but encoding is ok. +type soapEnvelope struct { + XMLName xml.Name `xml:"soapenv:Envelope"` + Enc string `xml:"xmlns:soapenc,attr"` + Env string `xml:"xmlns:soapenv,attr"` + XSD string `xml:"xmlns:xsd,attr"` + XSI string `xml:"xmlns:xsi,attr"` + Body any `xml:"soapenv:Body"` +} + +type faultDetail struct { + Fault types.AnyType +} + +// soapFault is a copy of soap.Fault, with the same changes as soapEnvelope +type soapFault struct { + XMLName xml.Name `xml:"soapenv:Fault"` + Code string `xml:"faultcode"` + String string `xml:"faultstring"` + Detail struct { + Fault *faultDetail + } `xml:"detail"` +} + +// MarshalXML renames the start element from "Fault" to "${Type}Fault" +func (d *faultDetail) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + kind := reflect.TypeOf(d.Fault).Elem().Name() + start.Name.Local = kind + "Fault" + start.Attr = append(start.Attr, + xml.Attr{ + Name: xml.Name{Local: "xmlns"}, + Value: "urn:" + vim25.Namespace, + }, + xml.Attr{ + Name: xml.Name{Local: "xsi:type"}, + Value: kind, + }) + return e.EncodeElement(d.Fault, start) +} + +// response sets xml.Name.Space when encoding Body. +// Note that namespace is intentionally omitted in the vim25/methods/methods.go Body.Res field tags. +type response struct { + Namespace string + Body soap.HasFault +} + +func (r *response) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + body := reflect.ValueOf(r.Body).Elem() + val := body.FieldByName("Res") + if !val.IsValid() { + return fmt.Errorf("%T: invalid response type (missing 'Res' field)", r.Body) + } + if val.IsNil() { + return fmt.Errorf("%T: invalid response (nil 'Res' field)", r.Body) + } + + // Default response namespace + ns := "urn:" + r.Namespace + // Override namespace from struct tag if defined + field, _ := body.Type().FieldByName("Res") + if tag := field.Tag.Get("xml"); tag != "" { + tags := strings.Split(tag, " ") + if len(tags) > 0 && strings.HasPrefix(tags[0], "urn") { + ns = tags[0] + } + } + + res := xml.StartElement{ + Name: xml.Name{ + Space: ns, + Local: val.Elem().Type().Name(), + }, + } + if err := e.EncodeToken(start); err != nil { + return err + } + if err := e.EncodeElement(val.Interface(), res); err != nil { + return err + } + return e.EncodeToken(start.End()) +} + +// About generates some info about the simulator. +func (s *Service) About(w http.ResponseWriter, r *http.Request) { + var about struct { + Methods []string `json:"methods"` + Types []string `json:"types"` + } + + seen := make(map[string]bool) + + f := reflect.TypeOf((*soap.HasFault)(nil)).Elem() + + for _, sdk := range s.sdk { + for _, obj := range sdk.objects { + kind := obj.Reference().Type + if seen[kind] { + continue + } + seen[kind] = true + + about.Types = append(about.Types, kind) + + t := reflect.TypeOf(obj) + for i := 0; i < t.NumMethod(); i++ { + m := t.Method(i) + if seen[m.Name] { + continue + } + seen[m.Name] = true + + in := m.Type.NumIn() + if in < 2 || in > 3 { // at least 2 params (receiver and request), optionally a 3rd param (context) + continue + } + if m.Type.NumOut() != 1 || m.Type.Out(0) != f { // all methods return soap.HasFault + continue + } + + about.Methods = append(about.Methods, strings.Replace(m.Name, "Task", "_Task", 1)) + } + } + } + + sort.Strings(about.Methods) + sort.Strings(about.Types) + + w.Header().Set("Content-Type", "application/json") + enc := json.NewEncoder(w) + enc.SetIndent("", " ") + _ = enc.Encode(&about) +} + +var endpoints []func(*Service, *Registry) + +// RegisterEndpoint funcs are called after the Server is initialized if Service.RegisterEndpoints=true. +// Such a func would typically register a SOAP endpoint via Service.RegisterSDK or REST endpoint via Service.Handle +func RegisterEndpoint(endpoint func(*Service, *Registry)) { + endpoints = append(endpoints, endpoint) +} + +// Handle registers the handler for the given pattern with Service.ServeMux. +func (s *Service) Handle(pattern string, handler http.Handler) { + s.ServeMux.Handle(pattern, handler) + // Not ideal, but avoids having to add yet another registration mechanism + // so we can optionally use vapi/simulator internally. + if m, ok := handler.(tagManager); ok { + s.sdk[vim25.Path].tagManager = m + } +} + +type muxHandleFunc interface { + HandleFunc(string, func(http.ResponseWriter, *http.Request)) +} + +type handleFunc struct { + pattern string + handler func(http.ResponseWriter, *http.Request) +} + +// HandleFunc dispatches to http.ServeMux.HandleFunc after all endpoints have been registered. +// This allows dispatching to an endpoint's HandleFunc impl, such as vapi/simulator for example. +func (s *Service) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) { + s.funcs = append(s.funcs, handleFunc{pattern, handler}) +} + +// RegisterSDK adds an HTTP handler for the Registry's Path and Namespace. +// If r.Path is already registered, r's objects are added to the existing Registry. +// An optional set of aliases can be provided to register the same handler for +// multiple paths. +func (s *Service) RegisterSDK(r *Registry, alias ...string) { + if existing, ok := s.sdk[r.Path]; ok { + for id, obj := range r.objects { + existing.objects[id] = obj + } + return + } + + if s.ServeMux == nil { + s.ServeMux = http.NewServeMux() + } + + s.sdk[r.Path] = r + s.ServeMux.HandleFunc(r.Path, s.ServeSDK) + + for _, p := range alias { + s.sdk[p] = r + s.ServeMux.HandleFunc(p, s.ServeSDK) + } +} + +// StatusSDK can be used to simulate an /sdk HTTP response code other than 200. +// The value of StatusSDK is restored to http.StatusOK after 1 response. +// This can be useful to test vim25.Retry() for example. +var StatusSDK = http.StatusOK + +// ServeSDK implements the http.Handler interface +func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + if StatusSDK != http.StatusOK { + w.WriteHeader(StatusSDK) + StatusSDK = http.StatusOK // reset + return + } + + body, err := s.readAll(r.Body) + _ = r.Body.Close() + if err != nil { + log.Printf("error reading body: %s", err) + w.WriteHeader(http.StatusBadRequest) + return + } + + if Trace { + fmt.Fprintf(TraceFile, "Request: %s\n", string(body)) + } + + ctx := &Context{ + req: r, + res: w, + svc: s, + + Map: s.sdk[r.URL.Path], + Context: context.Background(), + } + + var res soap.HasFault + var soapBody any + + method, err := UnmarshalBody(ctx.Map.typeFunc, body) + if err != nil { + res = serverFault(err.Error()) + } else { + ctx.Header = method.Header + if method.Name == "Fetch" { + // Redirect any Fetch method calls to the PropertyCollector singleton + method.This = ctx.Map.content().PropertyCollector + } + ctx.Map.WithLock(ctx, ctx.sessionManager(), ctx.mapSession) + res = s.call(ctx, method) + } + + if f := res.Fault(); f != nil { + w.WriteHeader(http.StatusInternalServerError) + + // the generated method/*Body structs use the '*soap.Fault' type, + // so we need our own Body type to use the modified '*soapFault' type. + soapBody = struct { + Fault *soapFault + }{ + &soapFault{ + Code: f.Code, + String: f.String, + Detail: struct { + Fault *faultDetail + }{&faultDetail{f.Detail.Fault}}, + }, + } + } else { + w.WriteHeader(http.StatusOK) + + soapBody = &response{ctx.Map.Namespace, res} + } + + var out bytes.Buffer + + fmt.Fprint(&out, xml.Header) + e := xml.NewEncoder(&out) + err = e.Encode(&soapEnvelope{ + Enc: "http://schemas.xmlsoap.org/soap/encoding/", + Env: "http://schemas.xmlsoap.org/soap/envelope/", + XSD: "http://www.w3.org/2001/XMLSchema", + XSI: "http://www.w3.org/2001/XMLSchema-instance", + Body: soapBody, + }) + if err == nil { + err = e.Flush() + } + + if err != nil { + log.Printf("error encoding %s response: %s", method.Name, err) + return + } + + if Trace { + fmt.Fprintf(TraceFile, "Response: %s\n", out.String()) + } + + _, _ = w.Write(out.Bytes()) +} + +func (s *Service) findDatastore(query url.Values) (*Datastore, error) { + ctx := context.Background() + + finder := find.NewFinder(s.client(), false) + dc, err := finder.DatacenterOrDefault(ctx, query.Get("dcPath")) + if err != nil { + return nil, err + } + + finder.SetDatacenter(dc) + + ds, err := finder.DatastoreOrDefault(ctx, query.Get("dsName")) + if err != nil { + return nil, err + } + + return s.Context.Map.Get(ds.Reference()).(*Datastore), nil +} + +const folderPrefix = "/folder/" + +// ServeDatastore handler for Datastore access via /folder path. +func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request) { + ds, ferr := s.findDatastore(r.URL.Query()) + if ferr != nil { + log.Printf("failed to locate datastore with query params: %s", r.URL.RawQuery) + w.WriteHeader(http.StatusNotFound) + return + } + + if strings.Contains(r.URL.Path, "..") { + w.WriteHeader(http.StatusBadRequest) + return + } + + r.URL.Path = strings.TrimPrefix(r.URL.Path, folderPrefix) + p := ds.resolve(s.Context, r.URL.Path) + + switch r.Method { + case http.MethodPost: + _, err := os.Stat(p) + if err == nil { + // File exists + w.WriteHeader(http.StatusConflict) + return + } + + // File does not exist, fallthrough to create via PUT logic + fallthrough + case http.MethodPut: + dir := path.Dir(p) + _ = os.MkdirAll(dir, 0700) + + f, err := os.Create(p) + if err != nil { + log.Printf("failed to %s '%s': %s", r.Method, p, err) + w.WriteHeader(http.StatusInternalServerError) + return + } + defer f.Close() + + _, _ = io.Copy(f, r.Body) + default: + // ds.resolve() may have translated vsan friendly name to uuid, + // apply the same to the Request.URL.Path + r.URL.Path = strings.TrimPrefix(p, ds.Summary.Url) + + fs := http.FileServer(http.Dir(ds.Summary.Url)) + + fs.ServeHTTP(w, r) + } +} + +// ServiceVersions handler for the /sdk/vimServiceVersions.xml path. +func (s *Service) ServiceVersions(w http.ResponseWriter, r *http.Request) { + const versions = xml.Header + ` + + urn:vim25 + %s + + 6.0 + 5.5 + + + +` + fmt.Fprintf(w, versions, s.Context.Map.content().About.ApiVersion) +} + +// ServiceVersionsVsan handler for the /sdk/vsanServiceVersions.xml path. +func (s *Service) ServiceVersionsVsan(w http.ResponseWriter, r *http.Request) { + const versions = xml.Header + ` + + urn:vsan + %s + + 6.7 + 6.6 + + + +` + fmt.Fprintf(w, versions, s.Context.Map.content().About.ApiVersion) +} + +// defaultIP returns addr.IP if specified, otherwise attempts to find a non-loopback ipv4 IP +func defaultIP(addr *net.TCPAddr) string { + if !addr.IP.IsUnspecified() { + return addr.IP.String() + } + + nics, err := net.Interfaces() + if err != nil { + return addr.IP.String() + } + + for _, nic := range nics { + if nic.Name == "docker0" || strings.HasPrefix(nic.Name, "vmnet") { + continue + } + addrs, aerr := nic.Addrs() + if aerr != nil { + continue + } + for _, addr := range addrs { + if ip, ok := addr.(*net.IPNet); ok && !ip.IP.IsLoopback() { + if ip.IP.To4() != nil { + return ip.IP.String() + } + } + } + } + + return addr.IP.String() +} + +// NewServer returns an http Server instance for the given service +func (s *Service) NewServer() *Server { + ctx := s.Context + s.RegisterSDK(ctx.Map, ctx.Map.Path+"/vimService") + + mux := s.ServeMux + mux.HandleFunc(ctx.Map.Path+"/vimServiceVersions.xml", s.ServiceVersions) + mux.HandleFunc(ctx.Map.Path+"/vsanServiceVersions.xml", s.ServiceVersionsVsan) + mux.HandleFunc(folderPrefix, s.ServeDatastore) + mux.HandleFunc(guestPrefix, ServeGuest) + mux.HandleFunc(nfcPrefix, ServeNFC) + mux.HandleFunc("/about", s.About) + + if s.Listen == nil { + s.Listen = new(url.URL) + } + ts := internal.NewUnstartedServer(mux, s.Listen.Host) + addr := ts.Listener.Addr().(*net.TCPAddr) + port := strconv.Itoa(addr.Port) + u := &url.URL{ + Scheme: "http", + Host: net.JoinHostPort(defaultIP(addr), port), + Path: ctx.Map.Path, + } + if s.TLS != nil { + u.Scheme += "s" + } + + // Redirect clients to this http server, rather than HostSystem.Name + ctx.sessionManager().ServiceHostName = u.Host + + // Add vcsim config to OptionManager for use by SDK handlers (see lookup/simulator for example) + m := ctx.Map.OptionManager() + for i := range m.Setting { + setting := m.Setting[i].GetOptionValue() + + if strings.HasSuffix(setting.Key, ".uri") { + // Rewrite any URIs with vcsim's host:port + endpoint, err := url.Parse(setting.Value.(string)) + if err == nil { + endpoint.Scheme = u.Scheme + endpoint.Host = u.Host + setting.Value = endpoint.String() + } + } + } + m.UpdateOptions(&types.UpdateOptions{ + ChangedValue: []types.BaseOptionValue{&types.OptionValue{ + Key: "vcsim.server.url", + Value: u.String(), + }}, + }) + + u.User = s.Listen.User + if u.User == nil { + u.User = DefaultLogin + } + s.Listen = u + + if s.RegisterEndpoints { + for i := range endpoints { + endpoints[i](s, ctx.Map) + } + } + + for _, f := range s.funcs { + pattern := &url.URL{Path: f.pattern} + endpoint, _ := s.ServeMux.Handler(&http.Request{URL: pattern}) + + if mux, ok := endpoint.(muxHandleFunc); ok { + mux.HandleFunc(f.pattern, f.handler) // e.g. vapi/simulator + } else { + s.ServeMux.HandleFunc(f.pattern, f.handler) + } + } + + if s.TLS != nil { + ts.TLS = s.TLS + ts.TLS.ClientAuth = tls.RequestClientCert // Used by SessionManager.LoginExtensionByCertificate + ctx.Map.SessionManager().TLS = func() *tls.Config { return ts.TLS } + ts.StartTLS() + } else { + ts.Start() + } + + return &Server{ + Server: ts, + URL: u, + } +} + +// Certificate returns the TLS certificate for the Server if started with TLS enabled. +// This method will panic if TLS is not enabled for the server. +func (s *Server) Certificate() *x509.Certificate { + // By default httptest.StartTLS uses http/internal.LocalhostCert, which we can access here: + cert, _ := x509.ParseCertificate(s.TLS.Certificates[0].Certificate[0]) + return cert +} + +// CertificateInfo returns Server.Certificate() as object.HostCertificateInfo +func (s *Server) CertificateInfo() *object.HostCertificateInfo { + info := new(object.HostCertificateInfo) + info.FromCertificate(s.Certificate()) + return info +} + +// CertificateFile returns a file name, where the file contains the PEM encoded Server.Certificate. +// The temporary file is removed when Server.Close() is called. +func (s *Server) CertificateFile() (string, error) { + if s.caFile != "" { + return s.caFile, nil + } + + f, err := os.CreateTemp("", "vcsim-") + if err != nil { + return "", err + } + defer f.Close() + + s.caFile = f.Name() + cert := s.Certificate() + return s.caFile, pem.Encode(f, &pem.Block{Type: "CERTIFICATE", Bytes: cert.Raw}) +} + +// proxy tunnels SDK requests +func (s *Server) proxy(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodConnect { + http.Error(w, "", http.StatusMethodNotAllowed) + return + } + + dst, err := net.Dial("tcp", s.URL.Host) + if err != nil { + http.Error(w, err.Error(), http.StatusBadGateway) + return + } + w.WriteHeader(http.StatusOK) + + src, _, err := w.(http.Hijacker).Hijack() + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + go io.Copy(src, dst) + go func() { + _, _ = io.Copy(dst, src) + _ = dst.Close() + _ = src.Close() + }() +} + +// StartTunnel runs an HTTP proxy for tunneling SDK requests that require TLS client certificate authentication. +func (s *Server) StartTunnel() error { + tunnel := &http.Server{ + Addr: fmt.Sprintf("%s:%d", s.URL.Hostname(), s.Tunnel), + Handler: http.HandlerFunc(s.proxy), + } + + l, err := net.Listen("tcp", tunnel.Addr) + if err != nil { + return err + } + + if s.Tunnel == 0 { + s.Tunnel = l.Addr().(*net.TCPAddr).Port + } + + // Set client proxy port (defaults to vCenter host port 80 in real life) + q := s.URL.Query() + q.Set("GOVMOMI_TUNNEL_PROXY_PORT", strconv.Itoa(s.Tunnel)) + s.URL.RawQuery = q.Encode() + + go tunnel.Serve(l) + + return nil +} + +// Close shuts down the server and blocks until all outstanding +// requests on this server have completed. +func (s *Server) Close() { + s.Server.Close() + if s.caFile != "" { + _ = os.Remove(s.caFile) + } +} + +var ( + vim25MapType = types.TypeFunc() +) + +func defaultMapType(name string) (reflect.Type, bool) { + typ, ok := vim25MapType(name) + if !ok { + // See TestIssue945, in which case Go does not resolve the namespace and name == "ns1:TraversalSpec" + // Without this hack, the SelectSet would be all nil's + kind := strings.SplitN(name, ":", 2) + if len(kind) == 2 { + typ, ok = vim25MapType(kind[1]) + } + } + return typ, ok +} + +// Element can be used to defer decoding of an XML node. +type Element struct { + start xml.StartElement + inner struct { + Content string `xml:",innerxml"` + } + typeFunc func(string) (reflect.Type, bool) +} + +func (e *Element) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + e.start = start + + return d.DecodeElement(&e.inner, &start) +} + +func (e *Element) decoder() *xml.Decoder { + decoder := xml.NewDecoder(strings.NewReader(e.inner.Content)) + decoder.TypeFunc = e.typeFunc // required to decode interface types + return decoder +} + +func (e *Element) Decode(val any) error { + return e.decoder().DecodeElement(val, &e.start) +} + +// UnmarshalBody extracts the Body from a soap.Envelope and unmarshals to the corresponding govmomi type +func UnmarshalBody(typeFunc func(string) (reflect.Type, bool), data []byte) (*Method, error) { + body := &Element{typeFunc: typeFunc} + req := soap.Envelope{ + Header: &soap.Header{ + Security: new(Element), + }, + Body: body, + } + + err := xml.Unmarshal(data, &req) + if err != nil { + return nil, fmt.Errorf("xml.Unmarshal: %s", err) + } + + var start xml.StartElement + var ok bool + decoder := body.decoder() + + for { + tok, derr := decoder.Token() + if derr != nil { + return nil, fmt.Errorf("decoding: %s", derr) + } + if start, ok = tok.(xml.StartElement); ok { + break + } + } + + if !ok { + return nil, fmt.Errorf("decoding: method token not found") + } + + kind := start.Name.Local + rtype, ok := typeFunc(kind) + if !ok { + return nil, fmt.Errorf("no vmomi type defined for '%s'", kind) + } + + val := reflect.New(rtype).Interface() + + err = decoder.DecodeElement(val, &start) + if err != nil { + return nil, fmt.Errorf("decoding %s: %s", kind, err) + } + + method := &Method{Name: kind, Header: *req.Header, Body: val} + + field := reflect.ValueOf(val).Elem().FieldByName("This") + + method.This = field.Interface().(types.ManagedObjectReference) + + return method, nil +} + +func newInvalidStateFault(format string, args ...any) *types.InvalidState { + msg := fmt.Sprintf(format, args...) + return &types.InvalidState{ + VimFault: types.VimFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{ + Reason: msg, + }, + LocalizedMessage: msg, + }, + }, + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/snapshot.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/snapshot.go new file mode 100644 index 000000000..821508a3d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/snapshot.go @@ -0,0 +1,220 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "os" + "path" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type VirtualMachineSnapshot struct { + mo.VirtualMachineSnapshot + DataSets map[string]*DataSet +} + +func (v *VirtualMachineSnapshot) createSnapshotFiles(ctx *Context) types.BaseMethodFault { + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + + snapshotDirectory := vm.Config.Files.SnapshotDirectory + if snapshotDirectory == "" { + snapshotDirectory = vm.Config.Files.VmPathName + } + + index := 1 + for { + fileName := fmt.Sprintf("%s-Snapshot%d.vmsn", vm.Name, index) + f, err := vm.createFile(ctx, snapshotDirectory, fileName, false) + if err != nil { + switch err.(type) { + case *types.FileAlreadyExists: + index++ + continue + default: + return err + } + } + + _ = f.Close() + + p, _ := parseDatastorePath(snapshotDirectory) + vm.useDatastore(ctx, p.Datastore) + datastorePath := object.DatastorePath{ + Datastore: p.Datastore, + Path: path.Join(p.Path, fileName), + } + + dataLayoutKey := vm.addFileLayoutEx(ctx, datastorePath, 0) + vm.addSnapshotLayout(ctx, v.Self, dataLayoutKey) + vm.addSnapshotLayoutEx(ctx, v.Self, dataLayoutKey, -1) + + return nil + } +} + +func (v *VirtualMachineSnapshot) removeSnapshotFiles(ctx *Context) types.BaseMethodFault { + // TODO: also remove delta disks that were created when snapshot was taken + + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + + for idx, sLayout := range vm.Layout.Snapshot { + if sLayout.Key == v.Self { + vm.Layout.Snapshot = append(vm.Layout.Snapshot[:idx], vm.Layout.Snapshot[idx+1:]...) + break + } + } + + for idx, sLayoutEx := range vm.LayoutEx.Snapshot { + if sLayoutEx.Key == v.Self { + for _, file := range vm.LayoutEx.File { + if file.Key == sLayoutEx.DataKey || file.Key == sLayoutEx.MemoryKey { + p, fault := parseDatastorePath(file.Name) + if fault != nil { + return fault + } + + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + datastore := ctx.Map.FindByName(p.Datastore, host.Datastore).(*Datastore) + dFilePath := datastore.resolve(ctx, p.Path) + + _ = os.Remove(dFilePath) + } + } + + vm.LayoutEx.Snapshot = append(vm.LayoutEx.Snapshot[:idx], vm.LayoutEx.Snapshot[idx+1:]...) + } + } + + vm.RefreshStorageInfo(ctx, nil) + + return nil +} + +func (v *VirtualMachineSnapshot) RemoveSnapshotTask(ctx *Context, req *types.RemoveSnapshot_Task) soap.HasFault { + task := CreateTask(v.Vm, "removeSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { + var changes []types.PropertyChange + + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + ctx.WithLock(vm, func() { + if vm.Snapshot.CurrentSnapshot != nil && *vm.Snapshot.CurrentSnapshot == req.This { + parent := findParentSnapshotInTree(vm.Snapshot.RootSnapshotList, req.This) + changes = append(changes, types.PropertyChange{Name: "snapshot.currentSnapshot", Val: parent}) + } + + rootSnapshots := removeSnapshotInTree(vm.Snapshot.RootSnapshotList, req.This, req.RemoveChildren) + changes = append(changes, types.PropertyChange{Name: "snapshot.rootSnapshotList", Val: rootSnapshots}) + + rootSnapshotRefs := make([]types.ManagedObjectReference, len(rootSnapshots)) + for i, rs := range rootSnapshots { + rootSnapshotRefs[i] = rs.Snapshot + } + changes = append(changes, types.PropertyChange{Name: "rootSnapshot", Val: rootSnapshotRefs}) + + if len(rootSnapshots) == 0 { + changes = []types.PropertyChange{ + {Name: "snapshot", Val: nil}, + {Name: "rootSnapshot", Val: nil}, + } + } + + ctx.Map.Get(req.This).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) + + ctx.Update(vm, changes) + }) + + ctx.Map.Remove(ctx, req.This) + + return nil, nil + }) + + return &methods.RemoveSnapshot_TaskBody{ + Res: &types.RemoveSnapshot_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (v *VirtualMachineSnapshot) RevertToSnapshotTask(ctx *Context, req *types.RevertToSnapshot_Task) soap.HasFault { + task := CreateTask(v.Vm, "revertToSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + + ctx.WithLock(vm, func() { + vm.DataSets = copyDataSetsForVmClone(v.DataSets) + ctx.Update(vm, []types.PropertyChange{ + {Name: "snapshot.currentSnapshot", Val: v.Self}, + }) + }) + + return nil, nil + }) + + return &methods.RevertToSnapshot_TaskBody{ + Res: &types.RevertToSnapshot_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (v *VirtualMachineSnapshot) ExportSnapshot(ctx *Context, req *types.ExportSnapshot) soap.HasFault { + + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + + lease := newHttpNfcLease(ctx) + lease.InitializeProgress = 100 + lease.TransferProgress = 0 + lease.Mode = string(types.HttpNfcLeaseModePushOrGet) + lease.Capabilities = types.HttpNfcLeaseCapabilities{ + CorsSupported: true, + PullModeSupported: true, + } + + device := object.VirtualDeviceList(v.Config.Hardware.Device) + ndevice := make(map[string]int) + var urls []types.HttpNfcLeaseDeviceUrl + u := leaseURL(ctx) + + for _, d := range device { + info, ok := d.GetVirtualDevice().Backing.(types.BaseVirtualDeviceFileBackingInfo) + if !ok { + continue + } + var file object.DatastorePath + file.FromString(info.GetVirtualDeviceFileBackingInfo().FileName) + name := path.Base(file.Path) + ds := vm.findDatastore(ctx, file.Datastore) + lease.files[name] = ds.resolve(ctx, file.Path) + + _, disk := d.(*types.VirtualDisk) + kind := device.Type(d) + n := ndevice[kind] + ndevice[kind]++ + + u.Path = nfcPrefix + path.Join(lease.Reference().Value, name) + urls = append(urls, types.HttpNfcLeaseDeviceUrl{ + Key: fmt.Sprintf("/%s/%s:%d", vm.Self.Value, kind, n), + ImportKey: fmt.Sprintf("/%s/%s:%d", vm.Name, kind, n), + Url: u.String(), + SslThumbprint: "", + Disk: types.NewBool(disk), + TargetId: name, + DatastoreKey: "", + FileSize: 0, + }) + } + + lease.ready(ctx, v.Vm, urls) + + return &methods.ExportSnapshotBody{ + Res: &types.ExportSnapshotResponse{ + Returnval: lease.Reference(), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go new file mode 100644 index 000000000..5c2ceb444 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go @@ -0,0 +1,172 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strconv" + "time" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type StorageResourceManager struct { + mo.StorageResourceManager +} + +func (m *StorageResourceManager) ConfigureStorageDrsForPodTask(ctx *Context, req *types.ConfigureStorageDrsForPod_Task) soap.HasFault { + task := CreateTask(m, "configureStorageDrsForPod", func(*Task) (types.AnyType, types.BaseMethodFault) { + cluster := ctx.Map.Get(req.Pod).(*StoragePod) + + if s := req.Spec.PodConfigSpec; s != nil { + config := &cluster.PodStorageDrsEntry.StorageDrsConfig.PodConfig + + if s.Enabled != nil { + config.Enabled = *s.Enabled + } + if s.DefaultVmBehavior != "" { + config.DefaultVmBehavior = s.DefaultVmBehavior + } + } + + return nil, nil + }) + + return &methods.ConfigureStorageDrsForPod_TaskBody{ + Res: &types.ConfigureStorageDrsForPod_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *StorageResourceManager) pod(ctx *Context, ref *types.ManagedObjectReference) *StoragePod { + if ref == nil { + return nil + } + cluster := ctx.Map.Get(*ref).(*StoragePod) + config := &cluster.PodStorageDrsEntry.StorageDrsConfig.PodConfig + + if !config.Enabled { + return nil + } + + if len(cluster.ChildEntity) == 0 { + return nil + } + + return cluster +} + +func (m *StorageResourceManager) RecommendDatastores(ctx *Context, req *types.RecommendDatastores) soap.HasFault { + spec := req.StorageSpec.PodSelectionSpec + body := new(methods.RecommendDatastoresBody) + res := new(types.RecommendDatastoresResponse) + key := 0 + invalid := func(prop string) soap.HasFault { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: prop, + }) + return body + } + add := func(cluster *StoragePod, ds types.ManagedObjectReference) { + key++ + res.Returnval.Recommendations = append(res.Returnval.Recommendations, types.ClusterRecommendation{ + Key: strconv.Itoa(key), + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: "storagePlacement", + ReasonText: "Satisfy storage initial placement requests", + WarningText: "", + WarningDetails: (*types.LocalizableMessage)(nil), + Prerequisite: nil, + Action: []types.BaseClusterAction{ + &types.StoragePlacementAction{ + ClusterAction: types.ClusterAction{ + Type: "StoragePlacementV1", + Target: (*types.ManagedObjectReference)(nil), + }, + Vm: (*types.ManagedObjectReference)(nil), + RelocateSpec: types.VirtualMachineRelocateSpec{ + Service: (*types.ServiceLocator)(nil), + Folder: (*types.ManagedObjectReference)(nil), + Datastore: &ds, + DiskMoveType: "moveAllDiskBackingsAndAllowSharing", + Pool: (*types.ManagedObjectReference)(nil), + Host: (*types.ManagedObjectReference)(nil), + Disk: nil, + Transform: "", + DeviceChange: nil, + Profile: nil, + }, + Destination: ds, + SpaceUtilBefore: 5.00297212600708, + SpaceDemandBefore: 5.00297212600708, + SpaceUtilAfter: 5.16835880279541, + SpaceDemandAfter: 5.894514083862305, + IoLatencyBefore: 0, + }, + }, + Target: &cluster.Self, + }) + } + + var devices object.VirtualDeviceList + + switch types.StoragePlacementSpecPlacementType(req.StorageSpec.Type) { + case types.StoragePlacementSpecPlacementTypeCreate: + if req.StorageSpec.ResourcePool == nil { + return invalid("resourcePool") + } + if req.StorageSpec.ConfigSpec == nil { + return invalid("configSpec") + } + for _, d := range req.StorageSpec.ConfigSpec.DeviceChange { + devices = append(devices, d.GetVirtualDeviceConfigSpec().Device) + } + cluster := m.pod(ctx, spec.StoragePod) + if cluster == nil { + if f := req.StorageSpec.ConfigSpec.Files; f == nil || f.VmPathName == "" { + return invalid("configSpec.files") + } + } + case types.StoragePlacementSpecPlacementTypeClone: + if req.StorageSpec.Folder == nil { + return invalid("folder") + } + if req.StorageSpec.Vm == nil { + return invalid("vm") + } + if req.StorageSpec.CloneName == "" { + return invalid("cloneName") + } + if req.StorageSpec.CloneSpec == nil { + return invalid("cloneSpec") + } + } + + for _, placement := range spec.InitialVmConfig { + cluster := m.pod(ctx, &placement.StoragePod) + if cluster == nil { + return invalid("podSelectionSpec.storagePod") + } + + for _, disk := range placement.Disk { + if devices.FindByKey(disk.DiskId) == nil { + return invalid("podSelectionSpec.initialVmConfig.disk.fileBacking") + } + } + + for _, ds := range cluster.ChildEntity { + add(cluster, ds) + } + } + + body.Res = res + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/task.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/task.go new file mode 100644 index 000000000..c7aaba2a3 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/task.go @@ -0,0 +1,264 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "reflect" + "strings" + "time" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +const vTaskSuffix = "_Task" // vmomi suffix +const sTaskSuffix = "Task" // simulator suffix (avoiding golint warning) + +// TaskDelay applies to all tasks. +// Names for DelayConfig.MethodDelay will differ for task and api delays. API +// level names often look like PowerOff_Task, whereas the task name is simply +// PowerOff. +var TaskDelay = DelayConfig{} + +type Task struct { + mo.Task + + ctx *Context + Execute func(*Task) (types.AnyType, types.BaseMethodFault) +} + +func NewTask(runner TaskRunner) *Task { + ref := runner.Reference() + name := reflect.TypeOf(runner).Elem().Name() + name = strings.Replace(name, "VM", "Vm", 1) // "VM" for the type to make go-lint happy, but "Vm" for the vmodl ID + return CreateTask(ref, name, runner.Run) +} + +func CreateTask(e mo.Reference, name string, run func(*Task) (types.AnyType, types.BaseMethodFault)) *Task { + ref := e.Reference() + id := name + + if strings.HasSuffix(id, sTaskSuffix) { + id = id[:len(id)-len(sTaskSuffix)] + name = id + vTaskSuffix + } + + task := &Task{ + Execute: run, + } + + task.Info.Name = ucFirst(name) + task.Info.DescriptionId = fmt.Sprintf("%s.%s", ref.Type, id) + task.Info.Entity = &ref + task.Info.EntityName = ref.Value + task.Info.Reason = &types.TaskReasonUser{UserName: "vcsim"} // TODO: Context.Session.User + task.Info.QueueTime = time.Now() + task.Info.State = types.TaskInfoStateQueued + + return task +} + +type TaskRunner interface { + mo.Reference + + Run(*Task) (types.AnyType, types.BaseMethodFault) +} + +// taskReference is a helper struct so we can call AcquireLock in Run() +type taskReference struct { + Self types.ManagedObjectReference +} + +func (tr *taskReference) Reference() types.ManagedObjectReference { + return tr.Self +} + +func (t *Task) Run(ctx *Context) types.ManagedObjectReference { + if ctx.Map.Path != vim25.Path { + // All Tasks live in the vim25 namespace + ctx = ctx.For(vim25.Path) + } + + t.ctx = ctx + + t.Self = ctx.Map.newReference(t) + t.Info.Key = t.Self.Value + t.Info.Task = t.Self + ctx.Map.Put(t) + + ctx.Map.AtomicUpdate(t.ctx, t, []types.PropertyChange{ + {Name: "info.startTime", Val: time.Now()}, + {Name: "info.state", Val: types.TaskInfoStateRunning}, + }) + + tr := &taskReference{ + Self: *t.Info.Entity, + } + + // in most cases, the caller already holds this lock, and we would like + // the lock to be held across the "hand off" to the async goroutine. + // however, with a TaskDelay, PropertyCollector (for example) cannot read + // any object properties while the lock is held. + handoff := true + if v, ok := TaskDelay.MethodDelay["LockHandoff"]; ok { + handoff = v != 0 + } + var unlock func() + if handoff { + unlock = ctx.Map.AcquireLock(ctx, tr) + } + go func() { + TaskDelay.delay(t.Info.Name) + if !handoff { + unlock = ctx.Map.AcquireLock(ctx, tr) + } + res, err := t.Execute(t) + unlock() + + state := types.TaskInfoStateSuccess + var fault any + if err != nil { + state = types.TaskInfoStateError + fault = types.LocalizedMethodFault{ + Fault: err, + LocalizedMessage: fmt.Sprintf("%T", err), + } + } + + ctx.Map.AtomicUpdate(t.ctx, t, []types.PropertyChange{ + {Name: "info.completeTime", Val: time.Now()}, + {Name: "info.state", Val: state}, + {Name: "info.result", Val: res}, + {Name: "info.error", Val: fault}, + }) + }() + + return t.Self +} + +// RunBlocking() should only be used when an async simulator task needs to wait +// on another async simulator task. +// It polls for task completion to avoid the need to set up a PropertyCollector. +func (t *Task) RunBlocking(ctx *Context) { + _ = t.Run(ctx) + t.Wait() +} + +// Wait blocks until the task is complete. +func (t *Task) Wait() { + // we do NOT want to share our lock with the tasks's context, because + // the goroutine that executes the task will use ctx to update the + // state (among other things). + isolatedLockingContext := &Context{} + + isRunning := func() bool { + var running bool + t.ctx.Map.WithLock(isolatedLockingContext, t, func() { + switch t.Info.State { + case types.TaskInfoStateSuccess, types.TaskInfoStateError: + running = false + default: + running = true + } + }) + return running + } + + for isRunning() { + time.Sleep(10 * time.Millisecond) + } +} + +func (t *Task) isDone() bool { + return t.Info.State == types.TaskInfoStateError || t.Info.State == types.TaskInfoStateSuccess +} + +func (t *Task) SetTaskState(ctx *Context, req *types.SetTaskState) soap.HasFault { + body := new(methods.SetTaskStateBody) + + if t.isDone() { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + changes := []types.PropertyChange{ + {Name: "info.state", Val: req.State}, + } + + switch req.State { + case types.TaskInfoStateRunning: + changes = append(changes, types.PropertyChange{Name: "info.startTime", Val: time.Now()}) + case types.TaskInfoStateError, types.TaskInfoStateSuccess: + changes = append(changes, types.PropertyChange{Name: "info.completeTime", Val: time.Now()}) + + if req.Fault != nil { + changes = append(changes, types.PropertyChange{Name: "info.error", Val: req.Fault}) + } + if req.Result != nil { + changes = append(changes, types.PropertyChange{Name: "info.result", Val: req.Result}) + } + } + + ctx.Update(t, changes) + + body.Res = new(types.SetTaskStateResponse) + return body +} + +func (t *Task) SetTaskDescription(ctx *Context, req *types.SetTaskDescription) soap.HasFault { + body := new(methods.SetTaskDescriptionBody) + + if t.isDone() { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + ctx.Update(t, []types.PropertyChange{{Name: "info.description", Val: req.Description}}) + + body.Res = new(types.SetTaskDescriptionResponse) + return body +} + +func (t *Task) UpdateProgress(ctx *Context, req *types.UpdateProgress) soap.HasFault { + body := new(methods.UpdateProgressBody) + + if t.Info.State != types.TaskInfoStateRunning { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + ctx.Update(t, []types.PropertyChange{{Name: "info.progress", Val: req.PercentDone}}) + + body.Res = new(types.UpdateProgressResponse) + return body +} + +func (t *Task) CancelTask(ctx *Context, req *types.CancelTask) soap.HasFault { + body := new(methods.CancelTaskBody) + + if t.isDone() { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + changes := []types.PropertyChange{ + {Name: "info.cancelled", Val: true}, + {Name: "info.completeTime", Val: time.Now()}, + {Name: "info.state", Val: types.TaskInfoStateError}, + {Name: "info.error", Val: &types.LocalizedMethodFault{ + Fault: &types.RequestCanceled{}, + LocalizedMessage: "The task was canceled by a user", + }}, + } + + ctx.Update(t, changes) + + body.Res = new(types.CancelTaskResponse) + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/task_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/task_manager.go new file mode 100644 index 000000000..c6d38dbd6 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/task_manager.go @@ -0,0 +1,384 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "container/list" + "sync" + "time" + + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var recentTaskMax = 200 // the VC limit + +type TaskManager struct { + mo.TaskManager + sync.Mutex + + history *history +} + +func (m *TaskManager) init(r *Registry) { + if len(m.Description.MethodInfo) == 0 { + if r.IsVPX() { + m.Description = vpx.Description + } else { + m.Description = esx.Description + } + } + + if m.MaxCollector == 0 { + // In real VC this default can be changed via OptionManager "task.maxCollectors" + m.MaxCollector = maxCollectors + } + + m.history = newHistory() + + r.AddHandler(m) +} + +func recentTask(recent []types.ManagedObjectReference, ref types.ManagedObjectReference) []types.PropertyChange { + // TODO: tasks completed > 10m ago should be removed + recent = append(recent, ref) + if len(recent) > recentTaskMax { + recent = recent[1:] + } + return []types.PropertyChange{{Name: "recentTask", Val: recent}} +} + +func (m *TaskManager) PutObject(ctx *Context, obj mo.Reference) { + task, ok := obj.(*Task) + if !ok { + return + } + + // propagate new Tasks to: + // - TaskManager.RecentTask + // - TaskHistoryCollector instances, if Filter matches + // - $MO.RecentTask + m.Lock() + ctx.Update(m, recentTask(m.RecentTask, task.Self)) + + pushHistory(m.history.page, task) + + for _, hc := range m.history.collectors { + c := hc.(*TaskHistoryCollector) + ctx.WithLock(c, func() { + if c.taskMatches(ctx, &task.Info) { + pushHistory(c.page, task) + ctx.Update(c, []types.PropertyChange{{Name: "latestPage", Val: c.GetLatestPage()}}) + } + }) + } + m.Unlock() + + entity := ctx.Map.Get(*task.Info.Entity) + if e, ok := entity.(mo.Entity); ok { + ctx.Update(entity, recentTask(e.Entity().RecentTask, task.Self)) + } +} + +func taskStateChanged(pc []types.PropertyChange) bool { + for i := range pc { + if pc[i].Name == "info.state" { + return true + } + } + return false +} + +func (m *TaskManager) UpdateObject(ctx *Context, obj mo.Reference, pc []types.PropertyChange) { + task, ok := obj.(*mo.Task) + if !ok { + return + } + + if !taskStateChanged(pc) { + // real vCenter only updates latestPage when Tasks are created (see PutObject above) and + // if Task.Info.State changes. + // Changes to Task.Info.{Description,Progress} does not update lastestPage. + return + } + + m.Lock() + for _, hc := range m.history.collectors { + c := hc.(*TaskHistoryCollector) + ctx.WithLock(c, func() { + if c.hasTask(ctx, &task.Info) { + ctx.Update(c, []types.PropertyChange{{Name: "latestPage", Val: c.GetLatestPage()}}) + } + }) + } + m.Unlock() +} + +func (*TaskManager) RemoveObject(*Context, types.ManagedObjectReference) {} + +func validTaskID(ctx *Context, taskID string) bool { + m := ctx.Map.ExtensionManager() + + for _, x := range m.ExtensionList { + for _, task := range x.TaskList { + if task.TaskID == taskID { + return true + } + } + } + + return false +} + +func (m *TaskManager) CreateTask(ctx *Context, req *types.CreateTask) soap.HasFault { + body := &methods.CreateTaskBody{} + + if !validTaskID(ctx, req.TaskTypeId) { + body.Fault_ = Fault("", &types.InvalidArgument{ + InvalidProperty: "taskType", + }) + return body + } + + task := &Task{} + + task.Self = ctx.Map.newReference(task) + task.Info.Key = task.Self.Value + task.Info.Task = task.Self + task.Info.DescriptionId = req.TaskTypeId + task.Info.Cancelable = req.Cancelable + task.Info.Entity = &req.Obj + task.Info.EntityName = req.Obj.Value + task.Info.Reason = &types.TaskReasonUser{UserName: ctx.Session.UserName} + task.Info.QueueTime = time.Now() + task.Info.State = types.TaskInfoStateQueued + + body.Res = &types.CreateTaskResponse{Returnval: task.Info} + + go ctx.Map.Put(task) + + return body +} + +type TaskHistoryCollector struct { + mo.TaskHistoryCollector + + *HistoryCollector +} + +func (m *TaskManager) createCollector(ctx *Context, req *types.CreateCollectorForTasks) (*TaskHistoryCollector, *soap.Fault) { + if len(m.history.collectors) >= int(m.MaxCollector) { + return nil, Fault("Too many task collectors to create", new(types.InvalidState)) + } + + collector := &TaskHistoryCollector{ + HistoryCollector: newHistoryCollector(ctx, m.history, defaultPageSize), + } + collector.Filter = req.Filter + + return collector, nil +} + +// taskFilterChildren returns true if a child of self is the task entity. +func taskFilterChildren(ctx *Context, root types.ManagedObjectReference, task *types.TaskInfo) bool { + seen := false + + var match func(types.ManagedObjectReference) + + match = func(child types.ManagedObjectReference) { + if child == *task.Entity { + seen = true + return + } + + walk(ctx.Map.Get(child), match) + } + + walk(ctx.Map.Get(root), match) + + return seen +} + +// entityMatches returns true if the spec Entity filter matches the task entity. +func (c *TaskHistoryCollector) entityMatches(ctx *Context, task *types.TaskInfo, spec types.TaskFilterSpec) bool { + e := spec.Entity + if e == nil { + return true + } + + isSelf := *task.Entity == e.Entity + + switch e.Recursion { + case types.TaskFilterSpecRecursionOptionSelf: + return isSelf + case types.TaskFilterSpecRecursionOptionChildren: + return taskFilterChildren(ctx, e.Entity, task) + case types.TaskFilterSpecRecursionOptionAll: + return isSelf || taskFilterChildren(ctx, e.Entity, task) + } + + return false +} + +func (c *TaskHistoryCollector) stateMatches(_ *Context, task *types.TaskInfo, spec types.TaskFilterSpec) bool { + if len(spec.State) == 0 { + return true + } + + for _, state := range spec.State { + if task.State == state { + return true + + } + } + + return false +} + +func (c *TaskHistoryCollector) timeMatches(_ *Context, task *types.TaskInfo, spec types.TaskFilterSpec) bool { + if spec.Time == nil { + return true + } + + created := task.QueueTime + + if begin := spec.Time.BeginTime; begin != nil { + if created.Before(*begin) { + return false + } + } + + if end := spec.Time.EndTime; end != nil { + if created.After(*end) { + return false + } + } + + return true +} + +// taskMatches returns true one of the filters matches the task. +func (c *TaskHistoryCollector) taskMatches(ctx *Context, task *types.TaskInfo) bool { + spec := c.Filter.(types.TaskFilterSpec) + + matchers := []func(*Context, *types.TaskInfo, types.TaskFilterSpec) bool{ + c.stateMatches, + c.timeMatches, + c.entityMatches, + // TODO: spec.UserName, etc + } + + for _, match := range matchers { + if !match(ctx, task, spec) { + return false + } + } + + return true +} + +func (c *TaskHistoryCollector) hasTask(_ *Context, task *types.TaskInfo) bool { + for e := c.page.Front(); e != nil; e = e.Next() { + if e.Value.(*Task).Info.Key == task.Key { + return true + } + } + return false +} + +// fillPage copies the manager's latest tasks into the collector's page with Filter applied. +func (m *TaskManager) fillPage(ctx *Context, c *TaskHistoryCollector) { + m.history.Lock() + defer m.history.Unlock() + + for e := m.history.page.Front(); e != nil; e = e.Next() { + task := e.Value.(*Task) + + if c.taskMatches(ctx, &task.Info) { + pushHistory(c.page, task) + } + } +} + +func (m *TaskManager) CreateCollectorForTasks(ctx *Context, req *types.CreateCollectorForTasks) soap.HasFault { + body := new(methods.CreateCollectorForTasksBody) + + if ctx.Map.IsESX() { + body.Fault_ = Fault("", new(types.NotSupported)) + return body + } + + collector, err := m.createCollector(ctx, req) + if err != nil { + body.Fault_ = err + return body + } + + collector.fill = func(x *Context) { m.fillPage(x, collector) } + collector.fill(ctx) + + body.Res = &types.CreateCollectorForTasksResponse{ + Returnval: m.history.add(ctx, collector), + } + + return body +} + +func (c *TaskHistoryCollector) ReadNextTasks(ctx *Context, req *types.ReadNextTasks) soap.HasFault { + body := new(methods.ReadNextTasksBody) + if req.MaxCount <= 0 { + body.Fault_ = Fault("", errInvalidArgMaxCount) + return body + } + body.Res = new(types.ReadNextTasksResponse) + + c.next(req.MaxCount, func(e *list.Element) { + body.Res.Returnval = append(body.Res.Returnval, e.Value.(*Task).Info) + }) + + return body +} + +func (c *TaskHistoryCollector) ReadPreviousTasks(ctx *Context, req *types.ReadPreviousTasks) soap.HasFault { + body := new(methods.ReadPreviousTasksBody) + if req.MaxCount <= 0 { + body.Fault_ = Fault("", errInvalidArgMaxCount) + return body + } + body.Res = new(types.ReadPreviousTasksResponse) + + c.prev(req.MaxCount, func(e *list.Element) { + body.Res.Returnval = append(body.Res.Returnval, e.Value.(*Task).Info) + }) + + return body +} + +func (c *TaskHistoryCollector) GetLatestPage() []types.TaskInfo { + var latestPage []types.TaskInfo + + e := c.page.Back() + for i := 0; i < c.size; i++ { + if e == nil { + break + } + latestPage = append(latestPage, e.Value.(*Task).Info) + e = e.Prev() + } + + return latestPage +} + +func (c *TaskHistoryCollector) Get() mo.Reference { + clone := *c + + clone.LatestPage = clone.GetLatestPage() + + return &clone +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go new file mode 100644 index 000000000..3d7cb75c3 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go @@ -0,0 +1,67 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type TenantManager struct { + mo.TenantTenantManager + + spEntities map[types.ManagedObjectReference]bool +} + +func (t *TenantManager) init(r *Registry) { + t.spEntities = make(map[types.ManagedObjectReference]bool) +} + +func (t *TenantManager) markEntities(entities []types.ManagedObjectReference) { + for _, e := range entities { + t.spEntities[e] = true + } +} + +func (t *TenantManager) unmarkEntities(entities []types.ManagedObjectReference) { + for _, e := range entities { + _, ok := t.spEntities[e] + if ok { + delete(t.spEntities, e) + } + } +} + +func (t *TenantManager) getEntities() []types.ManagedObjectReference { + entities := []types.ManagedObjectReference{} + for e := range t.spEntities { + entities = append(entities, e) + } + return entities +} + +func (t *TenantManager) MarkServiceProviderEntities(req *types.MarkServiceProviderEntities) soap.HasFault { + body := new(methods.MarkServiceProviderEntitiesBody) + t.markEntities(req.Entity) + body.Res = &types.MarkServiceProviderEntitiesResponse{} + return body +} + +func (t *TenantManager) UnmarkServiceProviderEntities(req *types.UnmarkServiceProviderEntities) soap.HasFault { + body := new(methods.UnmarkServiceProviderEntitiesBody) + t.unmarkEntities(req.Entity) + body.Res = &types.UnmarkServiceProviderEntitiesResponse{} + return body +} + +func (t *TenantManager) RetrieveServiceProviderEntities(req *types.RetrieveServiceProviderEntities) soap.HasFault { + body := new(methods.RetrieveServiceProviderEntitiesBody) + body.Res = &types.RetrieveServiceProviderEntitiesResponse{ + Returnval: t.getEntities(), + } + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/user_directory.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/user_directory.go new file mode 100644 index 000000000..7544984ac --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/user_directory.go @@ -0,0 +1,92 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "strings" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var DefaultUserGroup = []*types.UserSearchResult{ + {FullName: "root", Group: true, Principal: "root"}, + {FullName: "root", Group: false, Principal: "root"}, + {FullName: "administrator", Group: false, Principal: "admin"}, +} + +type UserDirectory struct { + mo.UserDirectory + + userGroup []*types.UserSearchResult +} + +func (m *UserDirectory) init(*Registry) { + m.userGroup = DefaultUserGroup +} + +func (u *UserDirectory) RetrieveUserGroups(req *types.RetrieveUserGroups) soap.HasFault { + compare := compareFunc(req.SearchStr, req.ExactMatch) + + res := u.search(req.FindUsers, req.FindGroups, compare) + + body := &methods.RetrieveUserGroupsBody{ + Res: &types.RetrieveUserGroupsResponse{ + Returnval: res, + }, + } + + return body +} + +func (u *UserDirectory) search(findUsers, findGroups bool, compare func(string) bool) (res []types.BaseUserSearchResult) { + for _, ug := range u.userGroup { + if findUsers && !ug.Group || findGroups && ug.Group { + if compare(ug.Principal) { + res = append(res, ug) + } + } + } + + return res +} + +func (u *UserDirectory) addUser(id string) { + u.add(id, false) +} + +func (u *UserDirectory) removeUser(id string) { + u.remove(id, false) +} + +func (u *UserDirectory) add(id string, group bool) { + user := &types.UserSearchResult{ + FullName: id, + Group: group, + Principal: id, + } + + u.userGroup = append(u.userGroup, user) +} + +func (u *UserDirectory) remove(id string, group bool) { + for i, ug := range u.userGroup { + if ug.Group == group && ug.Principal == id { + u.userGroup = append(u.userGroup[:i], u.userGroup[i+1:]...) + return + } + } +} + +func compareFunc(compared string, exactly bool) func(string) bool { + return func(s string) bool { + if exactly { + return s == compared + } + return strings.Contains(strings.ToLower(s), strings.ToLower(compared)) + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/view_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/view_manager.go new file mode 100644 index 000000000..5d367d9ee --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/view_manager.go @@ -0,0 +1,291 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type ViewManager struct { + mo.ViewManager + + entities map[string]bool +} + +var entities = []struct { + Type reflect.Type + Container bool +}{ + {reflect.TypeOf((*mo.ManagedEntity)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.Folder)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.StoragePod)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.Datacenter)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.ComputeResource)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.ClusterComputeResource)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.HostSystem)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.ResourcePool)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.VirtualApp)(nil)).Elem(), true}, + {reflect.TypeOf((*mo.VirtualMachine)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.Datastore)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.Network)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.OpaqueNetwork)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.DistributedVirtualPortgroup)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.DistributedVirtualSwitch)(nil)).Elem(), false}, + {reflect.TypeOf((*mo.VmwareDistributedVirtualSwitch)(nil)).Elem(), false}, +} + +func (m *ViewManager) init(*Registry) { + m.entities = make(map[string]bool, len(entities)) + for _, e := range entities { + m.entities[e.Type.Name()] = e.Container + } +} + +func destroyView(ref types.ManagedObjectReference) soap.HasFault { + return &methods.DestroyViewBody{ + Res: &types.DestroyViewResponse{}, + } +} + +func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContainerView) soap.HasFault { + body := &methods.CreateContainerViewBody{} + + root := ctx.Map.Get(req.Container) + if root == nil { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: req.Container}) + return body + } + + if !m.entities[root.Reference().Type] { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "container"}) + return body + } + + container := &ContainerView{ + mo.ContainerView{ + Container: root.Reference(), + Recursive: req.Recursive, + Type: req.Type, + }, + root, + make(map[string]bool), + } + + for _, ctype := range container.Type { + if _, ok := m.entities[ctype]; !ok { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "type"}) + return body + } + + container.types[ctype] = true + + for _, e := range entities { + // Check for embedded types + if f, ok := e.Type.FieldByName(ctype); ok && f.Anonymous { + container.types[e.Type.Name()] = true + } + } + } + + ctx.Session.setReference(container) + + body.Res = &types.CreateContainerViewResponse{ + Returnval: container.Self, + } + + seen := make(map[types.ManagedObjectReference]bool) + container.add(ctx, root, seen) + + ctx.Session.Registry.Put(container) + ctx.Map.AddHandler(container) + + return body +} + +type ContainerView struct { + mo.ContainerView + + root mo.Reference + types map[string]bool +} + +func (v *ContainerView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { + ctx.Map.RemoveHandler(v) + ctx.Session.Remove(ctx, c.This) + return destroyView(c.This) +} + +func (v *ContainerView) include(o types.ManagedObjectReference) bool { + if len(v.types) == 0 { + return true + } + + return v.types[o.Type] +} + +func walk(root mo.Reference, f func(child types.ManagedObjectReference)) { + if _, ok := root.(types.ManagedObjectReference); ok || root == nil { + return + } + + var children []types.ManagedObjectReference + + switch e := getManagedObject(root).Addr().Interface().(type) { + case *mo.Datacenter: + children = []types.ManagedObjectReference{e.VmFolder, e.HostFolder, e.DatastoreFolder, e.NetworkFolder} + case *mo.Folder: + children = e.ChildEntity + case *mo.StoragePod: + children = e.ChildEntity + case *mo.ComputeResource: + children = e.Host + children = append(children, *e.ResourcePool) + case *mo.ClusterComputeResource: + children = e.Host + children = append(children, *e.ResourcePool) + case *mo.ResourcePool: + children = e.ResourcePool + children = append(children, e.Vm...) + case *mo.VirtualApp: + children = e.ResourcePool.ResourcePool + children = append(children, e.Vm...) + case *mo.HostSystem: + children = e.Vm + } + + for _, child := range children { + f(child) + } +} + +func (v *ContainerView) add(ctx *Context, root mo.Reference, seen map[types.ManagedObjectReference]bool) { + walk(root, func(child types.ManagedObjectReference) { + if v.include(child) { + if !seen[child] { + seen[child] = true + v.View = append(v.View, child) + } + } + + if v.Recursive { + v.add(ctx, ctx.Map.Get(child), seen) + } + }) +} + +func (v *ContainerView) find(ctx *Context, root mo.Reference, ref types.ManagedObjectReference, found *bool) bool { + walk(root, func(child types.ManagedObjectReference) { + if *found { + return + } + if child == ref { + *found = true + return + } + if v.Recursive { + *found = v.find(ctx, ctx.Map.Get(child), ref, found) + } + }) + + return *found +} + +func (v *ContainerView) PutObject(ctx *Context, obj mo.Reference) { + ref := obj.Reference() + + ctx.WithLock(v, func() { + if v.include(ref) && v.find(ctx, v.root, ref, types.NewBool(false)) { + ctx.Update(v, []types.PropertyChange{{Name: "view", Val: append(v.View, ref)}}) + } + }) +} + +func (v *ContainerView) RemoveObject(ctx *Context, obj types.ManagedObjectReference) { + ctx.WithLock(v, func() { + ctx.Map.RemoveReference(ctx, v, &v.View, obj) + }) +} + +func (*ContainerView) UpdateObject(*Context, mo.Reference, []types.PropertyChange) {} + +func (m *ViewManager) CreateListView(ctx *Context, req *types.CreateListView) soap.HasFault { + body := new(methods.CreateListViewBody) + list := new(ListView) + + if refs := list.add(ctx, req.Obj); len(refs) != 0 { + body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: refs[0]}) + return body + } + + ctx.Session.Put(list) + + body.Res = &types.CreateListViewResponse{ + Returnval: list.Self, + } + + return body +} + +type ListView struct { + mo.ListView +} + +func (v *ListView) update(ctx *Context) { + ctx.Update(v, []types.PropertyChange{{Name: "view", Val: v.View}}) +} + +func (v *ListView) add(ctx *Context, refs []types.ManagedObjectReference) []types.ManagedObjectReference { + var unresolved []types.ManagedObjectReference + for _, ref := range refs { + obj := ctx.Session.Get(ref) + if obj == nil { + unresolved = append(unresolved, ref) + } + v.View = append(v.View, ref) + } + return unresolved +} + +func (v *ListView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { + ctx.Session.Remove(ctx, c.This) + return destroyView(c.This) +} + +func (v *ListView) ModifyListView(ctx *Context, req *types.ModifyListView) soap.HasFault { + body := &methods.ModifyListViewBody{ + Res: new(types.ModifyListViewResponse), + } + + body.Res.Returnval = v.add(ctx, req.Add) + + for _, ref := range req.Remove { + RemoveReference(&v.View, ref) + } + + if len(req.Remove) != 0 || len(req.Add) != 0 { + v.update(ctx) + } + + return body +} + +func (v *ListView) ResetListView(ctx *Context, req *types.ResetListView) soap.HasFault { + body := &methods.ResetListViewBody{ + Res: new(types.ResetListViewResponse), + } + + v.View = nil + + body.Res.Returnval = v.add(ctx, req.Obj) + + v.update(ctx) + + return body +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go new file mode 100644 index 000000000..b088a0c47 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go @@ -0,0 +1,302 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vmdk" +) + +type VirtualDiskManager struct { + mo.VirtualDiskManager +} + +func (m *VirtualDiskManager) MO() mo.VirtualDiskManager { + return m.VirtualDiskManager +} + +func VirtualDiskBackingFileName(name string) string { + return strings.Replace(name, ".vmdk", "-flat.vmdk", 1) +} + +func vdmNames(name string) []string { + return []string{ + VirtualDiskBackingFileName(name), + name, + } +} + +func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOperation, req *types.CreateVirtualDisk_Task) types.BaseMethodFault { + fm := ctx.Map.FileManager() + + file, fault := fm.resolve(ctx, req.Datacenter, req.Name) + if fault != nil { + return fault + } + + shouldReplace := op == types.VirtualDeviceConfigSpecFileOperationReplace + shouldExist := op == "" + + _, err := os.Stat(file) + if err == nil { + if shouldExist { + return nil + } + if !shouldReplace { + return fm.fault(file, nil, new(types.FileAlreadyExists)) + } + } else if shouldExist { + return fm.fault(file, nil, new(types.FileNotFound)) + } + + backing := VirtualDiskBackingFileName(file) + + extent := vmdk.Extent{ + Info: filepath.Base(backing), + } + + f, err := os.Create(file) + if err != nil { + return fm.fault(file, err, new(types.CannotCreateFile)) + } + + defer f.Close() + + if req.Spec != nil { + spec, ok := req.Spec.(types.BaseFileBackedVirtualDiskSpec) + if !ok { + return fm.fault(file, nil, new(types.FileFault)) + } + + fileSpec := spec.GetFileBackedVirtualDiskSpec() + extent.Size = fileSpec.CapacityKb * 1024 / vmdk.SectorSize + } + + desc := vmdk.NewDescriptor(extent) + if err := desc.Write(f); err != nil { + return fm.fault(file, err, new(types.FileFault)) + } + + b, err := os.Create(backing) + if err != nil { + return fm.fault(backing, err, new(types.CannotCreateFile)) + } + _ = b.Close() + + return nil +} + +func vdmExtendVirtualDisk(ctx *Context, req *types.ExtendVirtualDisk_Task) types.BaseMethodFault { + fm := ctx.Map.FileManager() + + desc, file, fault := fm.DiskDescriptor(ctx, req.Datacenter, req.Name) + if fault != nil { + return fault + } + + newCapacity := req.NewCapacityKb * 1024 + if desc.Capacity() > newCapacity { + return fm.fault(req.Name, errors.New("cannot shrink disk"), new(types.FileFault)) + } + + desc.Extent[0].Size = newCapacity / vmdk.SectorSize + + return fm.SaveDiskDescriptor(ctx, desc, file) +} + +func (m *VirtualDiskManager) CreateVirtualDiskTask(ctx *Context, req *types.CreateVirtualDisk_Task) soap.HasFault { + task := CreateTask(m, "createVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + if err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, req); err != nil { + return "", err + } + return req.Name, nil + }) + + return &methods.CreateVirtualDisk_TaskBody{ + Res: &types.CreateVirtualDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VirtualDiskManager) ExtendVirtualDiskTask(ctx *Context, req *types.ExtendVirtualDisk_Task) soap.HasFault { + task := CreateTask(m, "extendVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + if err := vdmExtendVirtualDisk(ctx, req); err != nil { + return "", err + } + return req.Name, nil + }) + + return &methods.ExtendVirtualDisk_TaskBody{ + Res: &types.ExtendVirtualDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VirtualDiskManager) DeleteVirtualDiskTask(ctx *Context, req *types.DeleteVirtualDisk_Task) soap.HasFault { + task := CreateTask(m, "deleteVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + fm := ctx.Map.FileManager() + + for _, name := range vdmNames(req.Name) { + err := fm.deleteDatastoreFile(ctx, &types.DeleteDatastoreFile_Task{ + Name: name, + Datacenter: req.Datacenter, + }) + + if err != nil { + return nil, err + } + } + + return nil, nil + }) + + return &methods.DeleteVirtualDisk_TaskBody{ + Res: &types.DeleteVirtualDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VirtualDiskManager) MoveVirtualDiskTask(ctx *Context, req *types.MoveVirtualDisk_Task) soap.HasFault { + task := CreateTask(m, "moveVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + fm := ctx.Map.FileManager() + + dest := vdmNames(req.DestName) + + for i, name := range vdmNames(req.SourceName) { + err := fm.moveDatastoreFile(ctx, &types.MoveDatastoreFile_Task{ + SourceName: name, + SourceDatacenter: req.SourceDatacenter, + DestinationName: dest[i], + DestinationDatacenter: req.DestDatacenter, + Force: req.Force, + }) + + if err != nil { + return nil, err + } + } + + return nil, nil + }) + + return &methods.MoveVirtualDisk_TaskBody{ + Res: &types.MoveVirtualDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VirtualDiskManager) CopyVirtualDiskTask(ctx *Context, req *types.CopyVirtualDisk_Task) soap.HasFault { + task := CreateTask(m, "copyVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + if req.DestSpec != nil { + // TODO: apply to destination vmdk.Descriptor + } + + fm := ctx.Map.FileManager() + + dest := vdmNames(req.DestName) + + for i, name := range vdmNames(req.SourceName) { + err := fm.copyDatastoreFile(ctx, &types.CopyDatastoreFile_Task{ + SourceName: name, + SourceDatacenter: req.SourceDatacenter, + DestinationName: dest[i], + DestinationDatacenter: req.DestDatacenter, + Force: req.Force, + }) + + if err != nil { + return nil, err + } + } + + return nil, nil + }) + + return &methods.CopyVirtualDisk_TaskBody{ + Res: &types.CopyVirtualDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func virtualDiskUUID(dc *types.ManagedObjectReference, file string) string { + if dc != nil { + file = dc.String() + file + } + return newUUID(file) +} + +func (m *VirtualDiskManager) QueryVirtualDiskUuid(ctx *Context, req *types.QueryVirtualDiskUuid) soap.HasFault { + body := new(methods.QueryVirtualDiskUuidBody) + + fm := ctx.Map.FileManager() + + file, fault := fm.resolve(ctx, req.Datacenter, req.Name) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + _, err := os.Stat(file) + if err != nil { + fault = fm.fault(req.Name, err, new(types.CannotAccessFile)) + body.Fault_ = Fault(fmt.Sprintf("File %s was not found", req.Name), fault) + return body + } + + body.Res = &types.QueryVirtualDiskUuidResponse{ + Returnval: virtualDiskUUID(req.Datacenter, req.Name), + } + + return body +} + +func (m *VirtualDiskManager) SetVirtualDiskUuid(_ *Context, req *types.SetVirtualDiskUuid) soap.HasFault { + body := new(methods.SetVirtualDiskUuidBody) + // TODO: validate uuid format and persist + body.Res = new(types.SetVirtualDiskUuidResponse) + return body +} + +func (m *VirtualDiskManager) QueryVirtualDiskInfoTask(ctx *Context, req *internal.QueryVirtualDiskInfoTaskRequest) soap.HasFault { + task := CreateTask(m, "queryVirtualDiskInfo", func(*Task) (types.AnyType, types.BaseMethodFault) { + var res []internal.VirtualDiskInfo + + fm := ctx.Map.FileManager() + + _, fault := fm.resolve(ctx, req.Datacenter, req.Name) + if fault != nil { + return nil, fault + } + + res = append(res, internal.VirtualDiskInfo{Name: req.Name, DiskType: "thin"}) + + if req.IncludeParents { + // TODO + } + + return res, nil + }) + + return &internal.QueryVirtualDiskInfoTaskBody{ + Res: &internal.QueryVirtualDiskInfo_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go new file mode 100644 index 000000000..8c19c17c8 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go @@ -0,0 +1,3183 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "bytes" + "encoding/binary" + "fmt" + "log" + "net" + "os" + "path" + "path/filepath" + "reflect" + "slices" + "strconv" + "strings" + "sync/atomic" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type VirtualMachine struct { + mo.VirtualMachine + DataSets map[string]*DataSet + + log string + sid int32 + svm *simVM + uid uuid.UUID + imc *types.CustomizationSpec +} + +func asVirtualMachineMO(obj mo.Reference) (*mo.VirtualMachine, bool) { + vm, ok := getManagedObject(obj).Addr().Interface().(*mo.VirtualMachine) + return vm, ok +} + +func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec *types.VirtualMachineConfigSpec) (*VirtualMachine, types.BaseMethodFault) { + vm := &VirtualMachine{} + vm.Parent = &parent + ctx.Map.reference(vm) + + folder := ctx.Map.Get(parent) + + if spec.Name == "" { + return vm, &types.InvalidVmConfig{Property: "configSpec.name"} + } + + if spec.Files == nil || spec.Files.VmPathName == "" { + return vm, &types.InvalidVmConfig{Property: "configSpec.files.vmPathName"} + } + + rspec := types.DefaultResourceConfigSpec() + vm.Guest = &types.GuestInfo{} + vm.Config = &types.VirtualMachineConfigInfo{ + ExtraConfig: []types.BaseOptionValue{&types.OptionValue{Key: "govcsim", Value: "TRUE"}}, + Tools: &types.ToolsConfigInfo{}, + MemoryAllocation: &rspec.MemoryAllocation, + CpuAllocation: &rspec.CpuAllocation, + LatencySensitivity: &types.LatencySensitivity{Level: types.LatencySensitivitySensitivityLevelNormal}, + BootOptions: &types.VirtualMachineBootOptions{}, + CreateDate: types.NewTime(time.Now()), + } + vm.Layout = &types.VirtualMachineFileLayout{} + vm.LayoutEx = &types.VirtualMachineFileLayoutEx{ + Timestamp: time.Now(), + } + vm.Snapshot = nil // intentionally set to nil until a snapshot is created + vm.Storage = &types.VirtualMachineStorageInfo{ + Timestamp: time.Now(), + } + vm.Summary.Guest = &types.VirtualMachineGuestSummary{} + vm.Summary.Vm = &vm.Self + vm.Summary.Storage = &types.VirtualMachineStorageSummary{ + Timestamp: time.Now(), + } + + vmx := vm.vmx(spec) + if vmx.Path == "" { + // Append VM Name as the directory name if not specified + vmx.Path = spec.Name + } + + dc := ctx.Map.getEntityDatacenter(folder.(mo.Entity)) + ds := ctx.Map.FindByName(vmx.Datastore, dc.Datastore).(*Datastore) + dir := ds.resolve(ctx, vmx.Path) + + if path.Ext(vmx.Path) == ".vmx" { + dir = path.Dir(dir) + // Ignore error here, deferring to createFile + _ = os.Mkdir(dir, 0700) + } else { + // Create VM directory, renaming if already exists + name := dir + + for i := 0; i < 1024; /* just in case */ i++ { + err := os.Mkdir(name, 0700) + if err != nil { + if os.IsExist(err) { + name = fmt.Sprintf("%s (%d)", dir, i) + continue + } + return nil, &types.FileFault{File: name} + } + break + } + vmx.Path = path.Join(path.Base(name), spec.Name+".vmx") + } + + spec.Files.VmPathName = vmx.String() + + dsPath := path.Dir(spec.Files.VmPathName) + vm.uid = internal.OID(spec.Files.VmPathName) + + defaults := types.VirtualMachineConfigSpec{ + NumCPUs: 1, + NumCoresPerSocket: 1, + MemoryMB: 32, + Uuid: vm.uid.String(), + InstanceUuid: newUUID(strings.ToUpper(spec.Files.VmPathName)), + Version: esx.HardwareVersion, + Firmware: string(types.GuestOsDescriptorFirmwareTypeBios), + VAppConfig: spec.VAppConfig, + Files: &types.VirtualMachineFileInfo{ + SnapshotDirectory: dsPath, + SuspendDirectory: dsPath, + LogDirectory: dsPath, + }, + } + + // Add the default devices + defaults.DeviceChange, _ = object.VirtualDeviceList(esx.VirtualDevice).ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + + err := vm.configure(ctx, &defaults) + if err != nil { + return vm, err + } + + vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff + vm.Runtime.ConnectionState = types.VirtualMachineConnectionStateConnected + vm.Summary.Runtime = vm.Runtime + + vm.Capability.ChangeTrackingSupported = types.NewBool(changeTrackingSupported(spec)) + + vm.Summary.QuickStats.GuestHeartbeatStatus = types.ManagedEntityStatusGray + vm.Summary.OverallStatus = types.ManagedEntityStatusGreen + vm.ConfigStatus = types.ManagedEntityStatusGreen + vm.DataSets = make(map[string]*DataSet) + + // put vm in the folder only if no errors occurred + f, _ := asFolderMO(folder) + folderPutChild(ctx, f, vm) + + return vm, nil +} + +func (o *VirtualMachine) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, o, r) +} + +func (*VirtualMachine) Reload(*types.Reload) soap.HasFault { + return &methods.ReloadBody{Res: new(types.ReloadResponse)} +} + +func (vm *VirtualMachine) event(ctx *Context) types.VmEvent { + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + + return types.VmEvent{ + Event: types.Event{ + Datacenter: datacenterEventArgument(ctx, host), + ComputeResource: host.eventArgumentParent(ctx), + Host: host.eventArgument(), + Ds: ctx.Map.Get(vm.Datastore[0]).(*Datastore).eventArgument(), + Vm: &types.VmEventArgument{ + EntityEventArgument: types.EntityEventArgument{Name: vm.Name}, + Vm: vm.Self, + }, + }, + } +} + +func (vm *VirtualMachine) hostInMM(ctx *Context) bool { + return ctx.Map.Get(*vm.Runtime.Host).(*HostSystem).Runtime.InMaintenanceMode +} + +func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { + if spec.Files == nil { + spec.Files = new(types.VirtualMachineFileInfo) + } + + apply := []struct { + src string + dst *string + }{ + {spec.AlternateGuestName, &vm.Config.AlternateGuestName}, + {spec.Annotation, &vm.Config.Annotation}, + {spec.Firmware, &vm.Config.Firmware}, + {spec.InstanceUuid, &vm.Config.InstanceUuid}, + {spec.LocationId, &vm.Config.LocationId}, + {spec.NpivWorldWideNameType, &vm.Config.NpivWorldWideNameType}, + {spec.Name, &vm.Name}, + {spec.Name, &vm.Config.Name}, + {spec.Name, &vm.Summary.Config.Name}, + {spec.GuestId, &vm.Config.GuestId}, + {spec.GuestId, &vm.Config.GuestFullName}, + {spec.GuestId, &vm.Summary.Guest.GuestId}, + {spec.GuestId, &vm.Summary.Config.GuestId}, + {spec.GuestId, &vm.Summary.Config.GuestFullName}, + {spec.Uuid, &vm.Config.Uuid}, + {spec.Uuid, &vm.Summary.Config.Uuid}, + {spec.InstanceUuid, &vm.Config.InstanceUuid}, + {spec.InstanceUuid, &vm.Summary.Config.InstanceUuid}, + {spec.Version, &vm.Config.Version}, + {spec.Version, &vm.Summary.Config.HwVersion}, + {spec.Files.VmPathName, &vm.Config.Files.VmPathName}, + {spec.Files.VmPathName, &vm.Summary.Config.VmPathName}, + {spec.Files.SnapshotDirectory, &vm.Config.Files.SnapshotDirectory}, + {spec.Files.SuspendDirectory, &vm.Config.Files.SuspendDirectory}, + {spec.Files.LogDirectory, &vm.Config.Files.LogDirectory}, + {spec.FtEncryptionMode, &vm.Config.FtEncryptionMode}, + {spec.MigrateEncryption, &vm.Config.MigrateEncryption}, + } + + for _, f := range apply { + if f.src != "" { + *f.dst = f.src + } + } + + applyb := []struct { + src *bool + dst **bool + }{ + {spec.NestedHVEnabled, &vm.Config.NestedHVEnabled}, + {spec.CpuHotAddEnabled, &vm.Config.CpuHotAddEnabled}, + {spec.CpuHotRemoveEnabled, &vm.Config.CpuHotRemoveEnabled}, + {spec.GuestAutoLockEnabled, &vm.Config.GuestAutoLockEnabled}, + {spec.MemoryHotAddEnabled, &vm.Config.MemoryHotAddEnabled}, + {spec.MemoryReservationLockedToMax, &vm.Config.MemoryReservationLockedToMax}, + {spec.MessageBusTunnelEnabled, &vm.Config.MessageBusTunnelEnabled}, + {spec.NpivTemporaryDisabled, &vm.Config.NpivTemporaryDisabled}, + {spec.NpivOnNonRdmDisks, &vm.Config.NpivOnNonRdmDisks}, + {spec.ChangeTrackingEnabled, &vm.Config.ChangeTrackingEnabled}, + } + + for _, f := range applyb { + if f.src != nil { + *f.dst = f.src + } + } + + if spec.Flags != nil { + vm.Config.Flags = *spec.Flags + } + + if spec.LatencySensitivity != nil { + vm.Config.LatencySensitivity = spec.LatencySensitivity + } + + if spec.ManagedBy != nil { + if spec.ManagedBy.ExtensionKey == "" { + spec.ManagedBy = nil + } + vm.Config.ManagedBy = spec.ManagedBy + vm.Summary.Config.ManagedBy = spec.ManagedBy + } + + if spec.BootOptions != nil { + vm.Config.BootOptions = spec.BootOptions + } + + if spec.RepConfig != nil { + vm.Config.RepConfig = spec.RepConfig + } + + if spec.Tools != nil { + vm.Config.Tools = spec.Tools + } + + if spec.ConsolePreferences != nil { + vm.Config.ConsolePreferences = spec.ConsolePreferences + } + + if spec.CpuAffinity != nil { + vm.Config.CpuAffinity = spec.CpuAffinity + } + + if spec.CpuAllocation != nil { + vm.Config.CpuAllocation = spec.CpuAllocation + } + + if spec.MemoryAffinity != nil { + vm.Config.MemoryAffinity = spec.MemoryAffinity + } + + if spec.MemoryAllocation != nil { + vm.Config.MemoryAllocation = spec.MemoryAllocation + } + + if spec.LatencySensitivity != nil { + vm.Config.LatencySensitivity = spec.LatencySensitivity + } + + if spec.MemoryMB != 0 { + vm.Config.Hardware.MemoryMB = int32(spec.MemoryMB) + vm.Summary.Config.MemorySizeMB = vm.Config.Hardware.MemoryMB + } + + if spec.NumCPUs != 0 { + vm.Config.Hardware.NumCPU = spec.NumCPUs + vm.Summary.Config.NumCpu = vm.Config.Hardware.NumCPU + } + + if spec.NumCoresPerSocket != 0 { + vm.Config.Hardware.NumCoresPerSocket = spec.NumCoresPerSocket + } + + if spec.GuestId != "" { + vm.Guest.GuestFamily = guestFamily(spec.GuestId) + } + + vm.Config.Modified = time.Now() +} + +// updateVAppProperty updates the simulator VM with the specified VApp properties. +func (vm *VirtualMachine) updateVAppProperty(spec *types.VmConfigSpec) types.BaseMethodFault { + if vm.Config.VAppConfig == nil { + vm.Config.VAppConfig = &types.VmConfigInfo{} + } + + info := vm.Config.VAppConfig.GetVmConfigInfo() + propertyInfo := info.Property + productInfo := info.Product + + for _, prop := range spec.Property { + var foundIndex int + exists := false + // Check if the specified property exists or not. This helps rejecting invalid + // operations (e.g., Adding a VApp property that already exists) + for i, p := range propertyInfo { + if p.Key == prop.Info.Key { + exists = true + foundIndex = i + break + } + } + + switch prop.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + propertyInfo = append(propertyInfo, *prop.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + propertyInfo[foundIndex] = *prop.Info + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + propertyInfo = append(propertyInfo[:foundIndex], propertyInfo[foundIndex+1:]...) + } + } + + for _, prod := range spec.Product { + var foundIndex int + exists := false + // Check if the specified product exists or not. This helps rejecting invalid + // operations (e.g., Adding a VApp product that already exists) + for i, p := range productInfo { + if p.Key == prod.Info.Key { + exists = true + foundIndex = i + break + } + } + + switch prod.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + productInfo = append(productInfo, *prod.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + productInfo[foundIndex] = *prod.Info + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + productInfo = append(productInfo[:foundIndex], productInfo[foundIndex+1:]...) + } + } + + info.Product = productInfo + info.Property = propertyInfo + + return nil +} + +var extraConfigAlias = map[string]string{ + "ip0": "SET.guest.ipAddress", +} + +func extraConfigKey(key string) string { + if k, ok := extraConfigAlias[key]; ok { + return k + } + return key +} + +func (vm *VirtualMachine) applyExtraConfig(ctx *Context, spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { + if len(spec.ExtraConfig) == 0 { + return nil + } + var removedContainerBacking bool + var changes []types.PropertyChange + field := mo.Field{Path: "config.extraConfig"} + + for _, c := range spec.ExtraConfig { + val := c.GetOptionValue() + key := strings.TrimPrefix(extraConfigKey(val.Key), "SET.") + if key == val.Key { + field.Key = key + op := types.PropertyChangeOpAssign + keyIndex := -1 + for i := range vm.Config.ExtraConfig { + bov := vm.Config.ExtraConfig[i] + if bov == nil { + continue + } + ov := bov.GetOptionValue() + if ov == nil { + continue + } + if ov.Key == key { + keyIndex = i + break + } + } + if keyIndex < 0 { + op = types.PropertyChangeOpAdd + vm.Config.ExtraConfig = append(vm.Config.ExtraConfig, c) + } else { + if s, ok := val.Value.(string); ok && s == "" { + op = types.PropertyChangeOpRemove + if key == ContainerBackingOptionKey { + removedContainerBacking = true + } + // Remove existing element + vm.Config.ExtraConfig = append( + vm.Config.ExtraConfig[:keyIndex], + vm.Config.ExtraConfig[keyIndex+1:]...) + val = nil + } else { + // Update existing element + vm.Config.ExtraConfig[keyIndex] = val + } + } + + changes = append(changes, types.PropertyChange{Name: field.String(), Val: val, Op: op}) + continue + } + changes = append(changes, types.PropertyChange{Name: key, Val: val.Value}) + + switch key { + case "guest.ipAddress": + if len(vm.Guest.Net) > 0 { + ip := val.Value.(string) + vm.Guest.Net[0].IpAddress = []string{ip} + changes = append(changes, + types.PropertyChange{Name: "summary." + key, Val: ip}, + types.PropertyChange{Name: "guest.net", Val: vm.Guest.Net}, + ) + } + case "guest.hostName": + changes = append(changes, + types.PropertyChange{Name: "summary." + key, Val: val.Value}, + ) + } + } + + // create the container backing before we publish the updates so the simVM is available before handlers + // get triggered + var fault types.BaseMethodFault + if vm.svm == nil { + vm.svm = createSimulationVM(vm) + + // check to see if the VM is already powered on - if so we need to retroactively hit that path here + if vm.Runtime.PowerState == types.VirtualMachinePowerStatePoweredOn { + err := vm.svm.start(ctx) + if err != nil { + // don't attempt to undo the changes already made - just return an error + // we'll retry the svm.start operation on pause/restart calls + fault = &types.VAppConfigFault{ + VimFault: types.VimFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{Reason: err.Error()}, + LocalizedMessage: err.Error()}}}} + } + } + } else if removedContainerBacking { + err := vm.svm.remove(ctx) + if err == nil { + // remove link from container to VM so callbacks no longer reflect state + vm.svm.vm = nil + // nil container backing reference to return this to a pure in-mem simulated VM + vm.svm = nil + + } else { + // don't attempt to undo the changes already made - just return an error + // we'll retry the svm.start operation on pause/restart calls + fault = &types.VAppConfigFault{ + VimFault: types.VimFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{Reason: err.Error()}, + LocalizedMessage: err.Error()}}}} + } + } + + change := types.PropertyChange{Name: field.Path, Val: vm.Config.ExtraConfig} + ctx.Update(vm, append(changes, change)) + + return fault +} + +func validateGuestID(id string) types.BaseMethodFault { + for _, x := range GuestID { + if id == string(x) { + return nil + } + } + + return &types.InvalidArgument{InvalidProperty: "configSpec.guestId"} +} + +func (vm *VirtualMachine) configure(ctx *Context, spec *types.VirtualMachineConfigSpec) (result types.BaseMethodFault) { + defer func() { + if result == nil { + vm.updateLastModifiedAndChangeVersion(ctx) + } + }() + + vm.apply(spec) + + if spec.MemoryAllocation != nil { + if err := updateResourceAllocation("memory", spec.MemoryAllocation, vm.Config.MemoryAllocation); err != nil { + return err + } + } + + if spec.CpuAllocation != nil { + if err := updateResourceAllocation("cpu", spec.CpuAllocation, vm.Config.CpuAllocation); err != nil { + return err + } + } + + if spec.GuestId != "" { + if err := validateGuestID(spec.GuestId); err != nil { + return err + } + } + + if o := spec.BootOptions; o != nil { + if isTrue(o.EfiSecureBootEnabled) && vm.Config.Firmware != string(types.GuestOsDescriptorFirmwareTypeEfi) { + return &types.InvalidVmConfig{Property: "msg.hostd.configSpec.efi"} + } + } + + if spec.VAppConfig != nil { + if err := vm.updateVAppProperty(spec.VAppConfig.GetVmConfigSpec()); err != nil { + return err + } + } + + if spec.Crypto != nil { + if err := vm.updateCrypto(ctx, spec.Crypto); err != nil { + return err + } + } + + return vm.configureDevices(ctx, spec) +} + +func getVMFileType(fileName string) types.VirtualMachineFileLayoutExFileType { + var fileType types.VirtualMachineFileLayoutExFileType + + fileExt := path.Ext(fileName) + fileNameNoExt := strings.TrimSuffix(fileName, fileExt) + + switch fileExt { + case ".vmx": + fileType = types.VirtualMachineFileLayoutExFileTypeConfig + case ".core": + fileType = types.VirtualMachineFileLayoutExFileTypeCore + case ".vmdk": + fileType = types.VirtualMachineFileLayoutExFileTypeDiskDescriptor + if strings.HasSuffix(fileNameNoExt, "-digest") { + fileType = types.VirtualMachineFileLayoutExFileTypeDigestDescriptor + } + + extentSuffixes := []string{"-flat", "-delta", "-s", "-rdm", "-rdmp"} + for _, suffix := range extentSuffixes { + if strings.HasSuffix(fileNameNoExt, suffix) { + fileType = types.VirtualMachineFileLayoutExFileTypeDiskExtent + } else if strings.HasSuffix(fileNameNoExt, "-digest"+suffix) { + fileType = types.VirtualMachineFileLayoutExFileTypeDigestExtent + } + } + case ".psf": + fileType = types.VirtualMachineFileLayoutExFileTypeDiskReplicationState + case ".vmxf": + fileType = types.VirtualMachineFileLayoutExFileTypeExtendedConfig + case ".vmft": + fileType = types.VirtualMachineFileLayoutExFileTypeFtMetadata + case ".log": + fileType = types.VirtualMachineFileLayoutExFileTypeLog + case ".nvram": + fileType = types.VirtualMachineFileLayoutExFileTypeNvram + case ".png", ".bmp": + fileType = types.VirtualMachineFileLayoutExFileTypeScreenshot + case ".vmsn": + fileType = types.VirtualMachineFileLayoutExFileTypeSnapshotData + case ".vmsd": + fileType = types.VirtualMachineFileLayoutExFileTypeSnapshotList + case ".xml": + if strings.HasSuffix(fileNameNoExt, "-aux") { + fileType = types.VirtualMachineFileLayoutExFileTypeSnapshotManifestList + } + case ".stat": + fileType = types.VirtualMachineFileLayoutExFileTypeStat + case ".vmss": + fileType = types.VirtualMachineFileLayoutExFileTypeSuspend + case ".vmem": + if strings.Contains(fileNameNoExt, "Snapshot") { + fileType = types.VirtualMachineFileLayoutExFileTypeSnapshotMemory + } else { + fileType = types.VirtualMachineFileLayoutExFileTypeSuspendMemory + } + case ".vswp": + if strings.HasPrefix(fileNameNoExt, "vmx-") { + fileType = types.VirtualMachineFileLayoutExFileTypeUwswap + } else { + fileType = types.VirtualMachineFileLayoutExFileTypeSwap + } + case "": + if strings.HasPrefix(fileNameNoExt, "imcf-") { + fileType = types.VirtualMachineFileLayoutExFileTypeGuestCustomization + } + } + + return fileType +} + +func (vm *VirtualMachine) addFileLayoutEx(ctx *Context, datastorePath object.DatastorePath, fileSize int64) int32 { + var newKey int32 + for _, layoutFile := range vm.LayoutEx.File { + if layoutFile.Name == datastorePath.String() { + return layoutFile.Key + } + + if layoutFile.Key >= newKey { + newKey = layoutFile.Key + 1 + } + } + + fileType := getVMFileType(filepath.Base(datastorePath.Path)) + + switch fileType { + case types.VirtualMachineFileLayoutExFileTypeNvram, types.VirtualMachineFileLayoutExFileTypeSnapshotList: + if !slices.Contains(vm.Layout.ConfigFile, datastorePath.Path) { + vm.Layout.ConfigFile = append(vm.Layout.ConfigFile, datastorePath.Path) + } + case types.VirtualMachineFileLayoutExFileTypeLog: + if !slices.Contains(vm.Layout.LogFile, datastorePath.Path) { + vm.Layout.LogFile = append(vm.Layout.LogFile, datastorePath.Path) + } + case types.VirtualMachineFileLayoutExFileTypeSwap: + vm.Layout.SwapFile = datastorePath.String() + } + + vm.LayoutEx.File = append(vm.LayoutEx.File, types.VirtualMachineFileLayoutExFileInfo{ + Accessible: types.NewBool(true), + BackingObjectId: "", + Key: newKey, + Name: datastorePath.String(), + Size: fileSize, + Type: string(fileType), + UniqueSize: fileSize, + }) + + vm.LayoutEx.Timestamp = time.Now() + + vm.updateStorage(ctx) + + return newKey +} + +func (vm *VirtualMachine) addSnapshotLayout(ctx *Context, snapshot types.ManagedObjectReference, dataKey int32) { + for _, snapshotLayout := range vm.Layout.Snapshot { + if snapshotLayout.Key == snapshot { + return + } + } + + var snapshotFiles []string + for _, file := range vm.LayoutEx.File { + if file.Key == dataKey || file.Type == "diskDescriptor" { + snapshotFiles = append(snapshotFiles, file.Name) + } + } + + vm.Layout.Snapshot = append(vm.Layout.Snapshot, types.VirtualMachineFileLayoutSnapshotLayout{ + Key: snapshot, + SnapshotFile: snapshotFiles, + }) +} + +func (vm *VirtualMachine) addSnapshotLayoutEx(ctx *Context, snapshot types.ManagedObjectReference, dataKey int32, memoryKey int32) { + for _, snapshotLayoutEx := range vm.LayoutEx.Snapshot { + if snapshotLayoutEx.Key == snapshot { + return + } + } + + vm.LayoutEx.Snapshot = append(vm.LayoutEx.Snapshot, types.VirtualMachineFileLayoutExSnapshotLayout{ + DataKey: dataKey, + Disk: vm.LayoutEx.Disk, + Key: snapshot, + MemoryKey: memoryKey, + }) + + vm.LayoutEx.Timestamp = time.Now() + + vm.updateStorage(ctx) +} + +// Updates both vm.Layout.Disk and vm.LayoutEx.Disk +func (vm *VirtualMachine) updateDiskLayouts(ctx *Context) types.BaseMethodFault { + var disksLayout []types.VirtualMachineFileLayoutDiskLayout + var disksLayoutEx []types.VirtualMachineFileLayoutExDiskLayout + + disks := object.VirtualDeviceList(vm.Config.Hardware.Device).SelectByType((*types.VirtualDisk)(nil)) + for _, disk := range disks { + disk := disk.(*types.VirtualDisk) + diskBacking := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + + diskLayout := &types.VirtualMachineFileLayoutDiskLayout{Key: disk.Key} + diskLayoutEx := &types.VirtualMachineFileLayoutExDiskLayout{Key: disk.Key} + + // Iterate through disk and its parents + for { + dFileName := diskBacking.GetVirtualDeviceFileBackingInfo().FileName + + var fileKeys []int32 + + // Add disk descriptor and extent files + for _, diskName := range vdmNames(dFileName) { + // get full path including datastore location + p, fault := parseDatastorePath(diskName) + if fault != nil { + return fault + } + + datastore := vm.useDatastore(ctx, p.Datastore) + dFilePath := datastore.resolve(ctx, p.Path) + + var fileSize int64 + // If file can not be opened - fileSize will be 0 + if dFileInfo, err := os.Stat(dFilePath); err == nil { + fileSize = dFileInfo.Size() + } + + diskKey := vm.addFileLayoutEx(ctx, *p, fileSize) + fileKeys = append(fileKeys, diskKey) + } + + diskLayout.DiskFile = append(diskLayout.DiskFile, dFileName) + diskLayoutEx.Chain = append(diskLayoutEx.Chain, types.VirtualMachineFileLayoutExDiskUnit{ + FileKey: fileKeys, + }) + + if parent := diskBacking.Parent; parent != nil { + diskBacking = parent + } else { + break + } + } + + disksLayout = append(disksLayout, *diskLayout) + disksLayoutEx = append(disksLayoutEx, *diskLayoutEx) + } + + vm.Layout.Disk = disksLayout + + vm.LayoutEx.Disk = disksLayoutEx + vm.LayoutEx.Timestamp = time.Now() + + vm.updateStorage(ctx) + + return nil +} + +func (vm *VirtualMachine) updateStorage(ctx *Context) types.BaseMethodFault { + // Committed - sum of Size for each file in vm.LayoutEx.File + // Unshared - sum of Size for each disk (.vmdk) in vm.LayoutEx.File + // Uncommitted - disk capacity minus disk usage (only currently used disk) + var datastoresUsage []types.VirtualMachineUsageOnDatastore + + disks := object.VirtualDeviceList(vm.Config.Hardware.Device).SelectByType((*types.VirtualDisk)(nil)) + + for _, file := range vm.LayoutEx.File { + p, fault := parseDatastorePath(file.Name) + if fault != nil { + return fault + } + + datastore := vm.useDatastore(ctx, p.Datastore) + dsUsage := &types.VirtualMachineUsageOnDatastore{ + Datastore: datastore.Self, + } + + for idx, usage := range datastoresUsage { + if usage.Datastore == datastore.Self { + datastoresUsage = append(datastoresUsage[:idx], datastoresUsage[idx+1:]...) + dsUsage = &usage + break + } + } + + dsUsage.Committed += file.Size + + if path.Ext(file.Name) == ".vmdk" { + dsUsage.Unshared += file.Size + } + + for _, disk := range disks { + disk := disk.(*types.VirtualDisk) + backing := disk.Backing.(types.BaseVirtualDeviceFileBackingInfo).GetVirtualDeviceFileBackingInfo() + + if backing.FileName == file.Name { + dsUsage.Uncommitted += disk.CapacityInBytes + } + } + + datastoresUsage = append(datastoresUsage, *dsUsage) + } + + vm.Storage.PerDatastoreUsage = datastoresUsage + vm.Storage.Timestamp = time.Now() + + storageSummary := &types.VirtualMachineStorageSummary{ + Timestamp: time.Now(), + } + + for i, usage := range datastoresUsage { + datastoresUsage[i].Uncommitted -= usage.Committed + storageSummary.Committed += usage.Committed + storageSummary.Uncommitted += usage.Uncommitted + storageSummary.Unshared += usage.Unshared + } + + vm.Summary.Storage = storageSummary + + return nil +} + +func (vm *VirtualMachine) RefreshStorageInfo(ctx *Context, req *types.RefreshStorageInfo) soap.HasFault { + body := new(methods.RefreshStorageInfoBody) + + if vm.Runtime.Host == nil { + // VM not fully created + return body + } + + // Validate that all files in vm.LayoutEx.File can still be found + for idx := len(vm.LayoutEx.File) - 1; idx >= 0; idx-- { + file := vm.LayoutEx.File[idx] + + p, fault := parseDatastorePath(file.Name) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + if _, err := os.Stat(p.String()); err != nil { + vm.LayoutEx.File = append(vm.LayoutEx.File[:idx], vm.LayoutEx.File[idx+1:]...) + } + } + + vmPathName := vm.Config.Files.VmPathName + // vm.Config.Files.VmPathName can be a directory or full path to .vmx + if path.Ext(vmPathName) == ".vmx" { + vmPathName = path.Dir(vmPathName) + } + + // Directories will be used to locate VM files. + // Does not include information about virtual disk file locations. + locations := []string{ + vmPathName, + vm.Config.Files.SnapshotDirectory, + vm.Config.Files.LogDirectory, + vm.Config.Files.SuspendDirectory, + vm.Config.Files.FtMetadataDirectory, + } + + for _, directory := range slices.Compact(locations) { + if directory == "" { + continue + } + + p, fault := parseDatastorePath(directory) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + datastore := vm.useDatastore(ctx, p.Datastore) + directory := datastore.resolve(ctx, p.Path) + + if _, err := os.Stat(directory); err != nil { + // Can not access the directory + continue + } + + files, err := os.ReadDir(directory) + if err != nil { + body.Fault_ = Fault("", ctx.Map.FileManager().fault(directory, err, new(types.CannotAccessFile))) + return body + } + + for _, file := range files { + datastorePath := object.DatastorePath{ + Datastore: p.Datastore, + Path: path.Join(p.Path, file.Name()), + } + info, _ := file.Info() + vm.addFileLayoutEx(ctx, datastorePath, info.Size()) + } + } + + fault := vm.updateDiskLayouts(ctx) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + vm.LayoutEx.Timestamp = time.Now() + + body.Res = new(types.RefreshStorageInfoResponse) + + return body +} + +func (vm *VirtualMachine) findDatastore(ctx *Context, name string) *Datastore { + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + + return ctx.Map.FindByName(name, host.Datastore).(*Datastore) +} + +func (vm *VirtualMachine) useDatastore(ctx *Context, name string) *Datastore { + ds := vm.findDatastore(ctx, name) + if FindReference(vm.Datastore, ds.Self) == nil { + vm.Datastore = append(vm.Datastore, ds.Self) + } + + return ds +} + +func (vm *VirtualMachine) vmx(spec *types.VirtualMachineConfigSpec) object.DatastorePath { + var p object.DatastorePath + vmx := vm.Config.Files.VmPathName + if spec != nil { + vmx = spec.Files.VmPathName + } + p.FromString(vmx) + return p +} + +func (vm *VirtualMachine) createFile(ctx *Context, spec string, name string, register bool) (*os.File, types.BaseMethodFault) { + p, fault := parseDatastorePath(spec) + if fault != nil { + return nil, fault + } + + ds := vm.useDatastore(ctx, p.Datastore) + + nhost := len(ds.Host) + if internal.IsDatastoreVSAN(ds.Datastore) && nhost < 3 { + fault := new(types.CannotCreateFile) + fault.FaultMessage = []types.LocalizableMessage{ + { + Key: "vob.vsanprovider.object.creation.failed", + Message: "Failed to create object.", + }, + { + Key: "vob.vsan.clomd.needMoreFaultDomains2", + Message: fmt.Sprintf("There are currently %d usable fault domains. The operation requires %d more usable fault domains.", nhost, 3-nhost), + }, + } + fault.File = p.Path + return nil, fault + } + + file := ds.resolve(ctx, p.Path) + + if name != "" { + if path.Ext(p.Path) == ".vmx" { + file = path.Dir(file) // vm.Config.Files.VmPathName can be a directory or full path to .vmx + } + + file = path.Join(file, name) + } + + if register { + f, err := os.Open(filepath.Clean(file)) + if err != nil { + log.Printf("register %s: %s", vm.Reference(), err) + if os.IsNotExist(err) { + return nil, &types.NotFound{} + } + + return nil, &types.InvalidArgument{} + } + + return f, nil + } + + _, err := os.Stat(file) + if err == nil { + fault := &types.FileAlreadyExists{FileFault: types.FileFault{File: file}} + log.Printf("%T: %s", fault, file) + return nil, fault + } + + // Create parent directory if needed + dir := path.Dir(file) + _, err = os.Stat(dir) + if err != nil { + if os.IsNotExist(err) { + _ = os.Mkdir(dir, 0700) + } + } + + f, err := os.Create(file) + if err != nil { + log.Printf("create(%s): %s", file, err) + return nil, &types.FileFault{ + File: file, + } + } + + return f, nil +} + +// Rather than keep an fd open for each VM, open/close the log for each messages. +// This is ok for now as we do not do any heavy VM logging. +func (vm *VirtualMachine) logPrintf(format string, v ...any) { + f, err := os.OpenFile(vm.log, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0) + if err != nil { + log.Println(err) + return + } + log.New(f, "vmx ", log.Flags()).Printf(format, v...) + _ = f.Close() +} + +func (vm *VirtualMachine) create(ctx *Context, spec *types.VirtualMachineConfigSpec, register bool) types.BaseMethodFault { + vm.apply(spec) + + if spec.Version != "" { + v := strings.TrimPrefix(spec.Version, "vmx-") + _, err := strconv.Atoi(v) + if err != nil { + log.Printf("unsupported hardware version: %s", spec.Version) + return new(types.NotSupported) + } + } + + files := []struct { + spec string + name string + use *string + }{ + {vm.Config.Files.VmPathName, "", nil}, + {vm.Config.Files.VmPathName, fmt.Sprintf("%s.nvram", vm.Name), nil}, + {vm.Config.Files.LogDirectory, "vmware.log", &vm.log}, + } + + for _, file := range files { + f, err := vm.createFile(ctx, file.spec, file.name, register) + if err != nil { + return err + } + if file.use != nil { + *file.use = f.Name() + } + _ = f.Close() + } + + vm.logPrintf("created") + + return vm.configureDevices(ctx, spec) +} + +var vmwOUI = net.HardwareAddr([]byte{0x0, 0xc, 0x29}) + +// From https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-networking-8-0/mac-addresses/mac-address-generation-on-esxi-hosts.html +// > The host generates generateMAC addresses that consists of the VMware OUI 00:0C:29 and the last three octets in hexadecimal +// > format of the virtual machine UUID. The virtual machine UUID is based on a hash calculated by using the UUID of the +// > ESXi physical machine and the path to the configuration file (.vmx) of the virtual machine. +func (vm *VirtualMachine) generateMAC(unit int32) string { + id := []byte(vm.Config.Uuid) + + offset := len(id) - len(vmwOUI) + key := id[offset] + byte(unit) // add device unit number, giving each VM NIC a unique MAC + id = append([]byte{key}, id[offset+1:]...) + + mac := append(vmwOUI, id...) + + return mac.String() +} + +func numberToString(n int64, sep rune) string { + buf := &bytes.Buffer{} + if n < 0 { + n = -n + buf.WriteRune('-') + } + s := strconv.FormatInt(n, 10) + pos := 3 - (len(s) % 3) + for i := 0; i < len(s); i++ { + if pos == 3 { + if i != 0 { + buf.WriteRune(sep) + } + pos = 0 + } + pos++ + buf.WriteByte(s[i]) + } + + return buf.String() +} + +func getDiskSize(disk *types.VirtualDisk) int64 { + if disk.CapacityInBytes == 0 { + return disk.CapacityInKB * 1024 + } + return disk.CapacityInBytes +} + +func changedDiskSize(oldDisk *types.VirtualDisk, newDiskSpec *types.VirtualDisk) (int64, bool) { + // capacity cannot be decreased + if newDiskSpec.CapacityInBytes > 0 && newDiskSpec.CapacityInBytes < oldDisk.CapacityInBytes { + return 0, false + } + if newDiskSpec.CapacityInKB > 0 && newDiskSpec.CapacityInKB < oldDisk.CapacityInKB { + return 0, false + } + + // NOTE: capacity is ignored if specified value is same as before + if newDiskSpec.CapacityInBytes == oldDisk.CapacityInBytes { + return newDiskSpec.CapacityInKB * 1024, true + } + if newDiskSpec.CapacityInKB == oldDisk.CapacityInKB { + return newDiskSpec.CapacityInBytes, true + } + + // if both set, CapacityInBytes and CapacityInKB must be the same + if newDiskSpec.CapacityInBytes > 0 && newDiskSpec.CapacityInKB > 0 { + if newDiskSpec.CapacityInBytes != newDiskSpec.CapacityInKB*1024 { + return 0, false + } + } + + return newDiskSpec.CapacityInBytes, true +} + +func (vm *VirtualMachine) validateSwitchMembers(ctx *Context, id string) types.BaseMethodFault { + var dswitch *DistributedVirtualSwitch + + var find func(types.ManagedObjectReference) + find = func(child types.ManagedObjectReference) { + s, ok := ctx.Map.Get(child).(*DistributedVirtualSwitch) + if ok && s.Uuid == id { + dswitch = s + return + } + walk(ctx.Map.Get(child), find) + } + f := ctx.Map.getEntityDatacenter(vm).NetworkFolder + walk(ctx.Map.Get(f), find) // search in NetworkFolder and any sub folders + + if dswitch == nil { + log.Printf("DVS %s cannot be found", id) + return new(types.NotFound) + } + + h := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + c := hostParent(ctx, &h.HostSystem) + isMember := func(val types.ManagedObjectReference) bool { + for _, mem := range dswitch.Summary.HostMember { + if mem == val { + return true + } + } + log.Printf("%s is not a member of VDS %s", h.Name, dswitch.Name) + return false + } + + for _, ref := range c.Host { + if !isMember(ref) { + return &types.InvalidArgument{InvalidProperty: "spec.deviceChange.device.port.switchUuid"} + } + } + + return nil +} + +func (vm *VirtualMachine) configureDevice( + ctx *Context, + devices object.VirtualDeviceList, + spec *types.VirtualDeviceConfigSpec, + oldDevice types.BaseVirtualDevice) types.BaseMethodFault { + + device := spec.Device + d := device.GetVirtualDevice() + var controller types.BaseVirtualController + + key := d.Key + if d.Key <= 0 { + // Keys can't be negative; Key 0 is reserved + d.Key = devices.NewKey() + d.Key *= -1 + } + + // Update device controller's key reference + if key != d.Key { + if device := devices.FindByKey(d.ControllerKey); device != nil { + if c, ok := device.(types.BaseVirtualController); ok { + c := c.GetVirtualController() + for i := range c.Device { + if c.Device[i] == key { + c.Device[i] = d.Key + break + } + } + } + } + } + + // Choose a unique key + for { + if devices.FindByKey(d.Key) == nil { + break + } + d.Key++ + } + + label := devices.Name(device) + summary := label + dc := ctx.Map.getEntityDatacenter(ctx.Map.Get(*vm.Parent).(mo.Entity)) + + switch x := device.(type) { + case types.BaseVirtualEthernetCard: + controller = devices.PickController((*types.VirtualPCIController)(nil)) + var net types.ManagedObjectReference + var name string + + switch b := d.Backing.(type) { + case *types.VirtualEthernetCardNetworkBackingInfo: + name = b.DeviceName + summary = name + net = ctx.Map.FindByName(b.DeviceName, dc.Network).Reference() + b.Network = &net + case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo: + summary = fmt.Sprintf("DVSwitch: %s", b.Port.SwitchUuid) + net.Type = "DistributedVirtualPortgroup" + net.Value = b.Port.PortgroupKey + if err := vm.validateSwitchMembers(ctx, b.Port.SwitchUuid); err != nil { + return err + } + } + + ctx.Update(vm, []types.PropertyChange{ + {Name: "summary.config.numEthernetCards", Val: vm.Summary.Config.NumEthernetCards + 1}, + {Name: "network", Val: append(vm.Network, net)}, + }) + + c := x.GetVirtualEthernetCard() + if c.MacAddress == "" { + if c.UnitNumber == nil { + devices.AssignController(device, controller) + } + c.MacAddress = vm.generateMAC(*c.UnitNumber - 7) // Note 7 == PCI offset + } + + vm.Guest.Net = append(vm.Guest.Net, types.GuestNicInfo{ + Network: name, + IpAddress: nil, + MacAddress: c.MacAddress, + Connected: true, + DeviceConfigId: c.Key, + }) + + if spec.Operation == types.VirtualDeviceConfigSpecOperationAdd { + if c.ResourceAllocation == nil { + c.ResourceAllocation = &types.VirtualEthernetCardResourceAllocation{ + Reservation: types.NewInt64(0), + Share: types.SharesInfo{ + Shares: 50, + Level: "normal", + }, + Limit: types.NewInt64(-1), + } + } + } + case *types.VirtualDisk: + if oldDevice == nil { + // NOTE: either of capacityInBytes and capacityInKB may not be specified + x.CapacityInBytes = getDiskSize(x) + x.CapacityInKB = getDiskSize(x) / 1024 + } else { + if oldDisk, ok := oldDevice.(*types.VirtualDisk); ok { + diskSize, ok := changedDiskSize(oldDisk, x) + if !ok { + return &types.InvalidDeviceOperation{} + } + x.CapacityInBytes = diskSize + x.CapacityInKB = diskSize / 1024 + } + } + + switch b := d.Backing.(type) { + case *types.VirtualDiskSparseVer2BackingInfo: + // Sparse disk creation not supported in ESX + return &types.DeviceUnsupportedForVmPlatform{ + InvalidDeviceSpec: types.InvalidDeviceSpec{ + InvalidVmConfig: types.InvalidVmConfig{Property: "VirtualDeviceSpec.device.backing"}, + }, + } + case types.BaseVirtualDeviceFileBackingInfo: + parent := "" + + switch backing := d.Backing.(type) { + case *types.VirtualDiskFlatVer2BackingInfo: + if backing.Parent != nil { + parent = backing.Parent.FileName + } + case *types.VirtualDiskSeSparseBackingInfo: + if backing.Parent != nil { + parent = backing.Parent.FileName + } + case *types.VirtualDiskSparseVer2BackingInfo: + if backing.Parent != nil { + parent = backing.Parent.FileName + } + } + + if parent != "" { + desc, _, err := ctx.Map.FileManager().DiskDescriptor(ctx, &dc.Self, parent) + if err != nil { + return &types.InvalidDeviceSpec{ + InvalidVmConfig: types.InvalidVmConfig{ + Property: "virtualDeviceSpec.device.backing.parent.fileName", + }, + } + } + + // Disk Capacity is always same as the parent's + x.CapacityInBytes = int64(desc.Capacity()) + x.CapacityInKB = x.CapacityInBytes / 1024 + } + + summary = fmt.Sprintf("%s KB", numberToString(x.CapacityInKB, ',')) + + info := b.GetVirtualDeviceFileBackingInfo() + var path object.DatastorePath + path.FromString(info.FileName) + + if path.Path == "" { + filename, err := vm.genVmdkPath(ctx, path) + if err != nil { + return err + } + + info.FileName = filename + } + + err := vdmCreateVirtualDisk(ctx, spec.FileOperation, &types.CreateVirtualDisk_Task{ + Datacenter: &dc.Self, + Name: info.FileName, + Spec: &types.FileBackedVirtualDiskSpec{CapacityKb: x.CapacityInKB}, + }) + if err != nil { + return err + } + + ctx.Update(vm, []types.PropertyChange{ + {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks + 1}, + }) + + p, _ := parseDatastorePath(info.FileName) + ds := vm.findDatastore(ctx, p.Datastore) + info.Datastore = &ds.Self + + if oldDevice != nil { + if oldDisk, ok := oldDevice.(*types.VirtualDisk); ok { + // add previous capacity to datastore freespace + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace += getDiskSize(oldDisk) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) + } + } + + // then subtract new capacity from datastore freespace + // XXX: compare disk size and free space until windows stat is supported + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace -= getDiskSize(x) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) + + vm.updateDiskLayouts(ctx) + + if disk, ok := b.(*types.VirtualDiskFlatVer2BackingInfo); ok { + // These properties default to false + props := []**bool{ + &disk.EagerlyScrub, + &disk.ThinProvisioned, + &disk.WriteThrough, + &disk.Split, + &disk.DigestEnabled, + } + for _, prop := range props { + if *prop == nil { + *prop = types.NewBool(false) + } + } + disk.Uuid = virtualDiskUUID(&dc.Self, info.FileName) + } + } + case *types.VirtualCdrom: + if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + summary = "ISO " + b.GetVirtualDeviceFileBackingInfo().FileName + } + case *types.VirtualFloppy: + if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + summary = "Image " + b.GetVirtualDeviceFileBackingInfo().FileName + } + case *types.VirtualSerialPort: + switch b := d.Backing.(type) { + case types.BaseVirtualDeviceFileBackingInfo: + summary = "File " + b.GetVirtualDeviceFileBackingInfo().FileName + case *types.VirtualSerialPortURIBackingInfo: + summary = "Remote " + b.ServiceURI + } + } + + if d.UnitNumber == nil && controller != nil { + devices.AssignController(device, controller) + } + + if d.DeviceInfo == nil { + d.DeviceInfo = &types.Description{ + Label: label, + Summary: summary, + } + } else { + info := d.DeviceInfo.GetDescription() + if info.Label == "" { + info.Label = label + } + if info.Summary == "" { + info.Summary = summary + } + } + + switch device.(type) { + case types.BaseVirtualEthernetCard, *types.VirtualCdrom, *types.VirtualFloppy, *types.VirtualUSB, *types.VirtualSerialPort: + if d.Connectable == nil { + d.Connectable = &types.VirtualDeviceConnectInfo{StartConnected: true, Connected: true} + } + } + + // device can be connected only if vm is powered on + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + if d.Connectable != nil { + d.Connectable.Connected = false + } + } + + return nil +} + +func (vm *VirtualMachine) removeDevice(ctx *Context, devices object.VirtualDeviceList, spec *types.VirtualDeviceConfigSpec) object.VirtualDeviceList { + key := spec.Device.GetVirtualDevice().Key + + for i, d := range devices { + if d.GetVirtualDevice().Key != key { + continue + } + + devices = append(devices[:i], devices[i+1:]...) + + switch device := spec.Device.(type) { + case *types.VirtualDisk: + if spec.FileOperation == types.VirtualDeviceConfigSpecFileOperationDestroy { + var file string + + switch b := device.Backing.(type) { + case types.BaseVirtualDeviceFileBackingInfo: + file = b.GetVirtualDeviceFileBackingInfo().FileName + + p, _ := parseDatastorePath(file) + ds := vm.findDatastore(ctx, p.Datastore) + + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace += getDiskSize(device) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) + } + + if file != "" { + dc := ctx.Map.getEntityDatacenter(vm) + dm := ctx.Map.VirtualDiskManager() + if dc == nil { + continue // parent was destroyed + } + res := dm.DeleteVirtualDiskTask(ctx, &types.DeleteVirtualDisk_Task{ + Name: file, + Datacenter: &dc.Self, + }) + ctask := ctx.Map.Get(res.(*methods.DeleteVirtualDisk_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + } + } + ctx.Update(vm, []types.PropertyChange{ + {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks - 1}, + }) + + vm.RefreshStorageInfo(ctx, nil) + case types.BaseVirtualEthernetCard: + var net types.ManagedObjectReference + + switch b := device.GetVirtualEthernetCard().Backing.(type) { + case *types.VirtualEthernetCardNetworkBackingInfo: + net = *b.Network + case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo: + net.Type = "DistributedVirtualPortgroup" + net.Value = b.Port.PortgroupKey + } + + for j, nicInfo := range vm.Guest.Net { + if nicInfo.DeviceConfigId == key { + vm.Guest.Net = append(vm.Guest.Net[:j], vm.Guest.Net[j+1:]...) + break + } + } + + networks := vm.Network + RemoveReference(&networks, net) + ctx.Update(vm, []types.PropertyChange{ + {Name: "summary.config.numEthernetCards", Val: vm.Summary.Config.NumEthernetCards - 1}, + {Name: "network", Val: networks}, + }) + } + + break + } + + return devices +} + +func (vm *VirtualMachine) genVmdkPath(ctx *Context, p object.DatastorePath) (string, types.BaseMethodFault) { + if p.Datastore == "" { + p.FromString(vm.Config.Files.VmPathName) + } + if p.Path == "" { + p.Path = vm.Config.Name + } else { + p.Path = path.Dir(p.Path) + } + vmdir := p.String() + index := 0 + for { + var filename string + if index == 0 { + filename = fmt.Sprintf("%s.vmdk", vm.Config.Name) + } else { + filename = fmt.Sprintf("%s_%d.vmdk", vm.Config.Name, index) + } + + f, err := vm.createFile(ctx, vmdir, filename, false) + if err != nil { + switch err.(type) { + case *types.FileAlreadyExists: + index++ + continue + default: + return "", err + } + } + + _ = f.Close() + _ = os.Remove(f.Name()) + + return path.Join(vmdir, filename), nil + } +} + +// Encrypt requires powered off VM with no snapshots. +// Decrypt requires powered off VM. +// Deep recrypt requires powered off VM with no snapshots. +// Shallow recrypt works with VMs in any power state and even if snapshots are +// present as long as it is a single chain and not a tree. +func (vm *VirtualMachine) updateCrypto( + ctx *Context, + spec types.BaseCryptoSpec) types.BaseMethodFault { + + const configKeyId = "config.keyId" + + assertEncrypted := func() types.BaseMethodFault { + if vm.Config.KeyId == nil { + return newInvalidStateFault("vm is not encrypted") + } + return nil + } + + assertPoweredOff := func() types.BaseMethodFault { + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { + return &types.InvalidPowerState{ + ExistingState: vm.Runtime.PowerState, + RequestedState: types.VirtualMachinePowerStatePoweredOff, + } + } + return nil + } + + assertNoSnapshots := func(allowSingleChain bool) types.BaseMethodFault { + hasSnapshots := vm.Snapshot != nil && vm.Snapshot.CurrentSnapshot != nil + if !hasSnapshots { + return nil + } + if !allowSingleChain { + return newInvalidStateFault("vm has snapshots") + } + type node = types.VirtualMachineSnapshotTree + var isTreeFn func(nodes []node) types.BaseMethodFault + isTreeFn = func(nodes []node) types.BaseMethodFault { + switch len(nodes) { + case 0: + return nil + case 1: + return isTreeFn(nodes[0].ChildSnapshotList) + default: + return newInvalidStateFault("vm has snapshot tree") + } + } + return isTreeFn(vm.Snapshot.RootSnapshotList) + } + + doRecrypt := func(newKeyID types.CryptoKeyId) types.BaseMethodFault { + if err := assertEncrypted(); err != nil { + return err + } + + var providerID *types.KeyProviderId + if pid := newKeyID.ProviderId; pid != nil { + providerID = &types.KeyProviderId{ + Id: pid.Id, + } + } + + keyID := newKeyID.KeyId + if providerID == nil { + if p, k := getDefaultProvider(ctx, vm, true); p != "" && k != "" { + providerID = &types.KeyProviderId{ + Id: p, + } + keyID = k + } + } else if keyID == "" { + keyID = generateKeyForProvider(ctx, providerID.Id) + } + + ctx.Update(vm, []types.PropertyChange{ + { + Name: configKeyId, + Op: types.PropertyChangeOpAssign, + Val: &types.CryptoKeyId{ + KeyId: keyID, + ProviderId: providerID, + }, + }, + }) + return nil + } + + switch tspec := spec.(type) { + case *types.CryptoSpecDecrypt: + if err := assertPoweredOff(); err != nil { + return err + } + if err := assertNoSnapshots(false); err != nil { + return err + } + if err := assertEncrypted(); err != nil { + return err + } + ctx.Update(vm, []types.PropertyChange{ + { + Name: configKeyId, + Op: types.PropertyChangeOpRemove, + Val: nil, + }, + }) + + case *types.CryptoSpecDeepRecrypt: + if err := assertPoweredOff(); err != nil { + return err + } + if err := assertNoSnapshots(false); err != nil { + return err + } + return doRecrypt(tspec.NewKeyId) + + case *types.CryptoSpecShallowRecrypt: + if err := assertNoSnapshots(true); err != nil { + return err + } + return doRecrypt(tspec.NewKeyId) + + case *types.CryptoSpecEncrypt: + if err := assertPoweredOff(); err != nil { + return err + } + if err := assertNoSnapshots(false); err != nil { + return err + } + if vm.Config.KeyId != nil { + return newInvalidStateFault("vm is already encrypted") + } + + var providerID *types.KeyProviderId + if pid := tspec.CryptoKeyId.ProviderId; pid != nil { + providerID = &types.KeyProviderId{ + Id: pid.Id, + } + } + + keyID := tspec.CryptoKeyId.KeyId + if providerID == nil { + if p, k := getDefaultProvider(ctx, vm, true); p != "" && k != "" { + providerID = &types.KeyProviderId{ + Id: p, + } + keyID = k + } + } else if keyID == "" { + keyID = generateKeyForProvider(ctx, providerID.Id) + } + + ctx.Update(vm, []types.PropertyChange{ + { + Name: configKeyId, + Op: types.PropertyChangeOpAssign, + Val: &types.CryptoKeyId{ + KeyId: keyID, + ProviderId: providerID, + }, + }, + }) + + case *types.CryptoSpecNoOp, + *types.CryptoSpecRegister: + + // No-op + } + + return nil +} + +func (vm *VirtualMachine) configureDevices(ctx *Context, spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { + var changes []types.PropertyChange + field := mo.Field{Path: "config.hardware.device"} + devices := object.VirtualDeviceList(vm.Config.Hardware.Device) + + var err types.BaseMethodFault + for i, change := range spec.DeviceChange { + dspec := change.GetVirtualDeviceConfigSpec() + device := dspec.Device.GetVirtualDevice() + invalid := &types.InvalidDeviceSpec{DeviceIndex: int32(i)} + change := types.PropertyChange{} + + switch dspec.FileOperation { + case types.VirtualDeviceConfigSpecFileOperationCreate: + switch dspec.Device.(type) { + case *types.VirtualDisk: + if device.UnitNumber == nil { + return invalid + } + } + } + + switch dspec.Operation { + case types.VirtualDeviceConfigSpecOperationAdd: + change.Op = types.PropertyChangeOpAdd + + if devices.FindByKey(device.Key) != nil && device.ControllerKey == 0 { + // Note: real ESX does not allow adding base controllers (ControllerKey = 0) + // after VM is created (returns success but device is not added). + continue + } else if device.UnitNumber != nil && devices.SelectByType(dspec.Device).Select(func(d types.BaseVirtualDevice) bool { + base := d.GetVirtualDevice() + if base.UnitNumber != nil { + if base.ControllerKey != device.ControllerKey { + return false + } + return *base.UnitNumber == *device.UnitNumber + } + return false + }) != nil { + // UnitNumber for this device type is taken + return invalid + } + + key := device.Key + err = vm.configureDevice(ctx, devices, dspec, nil) + if err != nil { + return err + } + + devices = append(devices, dspec.Device) + change.Val = dspec.Device + if key != device.Key { + // Update ControllerKey refs + for i := range spec.DeviceChange { + ckey := &spec.DeviceChange[i].GetVirtualDeviceConfigSpec().Device.GetVirtualDevice().ControllerKey + if *ckey == key { + *ckey = device.Key + } + } + } + case types.VirtualDeviceConfigSpecOperationEdit: + rspec := *dspec + oldDevice := devices.FindByKey(device.Key) + if oldDevice == nil { + return invalid + } + rspec.Device = oldDevice + devices = vm.removeDevice(ctx, devices, &rspec) + if device.DeviceInfo != nil { + device.DeviceInfo.GetDescription().Summary = "" // regenerate summary + } + + err = vm.configureDevice(ctx, devices, dspec, oldDevice) + if err != nil { + return err + } + + devices = append(devices, dspec.Device) + change.Val = dspec.Device + case types.VirtualDeviceConfigSpecOperationRemove: + change.Op = types.PropertyChangeOpRemove + + devices = vm.removeDevice(ctx, devices, dspec) + } + + field.Key = device.Key + change.Name = field.String() + changes = append(changes, change) + } + + if len(changes) != 0 { + change := types.PropertyChange{Name: field.Path, Val: []types.BaseVirtualDevice(devices)} + ctx.Update(vm, append(changes, change)) + } + + err = vm.updateDiskLayouts(ctx) + if err != nil { + return err + } + + // Do this after device config, as some may apply to the devices themselves (e.g. ethernet -> guest.net) + err = vm.applyExtraConfig(ctx, spec) + if err != nil { + return err + } + + return nil +} + +type powerVMTask struct { + *VirtualMachine + + state types.VirtualMachinePowerState + ctx *Context +} + +func (c *powerVMTask) Run(task *Task) (types.AnyType, types.BaseMethodFault) { + c.logPrintf("running power task: requesting %s, existing %s", + c.state, c.VirtualMachine.Runtime.PowerState) + + if c.VirtualMachine.Runtime.PowerState == c.state { + return nil, &types.InvalidPowerState{ + RequestedState: c.state, + ExistingState: c.VirtualMachine.Runtime.PowerState, + } + } + + var boot types.AnyType + if c.state == types.VirtualMachinePowerStatePoweredOn { + boot = time.Now() + } + + event := c.event(c.ctx) + switch c.state { + case types.VirtualMachinePowerStatePoweredOn: + if c.VirtualMachine.hostInMM(c.ctx) { + return nil, new(types.InvalidState) + } + + err := c.svm.start(c.ctx) + if err != nil { + return nil, &types.MissingPowerOnConfiguration{ + VAppConfigFault: types.VAppConfigFault{ + VimFault: types.VimFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{Reason: err.Error()}, + LocalizedMessage: err.Error()}}}}} + } + c.ctx.postEvent( + &types.VmStartingEvent{VmEvent: event}, + &types.VmPoweredOnEvent{VmEvent: event}, + ) + c.customize(c.ctx) + case types.VirtualMachinePowerStatePoweredOff: + c.svm.stop(c.ctx) + c.ctx.postEvent( + &types.VmStoppingEvent{VmEvent: event}, + &types.VmPoweredOffEvent{VmEvent: event}, + ) + case types.VirtualMachinePowerStateSuspended: + if c.VirtualMachine.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + return nil, &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: c.VirtualMachine.Runtime.PowerState, + } + } + + c.svm.pause(c.ctx) + c.ctx.postEvent( + &types.VmSuspendingEvent{VmEvent: event}, + &types.VmSuspendedEvent{VmEvent: event}, + ) + } + + // copy devices to prevent data race + devices := c.VirtualMachine.cloneDevice() + for _, d := range devices { + conn := d.GetVirtualDevice().Connectable + if conn == nil { + continue + } + + if c.state == types.VirtualMachinePowerStatePoweredOn { + // apply startConnected to current connection + conn.Connected = conn.StartConnected + } else { + conn.Connected = false + } + } + + c.ctx.Update(c.VirtualMachine, []types.PropertyChange{ + {Name: "runtime.powerState", Val: c.state}, + {Name: "summary.runtime.powerState", Val: c.state}, + {Name: "summary.runtime.bootTime", Val: boot}, + {Name: "config.hardware.device", Val: devices}, + }) + + return nil, nil +} + +func (vm *VirtualMachine) PowerOnVMTask(ctx *Context, c *types.PowerOnVM_Task) soap.HasFault { + if vm.Config.Template { + return &methods.PowerOnVM_TaskBody{ + Fault_: Fault("cannot powerOn a template", &types.InvalidState{}), + } + } + + runner := &powerVMTask{vm, types.VirtualMachinePowerStatePoweredOn, ctx} + task := CreateTask(runner.Reference(), "powerOn", runner.Run) + + return &methods.PowerOnVM_TaskBody{ + Res: &types.PowerOnVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) PowerOffVMTask(ctx *Context, c *types.PowerOffVM_Task) soap.HasFault { + runner := &powerVMTask{vm, types.VirtualMachinePowerStatePoweredOff, ctx} + task := CreateTask(runner.Reference(), "powerOff", runner.Run) + + return &methods.PowerOffVM_TaskBody{ + Res: &types.PowerOffVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) SuspendVMTask(ctx *Context, req *types.SuspendVM_Task) soap.HasFault { + runner := &powerVMTask{vm, types.VirtualMachinePowerStateSuspended, ctx} + task := CreateTask(runner.Reference(), "suspend", runner.Run) + + return &methods.SuspendVM_TaskBody{ + Res: &types.SuspendVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) ResetVMTask(ctx *Context, req *types.ResetVM_Task) soap.HasFault { + task := CreateTask(vm, "reset", func(task *Task) (types.AnyType, types.BaseMethodFault) { + res := vm.PowerOffVMTask(ctx, &types.PowerOffVM_Task{This: vm.Self}) + ctask := ctx.Map.Get(res.(*methods.PowerOffVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + if ctask.Info.Error != nil { + return nil, ctask.Info.Error.Fault + } + + res = vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{This: vm.Self}) + ctask = ctx.Map.Get(res.(*methods.PowerOnVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + + return nil, nil + }) + + return &methods.ResetVM_TaskBody{ + Res: &types.ResetVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) RebootGuest(ctx *Context, req *types.RebootGuest) soap.HasFault { + body := new(methods.RebootGuestBody) + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + body.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: vm.Runtime.PowerState, + }) + return body + } + + if vm.Guest.ToolsRunningStatus == string(types.VirtualMachineToolsRunningStatusGuestToolsRunning) { + vm.svm.restart(ctx) + body.Res = new(types.RebootGuestResponse) + } else { + body.Fault_ = Fault("", new(types.ToolsUnavailable)) + } + + return body +} + +func (vm *VirtualMachine) ReconfigVMTask(ctx *Context, req *types.ReconfigVM_Task) soap.HasFault { + task := CreateTask(vm, "reconfigVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + ctx.postEvent(&types.VmReconfiguredEvent{ + VmEvent: vm.event(ctx), + ConfigSpec: req.Spec, + }) + + if vm.Config.Template { + expect := types.VirtualMachineConfigSpec{ + Name: req.Spec.Name, + Annotation: req.Spec.Annotation, + } + if !reflect.DeepEqual(&req.Spec, &expect) { + log.Printf("template reconfigure only allows name and annotation change") + return nil, new(types.NotSupported) + } + } + + err := vm.configure(ctx, &req.Spec) + + return nil, err + }) + + return &methods.ReconfigVM_TaskBody{ + Res: &types.ReconfigVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) UpgradeVMTask(ctx *Context, req *types.UpgradeVM_Task) soap.HasFault { + body := &methods.UpgradeVM_TaskBody{} + + task := CreateTask(vm, "upgradeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + + // InvalidPowerState + // + // 1. Is VM's power state anything other than powered off? + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { + return nil, &types.InvalidPowerStateFault{ + ExistingState: vm.Runtime.PowerState, + RequestedState: types.VirtualMachinePowerStatePoweredOff, + } + } + + // InvalidState + // + // 1. Is host on which VM is scheduled in maintenance mode? + // 2. Is VM a template? + // 3. Is VM already the latest hardware version? + var ( + ebRef *types.ManagedObjectReference + latestHardwareVersion string + hostRef = vm.Runtime.Host + supportedHardwareVersions = map[string]struct{}{} + vmHardwareVersionString = vm.Config.Version + ) + if hostRef != nil { + var hostInMaintenanceMode bool + ctx.WithLock(*hostRef, func() { + host := ctx.Map.Get(*hostRef).(*HostSystem) + hostInMaintenanceMode = host.Runtime.InMaintenanceMode + switch host.Parent.Type { + case "ClusterComputeResource": + obj := ctx.Map.Get(*host.Parent).(*ClusterComputeResource) + ebRef = obj.EnvironmentBrowser + case "ComputeResource": + obj := ctx.Map.Get(*host.Parent).(*mo.ComputeResource) + ebRef = obj.EnvironmentBrowser + } + }) + if hostInMaintenanceMode { + return nil, newInvalidStateFault("%s in maintenance mode", hostRef.Value) + } + } + if vm.Config.Template { + return nil, newInvalidStateFault("%s is template", vm.Reference().Value) + } + if ebRef != nil { + ctx.WithLock(*ebRef, func() { + eb := ctx.Map.Get(*ebRef).(*EnvironmentBrowser) + for i := range eb.QueryConfigOptionDescriptorResponse.Returnval { + cod := eb.QueryConfigOptionDescriptorResponse.Returnval[i] + for j := range cod.Host { + if cod.Host[j].Value == hostRef.Value { + supportedHardwareVersions[cod.Key] = struct{}{} + } + if latestHardwareVersion == "" { + if def := cod.DefaultConfigOption; def != nil && *def { + latestHardwareVersion = cod.Key + } + } + } + } + }) + } + + if latestHardwareVersion == "" { + latestHardwareVersion = esx.HardwareVersion + } + if vmHardwareVersionString == latestHardwareVersion { + return nil, newInvalidStateFault("%s is latest version", vm.Reference().Value) + } + if req.Version == "" { + req.Version = latestHardwareVersion + } + + // NotSupported + targetVersion, _ := types.ParseHardwareVersion(req.Version) + if targetVersion.IsValid() { + req.Version = targetVersion.String() + } + if _, ok := supportedHardwareVersions[req.Version]; !ok { + msg := fmt.Sprintf("%s not supported", req.Version) + return nil, &types.NotSupported{ + RuntimeFault: types.RuntimeFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{ + Reason: msg, + }, + LocalizedMessage: msg, + }, + }, + }, + } + } + + // AlreadyUpgraded + vmHardwareVersion, _ := types.ParseHardwareVersion(vmHardwareVersionString) + if targetVersion.IsValid() && vmHardwareVersion.IsValid() && + targetVersion <= vmHardwareVersion { + + return nil, &types.AlreadyUpgradedFault{} + } + + // InvalidArgument + if targetVersion < types.VMX3 { + return nil, &types.InvalidArgument{} + } + + ctx.Update(vm, []types.PropertyChange{ + { + Name: "config.version", Val: targetVersion.String(), + }, + { + Name: "summary.config.hwVersion", Val: targetVersion.String(), + }, + }) + + return nil, nil + }) + + body.Res = &types.UpgradeVM_TaskResponse{ + Returnval: task.Run(ctx), + } + + return body +} + +func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + dc := ctx.Map.getEntityDatacenter(vm) + + task := CreateTask(vm, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if dc == nil { + return nil, &types.ManagedObjectNotFound{Obj: vm.Self} // If our Parent was destroyed, so were we. + // TODO: should this also trigger container removal? + } + + r := vm.UnregisterVM(ctx, &types.UnregisterVM{ + This: req.This, + }) + + if r.Fault() != nil { + return nil, r.Fault().VimFault().(types.BaseMethodFault) + } + + // Remove all devices + devices := object.VirtualDeviceList(vm.Config.Hardware.Device) + spec, _ := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationRemove) + vm.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: spec}) + + // Delete VM files from the datastore (ignoring result for now) + m := ctx.Map.FileManager() + + _ = m.DeleteDatastoreFileTask(ctx, &types.DeleteDatastoreFile_Task{ + This: m.Reference(), + Name: vm.Config.Files.LogDirectory, + Datacenter: &dc.Self, + }) + + err := vm.svm.remove(ctx) + if err != nil { + return nil, &types.RuntimeFault{ + MethodFault: types.MethodFault{ + FaultCause: &types.LocalizedMethodFault{ + Fault: &types.SystemErrorFault{Reason: err.Error()}, + LocalizedMessage: err.Error()}}} + } + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault { + return SetCustomValue(ctx, req) +} + +func (vm *VirtualMachine) UnregisterVM(ctx *Context, c *types.UnregisterVM) soap.HasFault { + r := &methods.UnregisterVMBody{} + + if vm.Runtime.PowerState == types.VirtualMachinePowerStatePoweredOn { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + }) + + return r + } + + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Vm, vm.Self) + + if vm.ResourcePool != nil { + switch pool := ctx.Map.Get(*vm.ResourcePool).(type) { + case *ResourcePool: + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, vm.Self) + case *VirtualApp: + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, vm.Self) + } + } + + for i := range vm.Datastore { + ds := ctx.Map.Get(vm.Datastore[i]).(*Datastore) + ctx.Map.RemoveReference(ctx, ds, &ds.Vm, vm.Self) + } + + ctx.postEvent(&types.VmRemovedEvent{VmEvent: vm.event(ctx)}) + if f, ok := asFolderMO(ctx.Map.getEntityParent(vm, "Folder")); ok { + folderRemoveChild(ctx, f, c.This) + } + + r.Res = new(types.UnregisterVMResponse) + + return r +} + +type vmFolder interface { + CreateVMTask(ctx *Context, c *types.CreateVM_Task) soap.HasFault +} + +func (vm *VirtualMachine) cloneDevice() []types.BaseVirtualDevice { + src := types.ArrayOfVirtualDevice{ + VirtualDevice: vm.Config.Hardware.Device, + } + dst := types.ArrayOfVirtualDevice{} + deepCopy(src, &dst) + return dst.VirtualDevice +} + +func (vm *VirtualMachine) worldID() int { + return int(binary.BigEndian.Uint32(vm.uid[0:4])) +} + +func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soap.HasFault { + pool := req.Spec.Location.Pool + if pool == nil { + if !vm.Config.Template { + pool = vm.ResourcePool + } + } + + destHost := vm.Runtime.Host + + if req.Spec.Location.Host != nil { + destHost = req.Spec.Location.Host + } + + folder, _ := asFolderMO(ctx.Map.Get(req.Folder)) + host := ctx.Map.Get(*destHost).(*HostSystem) + event := vm.event(ctx) + + ctx.postEvent(&types.VmBeingClonedEvent{ + VmCloneEvent: types.VmCloneEvent{ + VmEvent: event, + }, + DestFolder: folderEventArgument(folder), + DestName: req.Name, + DestHost: *host.eventArgument(), + }) + + vmx := vm.vmx(nil) + vmx.Path = req.Name + if ref := req.Spec.Location.Datastore; ref != nil { + ds := ctx.Map.Get(*ref).(*Datastore).Name + vmx.Datastore = ds + } + + task := CreateTask(vm, "cloneVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if pool == nil { + return nil, &types.InvalidArgument{InvalidProperty: "spec.location.pool"} + } + if obj := ctx.Map.FindByName(req.Name, folder.ChildEntity); obj != nil { + return nil, &types.DuplicateName{ + Name: req.Name, + Object: obj.Reference(), + } + } + config := types.VirtualMachineConfigSpec{ + Name: req.Name, + Version: vm.Config.Version, + GuestId: vm.Config.GuestId, + Files: &types.VirtualMachineFileInfo{ + VmPathName: vmx.String(), + }, + } + + // Copying hardware properties + config.NumCPUs = vm.Config.Hardware.NumCPU + config.MemoryMB = int64(vm.Config.Hardware.MemoryMB) + config.NumCoresPerSocket = vm.Config.Hardware.NumCoresPerSocket + config.VirtualICH7MPresent = vm.Config.Hardware.VirtualICH7MPresent + config.VirtualSMCPresent = vm.Config.Hardware.VirtualSMCPresent + + defaultDevices := object.VirtualDeviceList(esx.VirtualDevice) + devices := vm.cloneDevice() + + for _, device := range devices { + var fop types.VirtualDeviceConfigSpecFileOperation + + if defaultDevices.Find(object.VirtualDeviceList(devices).Name(device)) != nil { + // Default devices are added during CreateVMTask + continue + } + + switch disk := device.(type) { + case *types.VirtualDisk: + // TODO: consider VirtualMachineCloneSpec.DiskMoveType + fop = types.VirtualDeviceConfigSpecFileOperationCreate + + // Leave FileName empty so CreateVM will just create a new one under VmPathName + disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo).FileName = "" + disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo).Parent = nil + } + + config.DeviceChange = append(config.DeviceChange, &types.VirtualDeviceConfigSpec{ + Operation: types.VirtualDeviceConfigSpecOperationAdd, + Device: device, + FileOperation: fop, + }) + } + + if dst, src := config, req.Spec.Config; src != nil { + dst.ExtraConfig = src.ExtraConfig + copyNonEmptyValue(&dst.Uuid, &src.Uuid) + copyNonEmptyValue(&dst.InstanceUuid, &src.InstanceUuid) + copyNonEmptyValue(&dst.NumCPUs, &src.NumCPUs) + copyNonEmptyValue(&dst.MemoryMB, &src.MemoryMB) + } + + res := ctx.Map.Get(req.Folder).(vmFolder).CreateVMTask(ctx, &types.CreateVM_Task{ + This: folder.Self, + Config: config, + Pool: *pool, + Host: destHost, + }) + + ctask := ctx.Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + if ctask.Info.Error != nil { + return nil, ctask.Info.Error.Fault + } + + ref := ctask.Info.Result.(types.ManagedObjectReference) + clone := ctx.Map.Get(ref).(*VirtualMachine) + clone.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Location.DeviceChange}) + if req.Spec.Config != nil && req.Spec.Config.DeviceChange != nil { + clone.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Config.DeviceChange}) + } + clone.DataSets = copyDataSetsForVmClone(vm.DataSets) + + if req.Spec.Template { + _ = clone.MarkAsTemplate(&types.MarkAsTemplate{This: clone.Self}) + } + + ctx.postEvent(&types.VmClonedEvent{ + VmCloneEvent: types.VmCloneEvent{VmEvent: clone.event(ctx)}, + SourceVm: *event.Vm, + }) + + return ref, nil + }) + + return &methods.CloneVM_TaskBody{ + Res: &types.CloneVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func copyNonEmptyValue[T comparable](dst, src *T) { + if dst == nil || src == nil { + return + } + var t T + if *src == t { + return + } + *dst = *src +} + +func (vm *VirtualMachine) RelocateVMTask(ctx *Context, req *types.RelocateVM_Task) soap.HasFault { + task := CreateTask(vm, "relocateVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + var changes []types.PropertyChange + + if ref := req.Spec.Datastore; ref != nil { + ds := ctx.Map.Get(*ref).(*Datastore) + ctx.Map.RemoveReference(ctx, ds, &ds.Vm, *ref) + + // TODO: migrate vm.Config.Files, vm.Summary.Config.VmPathName, vm.Layout and vm.LayoutEx + + changes = append(changes, types.PropertyChange{Name: "datastore", Val: []types.ManagedObjectReference{*ref}}) + } + + if ref := req.Spec.Pool; ref != nil { + pool := ctx.Map.Get(*ref).(*ResourcePool) + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, *ref) + + changes = append(changes, types.PropertyChange{Name: "resourcePool", Val: ref}) + } + + if ref := req.Spec.Host; ref != nil { + host := ctx.Map.Get(*ref).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Vm, *ref) + + changes = append(changes, + types.PropertyChange{Name: "runtime.host", Val: ref}, + types.PropertyChange{Name: "summary.runtime.host", Val: ref}, + ) + } + + if ref := req.Spec.Folder; ref != nil { + folder := ctx.Map.Get(*ref).(*Folder) + ctx.WithLock(folder, func() { + res := folder.MoveIntoFolderTask(ctx, &types.MoveIntoFolder_Task{ + List: []types.ManagedObjectReference{vm.Self}, + }).(*methods.MoveIntoFolder_TaskBody).Res + // Wait for task to complete while we hold the Folder lock + ctx.Map.Get(res.Returnval).(*Task).Wait() + }) + } + + cspec := &types.VirtualMachineConfigSpec{DeviceChange: req.Spec.DeviceChange} + if err := vm.configureDevices(ctx, cspec); err != nil { + return nil, err + } + + ctx.postEvent(&types.VmMigratedEvent{ + VmEvent: vm.event(ctx), + SourceHost: *ctx.Map.Get(*vm.Runtime.Host).(*HostSystem).eventArgument(), + SourceDatacenter: datacenterEventArgument(ctx, vm), + SourceDatastore: ctx.Map.Get(vm.Datastore[0]).(*Datastore).eventArgument(), + }) + + ctx.Update(vm, changes) + + return nil, nil + }) + + return &methods.RelocateVM_TaskBody{ + Res: &types.RelocateVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) customize(ctx *Context) { + if vm.imc == nil { + return + } + + event := types.CustomizationEvent{VmEvent: vm.event(ctx)} + ctx.postEvent(&types.CustomizationStartedEvent{CustomizationEvent: event}) + + changes := []types.PropertyChange{ + {Name: "config.tools.pendingCustomization", Val: ""}, + } + + hostname := "" + address := "" + + switch c := vm.imc.Identity.(type) { + case *types.CustomizationLinuxPrep: + hostname = customizeName(vm, c.HostName) + case *types.CustomizationSysprep: + hostname = customizeName(vm, c.UserData.ComputerName) + } + + cards := object.VirtualDeviceList(vm.Config.Hardware.Device).SelectByType((*types.VirtualEthernetCard)(nil)) + + for i, s := range vm.imc.NicSettingMap { + nic := &vm.Guest.Net[i] + if s.MacAddress != "" { + nic.MacAddress = strings.ToLower(s.MacAddress) // MacAddress in guest will always be lowercase + card := cards[i].(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + card.MacAddress = s.MacAddress // MacAddress in Virtual NIC can be any case + card.AddressType = string(types.VirtualEthernetCardMacTypeManual) + } + if nic.DnsConfig == nil { + nic.DnsConfig = new(types.NetDnsConfigInfo) + } + if s.Adapter.DnsDomain != "" { + nic.DnsConfig.DomainName = s.Adapter.DnsDomain + } + if len(s.Adapter.DnsServerList) != 0 { + nic.DnsConfig.IpAddress = s.Adapter.DnsServerList + } + if hostname != "" { + nic.DnsConfig.HostName = hostname + } + if len(vm.imc.GlobalIPSettings.DnsSuffixList) != 0 { + nic.DnsConfig.SearchDomain = vm.imc.GlobalIPSettings.DnsSuffixList + } + if nic.IpConfig == nil { + nic.IpConfig = new(types.NetIpConfigInfo) + } + + switch ip := s.Adapter.Ip.(type) { + case *types.CustomizationCustomIpGenerator: + case *types.CustomizationDhcpIpGenerator: + case *types.CustomizationFixedIp: + if address == "" { + address = ip.IpAddress + } + nic.IpAddress = []string{ip.IpAddress} + nic.IpConfig.IpAddress = []types.NetIpConfigInfoIpAddress{{ + IpAddress: ip.IpAddress, + }} + case *types.CustomizationUnknownIpGenerator: + } + } + + if len(vm.imc.NicSettingMap) != 0 { + changes = append(changes, types.PropertyChange{Name: "guest.net", Val: vm.Guest.Net}) + } + if hostname != "" { + changes = append(changes, types.PropertyChange{Name: "guest.hostName", Val: hostname}) + changes = append(changes, types.PropertyChange{Name: "summary.guest.hostName", Val: hostname}) + } + if address != "" { + changes = append(changes, types.PropertyChange{Name: "guest.ipAddress", Val: address}) + changes = append(changes, types.PropertyChange{Name: "summary.guest.ipAddress", Val: address}) + } + + vm.imc = nil + ctx.Update(vm, changes) + ctx.postEvent(&types.CustomizationSucceeded{CustomizationEvent: event}) +} + +func (vm *VirtualMachine) CustomizeVMTask(ctx *Context, req *types.CustomizeVM_Task) soap.HasFault { + task := CreateTask(vm, "customizeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if vm.hostInMM(ctx) { + return nil, new(types.InvalidState) + } + + if vm.Runtime.PowerState == types.VirtualMachinePowerStatePoweredOn { + return nil, &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + } + } + if vm.Config.Tools.PendingCustomization != "" { + return nil, new(types.CustomizationPending) + } + if len(vm.Guest.Net) != len(req.Spec.NicSettingMap) { + return nil, &types.NicSettingMismatch{ + NumberOfNicsInSpec: int32(len(req.Spec.NicSettingMap)), + NumberOfNicsInVM: int32(len(vm.Guest.Net)), + } + } + + vm.imc = &req.Spec + vm.Config.Tools.PendingCustomization = uuid.New().String() + + return nil, nil + }) + + return &methods.CustomizeVM_TaskBody{ + Res: &types.CustomizeVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) CreateSnapshotTask(ctx *Context, req *types.CreateSnapshot_Task) soap.HasFault { + body := &methods.CreateSnapshot_TaskBody{} + + r := &types.CreateSnapshotEx_Task{ + Name: req.Name, + Description: req.Description, + Memory: req.Memory, + } + + if req.Quiesce { + r.QuiesceSpec = &types.VirtualMachineGuestQuiesceSpec{} + } + + res := vm.CreateSnapshotExTask(ctx, r) + + if res.Fault() != nil { + body.Fault_ = res.Fault() + } else { + body.Res = &types.CreateSnapshot_TaskResponse{ + Returnval: res.(*methods.CreateSnapshotEx_TaskBody).Res.Returnval, + } + } + + return body +} + +func (vm *VirtualMachine) CreateSnapshotExTask(ctx *Context, req *types.CreateSnapshotEx_Task) soap.HasFault { + task := CreateTask(vm, "createSnapshotEx", func(t *Task) (types.AnyType, types.BaseMethodFault) { + var changes []types.PropertyChange + + if vm.Snapshot == nil { + vm.Snapshot = &types.VirtualMachineSnapshotInfo{} + } + + snapshot := &VirtualMachineSnapshot{} + snapshot.Vm = vm.Reference() + snapshot.Config = *vm.Config + snapshot.DataSets = copyDataSetsForVmClone(vm.DataSets) + + ctx.Map.Put(snapshot) + + quiesced := false + if req.QuiesceSpec != nil { + quiesced = true + } + + treeItem := types.VirtualMachineSnapshotTree{ + Snapshot: snapshot.Self, + Vm: snapshot.Vm, + Name: req.Name, + Description: req.Description, + Id: atomic.AddInt32(&vm.sid, 1), + CreateTime: time.Now(), + State: vm.Runtime.PowerState, + Quiesced: quiesced, + BackupManifest: "", + ReplaySupported: types.NewBool(false), + } + + cur := vm.Snapshot.CurrentSnapshot + if cur != nil { + parent := ctx.Map.Get(*cur).(*VirtualMachineSnapshot) + parent.ChildSnapshot = append(parent.ChildSnapshot, snapshot.Self) + + ss := findSnapshotInTree(vm.Snapshot.RootSnapshotList, *cur) + ss.ChildSnapshotList = append(ss.ChildSnapshotList, treeItem) + } else { + changes = append(changes, types.PropertyChange{ + Name: "snapshot.rootSnapshotList", + Val: append(vm.Snapshot.RootSnapshotList, treeItem), + }) + changes = append(changes, types.PropertyChange{ + Name: "rootSnapshot", + Val: append(vm.RootSnapshot, treeItem.Snapshot), + }) + } + + snapshot.createSnapshotFiles(ctx) + + changes = append(changes, types.PropertyChange{Name: "snapshot.currentSnapshot", Val: snapshot.Self}) + ctx.Update(vm, changes) + + return snapshot.Self, nil + }) + + return &methods.CreateSnapshotEx_TaskBody{ + Res: &types.CreateSnapshotEx_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) RevertToCurrentSnapshotTask(ctx *Context, req *types.RevertToCurrentSnapshot_Task) soap.HasFault { + body := &methods.RevertToCurrentSnapshot_TaskBody{} + + if vm.Snapshot == nil || vm.Snapshot.CurrentSnapshot == nil { + body.Fault_ = Fault("snapshot not found", &types.NotFound{}) + + return body + } + snapshot := ctx.Map.Get(*vm.Snapshot.CurrentSnapshot).(*VirtualMachineSnapshot) + + task := CreateTask(vm, "revertSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { + vm.DataSets = copyDataSetsForVmClone(snapshot.DataSets) + return nil, nil + }) + + body.Res = &types.RevertToCurrentSnapshot_TaskResponse{ + Returnval: task.Run(ctx), + } + + return body +} + +func (vm *VirtualMachine) RemoveAllSnapshotsTask(ctx *Context, req *types.RemoveAllSnapshots_Task) soap.HasFault { + task := CreateTask(vm, "RemoveAllSnapshots", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if vm.Snapshot == nil { + return nil, nil + } + + refs := allSnapshotsInTree(vm.Snapshot.RootSnapshotList) + + ctx.Update(vm, []types.PropertyChange{ + {Name: "snapshot", Val: nil}, + {Name: "rootSnapshot", Val: nil}, + }) + + for _, ref := range refs { + ctx.Map.Get(ref).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) + ctx.Map.Remove(ctx, ref) + } + + return nil, nil + }) + + return &methods.RemoveAllSnapshots_TaskBody{ + Res: &types.RemoveAllSnapshots_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) fcd(ctx *Context, ds types.ManagedObjectReference, id types.ID) *VStorageObject { + m := ctx.Map.VStorageObjectManager() + if ds.Value != "" { + return m.objects[ds][id] + } + for _, set := range m.objects { + for key, val := range set { + if key == id { + return val + } + } + } + return nil +} + +func (vm *VirtualMachine) AttachDiskTask(ctx *Context, req *types.AttachDisk_Task) soap.HasFault { + task := CreateTask(vm, "attachDisk", func(t *Task) (types.AnyType, types.BaseMethodFault) { + fcd := vm.fcd(ctx, req.Datastore, req.DiskId) + if fcd == nil { + return nil, new(types.InvalidArgument) + } + + fcd.Config.ConsumerId = []types.ID{{Id: vm.Config.Uuid}} + + // TODO: add device + + return nil, nil + }) + + return &methods.AttachDisk_TaskBody{ + Res: &types.AttachDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) DetachDiskTask(ctx *Context, req *types.DetachDisk_Task) soap.HasFault { + task := CreateTask(vm, "detachDisk", func(t *Task) (types.AnyType, types.BaseMethodFault) { + fcd := vm.fcd(ctx, types.ManagedObjectReference{}, req.DiskId) + if fcd == nil { + return nil, new(types.InvalidArgument) + } + + fcd.Config.ConsumerId = nil + + // TODO: remove device + + return nil, nil + }) + + return &methods.DetachDisk_TaskBody{ + Res: &types.DetachDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) PromoteDisksTask(ctx *Context, req *types.PromoteDisks_Task) soap.HasFault { + task := CreateTask(vm, "promoteDisks", func(t *Task) (types.AnyType, types.BaseMethodFault) { + devices := object.VirtualDeviceList(vm.Config.Hardware.Device) + devices = devices.SelectByType((*types.VirtualDisk)(nil)) + var cap int64 + + for i := range req.Disks { + d := devices.FindByKey(req.Disks[i].Key) + if d == nil { + return nil, &types.InvalidArgument{InvalidProperty: "disks"} + } + + disk := d.(*types.VirtualDisk) + + switch backing := disk.Backing.(type) { + case *types.VirtualDiskFlatVer2BackingInfo: + if backing.Parent != nil { + cap += disk.CapacityInBytes + if req.Unlink { + backing.Parent = nil + } + } + case *types.VirtualDiskSeSparseBackingInfo: + if backing.Parent != nil { + cap += disk.CapacityInBytes + if req.Unlink { + backing.Parent = nil + } + } + case *types.VirtualDiskSparseVer2BackingInfo: + if backing.Parent != nil { + cap += disk.CapacityInBytes + if req.Unlink { + backing.Parent = nil + } + } + } + } + + // Built-in default delay. `simulator.TaskDelay` can be used to add additional time + // Translates to roughly 1s per 1GB + sleep := time.Duration(cap/units.MB) * time.Millisecond + if sleep > 0 { + log.Printf("%s: sleep %s for %s", t.Info.DescriptionId, sleep, units.ByteSize(cap)) + time.Sleep(sleep) + } + + return nil, nil + }) + + return &methods.PromoteDisks_TaskBody{ + Res: &types.PromoteDisks_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) soap.HasFault { + r := &methods.ShutdownGuestBody{} + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: vm.Runtime.PowerState, + }) + + return r + } + + event := vm.event(ctx) + ctx.postEvent(&types.VmGuestShutdownEvent{VmEvent: event}) + + _ = CreateTask(vm, "shutdownGuest", func(*Task) (types.AnyType, types.BaseMethodFault) { + vm.svm.stop(ctx) + + ctx.Update(vm, []types.PropertyChange{ + {Name: "runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, + {Name: "summary.runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, + }) + + ctx.postEvent(&types.VmPoweredOffEvent{VmEvent: event}) + + return nil, nil + }).Run(ctx) + + r.Res = new(types.ShutdownGuestResponse) + + return r +} + +func (vm *VirtualMachine) StandbyGuest(ctx *Context, c *types.StandbyGuest) soap.HasFault { + r := &methods.StandbyGuestBody{} + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: vm.Runtime.PowerState, + }) + + return r + } + + event := vm.event(ctx) + ctx.postEvent(&types.VmGuestStandbyEvent{VmEvent: event}) + + _ = CreateTask(vm, "standbyGuest", func(*Task) (types.AnyType, types.BaseMethodFault) { + vm.svm.pause(ctx) + + ctx.Update(vm, []types.PropertyChange{ + {Name: "runtime.powerState", Val: types.VirtualMachinePowerStateSuspended}, + {Name: "summary.runtime.powerState", Val: types.VirtualMachinePowerStateSuspended}, + }) + + ctx.postEvent(&types.VmSuspendedEvent{VmEvent: event}) + + return nil, nil + }).Run(ctx) + + r.Res = new(types.StandbyGuestResponse) + + return r +} + +func (vm *VirtualMachine) MarkAsTemplate(req *types.MarkAsTemplate) soap.HasFault { + r := &methods.MarkAsTemplateBody{} + + if vm.Config.Template { + r.Fault_ = Fault("", new(types.NotSupported)) + return r + } + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + }) + return r + } + + vm.Config.Template = true + vm.Summary.Config.Template = true + vm.ResourcePool = nil + + r.Res = new(types.MarkAsTemplateResponse) + + return r +} + +func (vm *VirtualMachine) MarkAsVirtualMachine(req *types.MarkAsVirtualMachine) soap.HasFault { + r := &methods.MarkAsVirtualMachineBody{} + + if !vm.Config.Template { + r.Fault_ = Fault("", new(types.NotSupported)) + return r + } + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + }) + return r + } + + vm.Config.Template = false + vm.Summary.Config.Template = false + vm.ResourcePool = &req.Pool + if req.Host != nil { + vm.Runtime.Host = req.Host + } + + r.Res = new(types.MarkAsVirtualMachineResponse) + + return r +} + +func findSnapshotInTree(tree []types.VirtualMachineSnapshotTree, ref types.ManagedObjectReference) *types.VirtualMachineSnapshotTree { + if tree == nil { + return nil + } + + for i, ss := range tree { + if ss.Snapshot == ref { + return &tree[i] + } + + target := findSnapshotInTree(ss.ChildSnapshotList, ref) + if target != nil { + return target + } + } + + return nil +} + +func findParentSnapshot(tree types.VirtualMachineSnapshotTree, ref types.ManagedObjectReference) *types.ManagedObjectReference { + for _, ss := range tree.ChildSnapshotList { + if ss.Snapshot == ref { + return &tree.Snapshot + } + + res := findParentSnapshot(ss, ref) + if res != nil { + return res + } + } + + return nil +} + +func findParentSnapshotInTree(tree []types.VirtualMachineSnapshotTree, ref types.ManagedObjectReference) *types.ManagedObjectReference { + if tree == nil { + return nil + } + + for _, ss := range tree { + res := findParentSnapshot(ss, ref) + if res != nil { + return res + } + } + + return nil +} + +func removeSnapshotInTree(tree []types.VirtualMachineSnapshotTree, ref types.ManagedObjectReference, removeChildren bool) []types.VirtualMachineSnapshotTree { + if tree == nil { + return tree + } + + var result []types.VirtualMachineSnapshotTree + + for _, ss := range tree { + if ss.Snapshot == ref { + if !removeChildren { + result = append(result, ss.ChildSnapshotList...) + } + } else { + ss.ChildSnapshotList = removeSnapshotInTree(ss.ChildSnapshotList, ref, removeChildren) + result = append(result, ss) + } + } + + return result +} + +func allSnapshotsInTree(tree []types.VirtualMachineSnapshotTree) []types.ManagedObjectReference { + var result []types.ManagedObjectReference + + if tree == nil { + return result + } + + for _, ss := range tree { + result = append(result, ss.Snapshot) + result = append(result, allSnapshotsInTree(ss.ChildSnapshotList)...) + } + + return result +} + +func changeTrackingSupported(spec *types.VirtualMachineConfigSpec) bool { + for _, device := range spec.DeviceChange { + if dev, ok := device.GetVirtualDeviceConfigSpec().Device.(*types.VirtualDisk); ok { + switch dev.Backing.(type) { + case *types.VirtualDiskFlatVer2BackingInfo: + return true + case *types.VirtualDiskSparseVer2BackingInfo: + return true + case *types.VirtualDiskRawDiskMappingVer1BackingInfo: + return true + case *types.VirtualDiskRawDiskVer2BackingInfo: + return true + default: + return false + } + } + } + return false +} + +func (vm *VirtualMachine) updateLastModifiedAndChangeVersion(ctx *Context) { + modified := time.Now() + ctx.Update(vm, []types.PropertyChange{ + { + Name: "config.changeVersion", + Val: fmt.Sprintf("%d", modified.UnixNano()), + Op: types.PropertyChangeOpAssign, + }, + { + Name: "config.modified", + Val: modified, + Op: types.PropertyChangeOpAssign, + }, + }) +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_compatibility_checker.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_compatibility_checker.go new file mode 100644 index 000000000..148c2c83e --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_compatibility_checker.go @@ -0,0 +1,176 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "fmt" + "math/rand" + "slices" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type VmCompatibilityChecker struct { + mo.VirtualMachineCompatibilityChecker +} + +func resolveHostsAndPool(ctx *Context, vm, host, pool *types.ManagedObjectReference) (*ResourcePool, []types.ManagedObjectReference) { + var vmMo *VirtualMachine + var poolMo *ResourcePool + + switch { + case pool != nil: + poolMo = ctx.Map.Get(*pool).(*ResourcePool) + case vm != nil: + vmMo = ctx.Map.Get(*vm).(*VirtualMachine) + poolMo = ctx.Map.Get(*vmMo.ResourcePool).(*ResourcePool) + case host != nil: + h := ctx.Map.Get(*host).(*HostSystem) + parent := hostParent(ctx, &h.HostSystem).ResourcePool + poolMo = ctx.Map.Get(*parent).(*ResourcePool) + } + + var hosts []types.ManagedObjectReference + + switch { + case host != nil: + hosts = append(hosts, *host) + case pool != nil: + hosts = resourcePoolHosts(ctx, poolMo) + case vm != nil: + hosts = append(hosts, *vmMo.Runtime.Host) + } + + return poolMo, hosts +} + +func validateHostsAndPool(ctx *Context, pool *ResourcePool, hosts []types.ManagedObjectReference) *types.InvalidArgument { + allHosts := resourcePoolHosts(ctx, pool) + + for _, host := range hosts { + if !slices.Contains(allHosts, host) { + return &types.InvalidArgument{ + InvalidProperty: "spec.pool", + } + } + } + + return nil +} + +func (c *VmCompatibilityChecker) checkVmConfigSpec(ctx *Context, check *types.CheckResult, spec types.VirtualMachineConfigSpec, hosts []types.ManagedObjectReference) { + if check.Host == nil { + // By default all hosts use the same HostSystem template, so we check against any. + // But we could choose a host based on the spec, e.g. record + playback of real hosts + check.Host = &hosts[rand.Intn(len(hosts))] + } + + host := ctx.Map.Get(*check.Host).(*HostSystem) + + mem := int32(spec.MemoryMB) + if mem > 0 { + min := int32(4) + max := host.Capability.MaxSupportedVmMemory + if mem > max || mem < min { + check.Warning = append(check.Warning, types.LocalizedMethodFault{ + Fault: &types.MemorySizeNotSupported{ + MemorySizeMB: mem, + MinMemorySizeMB: min, + MaxMemorySizeMB: max, + }, + LocalizedMessage: fmt.Sprintf("vm requires %d MB of memory, outside the range of %d to %d", mem, min, max), + }) + } + } + + cpu := spec.NumCPUs + if cpu > 0 { + max := int32(host.Summary.Hardware.NumCpuCores) + if cpu > max { + check.Warning = append(check.Warning, types.LocalizedMethodFault{ + Fault: &types.NotEnoughCpus{ + NumCpuDest: max, + NumCpuVm: cpu, + }, + LocalizedMessage: fmt.Sprintf("vm requires %d CPUs, host has %d", cpu, max), + }) + } + } + + if spec.GuestId != "" { + var guest types.VirtualMachineGuestOsIdentifier + if !slices.Contains(guest.Strings(), spec.GuestId) { + check.Warning = append(check.Warning, types.LocalizedMethodFault{ + Fault: &types.UnsupportedGuest{ + UnsupportedGuestOS: spec.GuestId, + }, + LocalizedMessage: fmt.Sprintf("vm guest os %s not supported", spec.GuestId), + }) + } + } +} + +func (c *VmCompatibilityChecker) CheckVmConfigTask( + ctx *Context, + r *types.CheckVmConfig_Task) soap.HasFault { + + task := CreateTask(c, "checkVmConfig", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if r.Vm == nil && r.Host == nil && r.Pool == nil { + return nil, new(types.InvalidArgument) + } + + poolMo, hosts := resolveHostsAndPool(ctx, r.Vm, r.Host, r.Pool) + if err := validateHostsAndPool(ctx, poolMo, hosts); err != nil { + return nil, err + } + + check := types.CheckResult{ + Vm: r.Vm, + Host: r.Host, + } + + c.checkVmConfigSpec(ctx, &check, r.Spec, hosts) + + return types.ArrayOfCheckResult{ + CheckResult: []types.CheckResult{check}, + }, nil + }) + + return &methods.CheckVmConfig_TaskBody{ + Res: &types.CheckVmConfig_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (c *VmCompatibilityChecker) CheckCompatibilityTask( + ctx *Context, + r *types.CheckCompatibility_Task) soap.HasFault { + + task := CreateTask(c, "checkCompatibility", func(t *Task) (types.AnyType, types.BaseMethodFault) { + poolMo, hosts := resolveHostsAndPool(ctx, &r.Vm, r.Host, r.Pool) + if err := validateHostsAndPool(ctx, poolMo, hosts); err != nil { + return nil, err + } + + check := types.CheckResult{ + Vm: &r.Vm, + Host: r.Host, + } + + return types.ArrayOfCheckResult{ + CheckResult: []types.CheckResult{check}, + }, nil + }) + + return &methods.CheckCompatibility_TaskBody{ + Res: &types.CheckCompatibility_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_provisioning_checker.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_provisioning_checker.go new file mode 100644 index 000000000..b5019e4f0 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vm_provisioning_checker.go @@ -0,0 +1,37 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type VmProvisioningChecker struct { + mo.VirtualMachineProvisioningChecker +} + +func (c *VmProvisioningChecker) CheckRelocateTask( + ctx *Context, + r *types.CheckRelocate_Task) soap.HasFault { + + task := CreateTask(c, "checkRelocate", func(t *Task) (types.AnyType, types.BaseMethodFault) { + check := types.CheckResult{ + Vm: &r.Vm, + } + + return types.ArrayOfCheckResult{ + CheckResult: []types.CheckResult{check}, + }, nil + }) + + return &methods.CheckRelocate_TaskBody{ + Res: &types.CheckRelocate_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/alarm_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/alarm_manager.go new file mode 100644 index 000000000..e51b1bdc8 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/alarm_manager.go @@ -0,0 +1,207 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import ( + "time" + + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// Alarm captured using: +// govc alarm.info -dump -n alarm.VmErrorAlarm -n alarm.HostErrorAlarm +var Alarm = []mo.Alarm{ + { + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-384", ServerGUID: ""}, + Value: nil, + AvailableField: nil, + }, + Info: types.AlarmInfo{ + AlarmSpec: types.AlarmSpec{ + Name: "vcsim VM Alarm", + SystemName: "", + Description: "vcsim alarm for Virtual Machines", + Enabled: true, + Expression: &types.OrAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Expression: []types.BaseAlarmExpression{ + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "EventEx", + EventTypeId: "vcsim.vm.success", + ObjectType: "VirtualMachine", + Status: "green", + }, + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "EventEx", + EventTypeId: "vcsim.vm.failure", + ObjectType: "VirtualMachine", + Status: "yellow", + }, + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "EventEx", + EventTypeId: "vcsim.vm.fatal", + ObjectType: "VirtualMachine", + Status: "red", + }, + }, + }, + Action: nil, + ActionFrequency: 0, + Setting: &types.AlarmSetting{ + ToleranceRange: 0, + ReportingFrequency: 300, + }, + }, + Key: "", + Alarm: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-384", ServerGUID: ""}, + Entity: types.ManagedObjectReference{Type: "Folder", Value: "group-d1", ServerGUID: ""}, + LastModifiedTime: time.Now(), + LastModifiedUser: "VSPHERE.LOCAL\\Administrator", + CreationEventId: 0, + }, + }, + { + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-11", ServerGUID: ""}, + Value: nil, + AvailableField: nil, + }, + Info: types.AlarmInfo{ + AlarmSpec: types.AlarmSpec{ + Name: "Host error", + SystemName: "alarm.HostErrorAlarm", + Description: "Default alarm to monitor host error and warning events", + Enabled: true, + Expression: &types.OrAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Expression: []types.BaseAlarmExpression{ + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "GeneralHostErrorEvent", + EventTypeId: "", + ObjectType: "HostSystem", + Status: "", + }, + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "GeneralHostWarningEvent", + EventTypeId: "", + ObjectType: "HostSystem", + Status: "", + }, + }, + }, + Action: &types.GroupAlarmAction{ + AlarmAction: types.AlarmAction{}, + Action: []types.BaseAlarmAction{ + &types.AlarmTriggeringAction{ + AlarmAction: types.AlarmAction{}, + Action: &types.SendSNMPAction{}, + TransitionSpecs: []types.AlarmTriggeringActionTransitionSpec{ + { + StartState: "yellow", + FinalState: "red", + Repeats: true, + }, + }, + Green2yellow: false, + Yellow2red: false, + Red2yellow: false, + Yellow2green: false, + }, + }, + }, + ActionFrequency: 0, + Setting: &types.AlarmSetting{ + ToleranceRange: 0, + ReportingFrequency: 300, + }, + }, + Key: "", + Alarm: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-11", ServerGUID: ""}, + Entity: types.ManagedObjectReference{Type: "Folder", Value: "group-d1", ServerGUID: ""}, + LastModifiedTime: time.Now(), + LastModifiedUser: "", + CreationEventId: 0, + }, + }, + { + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-12", ServerGUID: ""}, + Value: nil, + AvailableField: nil, + }, + Info: types.AlarmInfo{ + AlarmSpec: types.AlarmSpec{ + Name: "Virtual machine error", + SystemName: "alarm.VmErrorAlarm", + Description: "Default alarm to monitor virtual machine error and warning events", + Enabled: true, + Expression: &types.OrAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Expression: []types.BaseAlarmExpression{ + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "GeneralVmErrorEvent", + EventTypeId: "", + ObjectType: "VirtualMachine", + Status: "", + }, + &types.EventAlarmExpression{ + AlarmExpression: types.AlarmExpression{}, + Comparisons: nil, + EventType: "GeneralVmWarningEvent", + EventTypeId: "", + ObjectType: "VirtualMachine", + Status: "", + }, + }, + }, + Action: &types.GroupAlarmAction{ + AlarmAction: types.AlarmAction{}, + Action: []types.BaseAlarmAction{ + &types.AlarmTriggeringAction{ + AlarmAction: types.AlarmAction{}, + Action: &types.SendSNMPAction{}, + TransitionSpecs: []types.AlarmTriggeringActionTransitionSpec{ + { + StartState: "yellow", + FinalState: "red", + Repeats: true, + }, + }, + Green2yellow: false, + Yellow2red: false, + Red2yellow: false, + Yellow2green: false, + }, + }, + }, + ActionFrequency: 0, + Setting: &types.AlarmSetting{ + ToleranceRange: 0, + ReportingFrequency: 300, + }, + }, + Key: "", + Alarm: types.ManagedObjectReference{Type: "Alarm", Value: "alarm-12", ServerGUID: ""}, + Entity: types.ManagedObjectReference{Type: "Folder", Value: "group-d1", ServerGUID: ""}, + LastModifiedTime: time.Now(), + LastModifiedUser: "", + CreationEventId: 0, + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go new file mode 100644 index 000000000..fe77ef855 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go @@ -0,0 +1,8 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +/* +Package vpx contains SOAP responses from a vCenter server, captured using `govc ... -dump`. +*/ +package vpx diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go new file mode 100644 index 000000000..2107fb7e5 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go @@ -0,0 +1,21828 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import "github.com/vmware/govmomi/vim25/types" + +// HistoricalInterval is the default template for the PerformanceManager historicalInterval property. +// Capture method: +// +// govc object.collect -s -dump PerformanceManager:Perfmgr historicalInterval +var HistoricalInterval = []types.PerfInterval{ + { + Enabled: true, + Key: 1, + Length: 86400, + Level: 1, + Name: "Past Day", + SamplingPeriod: 300, + }, + { + Enabled: true, + Key: 2, + Length: 604800, + Level: 1, + Name: "Past Week", + SamplingPeriod: 1800, + }, + { + Enabled: true, + Key: 1, + Length: 2592000, + Level: 1, + Name: "Past Month", + SamplingPeriod: 7200, + }, + { + Enabled: true, + Key: 1, + Length: 31536000, + Level: 1, + Name: "Past Year", + SamplingPeriod: 86400, + }, +} + +// PerfCounter is the default template for the PerformanceManager perfCounter property. +// Capture method: +// govc object.collect -s -dump PerformanceManager:PerfMgr perfCounter + +var PerfCounter = []types.PerfCounterInfo{ + { + Key: 1, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 2, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 3, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 4, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "CPU usage as a percentage during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 5, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 6, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 7, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 8, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage in MHz", + Summary: "CPU usage in megahertz during the interval", + }, + Key: "usagemhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 9, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reserved capacity", + Summary: "Total CPU capacity reserved by virtual machines", + }, + Key: "reservedCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 10, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "Amount of time spent on system processes on each virtual CPU in the virtual machine", + }, + Key: "system", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 11, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Wait", + Summary: "Total CPU time spent in wait state", + }, + Key: "wait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 12, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ready", + Summary: "Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU during last measurement interval", + }, + Key: "ready", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 13, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Idle", + Summary: "Total time that the CPU spent in an idle state", + }, + Key: "idle", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 14, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Used", + Summary: "Total CPU usage", + }, + Key: "used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 15, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Capacity Provisioned", + Summary: "Capacity in MHz of the physical CPU cores", + }, + Key: "capacity.provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 16, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Capacity Entitlement", + Summary: "CPU resources devoted by the ESXi scheduler to the virtual machines and resource pools", + }, + Key: "capacity.entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 17, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Capacity Usage", + Summary: "CPU usage as a percent during the interval.", + }, + Key: "capacity.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 18, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Capacity Demand", + Summary: "The amount of CPU resources a VM would use if there were no CPU contention or CPU limit", + }, + Key: "capacity.demand", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 19, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Capacity Contention", + Summary: "Percent of time the VM is unable to run because it is contending for access to the physical CPU(s)", + }, + Key: "capacity.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 20, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Core Count Provisioned", + Summary: "The number of virtual processors provisioned to the entity.", + }, + Key: "corecount.provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 21, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Core Count Usage", + Summary: "The number of virtual processors running on the host.", + }, + Key: "corecount.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 22, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU Core Count Contention", + Summary: "Time the VM vCPU is ready to run, but is unable to run due to co-scheduling constraints", + }, + Key: "corecount.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 23, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 24, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 25, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 26, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host consumed %", + Summary: "Percentage of host physical memory that has been consumed", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 27, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation consumed", + Summary: "Memory reservation consumed by powered-on virtual machines", + }, + Key: "reservedCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 28, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 29, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 30, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 31, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Granted", + Summary: "Amount of host physical memory or physical memory that is mapped for a virtual machine or a host", + }, + Key: "granted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 32, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 33, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 34, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 35, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active", + Summary: "Amount of guest physical memory that is being actively read or written by guest. Activeness is estimated by ESXi", + }, + Key: "active", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 36, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 37, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 38, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 39, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared", + Summary: "Amount of guest physical memory that is shared within a single virtual machine or across virtual machines", + }, + Key: "shared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 40, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 41, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 42, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 43, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Zero pages", + Summary: "Guest physical memory pages whose content is 0x00", + }, + Key: "zero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 44, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 45, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 46, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 47, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reservation available", + Summary: "Amount by which reservation can be raised", + }, + Key: "unreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 48, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 49, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 50, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 51, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap consumed", + Summary: "Swap storage space consumed", + }, + Key: "swapused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 52, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapunreserved", + Summary: "swapunreserved", + }, + Key: "swapunreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 53, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapunreserved", + Summary: "swapunreserved", + }, + Key: "swapunreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 54, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapunreserved", + Summary: "swapunreserved", + }, + Key: "swapunreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 55, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapunreserved", + Summary: "swapunreserved", + }, + Key: "swapunreserved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 56, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 57, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 58, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 59, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Shared common", + Summary: "Amount of host physical memory that backs shared guest physical memory (Shared)", + }, + Key: "sharedcommon", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 60, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 61, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 62, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 63, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap", + Summary: "Virtual address space of ESXi that is dedicated to its heap", + }, + Key: "heap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 64, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 65, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 66, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 67, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heap free", + Summary: "Free address space in the heap of ESXi. This is less than or equal to Heap", + }, + Key: "heapfree", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 68, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Free state", + Summary: "Current memory availability state of ESXi. Possible values are high, clear, soft, hard, low. The state value determines the techniques used for memory reclamation from virtual machines", + }, + Key: "state", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 69, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 70, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 71, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 72, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swapped", + Summary: "Amount of guest physical memory that is swapped out to the swap space", + }, + Key: "swapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 73, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 74, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 75, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 76, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap target", + Summary: "Amount of memory that ESXi needs to reclaim by swapping", + }, + Key: "swaptarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 77, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapIn", + Summary: "swapIn", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 78, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapIn", + Summary: "swapIn", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 79, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapIn", + Summary: "swapIn", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 80, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapIn", + Summary: "swapIn", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 81, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapOut", + Summary: "swapOut", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 82, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapOut", + Summary: "swapOut", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 83, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapOut", + Summary: "swapOut", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 84, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "swapOut", + Summary: "swapOut", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 85, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in rate", + Summary: "Rate at which guest physical memory is swapped in from the swap space", + }, + Key: "swapinRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 86, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out rate", + Summary: "Rate at which guest physical memory is swapped out to the swap space", + }, + Key: "swapoutRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 87, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap out", + Summary: "Amount of memory that is swapped out for the Service Console", + }, + Key: "swapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 88, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap in", + Summary: "Amount of memory that is swapped in for the Service Console", + }, + Key: "swapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 89, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 90, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 91, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 92, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Ballooned memory", + Summary: "Amount of guest physical memory reclaimed from the virtual machine by the balloon driver in the guest", + }, + Key: "vmmemctl", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 93, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 94, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 95, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 96, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Balloon target", + Summary: "Desired amount of guest physical memory the balloon driver needs to reclaim, as determined by ESXi", + }, + Key: "vmmemctltarget", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 97, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 98, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 99, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 100, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Consumed", + Summary: "Amount of host physical memory consumed for backing up guest physical memory pages", + }, + Key: "consumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 101, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 102, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 103, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 104, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead consumed", + Summary: "Host physical memory consumed by ESXi data structures for running the virtual machines", + }, + Key: "overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 105, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compressed", + Summary: "Guest physical memory pages that have undergone memory compression", + }, + Key: "compressed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 106, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compression rate", + Summary: "Rate of guest physical memory page compression by ESXi", + }, + Key: "compressionRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 107, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Decompression rate", + Summary: "Rate of guest physical memory decompression", + }, + Key: "decompressionRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 108, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Capacity Provisioned", + Summary: "Total amount of memory available to the host", + }, + Key: "capacity.provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 109, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Capacity Entitlement", + Summary: "Amount of host physical memory the VM is entitled to, as determined by the ESXi scheduler", + }, + Key: "capacity.entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 110, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Capacity Usable", + Summary: "Amount of physical memory available for use by virtual machines on this host", + }, + Key: "capacity.usable", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 111, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Capacity Usage", + Summary: "Amount of physical memory actively used", + }, + Key: "capacity.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 112, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Capacity Contention", + Summary: "Percentage of time VMs are waiting to access swapped, compressed or ballooned memory", + }, + Key: "capacity.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 113, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vm", + Summary: "vm", + }, + Key: "capacity.usage.vm", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 114, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vmOvrhd", + Summary: "vmOvrhd", + }, + Key: "capacity.usage.vmOvrhd", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 115, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vmkOvrhd", + Summary: "vmkOvrhd", + }, + Key: "capacity.usage.vmkOvrhd", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 116, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "userworld", + Summary: "userworld", + }, + Key: "capacity.usage.userworld", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 117, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vm", + Summary: "vm", + }, + Key: "reservedCapacity.vm", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 118, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vmOvhd", + Summary: "vmOvhd", + }, + Key: "reservedCapacity.vmOvhd", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 119, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vmkOvrhd", + Summary: "vmkOvrhd", + }, + Key: "reservedCapacity.vmkOvrhd", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 120, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "userworld", + Summary: "userworld", + }, + Key: "reservedCapacity.userworld", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 121, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Reserved Capacity %", + Summary: "Percent of memory that has been reserved either through VMkernel use, by userworlds or due to VM memory reservations", + }, + Key: "reservedCapacityPct", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 122, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Consumed by VMs", + Summary: "Amount of physical memory consumed by VMs on this host", + }, + Key: "consumed.vms", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 123, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory Consumed by userworlds", + Summary: "Amount of physical memory consumed by userworlds on this host", + }, + Key: "consumed.userworlds", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 124, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 125, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 126, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 127, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host during the collection interval.", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 128, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read requests", + Summary: "Number of disk reads during the collection interval", + }, + Key: "numberRead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 129, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write requests", + Summary: "Number of disk writes during the collection interval", + }, + Key: "numberWrite", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 130, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Average number of kilobytes read from the disk each second during the collection interval", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 131, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Average number of kilobytes written to disk each second during the collection interval", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 132, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Command latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI command issued by the guest OS to the virtual machine", + }, + Key: "totalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 133, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all disks used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 134, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Commands aborted", + Summary: "Number of SCSI commands aborted during the collection interval", + }, + Key: "commandsAborted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 135, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Bus resets", + Summary: "Number of SCSI-bus reset commands issued during the collection interval", + }, + Key: "busResets", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 136, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of disk reads per second during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 137, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of disk writes per second during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 138, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk Throughput Usage", + Summary: "Aggregated disk I/O rate, including the rates for all virtual machines running on the host during the collection interval", + }, + Key: "throughput.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 139, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk Throughput Contention", + Summary: "Average amount of time for an I/O operation to complete successfully", + }, + Key: "throughput.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 140, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk SCSI Reservation Conflicts", + Summary: "Number of SCSI reservation conflicts for the LUN during the collection interval", + }, + Key: "scsiReservationConflicts", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 141, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk SCSI Reservation Conflicts %", + Summary: "Number of SCSI reservation conflicts for the LUN as a percent of total commands during the collection interval", + }, + Key: "scsiReservationCnflctsPct", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 142, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 143, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 144, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 145, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Network utilization (combined transmit-rates and receive-rates) during the interval", + }, + Key: "usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 146, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packets received", + Summary: "Number of packets received during the interval", + }, + Key: "packetsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 147, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packets transmitted", + Summary: "Number of packets transmitted during the interval", + }, + Key: "packetsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 148, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data receive rate", + Summary: "Average rate at which data was received during the interval", + }, + Key: "received", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 149, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data transmit rate", + Summary: "Average rate at which data was transmitted during the interval", + }, + Key: "transmitted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 150, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Net Throughput Provisioned", + Summary: "The maximum network bandwidth for the host", + }, + Key: "throughput.provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 151, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Net Throughput Usable", + Summary: "The current available network bandwidth for the host", + }, + Key: "throughput.usable", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 152, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Net Throughput Usage", + Summary: "The current network bandwidth usage for the host", + }, + Key: "throughput.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 153, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Net Throughput Contention", + Summary: "The aggregate network dropped packets for the host", + }, + Key: "throughput.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 154, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Packets Received and Transmitted per Second", + Summary: "Average rate of packets received and transmitted per second", + }, + Key: "throughput.packetsPerSec", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 155, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Uptime", + Summary: "Total time elapsed, in seconds, since last system startup", + }, + Key: "uptime", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "s", + Summary: "Second", + }, + Key: "second", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 156, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heartbeat", + Summary: "Number of heartbeats issued per virtual machine during the interval", + }, + Key: "heartbeat", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 157, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Usage", + Summary: "Current power usage", + }, + Key: "power", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 158, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cap", + Summary: "Maximum allowed power usage", + }, + Key: "powerCap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 159, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Energy usage", + Summary: "Total energy used since last stats reset", + }, + Key: "energy", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "J", + Summary: "Joule", + }, + Key: "joule", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 160, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host Power Capacity Provisioned", + Summary: "Current power usage as a percentage of maximum allowed power.", + }, + Key: "capacity.usagePct", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 161, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of commands issued per second by the storage adapter during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 162, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second by the storage adapter during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 163, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second by the storage adapter during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 164, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data by the storage adapter", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 165, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data by the storage adapter", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 166, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read by the storage adapter takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 167, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write by the storage adapter takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 168, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all storage adapters used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 169, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Throughput Contention", + Summary: "Average amount of time for an I/O operation to complete successfully", + }, + Key: "throughput.cont", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 170, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Outstanding I/Os", + Summary: "The percent of I/Os that have been issued but have not yet completed", + }, + Key: "OIOsPct", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 171, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second to the virtual disk during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 172, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second to the virtual disk during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 173, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data from the virtual disk", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 174, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data to the virtual disk", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 175, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read from the virtual disk takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 176, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write to the virtual disk takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 177, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Disk Throughput Contention", + Summary: "Average amount of time for an I/O operation to complete successfully", + }, + Key: "throughput.cont", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 178, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second to the datastore during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 179, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second to the datastore during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 180, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data from the datastore", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 181, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data to the datastore", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 182, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read from the datastore takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 183, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write to the datastore takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 184, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all datastores used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 185, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control aggregated IOPS", + Summary: "Storage I/O Control aggregated IOPS", + }, + Key: "datastoreIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 186, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control normalized latency", + Summary: "Storage I/O Control size-normalized I/O latency", + }, + Key: "sizeNormalizedDatastoreLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 187, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "usage", + Summary: "usage", + }, + Key: "throughput.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 188, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "contention", + Summary: "contention", + }, + Key: "throughput.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 189, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "busResets", + Summary: "busResets", + }, + Key: "busResets", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 190, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "commandsAborted", + Summary: "commandsAborted", + }, + Key: "commandsAborted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 191, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control active time percentage", + Summary: "Percentage of time Storage I/O Control actively controlled datastore latency", + }, + Key: "siocActiveTimePercentage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 192, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Path Throughput Contention", + Summary: "Average amount of time for an I/O operation to complete successfully", + }, + Key: "throughput.cont", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 193, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Highest latency", + Summary: "Highest latency value across all storage paths used by the host", + }, + Key: "maxTotalLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 194, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Disk Throughput Usage", + Summary: "Virtual disk I/O rate", + }, + Key: "throughput.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 195, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Disk Number of Terminations", + Summary: "Number of terminations to a virtual disk", + }, + Key: "commandsAborted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 196, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Disk Number of Resets", + Summary: "Number of resets to a virtual disk", + }, + Key: "busResets", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 197, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Outstanding I/Os", + Summary: "The number of I/Os that have been issued but have not yet completed", + }, + Key: "outstandingIOs", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 198, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Number Queued", + Summary: "The current number of I/Os that are waiting to be issued", + }, + Key: "queued", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 199, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Queue Depth", + Summary: "The maximum number of I/Os that can be outstanding at a given time", + }, + Key: "queueDepth", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 200, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Queue Command Latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI command, during the collection interval", + }, + Key: "queueLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 201, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Adapter Throughput Usage", + Summary: "The storage adapter's I/O rate", + }, + Key: "throughput.usag", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage adapter", + Summary: "Storage adapter", + }, + Key: "storageAdapter", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 202, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Path Bus Resets", + Summary: "Number of SCSI-bus reset commands issued during the collection interval", + }, + Key: "busResets", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 203, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Path Command Terminations", + Summary: "Number of SCSI commands terminated during the collection interval", + }, + Key: "commandsAborted", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 204, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage Path Throughput Usage", + Summary: "Storage path I/O rate", + }, + Key: "throughput.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 205, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for VMs", + Summary: "Average pNic I/O rate for VMs", + }, + Key: "throughput.usage.vm", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 206, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for NFS", + Summary: "Average pNic I/O rate for NFS", + }, + Key: "throughput.usage.nfs", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 207, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for vMotion", + Summary: "Average pNic I/O rate for vMotion", + }, + Key: "throughput.usage.vmotion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 208, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for FT", + Summary: "Average pNic I/O rate for FT", + }, + Key: "throughput.usage.ft", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 209, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for iSCSI", + Summary: "Average pNic I/O rate for iSCSI", + }, + Key: "throughput.usage.iscsi", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 210, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pNic Throughput Usage for HBR", + Summary: "Average pNic I/O rate for HBR", + }, + Key: "throughput.usage.hbr", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 211, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host Power Capacity Usable", + Summary: "Current maximum allowed power usage.", + }, + Key: "capacity.usable", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 212, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host Power Capacity Usage", + Summary: "Current power usage", + }, + Key: "capacity.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Power", + Summary: "Power", + }, + Key: "power", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "W", + Summary: "Watt", + }, + Key: "watt", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 213, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Worst case allocation", + Summary: "Amount of CPU resources allocated to the virtual machine or resource pool, based on the total cluster capacity and the resource configuration of the resource hierarchy", + }, + Key: "cpuentitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 214, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Entitlement", + Summary: "Memory allocation as calculated by the VMkernel scheduler based on current estimated demand and reservation, limit, and shares policies set for all virtual machines and resource pools in the host or cluster", + }, + Key: "mementitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 215, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU fairness", + Summary: "Fairness of distributed CPU resource allocation", + }, + Key: "cpufairness", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cluster services", + Summary: "Cluster services", + }, + Key: "clusterServices", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 216, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory fairness", + Summary: "Aggregate available memory resources of all the hosts within a cluster", + }, + Key: "memfairness", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cluster services", + Summary: "Cluster services", + }, + Key: "clusterServices", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 217, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Packets Throughput Transmitted", + Summary: "The rate of transmitted packets for this VDS", + }, + Key: "throughput.pktsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 218, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Multicast Packets Throughput Transmitted", + Summary: "The rate of transmitted Multicast packets for this VDS", + }, + Key: "throughput.pktsTxMulticast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 219, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Broadcast Packets Throughput Transmitted", + Summary: "The rate of transmitted Broadcast packets for this VDS", + }, + Key: "throughput.pktsTxBroadcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 220, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Packets Throughput Received", + Summary: "The rate of received packets for this vDS", + }, + Key: "throughput.pktsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 221, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Multicast Packets Throughput Received", + Summary: "The rate of received Multicast packets for this VDS", + }, + Key: "throughput.pktsRxMulticast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 222, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Broadcast Packets Throughput Received", + Summary: "The rate of received Broadcast packets for this VDS", + }, + Key: "throughput.pktsRxBroadcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 223, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Dropped Transmitted Packets Throughput", + Summary: "Count of dropped transmitted packets for this VDS", + }, + Key: "throughput.droppedTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 224, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VDS Dropped Received Packets Throughput", + Summary: "Count of dropped received packets for this VDS", + }, + Key: "throughput.droppedRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 225, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Packets Throughput Transmitted", + Summary: "The rate of transmitted packets for this DVPort", + }, + Key: "throughput.vds.pktsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 226, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Multicast Packets Throughput Transmitted", + Summary: "The rate of transmitted multicast packets for this DVPort", + }, + Key: "throughput.vds.pktsTxMcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 227, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Broadcast Packets Throughput Transmitted", + Summary: "The rate of transmitted broadcast packets for this DVPort", + }, + Key: "throughput.vds.pktsTxBcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 228, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Packets Throughput Received", + Summary: "The rate of received packets for this DVPort", + }, + Key: "throughput.vds.pktsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 229, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Multicast Packets Throughput Received", + Summary: "The rate of received multicast packets for this DVPort", + }, + Key: "throughput.vds.pktsRxMcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 230, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort Broadcast Packets Throughput Received", + Summary: "The rate of received broadcast packets for this DVPort", + }, + Key: "throughput.vds.pktsRxBcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 231, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort dropped transmitted packets throughput", + Summary: "Count of dropped transmitted packets for this DVPort", + }, + Key: "throughput.vds.droppedTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 232, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "DVPort dropped received packets throughput", + Summary: "Count of dropped received packets for this DVPort", + }, + Key: "throughput.vds.droppedRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 233, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG Packets Throughput Transmitted", + Summary: "The rate of transmitted packets for this LAG", + }, + Key: "throughput.vds.lagTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 234, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG Multicast Packets Throughput Transmitted", + Summary: "The rate of transmitted Multicast packets for this LAG", + }, + Key: "throughput.vds.lagTxMcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 235, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG Broadcast Packets Throughput Transmitted", + Summary: "The rate of transmitted Broadcast packets for this LAG", + }, + Key: "throughput.vds.lagTxBcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 236, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG packets Throughput received", + Summary: "The rate of received packets for this LAG", + }, + Key: "throughput.vds.lagRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 237, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG multicast packets throughput received", + Summary: "The rate of received multicast packets for this LAG", + }, + Key: "throughput.vds.lagRxMcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 238, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG Broadcast packets Throughput received", + Summary: "The rate of received Broadcast packets for this LAG", + }, + Key: "throughput.vds.lagRxBcast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 239, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG dropped transmitted packets throughput", + Summary: "Count of dropped transmitted packets for this LAG", + }, + Key: "throughput.vds.lagDropTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 240, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "LAG dropped received packets throughput", + Summary: "Count of dropped received packets for this LAG", + }, + Key: "throughput.vds.lagDropRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 241, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network packets throughput transmitted", + Summary: "The rate of transmitted packets for this network", + }, + Key: "throughput.vds.txTotal", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 242, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network non-unicast packets throughput transmitted", + Summary: "The rate of transmitted non-unicast packets for this network", + }, + Key: "throughput.vds.txNoUnicast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 243, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network cross-router packets throughput transmitted", + Summary: "The rate of transmitted cross-router packets for this network", + }, + Key: "throughput.vds.txCrsRouter", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 244, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped transmitted packets throughput", + Summary: "Count of dropped transmitted packets for this network", + }, + Key: "throughput.vds.txDrop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 245, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network packets throughput received", + Summary: "The rate of received packets for this network", + }, + Key: "throughput.vds.rxTotal", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 246, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped received packets due to destination IP error throughput", + Summary: "Count of dropped received packets with destination IP error for this network", + }, + Key: "throughput.vds.rxDestErr", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 247, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped received packets throughput", + Summary: "Count of dropped received packets for this network", + }, + Key: "throughput.vds.rxDrop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 248, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to match mapping entry for a unicast MAC throughput", + Summary: "Count of transmitted packets that cannot find matched mapping entry for this network", + }, + Key: "throughput.vds.macFlood", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 249, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to allocate a new mapping entry during translation phase", + Summary: "Count of transmitted packets that failed to acquire new mapping entry during translation phase for this network", + }, + Key: "throughput.vds.macLKUPFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 250, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to allocate a new mapping entry during learning phase", + Summary: "Count of transmitted packets that failed to acquire new mapping entry during learning phase for this network", + }, + Key: "throughput.vds.macUPDTFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 251, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found Matched ARP Entry Throughput", + Summary: "Count of transmitted packets that found matched ARP entry for this network", + }, + Key: "throughput.vds.arpFound", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 252, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found Matched ARP Entry Marked as Unknown Throughput", + Summary: "Count of transmitted packets whose matched arp entry is marked as unknown for this network", + }, + Key: "throughput.vds.arpUnknown", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 253, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Failed to Allocate ARP Entry During Translation Phase Throughput", + Summary: "Count of transmitted packets that failed to acquire new ARP entry during translation phase for this network", + }, + Key: "throughput.vds.arpLKUPFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 254, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network found the same ARP requests have been sent into queue throughput", + Summary: "Count of transmitted packets whose ARP requests have already been sent into queue for this network", + }, + Key: "throughput.vds.arpWait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 255, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found ARP Queries Have Been Expired Throughput", + Summary: "Count of arp queries that have been expired for this network", + }, + Key: "throughput.vds.arpTimeout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 256, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM power on count", + Summary: "Number of virtual machine power on operations", + }, + Key: "numPoweron", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 257, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM power off count", + Summary: "Number of virtual machine power off operations", + }, + Key: "numPoweroff", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 258, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM suspend count", + Summary: "Number of virtual machine suspend operations", + }, + Key: "numSuspend", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 259, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM reset count", + Summary: "Number of virtual machine reset operations", + }, + Key: "numReset", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 260, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM guest reboot count", + Summary: "Number of virtual machine guest reboot operations", + }, + Key: "numRebootGuest", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 261, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM standby guest count", + Summary: "Number of virtual machine standby guest operations", + }, + Key: "numStandbyGuest", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 262, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM guest shutdown count", + Summary: "Number of virtual machine guest shutdown operations", + }, + Key: "numShutdownGuest", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 263, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM create count", + Summary: "Number of virtual machine create operations", + }, + Key: "numCreate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 264, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM delete count", + Summary: "Number of virtual machine delete operations", + }, + Key: "numDestroy", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 265, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM register count", + Summary: "Number of virtual machine register operations", + }, + Key: "numRegister", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 266, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM unregister count", + Summary: "Number of virtual machine unregister operations", + }, + Key: "numUnregister", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 267, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM reconfigure count", + Summary: "Number of virtual machine reconfigure operations", + }, + Key: "numReconfigure", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 268, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM clone count", + Summary: "Number of virtual machine clone operations", + }, + Key: "numClone", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 269, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM template deploy count", + Summary: "Number of virtual machine template deploy operations", + }, + Key: "numDeploy", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 270, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM host change count (non-powered-on VMs)", + Summary: "Number of host change operations for powered-off and suspended VMs", + }, + Key: "numChangeHost", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 271, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM datastore change count (non-powered-on VMs)", + Summary: "Number of datastore change operations for powered-off and suspended virtual machines", + }, + Key: "numChangeDS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 272, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM host and datastore change count (non-powered-on VMs)", + Summary: "Number of host and datastore change operations for powered-off and suspended virtual machines", + }, + Key: "numChangeHostDS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 273, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vMotion count", + Summary: "Number of migrations with vMotion (host change operations for powered-on VMs)", + }, + Key: "numVMotion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 274, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage vMotion count", + Summary: "Number of migrations with Storage vMotion (datastore change operations for powered-on VMs)", + }, + Key: "numSVMotion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 275, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VM host and datastore change count (powered-on VMs)", + Summary: "Number of host and datastore change operations for powered-on and suspended virtual machines", + }, + Key: "numXVMotion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual machine operations", + Summary: "Virtual machine operations", + }, + Key: "vmop", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 276, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Effective CPU resources", + Summary: "Total available CPU resources of all hosts within a cluster", + }, + Key: "effectivecpu", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cluster services", + Summary: "Cluster services", + }, + Key: "clusterServices", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 277, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Effective memory resources", + Summary: "Total amount of machine memory of all hosts in the cluster that is available for use for virtual machine memory and overhead memory", + }, + Key: "effectivemem", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cluster services", + Summary: "Cluster services", + }, + Key: "clusterServices", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 278, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total", + Summary: "Total amount of CPU resources of all hosts in the cluster", + }, + Key: "totalmhz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 279, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total", + Summary: "Total amount of host physical memory of all hosts in the cluster that is available for virtual machine memory (physical memory for use by the guest OS) and virtual machine overhead memory", + }, + Key: "totalmb", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 280, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Current failover level", + Summary: "vSphere HA number of failures that can be tolerated", + }, + Key: "failover", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cluster services", + Summary: "Cluster services", + }, + Key: "clusterServices", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 281, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Space actually used", + Summary: "Amount of space actually used by the virtual machine or the datastore", + }, + Key: "used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 282, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Space potentially used", + Summary: "Amount of storage set aside for use by a datastore or a virtual machine", + }, + Key: "provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 283, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Capacity", + Summary: "Configured size of the datastore", + }, + Key: "capacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 284, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Space not shared", + Summary: "Amount of space associated exclusively with a virtual machine", + }, + Key: "unshared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 285, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead due to delta disk backings", + Summary: "Storage overhead of a virtual machine or a datastore due to delta disk backings", + }, + Key: "deltaused", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 286, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "provisioned", + Summary: "provisioned", + }, + Key: "capacity.provisioned", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 287, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "usage", + Summary: "usage", + }, + Key: "capacity.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 288, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "contention", + Summary: "contention", + }, + Key: "capacity.contention", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 289, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation latency", + Summary: "The latency of an activation operation in vCenter Server", + }, + Key: "activationlatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 290, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation latency", + Summary: "The latency of an activation operation in vCenter Server", + }, + Key: "activationlatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 291, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation latency", + Summary: "The latency of an activation operation in vCenter Server", + }, + Key: "activationlatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 292, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation count", + Summary: "Activation operations in vCenter Server", + }, + Key: "activationstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 293, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation count", + Summary: "Activation operations in vCenter Server", + }, + Key: "activationstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 294, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Activation count", + Summary: "Activation operations in vCenter Server", + }, + Key: "activationstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 295, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "buffersz", + Summary: "buffersz", + }, + Key: "buffersz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 296, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "cachesz", + Summary: "cachesz", + }, + Key: "cachesz", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 297, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Context switch rate", + Summary: "Number of context switches per second on the system where vCenter Server is running", + }, + Key: "ctxswitchesrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 298, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "diskreadsectorrate", + Summary: "diskreadsectorrate", + }, + Key: "diskreadsectorrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 299, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk read rate", + Summary: "Number of disk reads per second on the system where vCenter Server is running", + }, + Key: "diskreadsrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 300, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "diskwritesectorrate", + Summary: "diskwritesectorrate", + }, + Key: "diskwritesectorrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 301, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk write rate", + Summary: "Number of disk writes per second on the system where vCenter Server is running", + }, + Key: "diskwritesrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 302, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync latency", + Summary: "The latency of a host sync operation in vCenter Server", + }, + Key: "hostsynclatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 303, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync latency", + Summary: "The latency of a host sync operation in vCenter Server", + }, + Key: "hostsynclatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 304, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync latency", + Summary: "The latency of a host sync operation in vCenter Server", + }, + Key: "hostsynclatencystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 305, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync count", + Summary: "The number of host sync operations in vCenter Server", + }, + Key: "hostsyncstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 306, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync count", + Summary: "The number of host sync operations in vCenter Server", + }, + Key: "hostsyncstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 307, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host sync count", + Summary: "The number of host sync operations in vCenter Server", + }, + Key: "hostsyncstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 308, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Inventory statistics", + Summary: "vCenter Server inventory statistics", + }, + Key: "inventorystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 309, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Inventory statistics", + Summary: "vCenter Server inventory statistics", + }, + Key: "inventorystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 310, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Inventory statistics", + Summary: "vCenter Server inventory statistics", + }, + Key: "inventorystats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 311, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Locking statistics", + Summary: "vCenter Server locking statistics", + }, + Key: "lockstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 312, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Locking statistics", + Summary: "vCenter Server locking statistics", + }, + Key: "lockstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 313, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Locking statistics", + Summary: "vCenter Server locking statistics", + }, + Key: "lockstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 314, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server LRO statistics", + Summary: "vCenter Server LRO statistics", + }, + Key: "lrostats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 315, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server LRO statistics", + Summary: "vCenter Server LRO statistics", + }, + Key: "lrostats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 316, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server LRO statistics", + Summary: "vCenter Server LRO statistics", + }, + Key: "lrostats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 317, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Miscellaneous", + Summary: "Miscellaneous statistics", + }, + Key: "miscstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 318, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Miscellaneous", + Summary: "Miscellaneous statistics", + }, + Key: "miscstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 319, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Miscellaneous", + Summary: "Miscellaneous statistics", + }, + Key: "miscstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 320, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Managed object reference statistics", + Summary: "Managed object reference counts in vCenter Server", + }, + Key: "morefregstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 321, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Managed object reference statistics", + Summary: "Managed object reference counts in vCenter Server", + }, + Key: "morefregstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 322, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Managed object reference statistics", + Summary: "Managed object reference counts in vCenter Server", + }, + Key: "morefregstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 323, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Received packet rate", + Summary: "Rate of the number of total packets received per second on the system where vCenter Server is running", + }, + Key: "packetrecvrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 324, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Sent packet rate", + Summary: "Number of total packets sent per second on the system where vCenter Server is running", + }, + Key: "packetsentrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 325, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU system", + Summary: "Total system CPU used on the system where vCenter Server in running", + }, + Key: "systemcpuusage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 326, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Page fault rate", + Summary: "Number of page faults per second on the system where vCenter Server is running", + }, + Key: "pagefaultrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 327, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical memory", + Summary: "Physical memory used by vCenter", + }, + Key: "physicalmemusage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 328, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU privileged", + Summary: "CPU used by vCenter Server in privileged mode", + }, + Key: "priviledgedcpuusage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 329, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Scoreboard statistics", + Summary: "Object counts in vCenter Server", + }, + Key: "scoreboard", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 330, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Scoreboard statistics", + Summary: "Object counts in vCenter Server", + }, + Key: "scoreboard", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 331, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Scoreboard statistics", + Summary: "Object counts in vCenter Server", + }, + Key: "scoreboard", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 332, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Session statistics", + Summary: "The statistics of client sessions connected to vCenter Server", + }, + Key: "sessionstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 333, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Session statistics", + Summary: "The statistics of client sessions connected to vCenter Server", + }, + Key: "sessionstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 334, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Session statistics", + Summary: "The statistics of client sessions connected to vCenter Server", + }, + Key: "sessionstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 335, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System call rate", + Summary: "Number of systems calls made per second on the system where vCenter Server is running", + }, + Key: "syscallsrate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 336, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System statistics", + Summary: "The statistics of vCenter Server as a running system such as thread statistics and heap statistics", + }, + Key: "systemstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 337, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System statistics", + Summary: "The statistics of vCenter Server as a running system such as thread statistics and heap statistics", + }, + Key: "systemstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 338, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System statistics", + Summary: "The statistics of vCenter Server as a running system such as thread statistics and heap statistics", + }, + Key: "systemstats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 339, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU user", + Summary: "CPU used by vCenter Server in user mode", + }, + Key: "usercpuusage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 340, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server service statistics", + Summary: "vCenter service statistics such as events, alarms, and tasks", + }, + Key: "vcservicestats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 341, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server service statistics", + Summary: "vCenter service statistics such as events, alarms, and tasks", + }, + Key: "vcservicestats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 342, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter Server service statistics", + Summary: "vCenter service statistics such as events, alarms, and tasks", + }, + Key: "vcservicestats", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter debugging information", + Summary: "vCenter debugging information", + }, + Key: "vcDebugInfo", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 343, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual memory", + Summary: "Virtual memory used by vCenter Server", + }, + Key: "virtualmemusage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vCenter resource usage information", + Summary: "vCenter resource usage information", + }, + Key: "vcResources", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 1, + AssociatedCounterId: nil, + }, + { + Key: 344, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average number of outstanding read requests", + Summary: "Average number of outstanding read requests to the virtual disk during the collection interval", + }, + Key: "readOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 345, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average number of outstanding write requests", + Summary: "Average number of outstanding write requests to the virtual disk during the collection interval", + }, + Key: "writeOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 346, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read workload metric", + Summary: "Storage DRS virtual disk metric for the read workload model", + }, + Key: "readLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 347, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write workload metric", + Summary: "Storage DRS virtual disk metric for the write workload model", + }, + Key: "writeLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 348, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (1 min average)", + Summary: "CPU active average over 1 minute", + }, + Key: "actav1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 349, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore bytes read", + Summary: "Storage DRS datastore bytes read", + }, + Key: "datastoreReadBytes", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 350, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore bytes written", + Summary: "Storage DRS datastore bytes written", + }, + Key: "datastoreWriteBytes", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 351, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore read I/O rate", + Summary: "Storage DRS datastore read I/O rate", + }, + Key: "datastoreReadIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 352, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore write I/O rate", + Summary: "Storage DRS datastore write I/O rate", + }, + Key: "datastoreWriteIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 353, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore outstanding read requests", + Summary: "Storage DRS datastore outstanding read requests", + }, + Key: "datastoreReadOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 354, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore outstanding write requests", + Summary: "Storage DRS datastore outstanding write requests", + }, + Key: "datastoreWriteOIO", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 355, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore normalized read latency", + Summary: "Storage DRS datastore normalized read latency", + }, + Key: "datastoreNormalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 356, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore normalized write latency", + Summary: "Storage DRS datastore normalized write latency", + }, + Key: "datastoreNormalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 2, + AssociatedCounterId: nil, + }, + { + Key: 357, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore read workload metric", + Summary: "Storage DRS datastore metric for read workload model", + }, + Key: "datastoreReadLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 358, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage DRS datastore write workload metric", + Summary: "Storage DRS datastore metric for write workload model", + }, + Key: "datastoreWriteLoadMetric", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 359, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore latency observed by VMs", + Summary: "The average datastore latency as seen by virtual machines", + }, + Key: "datastoreVMObservedLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 360, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network packets throughput transmitted", + Summary: "The rate of transmitted packets for this network", + }, + Key: "throughput.vds.txTotal", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 361, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network non-unicast packets throughput transmitted", + Summary: "The rate of transmitted non-unicast packets for this network", + }, + Key: "throughput.vds.txNoUnicast", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 362, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network cross-router packets throughput transmitted", + Summary: "The rate of transmitted cross-router packets for this network", + }, + Key: "throughput.vds.txCrsRouter", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 363, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped transmitted packets throughput", + Summary: "Count of dropped transmitted packets for this network", + }, + Key: "throughput.vds.txDrop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 364, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network packets throughput received", + Summary: "The rate of received packets for this network", + }, + Key: "throughput.vds.rxTotal", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 365, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped received packets due to destination IP error throughput", + Summary: "Count of dropped received packets with destination IP error for this network", + }, + Key: "throughput.vds.rxDestErr", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 366, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network dropped received packets throughput", + Summary: "Count of dropped received packets for this network", + }, + Key: "throughput.vds.rxDrop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 367, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to match mapping entry for a unicast MAC throughput", + Summary: "Count of transmitted packets that cannot find matched mapping entry for this network", + }, + Key: "throughput.vds.macFlood", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 368, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to allocate a new mapping entry during translation phase", + Summary: "Count of transmitted packets that failed to acquire new mapping entry during translation phase for this network", + }, + Key: "throughput.vds.macLKUPFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 369, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network failed to allocate a new mapping entry during learning phase", + Summary: "Count of transmitted packets that failed to acquire new mapping entry during learning phase for this network", + }, + Key: "throughput.vds.macUPDTFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 370, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found Matched ARP Entry Throughput", + Summary: "Count of transmitted packets that found matched ARP entry for this network", + }, + Key: "throughput.vds.arpFound", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 371, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found Matched ARP Entry Marked as Unknown Throughput", + Summary: "Count of transmitted packets whose matched arp entry is marked as unknown for this network", + }, + Key: "throughput.vds.arpUnknown", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 372, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Failed to Allocate ARP Entry During Translation Phase Throughput", + Summary: "Count of transmitted packets that failed to acquire new ARP entry during translation phase for this network", + }, + Key: "throughput.vds.arpLKUPFull", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 373, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN network found the same ARP requests have been sent into queue throughput", + Summary: "Count of transmitted packets whose ARP requests have already been sent into queue for this network", + }, + Key: "throughput.vds.arpWait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 374, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VXLAN Network Found ARP Queries Have Been Expired Throughput", + Summary: "Count of arp queries that have been expired for this network", + }, + Key: "throughput.vds.arpTimeout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 386, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap wait", + Summary: "CPU time spent waiting for swap-in", + }, + Key: "swapwait", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 387, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 388, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 389, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 390, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading)", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 391, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 392, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 393, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 394, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Core Utilization", + Summary: "CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage during the interval (A core is utilized if either or both of its logical CPUs are utilized)", + }, + Key: "coreUtilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 395, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total capacity", + Summary: "Total CPU capacity reserved by and available for virtual machines", + }, + Key: "totalCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 396, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Latency", + Summary: "Percent of time the virtual machine is unable to run because it is contending for access to the physical CPU(s)", + }, + Key: "latency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 397, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Entitlement", + Summary: "CPU resources devoted by the ESX scheduler", + }, + Key: "entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 398, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Demand", + Summary: "The amount of CPU resources a virtual machine would use if there were no CPU contention or CPU limit", + }, + Key: "demand", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 399, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Co-stop", + Summary: "Time the virtual machine is ready to run, but is unable to run due to co-scheduling constraints", + }, + Key: "costop", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 400, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max limited", + Summary: "Time the virtual machine is ready to run, but is not run due to maxing out its CPU limit setting", + }, + Key: "maxlimited", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 401, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overlap", + Summary: "Time the virtual machine was interrupted to perform system services on behalf of itself or other virtual machines", + }, + Key: "overlap", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 402, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Run", + Summary: "Time the virtual machine is scheduled to run", + }, + Key: "run", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 403, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Demand-to-entitlement ratio", + Summary: "CPU resource entitlement to CPU demand ratio (in percents)", + }, + Key: "demandEntitlementRatio", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 404, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Readiness", + Summary: "Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU", + }, + Key: "readiness", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU", + Summary: "CPU", + }, + Key: "cpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 405, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 406, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 407, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 408, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap in", + Summary: "Amount of guest physical memory that is swapped in from the swap space since the virtual machine has been powered on. This value is less than or equal to the 'Swap out' counter", + }, + Key: "swapin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 409, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 410, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 411, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 412, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Swap out", + Summary: "Amount of guest physical memory that is swapped out from the virtual machine to its swap space since it has been powered on.", + }, + Key: "swapout", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 413, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 414, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 415, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 416, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMkernel consumed", + Summary: "Amount of host physical memory consumed by VMkernel", + }, + Key: "sysUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 417, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active write", + Summary: "Amount of guest physical memory that is being actively written by guest. Activeness is estimated by ESXi", + }, + Key: "activewrite", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 418, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead reserved", + Summary: "Host physical memory reserved by ESXi, for its data structures, for running the virtual machine", + }, + Key: "overheadMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 419, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Total reservation", + Summary: "Total reservation, available and consumed, for powered-on virtual machines", + }, + Key: "totalCapacity", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 420, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compressed", + Summary: "Amount of guest physical memory pages compressed by ESXi", + }, + Key: "zipped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 421, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Compression saved", + Summary: "Host physical memory, reclaimed from a virtual machine, by memory compression. This value is less than the value of 'Compressed' memory", + }, + Key: "zipSaved", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 422, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Page-fault latency", + Summary: "Percentage of time the virtual machine spent waiting to swap in or decompress guest physical memory", + }, + Key: "latency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 423, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Entitlement", + Summary: "Amount of host physical memory the virtual machine deserves, as determined by ESXi", + }, + Key: "entitlement", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 424, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Reclamation threshold", + Summary: "Threshold of free host physical memory below which ESXi will begin actively reclaiming memory from virtual machines by swapping, compression and ballooning", + }, + Key: "lowfreethreshold", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 425, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 426, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in rate", + Summary: "Rate at which guest physical memory is swapped in from the host swap cache", + }, + Key: "llSwapInRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 427, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out rate", + Summary: "Rate at which guest physical memory is swapped out to the host swap cache", + }, + Key: "llSwapOutRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 428, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Overhead active", + Summary: "Estimate of the host physical memory, from Overhead consumed, that is actively read or written to by ESXi", + }, + Key: "overheadTouched", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 429, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 430, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 431, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache consumed", + Summary: "Storage space consumed on the host swap cache for storing swapped guest physical memory pages", + }, + Key: "llSwapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 432, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 433, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 434, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 435, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap in", + Summary: "Amount of guest physical memory swapped in from host cache", + }, + Key: "llSwapIn", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 436, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 437, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 438, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 439, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Host cache swap out", + Summary: "Amount of guest physical memory swapped out to the host swap cache", + }, + Key: "llSwapOut", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 440, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Size", + Summary: "Space used for holding VMFS Pointer Blocks in memory", + }, + Key: "vmfs.pbc.size", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 441, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum VMFS PB Cache Size", + Summary: "Maximum size the VMFS Pointer Block Cache can grow to", + }, + Key: "vmfs.pbc.sizeMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 442, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS Working Set", + Summary: "Amount of file blocks whose addresses are cached in the VMFS PB Cache", + }, + Key: "vmfs.pbc.workingSet", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "TB", + Summary: "Terabyte", + }, + Key: "teraBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 443, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum VMFS Working Set", + Summary: "Maximum amount of file blocks whose addresses are cached in the VMFS PB Cache", + }, + Key: "vmfs.pbc.workingSetMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "TB", + Summary: "Terabyte", + }, + Key: "teraBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 444, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Overhead", + Summary: "Amount of VMFS heap used by the VMFS PB Cache", + }, + Key: "vmfs.pbc.overhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 445, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VMFS PB Cache Capacity Miss Ratio", + Summary: "Trailing average of the ratio of capacity misses to compulsory misses for the VMFS PB Cache", + }, + Key: "vmfs.pbc.capMissRatio", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory", + Summary: "Memory", + }, + Key: "mem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 446, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Commands issued", + Summary: "Number of SCSI commands issued during the collection interval", + }, + Key: "commands", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 447, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device read latency", + Summary: "Average amount of time, in milliseconds, to read from the physical device", + }, + Key: "deviceReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 448, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel read latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI read command", + }, + Key: "kernelReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 449, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI read command issued from the guest OS to the virtual machine", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 450, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue read latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI read command, during the collection interval", + }, + Key: "queueReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 451, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device write latency", + Summary: "Average amount of time, in milliseconds, to write to the physical device", + }, + Key: "deviceWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 452, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel write latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI write command", + }, + Key: "kernelWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 453, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "Average amount of time taken during the collection interval to process a SCSI write command issued by the guest OS to the virtual machine", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 454, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue write latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI write command, during the collection interval", + }, + Key: "queueWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 455, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Physical device command latency", + Summary: "Average amount of time, in milliseconds, to complete a SCSI command from the physical device", + }, + Key: "deviceLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 456, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Kernel command latency", + Summary: "Average amount of time, in milliseconds, spent by VMkernel to process each SCSI command", + }, + Key: "kernelLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 457, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Queue command latency", + Summary: "Average amount of time spent in the VMkernel queue, per SCSI command, during the collection interval", + }, + Key: "queueLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 458, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Maximum queue depth", + Summary: "Maximum queue depth", + }, + Key: "maxQueueDepth", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 459, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of SCSI commands issued per second during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk", + Summary: "Disk", + }, + Key: "disk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 460, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Receive packets dropped", + Summary: "Number of receives dropped", + }, + Key: "droppedRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 461, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Transmit packets dropped", + Summary: "Number of transmits dropped", + }, + Key: "droppedTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 462, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data receive rate", + Summary: "Average amount of data received per second", + }, + Key: "bytesRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 463, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Data transmit rate", + Summary: "Average amount of data transmitted per second", + }, + Key: "bytesTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 464, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Broadcast receives", + Summary: "Number of broadcast packets received during the sampling interval", + }, + Key: "broadcastRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 465, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Broadcast transmits", + Summary: "Number of broadcast packets transmitted during the sampling interval", + }, + Key: "broadcastTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 466, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Multicast receives", + Summary: "Number of multicast packets received during the sampling interval", + }, + Key: "multicastRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 467, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Multicast transmits", + Summary: "Number of multicast packets transmitted during the sampling interval", + }, + Key: "multicastTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 468, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packet receive errors", + Summary: "Number of packets with errors received during the sampling interval", + }, + Key: "errorsRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 469, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Packet transmit errors", + Summary: "Number of packets with errors transmitted during the sampling interval", + }, + Key: "errorsTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 470, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Unknown protocol frames", + Summary: "Number of frames with unknown protocol received during the sampling interval", + }, + Key: "unknownProtos", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "summation", + StatsType: "delta", + Level: 2, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 471, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pnicBytesRx", + Summary: "pnicBytesRx", + }, + Key: "pnicBytesRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 472, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "pnicBytesTx", + Summary: "pnicBytesTx", + }, + Key: "pnicBytesTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Network", + Summary: "Network", + }, + Key: "net", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 473, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Heartbeat", + Summary: "Number of heartbeats issued per virtual machine during the interval", + }, + Key: "heartbeat", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 474, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Disk usage", + Summary: "Amount of disk space usage for each mount point", + }, + Key: "diskUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 475, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (None)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "none", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 476, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Average)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 477, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Maximum)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "maximum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 478, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU usage (Minimum)", + Summary: "Amount of CPU used by the Service Console and other applications during the interval", + }, + Key: "resourceCpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "minimum", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 479, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory touched", + Summary: "Memory touched by the system resource group", + }, + Key: "resourceMemTouched", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 480, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory mapped", + Summary: "Memory mapped by the system resource group", + }, + Key: "resourceMemMapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 481, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory share saved", + Summary: "Memory saved due to sharing by the system resource group", + }, + Key: "resourceMemShared", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 482, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory swapped", + Summary: "Memory swapped out by the system resource group", + }, + Key: "resourceMemSwapped", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 483, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory overhead", + Summary: "Overhead memory consumed by the system resource group", + }, + Key: "resourceMemOverhead", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 484, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory shared", + Summary: "Memory shared by the system resource group", + }, + Key: "resourceMemCow", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 485, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory zero", + Summary: "Zero filled memory used by the system resource group", + }, + Key: "resourceMemZero", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 486, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU running (1 min. average)", + Summary: "CPU running average over 1 minute of the system resource group", + }, + Key: "resourceCpuRun1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 487, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU active (1 min average)", + Summary: "CPU active average over 1 minute of the system resource group", + }, + Key: "resourceCpuAct1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 488, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU maximum limited (1 min)", + Summary: "CPU maximum limited over 1 minute of the system resource group", + }, + Key: "resourceCpuMaxLimited1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 489, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU running (5 min average)", + Summary: "CPU running average over 5 minutes of the system resource group", + }, + Key: "resourceCpuRun5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 490, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU active (5 min average)", + Summary: "CPU active average over 5 minutes of the system resource group", + }, + Key: "resourceCpuAct5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 491, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU maximum limited (5 min)", + Summary: "CPU maximum limited over 5 minutes of the system resource group", + }, + Key: "resourceCpuMaxLimited5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 492, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation minimum (in MHz)", + Summary: "CPU allocation reservation (in MHz) of the system resource group", + }, + Key: "resourceCpuAllocMin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 493, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation maximum (in MHz)", + Summary: "CPU allocation limit (in MHz) of the system resource group", + }, + Key: "resourceCpuAllocMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 494, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource CPU allocation shares", + Summary: "CPU allocation shares of the system resource group", + }, + Key: "resourceCpuAllocShares", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 495, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation minimum (in KB)", + Summary: "Memory allocation reservation (in KB) of the system resource group", + }, + Key: "resourceMemAllocMin", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 496, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation maximum (in KB)", + Summary: "Memory allocation limit (in KB) of the system resource group", + }, + Key: "resourceMemAllocMax", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 497, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory allocation shares", + Summary: "Memory allocation shares of the system resource group", + }, + Key: "resourceMemAllocShares", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 498, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "OS Uptime", + Summary: "Total time elapsed, in seconds, since last operating system boot-up", + }, + Key: "osUptime", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "s", + Summary: "Second", + }, + Key: "second", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 499, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource memory consumed", + Summary: "Memory consumed by the system resource group", + }, + Key: "resourceMemConsumed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 500, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "File descriptors used", + Summary: "Number of file descriptors used by the system resource group", + }, + Key: "resourceFdUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "System", + Summary: "System", + }, + Key: "sys", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 501, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (1 min peak)", + Summary: "CPU active peak over 1 minute", + }, + Key: "actpk1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 502, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (1 min average)", + Summary: "CPU running average over 1 minute", + }, + Key: "runav1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 503, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (5 min average)", + Summary: "CPU active average over 5 minutes", + }, + Key: "actav5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 504, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (5 min peak)", + Summary: "CPU active peak over 5 minutes", + }, + Key: "actpk5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 505, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (5 min average)", + Summary: "CPU running average over 5 minutes", + }, + Key: "runav5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 506, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (15 min average)", + Summary: "CPU active average over 15 minutes", + }, + Key: "actav15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 507, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Active (15 min peak)", + Summary: "CPU active peak over 15 minutes", + }, + Key: "actpk15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 508, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (15 min average)", + Summary: "CPU running average over 15 minutes", + }, + Key: "runav15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 509, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (1 min peak)", + Summary: "CPU running peak over 1 minute", + }, + Key: "runpk1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 510, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (1 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 1 minute", + }, + Key: "maxLimited1", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 511, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (5 min peak)", + Summary: "CPU running peak over 5 minutes", + }, + Key: "runpk5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 512, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (5 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 5 minutes", + }, + Key: "maxLimited5", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 513, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Running (15 min peak)", + Summary: "CPU running peak over 15 minutes", + }, + Key: "runpk15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 514, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Throttled (15 min average)", + Summary: "Amount of CPU resources over the limit that were refused, average over 15 minutes", + }, + Key: "maxLimited15", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 515, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Group CPU sample count", + Summary: "Group CPU sample count", + }, + Key: "sampleCount", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 516, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Group CPU sample period", + Summary: "Group CPU sample period", + }, + Key: "samplePeriod", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Resource group CPU", + Summary: "Resource group CPU", + }, + Key: "rescpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 517, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "Amount of total configured memory that is available for use", + }, + Key: "memUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 518, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory swap used", + Summary: "Sum of the memory swapped by all powered-on virtual machines on the host", + }, + Key: "swapUsed", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 519, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "CPU usage", + Summary: "Amount of Service Console CPU usage", + }, + Key: "cpuUsage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Management agent", + Summary: "Management agent", + }, + Key: "managementAgent", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MHz", + Summary: "Megahertz", + }, + Key: "megaHertz", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 520, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average commands issued per second", + Summary: "Average number of commands issued per second on the storage path during the collection interval", + }, + Key: "commandsAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 521, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read requests per second", + Summary: "Average number of read commands issued per second on the storage path during the collection interval", + }, + Key: "numberReadAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 522, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write requests per second", + Summary: "Average number of write commands issued per second on the storage path during the collection interval", + }, + Key: "numberWriteAveraged", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 523, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read rate", + Summary: "Rate of reading data on the storage path", + }, + Key: "read", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 524, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write rate", + Summary: "Rate of writing data on the storage path", + }, + Key: "write", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 525, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read latency", + Summary: "The average time a read issued on the storage path takes", + }, + Key: "totalReadLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 526, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write latency", + Summary: "The average time a write issued on the storage path takes", + }, + Key: "totalWriteLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage path", + Summary: "Storage path", + }, + Key: "storagePath", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 3, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 527, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read request size", + Summary: "Average read request size in bytes", + }, + Key: "readIOSize", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 528, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write request size", + Summary: "Average write request size in bytes", + }, + Key: "writeIOSize", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 529, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of small seeks", + Summary: "Number of seeks during the interval that were less than 64 LBNs apart", + }, + Key: "smallSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 530, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of medium seeks", + Summary: "Number of seeks during the interval that were between 64 and 8192 LBNs apart", + }, + Key: "mediumSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 531, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of large seeks", + Summary: "Number of seeks during the interval that were greater than 8192 LBNs apart", + }, + Key: "largeSeeks", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 532, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read Latency (us)", + Summary: "Read latency in microseconds", + }, + Key: "readLatencyUS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 533, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write Latency (us)", + Summary: "Write latency in microseconds", + }, + Key: "writeLatencyUS", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 534, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache I/Os per second for the virtual disk", + Summary: "The average virtual Flash Read Cache I/Os per second value for the virtual disk", + }, + Key: "vFlashCacheIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 535, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache latency for the virtual disk", + Summary: "The average virtual Flash Read Cache latency value for the virtual disk", + }, + Key: "vFlashCacheLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "µs", + Summary: "Microsecond", + }, + Key: "microsecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 536, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual Flash Read Cache throughput for virtual disk", + Summary: "The average virtual Flash Read Cache throughput value for the virtual disk", + }, + Key: "vFlashCacheThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual disk", + Summary: "Virtual disk", + }, + Key: "virtualDisk", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 537, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Storage I/O Control datastore maximum queue depth", + Summary: "Storage I/O Control datastore maximum queue depth", + }, + Key: "datastoreMaxQueueDepth", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Datastore", + Summary: "Datastore", + }, + Key: "datastore", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 1, + PerDeviceLevel: 3, + AssociatedCounterId: nil, + }, + { + Key: 538, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication VM Count", + Summary: "Current number of replicated virtual machines", + }, + Key: "hbrNumVms", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 539, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Replication Data Receive Rate", + Summary: "Average amount of data received per second", + }, + Key: "hbrNetRx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 540, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Replication Data Transmit Rate", + Summary: "Average amount of data transmitted per second", + }, + Key: "hbrNetTx", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Replication", + Summary: "vSphere Replication", + }, + Key: "hbr", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 541, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Number of caches controlled by the virtual flash module", + Summary: "Number of caches controlled by the virtual flash module", + }, + Key: "numActiveVMDKs", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Virtual flash", + Summary: "Virtual flash module related statistical values", + }, + Key: "vflashModule", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 542, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read IOPS", + Summary: "Read IOPS", + }, + Key: "readIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 543, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read throughput", + Summary: "Read throughput in kBps", + }, + Key: "readThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 544, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average read latency", + Summary: "Average read latency in ms", + }, + Key: "readAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 545, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max read latency", + Summary: "Max read latency in ms", + }, + Key: "readMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 546, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Cache hit rate", + Summary: "Cache hit rate percentage", + }, + Key: "readCacheHitRate", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 547, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Read congestion per sampling interval", + Summary: "Read congestion", + }, + Key: "readCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 548, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write IOPS", + Summary: "Write IOPS", + }, + Key: "writeIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 549, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write throughput", + Summary: "Write throughput in kBps", + }, + Key: "writeThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 550, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average write latency", + Summary: "Average write latency in ms", + }, + Key: "writeAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 551, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max write latency", + Summary: "Max write latency in ms", + }, + Key: "writeMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 552, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Write congestion per sampling interval", + Summary: "Write congestion", + }, + Key: "writeCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 553, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write IOPS", + Summary: "Recovery write IOPS", + }, + Key: "recoveryWriteIops", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 554, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write through-put", + Summary: "Recovery write through-put in kBps", + }, + Key: "recoveryWriteThroughput", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KBps", + Summary: "Kilobytes per second", + }, + Key: "kiloBytesPerSecond", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 555, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Average recovery write latency", + Summary: "Average recovery write latency in ms", + }, + Key: "recoveryWriteAvgLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 556, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Max recovery write latency", + Summary: "Max recovery write latency in ms", + }, + Key: "recoveryWriteMaxLatency", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "ms", + Summary: "Millisecond", + }, + Key: "millisecond", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 557, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Recovery write congestion per sampling interval", + Summary: "Recovery write congestion", + }, + Key: "recoveryWriteCongestion", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "VSAN DOM Objects", + Summary: "VSAN DOM object related statistical values", + }, + Key: "vsanDomObj", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "num", + Summary: "Number", + }, + Key: "number", + }, + RollupType: "average", + StatsType: "rate", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 558, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 559, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 560, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 561, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Utilization", + Summary: "The utilization of a GPU in percentages", + }, + Key: "utilization", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 562, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 563, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 564, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 565, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory used", + Summary: "The amount of GPU memory used in kilobytes", + }, + Key: "mem.used", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "KB", + Summary: "Kilobyte", + }, + Key: "kiloBytes", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 566, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "none", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 567, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 568, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "maximum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 569, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Memory usage", + Summary: "The amount of GPU memory used in percentages of the total available", + }, + Key: "mem.usage", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "%", + Summary: "Percentage", + }, + Key: "percent", + }, + RollupType: "minimum", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 570, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Temperature", + Summary: "The temperature of a GPU in degrees celsius", + }, + Key: "temperature", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "GPU", + Summary: "GPU", + }, + Key: "gpu", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "℃", + Summary: "Temperature in degrees Celsius", + }, + Key: "celsius", + }, + RollupType: "average", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, + { + Key: 571, + NameInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "Persistent memory available reservation", + Summary: "Persistent memory available reservation on a host.", + }, + Key: "available.reservation", + }, + GroupInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "PMEM", + Summary: "PMEM", + }, + Key: "pmem", + }, + UnitInfo: &types.ElementDescription{ + Description: types.Description{ + Label: "MB", + Summary: "Megabyte", + }, + Key: "megaBytes", + }, + RollupType: "latest", + StatsType: "absolute", + Level: 4, + PerDeviceLevel: 4, + AssociatedCounterId: nil, + }, +} + +var VmMetrics = []types.PerfMetricId{ + { + CounterId: 12, + Instance: "$cpu", + }, + { + CounterId: 401, + Instance: "$cpu", + }, + { + CounterId: 2, + Instance: "", + }, + { + CounterId: 14, + Instance: "", + }, + { + CounterId: 10, + Instance: "", + }, + { + CounterId: 401, + Instance: "", + }, + { + CounterId: 402, + Instance: "$cpu", + }, + { + CounterId: 396, + Instance: "", + }, + { + CounterId: 13, + Instance: "", + }, + { + CounterId: 11, + Instance: "$cpu", + }, + { + CounterId: 386, + Instance: "$cpu", + }, + { + CounterId: 399, + Instance: "$cpu", + }, + { + CounterId: 397, + Instance: "", + }, + { + CounterId: 6, + Instance: "$cpu", + }, + { + CounterId: 404, + Instance: "$cpu", + }, + { + CounterId: 386, + Instance: "", + }, + { + CounterId: 14, + Instance: "$cpu", + }, + { + CounterId: 11, + Instance: "", + }, + { + CounterId: 400, + Instance: "$cpu", + }, + { + CounterId: 6, + Instance: "", + }, + { + CounterId: 399, + Instance: "", + }, + { + CounterId: 403, + Instance: "", + }, + { + CounterId: 404, + Instance: "", + }, + { + CounterId: 398, + Instance: "", + }, + { + CounterId: 13, + Instance: "$cpu", + }, + { + CounterId: 400, + Instance: "", + }, + { + CounterId: 402, + Instance: "", + }, + { + CounterId: 12, + Instance: "", + }, + { + CounterId: 184, + Instance: "", + }, + { + CounterId: 180, + Instance: "$physDisk", + }, + { + CounterId: 181, + Instance: "$physDisk", + }, + { + CounterId: 178, + Instance: "$physDisk", + }, + { + CounterId: 182, + Instance: "$physDisk", + }, + { + CounterId: 179, + Instance: "$physDisk", + }, + { + CounterId: 183, + Instance: "$physDisk", + }, + { + CounterId: 133, + Instance: "", + }, + { + CounterId: 37, + Instance: "", + }, + { + CounterId: 74, + Instance: "", + }, + { + CounterId: 426, + Instance: "", + }, + { + CounterId: 70, + Instance: "", + }, + { + CounterId: 107, + Instance: "", + }, + { + CounterId: 422, + Instance: "", + }, + { + CounterId: 105, + Instance: "", + }, + { + CounterId: 85, + Instance: "", + }, + { + CounterId: 428, + Instance: "", + }, + { + CounterId: 418, + Instance: "", + }, + { + CounterId: 102, + Instance: "", + }, + { + CounterId: 33, + Instance: "", + }, + { + CounterId: 427, + Instance: "", + }, + { + CounterId: 94, + Instance: "", + }, + { + CounterId: 29, + Instance: "", + }, + { + CounterId: 420, + Instance: "", + }, + { + CounterId: 417, + Instance: "", + }, + { + CounterId: 98, + Instance: "", + }, + { + CounterId: 423, + Instance: "", + }, + { + CounterId: 106, + Instance: "", + }, + { + CounterId: 86, + Instance: "", + }, + { + CounterId: 41, + Instance: "", + }, + { + CounterId: 421, + Instance: "", + }, + { + CounterId: 429, + Instance: "", + }, + { + CounterId: 406, + Instance: "", + }, + { + CounterId: 90, + Instance: "", + }, + { + CounterId: 24, + Instance: "", + }, + { + CounterId: 410, + Instance: "", + }, + { + CounterId: 149, + Instance: "vmnic1", + }, + { + CounterId: 466, + Instance: "4000", + }, + { + CounterId: 146, + Instance: "", + }, + { + CounterId: 461, + Instance: "", + }, + { + CounterId: 148, + Instance: "vmnic1", + }, + { + CounterId: 462, + Instance: "vmnic0", + }, + { + CounterId: 143, + Instance: "vmnic0", + }, + { + CounterId: 463, + Instance: "vmnic1", + }, + { + CounterId: 147, + Instance: "", + }, + { + CounterId: 463, + Instance: "4000", + }, + { + CounterId: 462, + Instance: "vmnic1", + }, + { + CounterId: 462, + Instance: "4000", + }, + { + CounterId: 461, + Instance: "4000", + }, + { + CounterId: 146, + Instance: "vmnic0", + }, + { + CounterId: 465, + Instance: "4000", + }, + { + CounterId: 460, + Instance: "4000", + }, + { + CounterId: 149, + Instance: "4000", + }, + { + CounterId: 148, + Instance: "4000", + }, + { + CounterId: 462, + Instance: "", + }, + { + CounterId: 149, + Instance: "vmnic0", + }, + { + CounterId: 143, + Instance: "4000", + }, + { + CounterId: 463, + Instance: "", + }, + { + CounterId: 147, + Instance: "vmnic1", + }, + { + CounterId: 466, + Instance: "", + }, + { + CounterId: 472, + Instance: "4000", + }, + { + CounterId: 143, + Instance: "", + }, + { + CounterId: 146, + Instance: "vmnic1", + }, + { + CounterId: 146, + Instance: "4000", + }, + { + CounterId: 472, + Instance: "", + }, + { + CounterId: 471, + Instance: "", + }, + { + CounterId: 460, + Instance: "", + }, + { + CounterId: 147, + Instance: "4000", + }, + { + CounterId: 471, + Instance: "4000", + }, + { + CounterId: 148, + Instance: "", + }, + { + CounterId: 147, + Instance: "vmnic0", + }, + { + CounterId: 465, + Instance: "", + }, + { + CounterId: 464, + Instance: "4000", + }, + { + CounterId: 464, + Instance: "", + }, + { + CounterId: 148, + Instance: "vmnic0", + }, + { + CounterId: 463, + Instance: "vmnic0", + }, + { + CounterId: 467, + Instance: "", + }, + { + CounterId: 143, + Instance: "vmnic1", + }, + { + CounterId: 149, + Instance: "", + }, + { + CounterId: 467, + Instance: "4000", + }, + { + CounterId: 159, + Instance: "", + }, + { + CounterId: 157, + Instance: "", + }, + { + CounterId: 504, + Instance: "", + }, + { + CounterId: 507, + Instance: "", + }, + { + CounterId: 513, + Instance: "", + }, + { + CounterId: 348, + Instance: "", + }, + { + CounterId: 505, + Instance: "", + }, + { + CounterId: 514, + Instance: "", + }, + { + CounterId: 506, + Instance: "", + }, + { + CounterId: 512, + Instance: "", + }, + { + CounterId: 508, + Instance: "", + }, + { + CounterId: 515, + Instance: "", + }, + { + CounterId: 509, + Instance: "", + }, + { + CounterId: 501, + Instance: "", + }, + { + CounterId: 516, + Instance: "", + }, + { + CounterId: 503, + Instance: "", + }, + { + CounterId: 511, + Instance: "", + }, + { + CounterId: 510, + Instance: "", + }, + { + CounterId: 502, + Instance: "", + }, + { + CounterId: 155, + Instance: "", + }, + { + CounterId: 473, + Instance: "", + }, + { + CounterId: 498, + Instance: "", + }, + { + CounterId: 174, + Instance: "", + }, + { + CounterId: 173, + Instance: "", + }, +} + +// ************************* Host metrics ************************************ + +var HostMetrics = []types.PerfMetricId{ + { + CounterId: 386, + Instance: "", + }, + { + CounterId: 395, + Instance: "", + }, + { + CounterId: 14, + Instance: "", + }, + { + CounterId: 399, + Instance: "", + }, + { + CounterId: 392, + Instance: "", + }, + { + CounterId: 392, + Instance: "$cpu", + }, + { + CounterId: 11, + Instance: "", + }, + { + CounterId: 398, + Instance: "", + }, + { + CounterId: 388, + Instance: "", + }, + { + CounterId: 388, + Instance: "$cpu", + }, + { + CounterId: 13, + Instance: "", + }, + { + CounterId: 396, + Instance: "", + }, + { + CounterId: 12, + Instance: "", + }, + { + CounterId: 9, + Instance: "", + }, + { + CounterId: 2, + Instance: "", + }, + { + CounterId: 14, + Instance: "$cpu", + }, + { + CounterId: 404, + Instance: "", + }, + { + CounterId: 6, + Instance: "", + }, + { + CounterId: 2, + Instance: "$cpu", + }, + { + CounterId: 13, + Instance: "$cpu", + }, + { + CounterId: 185, + Instance: "d10c389e-c75b7dc4", + }, + { + CounterId: 179, + Instance: "$physDisk", + }, + { + CounterId: 178, + Instance: "$physDisk", + }, + { + CounterId: 358, + Instance: "$physDisk", + }, + { + CounterId: 537, + Instance: "$physDisk", + }, + { + CounterId: 354, + Instance: "$physDisk", + }, + { + CounterId: 191, + Instance: "$physDisk", + }, + { + CounterId: 352, + Instance: "$physDisk", + }, + { + CounterId: 359, + Instance: "$physDisk", + }, + { + CounterId: 184, + Instance: "", + }, + { + CounterId: 186, + Instance: "$physDisk", + }, + { + CounterId: 351, + Instance: "$physDisk", + }, + { + CounterId: 180, + Instance: "$physDisk", + }, + { + CounterId: 353, + Instance: "$physDisk", + }, + { + CounterId: 356, + Instance: "$physDisk", + }, + { + CounterId: 355, + Instance: "$physDisk", + }, + { + CounterId: 350, + Instance: "$physDisk", + }, + { + CounterId: 349, + Instance: "$physDisk", + }, + { + CounterId: 182, + Instance: "$physDisk", + }, + { + CounterId: 357, + Instance: "$physDisk", + }, + { + CounterId: 181, + Instance: "$physDisk", + }, + { + CounterId: 185, + Instance: "$physDisk", + }, + { + CounterId: 183, + Instance: "$physDisk", + }, + + { + CounterId: 455, + Instance: "$physDisk", + }, + { + CounterId: 133, + Instance: "", + }, + { + CounterId: 456, + Instance: "$physDisk", + }, + { + CounterId: 457, + Instance: "$physDisk", + }, + { + CounterId: 129, + Instance: "$physDisk", + }, + { + CounterId: 448, + Instance: "$physDisk", + }, + { + CounterId: 130, + Instance: "", + }, + { + CounterId: 447, + Instance: "$physDisk", + }, + { + CounterId: 458, + Instance: "$physDisk", + }, + { + CounterId: 131, + Instance: "$physDisk", + }, + { + CounterId: 134, + Instance: "$physDisk", + }, + { + CounterId: 446, + Instance: "$physDisk", + }, + { + CounterId: 450, + Instance: "$physDisk", + }, + { + CounterId: 451, + Instance: "$physDisk", + }, + { + CounterId: 453, + Instance: "$physDisk", + }, + { + CounterId: 452, + Instance: "$physDisk", + }, + { + CounterId: 454, + Instance: "$physDisk", + }, + { + CounterId: 128, + Instance: "$physDisk", + }, + { + CounterId: 132, + Instance: "$physDisk", + }, + { + CounterId: 459, + Instance: "$physDisk", + }, + { + CounterId: 130, + Instance: "$physDisk", + }, + { + CounterId: 125, + Instance: "", + }, + { + CounterId: 131, + Instance: "", + }, + { + CounterId: 449, + Instance: "$physDisk", + }, + { + CounterId: 135, + Instance: "$physDisk", + }, + { + CounterId: 136, + Instance: "$physDisk", + }, + { + CounterId: 137, + Instance: "$physDisk", + }, + { + CounterId: 538, + Instance: "", + }, + { + CounterId: 540, + Instance: "", + }, + { + CounterId: 539, + Instance: "", + }, + { + CounterId: 65, + Instance: "", + }, + { + CounterId: 27, + Instance: "", + }, + { + CounterId: 419, + Instance: "", + }, + { + CounterId: 443, + Instance: "", + }, + { + CounterId: 437, + Instance: "", + }, + { + CounterId: 24, + Instance: "", + }, + { + CounterId: 68, + Instance: "", + }, + { + CounterId: 422, + Instance: "", + }, + { + CounterId: 106, + Instance: "", + }, + { + CounterId: 410, + Instance: "", + }, + { + CounterId: 33, + Instance: "", + }, + { + CounterId: 105, + Instance: "", + }, + { + CounterId: 107, + Instance: "", + }, + { + CounterId: 61, + Instance: "", + }, + { + CounterId: 445, + Instance: "", + }, + { + CounterId: 417, + Instance: "", + }, + { + CounterId: 406, + Instance: "", + }, + { + CounterId: 444, + Instance: "", + }, + { + CounterId: 427, + Instance: "", + }, + { + CounterId: 85, + Instance: "", + }, + { + CounterId: 424, + Instance: "", + }, + { + CounterId: 49, + Instance: "", + }, + { + CounterId: 414, + Instance: "", + }, + { + CounterId: 98, + Instance: "", + }, + { + CounterId: 29, + Instance: "", + }, + { + CounterId: 57, + Instance: "", + }, + { + CounterId: 441, + Instance: "", + }, + { + CounterId: 41, + Instance: "", + }, + { + CounterId: 86, + Instance: "", + }, + { + CounterId: 433, + Instance: "", + }, + { + CounterId: 45, + Instance: "", + }, + { + CounterId: 426, + Instance: "", + }, + { + CounterId: 429, + Instance: "", + }, + { + CounterId: 440, + Instance: "", + }, + { + CounterId: 102, + Instance: "", + }, + { + CounterId: 90, + Instance: "", + }, + { + CounterId: 37, + Instance: "", + }, + { + CounterId: 442, + Instance: "", + }, + { + CounterId: 469, + Instance: "vmnic0", + }, + { + CounterId: 460, + Instance: "", + }, + { + CounterId: 463, + Instance: "", + }, + { + CounterId: 143, + Instance: "", + }, + { + CounterId: 465, + Instance: "", + }, + { + CounterId: 461, + Instance: "", + }, + { + CounterId: 468, + Instance: "", + }, + { + CounterId: 143, + Instance: "vmnic0", + }, + { + CounterId: 467, + Instance: "vmnic0", + }, + { + CounterId: 149, + Instance: "vmnic0", + }, + { + CounterId: 149, + Instance: "", + }, + { + CounterId: 470, + Instance: "", + }, + { + CounterId: 466, + Instance: "", + }, + { + CounterId: 146, + Instance: "", + }, + { + CounterId: 465, + Instance: "vmnic0", + }, + { + CounterId: 461, + Instance: "vmnic0", + }, + { + CounterId: 466, + Instance: "vmnic0", + }, + { + CounterId: 146, + Instance: "vmnic0", + }, + { + CounterId: 464, + Instance: "vmnic0", + }, + { + CounterId: 148, + Instance: "vmnic0", + }, + { + CounterId: 460, + Instance: "vmnic0", + }, + { + CounterId: 468, + Instance: "vmnic0", + }, + { + CounterId: 147, + Instance: "", + }, + { + CounterId: 463, + Instance: "vmnic0", + }, + { + CounterId: 462, + Instance: "vmnic0", + }, + { + CounterId: 464, + Instance: "", + }, + { + CounterId: 470, + Instance: "vmnic0", + }, + { + CounterId: 148, + Instance: "", + }, + { + CounterId: 462, + Instance: "", + }, + { + CounterId: 467, + Instance: "", + }, + { + CounterId: 469, + Instance: "", + }, + { + CounterId: 147, + Instance: "vmnic0", + }, + { + CounterId: 159, + Instance: "", + }, + { + CounterId: 158, + Instance: "", + }, + { + CounterId: 157, + Instance: "", + }, + { + CounterId: 503, + Instance: "", + }, + { + CounterId: 511, + Instance: "", + }, + { + CounterId: 504, + Instance: "", + }, + { + CounterId: 501, + Instance: "", + }, + { + CounterId: 513, + Instance: "", + }, + { + CounterId: 516, + Instance: "", + }, + { + CounterId: 507, + Instance: "", + }, + { + CounterId: 508, + Instance: "", + }, + { + CounterId: 502, + Instance: "", + }, + { + CounterId: 348, + Instance: "", + }, + { + CounterId: 505, + Instance: "", + }, + { + CounterId: 510, + Instance: "", + }, + { + CounterId: 512, + Instance: "", + }, + { + CounterId: 515, + Instance: "", + }, + { + CounterId: 514, + Instance: "", + }, + { + CounterId: 506, + Instance: "", + }, + { + CounterId: 509, + Instance: "", + }, + { + CounterId: 161, + Instance: "vmhba32", + }, + { + CounterId: 162, + Instance: "vmhba1", + }, + { + CounterId: 166, + Instance: "vmhba32", + }, + { + CounterId: 163, + Instance: "vmhba1", + }, + { + CounterId: 163, + Instance: "vmhba0", + }, + { + CounterId: 168, + Instance: "", + }, + { + CounterId: 167, + Instance: "vmhba32", + }, + { + CounterId: 162, + Instance: "vmhba0", + }, + { + CounterId: 164, + Instance: "vmhba1", + }, + { + CounterId: 167, + Instance: "vmhba1", + }, + { + CounterId: 167, + Instance: "vmhba0", + }, + { + CounterId: 162, + Instance: "vmhba32", + }, + { + CounterId: 164, + Instance: "vmhba0", + }, + { + CounterId: 166, + Instance: "vmhba1", + }, + { + CounterId: 166, + Instance: "vmhba0", + }, + { + CounterId: 165, + Instance: "vmhba1", + }, + { + CounterId: 165, + Instance: "vmhba0", + }, + { + CounterId: 164, + Instance: "vmhba32", + }, + { + CounterId: 161, + Instance: "vmhba1", + }, + { + CounterId: 161, + Instance: "vmhba0", + }, + { + CounterId: 163, + Instance: "vmhba32", + }, + { + CounterId: 165, + Instance: "vmhba32", + }, + { + CounterId: 520, + Instance: "$physDisk", + }, + { + CounterId: 523, + Instance: "$physDisk", + }, + { + CounterId: 193, + Instance: "", + }, + { + CounterId: 522, + Instance: "$physDisk", + }, + { + CounterId: 524, + Instance: "$physDisk", + }, + { + CounterId: 521, + Instance: "$physDisk", + }, + { + CounterId: 525, + Instance: "$physDisk", + }, + { + CounterId: 526, + Instance: "$physDisk", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 482, + Instance: "host/system/svmotion", + }, + { + CounterId: 483, + Instance: "host/system/kernel/root", + }, + { + CounterId: 479, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 499, + Instance: "host/system/kernel/var", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 485, + Instance: "host/system/kernel/var", + }, + { + CounterId: 480, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 481, + Instance: "host/system/vmotion", + }, + { + CounterId: 488, + Instance: "host/vim", + }, + { + CounterId: 484, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 481, + Instance: "host/iofilters/spm", + }, + { + CounterId: 480, + Instance: "host/vim", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 483, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 500, + Instance: "host/system/kernel/var", + }, + { + CounterId: 500, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 480, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 499, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 485, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 482, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 481, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 484, + Instance: "host/system/kernel/root", + }, + { + CounterId: 481, + Instance: "host/system/kernel/root", + }, + { + CounterId: 480, + Instance: "host/system/kernel/var", + }, + { + CounterId: 479, + Instance: "host/system/kernel/root", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 485, + Instance: "host/system/kernel", + }, + { + CounterId: 499, + Instance: "host/iofilters", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 484, + Instance: "host/system/kernel", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 481, + Instance: "host/system/kernel/var", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 480, + Instance: "host/system/kernel", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 476, + Instance: "host/system/kernel", + }, + { + CounterId: 483, + Instance: "host/system/kernel/var", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 500, + Instance: "host/system/kernel", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 496, + Instance: "host/system", + }, + { + CounterId: 500, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 494, + Instance: "host/system", + }, + { + CounterId: 482, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 482, + Instance: "host/system/kernel", + }, + { + CounterId: 491, + Instance: "host/system", + }, + { + CounterId: 487, + Instance: "host/system", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 481, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 500, + Instance: "host/vim/vmci", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 482, + Instance: "host/iofilters/spm", + }, + { + CounterId: 499, + Instance: "host/system", + }, + { + CounterId: 485, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/system/kernel", + }, + { + CounterId: 483, + Instance: "host/system/vmotion", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 484, + Instance: "host/system", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 476, + Instance: "host/vim", + }, + { + CounterId: 499, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 493, + Instance: "host/system", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 481, + Instance: "host/system", + }, + { + CounterId: 479, + Instance: "host/system/kernel/var", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 476, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 500, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 499, + Instance: "host", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 479, + Instance: "host/system/drivers", + }, + { + CounterId: 476, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 484, + Instance: "host", + }, + { + CounterId: 485, + Instance: "host/system/kernel/root", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 483, + Instance: "host/system/drivers", + }, + { + CounterId: 479, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 481, + Instance: "host", + }, + { + CounterId: 480, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 479, + Instance: "host/system/vmotion", + }, + { + CounterId: 500, + Instance: "host", + }, + { + CounterId: 476, + Instance: "host/system/kernel/var", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 481, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 481, + Instance: "host/system/svmotion", + }, + { + CounterId: 484, + Instance: "host/system/helper", + }, + { + CounterId: 499, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 500, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 500, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 476, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 499, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 482, + Instance: "host/system/kernel/var", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 485, + Instance: "host/system/svmotion", + }, + { + CounterId: 476, + Instance: "host/iofilters", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 482, + Instance: "host/vim", + }, + { + CounterId: 484, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 480, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 479, + Instance: "host/system/kernel", + }, + { + CounterId: 486, + Instance: "host/system/vmotion", + }, + { + CounterId: 492, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 485, + Instance: "host/vim", + }, + { + CounterId: 483, + Instance: "host/system/helper", + }, + { + CounterId: 476, + Instance: "host/system/vmotion", + }, + { + CounterId: 489, + Instance: "host/system", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 499, + Instance: "host/system/svmotion", + }, + { + CounterId: 485, + Instance: "host/iofilters/spm", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 481, + Instance: "host/system/helper", + }, + { + CounterId: 497, + Instance: "host/system", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 480, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 491, + Instance: "host/system/vmotion", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 485, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 476, + Instance: "host/system/drivers", + }, + { + CounterId: 485, + Instance: "host/system/vmotion", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 483, + Instance: "host/iofilters", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 485, + Instance: "host/system/drivers", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 499, + Instance: "host/system/ft", + }, + { + CounterId: 483, + Instance: "host/system/ft", + }, + { + CounterId: 484, + Instance: "host/system/ft", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 480, + Instance: "host/system/vmotion", + }, + { + CounterId: 487, + Instance: "host/vim", + }, + { + CounterId: 484, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 484, + Instance: "host/system/vmotion", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 486, + Instance: "host/vim", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 483, + Instance: "host/system", + }, + { + CounterId: 495, + Instance: "host/system", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 499, + Instance: "host/system/vmotion", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 488, + Instance: "host/system/vmotion", + }, + { + CounterId: 489, + Instance: "host/system/vmotion", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 481, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 492, + Instance: "host/system/vmotion", + }, + { + CounterId: 485, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 499, + Instance: "host/system/helper", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 493, + Instance: "host/system/vmotion", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 479, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 482, + Instance: "host/system/kernel/root", + }, + { + CounterId: 495, + Instance: "host/vim", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 479, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 481, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 495, + Instance: "host/system/vmotion", + }, + { + CounterId: 482, + Instance: "host", + }, + { + CounterId: 480, + Instance: "host/system/svmotion", + }, + { + CounterId: 480, + Instance: "host/user", + }, + { + CounterId: 483, + Instance: "host/system/svmotion", + }, + { + CounterId: 480, + Instance: "host", + }, + { + CounterId: 488, + Instance: "host/system", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 481, + Instance: "host/vim", + }, + { + CounterId: 483, + Instance: "host/vim", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 490, + Instance: "host/vim", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 484, + Instance: "host/vim/tmp", + }, + { + CounterId: 491, + Instance: "host/vim", + }, + { + CounterId: 481, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 490, + Instance: "host/system", + }, + { + CounterId: 482, + Instance: "host/system/drivers", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 482, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 479, + Instance: "host/iofilters/spm", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 479, + Instance: "host/vim/vimuser", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 499, + Instance: "host/system/kernel", + }, + { + CounterId: 481, + Instance: "host/system/kernel/hostdstats", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 485, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 485, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 481, + Instance: "host/system/drivers", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 492, + Instance: "host/vim", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 499, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 484, + Instance: "host/system/drivers", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 485, + Instance: "host", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 485, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 496, + Instance: "host/system/vmotion", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 500, + Instance: "host/system/svmotion", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 485, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 484, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 482, + Instance: "host/vim/vimuser", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 486, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 485, + Instance: "host/system/ft", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 483, + Instance: "host/user", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 481, + Instance: "host/iofilters", + }, + { + CounterId: 476, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 499, + Instance: "host/system/kernel/root", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 479, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 481, + Instance: "host/system/ft", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 499, + Instance: "host/vim/tmp", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 480, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 484, + Instance: "host/vim", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 484, + Instance: "host/system/kernel/var", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 481, + Instance: "host/vim/vmci", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 476, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 479, + Instance: "host/user", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 487, + Instance: "host/system/vmotion", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 476, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 500, + Instance: "host/system/vmotion", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 476, + Instance: "host/vim/vimuser", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 482, + Instance: "host/system/helper", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 155, + Instance: "", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/slp", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 480, + Instance: "host/system/helper", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 500, + Instance: "host/user", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 479, + Instance: "host/system/svmotion", + }, + { + CounterId: 480, + Instance: "host/system/ft", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 500, + Instance: "host/system/kernel/root", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 485, + Instance: "host/system/helper", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 482, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 482, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 483, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 483, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 476, + Instance: "host/vim/vmci", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 476, + Instance: "host/system/ft", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 480, + Instance: "host/system/drivers", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 489, + Instance: "host/vim", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 480, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 484, + Instance: "host/system/svmotion", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 500, + Instance: "host/system/helper", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/wsman", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 497, + Instance: "host/system/vmotion", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 494, + Instance: "host/system/vmotion", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 482, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 500, + Instance: "host/vim", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 476, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 482, + Instance: "host/system/vmotion", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 479, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vsanperfsvc", + }, + { + CounterId: 500, + Instance: "host/system/ft", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 500, + Instance: "host/vim/vimuser", + }, + { + CounterId: 480, + Instance: "host/vim/vimuser", + }, + { + CounterId: 483, + Instance: "host/vim/vimuser", + }, + { + CounterId: 484, + Instance: "host/vim/vimuser", + }, + { + CounterId: 485, + Instance: "host/vim/vimuser", + }, + { + CounterId: 476, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 493, + Instance: "host/vim", + }, + { + CounterId: 483, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 484, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 499, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 500, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 499, + Instance: "host/vim", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 479, + Instance: "host/vim", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 476, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 485, + Instance: "host/iofilters", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vobd", + }, + { + CounterId: 479, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 476, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 481, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 483, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 485, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 494, + Instance: "host/vim", + }, + { + CounterId: 496, + Instance: "host/vim", + }, + { + CounterId: 497, + Instance: "host/vim", + }, + { + CounterId: 481, + Instance: "host/vim/vimuser", + }, + { + CounterId: 483, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 479, + Instance: "host/vim/vmci", + }, + { + CounterId: 480, + Instance: "host/vim/vmci", + }, + { + CounterId: 499, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 482, + Instance: "host/vim/vmci", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 483, + Instance: "host/vim/vmci", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 500, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 479, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 484, + Instance: "host/vim/vmci", + }, + { + CounterId: 482, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 485, + Instance: "host/vim/vmci", + }, + { + CounterId: 499, + Instance: "host/vim/vmci", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 476, + Instance: "host/system/kernel/root", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 500, + Instance: "host/vim/tmp", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 499, + Instance: "host/user", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 476, + Instance: "host/vim/tmp", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 479, + Instance: "host/vim/vimuser/terminal", + }, + { + CounterId: 479, + Instance: "host/vim/tmp", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/smartd", + }, + { + CounterId: 476, + Instance: "host", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 480, + Instance: "host/vim/tmp", + }, + { + CounterId: 476, + Instance: "host/system/svmotion", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 483, + Instance: "host", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 490, + Instance: "host/system/vmotion", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 481, + Instance: "host/vim/tmp", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 483, + Instance: "host/vim/tmp", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 485, + Instance: "host/vim/tmp", + }, + { + CounterId: 483, + Instance: "host/iofilters/spm", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 480, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 484, + Instance: "host/iofilters/spm", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 500, + Instance: "host/iofilters", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/dhclientrelease", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 479, + Instance: "host/system/helper", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 500, + Instance: "host/system", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 479, + Instance: "host/iofilters", + }, + { + CounterId: 480, + Instance: "host/iofilters", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 482, + Instance: "host/iofilters", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 484, + Instance: "host/iofilters", + }, + { + CounterId: 476, + Instance: "host/system/helper", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 499, + Instance: "host/system/drivers", + }, + { + CounterId: 500, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 482, + Instance: "host/system", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/awk", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 484, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/dhclient", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 484, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 479, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 483, + Instance: "host/system/kernel/tmp", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/head", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/vpxa", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 480, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 481, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 482, + Instance: "host/system/ft", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor", + }, + { + CounterId: 482, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/usbArbitrator", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/ls", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/pgrep", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 483, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 500, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 485, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/probe", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 481, + Instance: "host/system/kernel", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 482, + Instance: "host/vim/tmp", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 483, + Instance: "host/vim/vimuser/terminal/ssh", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/vmkbacktrace", + }, + { + CounterId: 499, + Instance: "host/iofilters/iofiltervpd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/hostdCgiServer", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/hbrca", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/init", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 480, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/uwdaemons", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 500, + Instance: "host/system/drivers", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/lacpd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 499, + Instance: "host/system/kernel/opt", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vmkiscsid", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/upitd", + }, + { + CounterId: 481, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 479, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/lbt", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 482, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/aam", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/vsish", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 484, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/likewise", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/snmpd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 482, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe/stats", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/logging", + }, + { + CounterId: 484, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 480, + Instance: "host/system/kernel/root", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 485, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 484, + Instance: "host/vim/vimuser/terminal/shell", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 479, + Instance: "host/system/ft", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/netcpa", + }, + { + CounterId: 499, + Instance: "host/iofilters/vmwarevmcrypt", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/sh", + }, + { + CounterId: 479, + Instance: "host", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 476, + Instance: "host/system/kernel/etc", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/vmkdevmgr", + }, + { + CounterId: 500, + Instance: "host/iofilters/spm", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 476, + Instance: "host/iofilters/spm", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/dcui", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/upittraced", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 480, + Instance: "host/iofilters/spm", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/nfsgssd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/hostd-probe", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 499, + Instance: "host/iofilters/spm", + }, + { + CounterId: 500, + Instance: "host/system/kernel/iofilters", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/sioc", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/nscd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/net-daemons", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 476, + Instance: "host/user", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/boot", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/ntpd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/memScrubber", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/vvold", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/vmkeventd", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/pcscd", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 481, + Instance: "host/user", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 480, + Instance: "host/system", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/nfcd", + }, + { + CounterId: 484, + Instance: "host/vim/vmvisor/plugins", + }, + { + CounterId: 482, + Instance: "host/user", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/sensord", + }, + { + CounterId: 500, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 484, + Instance: "host/user", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/vvoltraced", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/swapobjd", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/sfcb", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/osfsd", + }, + { + CounterId: 485, + Instance: "host/user", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 480, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 476, + Instance: "host/vim/vmvisor/hostd-probe/stats/logger", + }, + { + CounterId: 481, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 499, + Instance: "host/vim/vimuser", + }, + { + CounterId: 482, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 479, + Instance: "host/vim/vmvisor/rabbitmqproxy", + }, + { + CounterId: 483, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 485, + Instance: "host/vim/vmvisor/sfcb_aux", + }, + { + CounterId: 499, + Instance: "host/vim/vmvisor/vmfstraced", + }, + { + CounterId: 541, + Instance: "vfc", + }, +} + +// ************************************** Cluster Metrics ************************************** +var ClusterMetrics = []types.PerfMetricId{ + { + CounterId: 22, + Instance: "", + }, + { + CounterId: 2, + Instance: "", + }, + { + CounterId: 9, + Instance: "", + }, + { + CounterId: 7, + Instance: "", + }, + { + CounterId: 8, + Instance: "", + }, + { + CounterId: 3, + Instance: "", + }, + { + CounterId: 4, + Instance: "", + }, + { + CounterId: 15, + Instance: "", + }, + { + CounterId: 17, + Instance: "", + }, + { + CounterId: 18, + Instance: "", + }, + { + CounterId: 19, + Instance: "", + }, + { + CounterId: 20, + Instance: "", + }, + { + CounterId: 21, + Instance: "", + }, + { + CounterId: 6, + Instance: "", + }, + { + CounterId: 139, + Instance: "", + }, + { + CounterId: 138, + Instance: "", + }, + { + CounterId: 107, + Instance: "", + }, + { + CounterId: 29, + Instance: "", + }, + { + CounterId: 33, + Instance: "", + }, + { + CounterId: 37, + Instance: "", + }, + { + CounterId: 41, + Instance: "", + }, + { + CounterId: 49, + Instance: "", + }, + { + CounterId: 90, + Instance: "", + }, + { + CounterId: 105, + Instance: "", + }, + { + CounterId: 106, + Instance: "", + }, + { + CounterId: 27, + Instance: "", + }, + { + CounterId: 108, + Instance: "", + }, + { + CounterId: 110, + Instance: "", + }, + { + CounterId: 111, + Instance: "", + }, + { + CounterId: 109, + Instance: "", + }, + { + CounterId: 112, + Instance: "", + }, + { + CounterId: 25, + Instance: "", + }, + { + CounterId: 103, + Instance: "", + }, + { + CounterId: 99, + Instance: "", + }, + { + CounterId: 30, + Instance: "", + }, + { + CounterId: 34, + Instance: "", + }, + { + CounterId: 38, + Instance: "", + }, + { + CounterId: 42, + Instance: "", + }, + { + CounterId: 50, + Instance: "", + }, + { + CounterId: 98, + Instance: "", + }, + { + CounterId: 26, + Instance: "", + }, + { + CounterId: 104, + Instance: "", + }, + { + CounterId: 100, + Instance: "", + }, + { + CounterId: 31, + Instance: "", + }, + { + CounterId: 102, + Instance: "", + }, + { + CounterId: 39, + Instance: "", + }, + { + CounterId: 43, + Instance: "", + }, + { + CounterId: 51, + Instance: "", + }, + { + CounterId: 92, + Instance: "", + }, + { + CounterId: 24, + Instance: "", + }, + { + CounterId: 35, + Instance: "", + }, + { + CounterId: 91, + Instance: "", + }, + { + CounterId: 153, + Instance: "", + }, + { + CounterId: 152, + Instance: "", + }, + { + CounterId: 151, + Instance: "", + }, + { + CounterId: 150, + Instance: "", + }, + { + CounterId: 157, + Instance: "", + }, + { + CounterId: 158, + Instance: "", + }, + { + CounterId: 159, + Instance: "", + }, + { + CounterId: 262, + Instance: "", + }, + { + CounterId: 257, + Instance: "", + }, + { + CounterId: 258, + Instance: "", + }, + { + CounterId: 259, + Instance: "", + }, + { + CounterId: 260, + Instance: "", + }, + { + CounterId: 261, + Instance: "", + }, + { + CounterId: 256, + Instance: "", + }, + { + CounterId: 263, + Instance: "", + }, + { + CounterId: 264, + Instance: "", + }, + { + CounterId: 265, + Instance: "", + }, + { + CounterId: 266, + Instance: "", + }, + { + CounterId: 267, + Instance: "", + }, + { + CounterId: 268, + Instance: "", + }, + { + CounterId: 269, + Instance: "", + }, + { + CounterId: 270, + Instance: "", + }, + { + CounterId: 271, + Instance: "", + }, + { + CounterId: 272, + Instance: "", + }, + { + CounterId: 273, + Instance: "", + }, + { + CounterId: 274, + Instance: "", + }, + { + CounterId: 275, + Instance: "", + }, +} + +// *************************************** Datastore metrics **************************************** +var DatastoreMetrics = []types.PerfMetricId{ + { + CounterId: 178, + Instance: "", + }, + { + CounterId: 188, + Instance: "", + }, + { + CounterId: 187, + Instance: "", + }, + { + CounterId: 181, + Instance: "", + }, + { + CounterId: 180, + Instance: "", + }, + { + CounterId: 179, + Instance: "", + }, + { + CounterId: 281, + Instance: "", + }, + { + CounterId: 281, + Instance: "$file", + }, + + { + CounterId: 282, + Instance: "", + }, + { + CounterId: 282, + Instance: "$file", + }, + { + CounterId: 283, + Instance: "", + }, + { + CounterId: 284, + Instance: "", + }, + { + CounterId: 284, + Instance: "$file", + }, + + { + CounterId: 288, + Instance: "", + }, + { + CounterId: 286, + Instance: "", + }, + { + CounterId: 287, + Instance: "", + }, + { + CounterId: 287, + Instance: "$file", + }, +} + +// ********************************************* Resource pool metrics *********************************** +var ResourcePoolMetrics = []types.PerfMetricId{ + { + CounterId: 6, + Instance: "", + }, + { + CounterId: 213, + Instance: "", + }, + { + CounterId: 7, + Instance: "", + }, + { + CounterId: 8, + Instance: "", + }, + { + CounterId: 16, + Instance: "", + }, + { + CounterId: 17, + Instance: "", + }, + { + CounterId: 18, + Instance: "", + }, + { + CounterId: 19, + Instance: "", + }, + { + CounterId: 20, + Instance: "", + }, + { + CounterId: 22, + Instance: "", + }, + { + CounterId: 138, + Instance: "", + }, + { + CounterId: 139, + Instance: "", + }, + { + CounterId: 112, + Instance: "", + }, + { + CounterId: 102, + Instance: "", + }, + { + CounterId: 98, + Instance: "", + }, + { + CounterId: 29, + Instance: "", + }, + { + CounterId: 33, + Instance: "", + }, + { + CounterId: 37, + Instance: "", + }, + { + CounterId: 41, + Instance: "", + }, + { + CounterId: 70, + Instance: "", + }, + { + CounterId: 90, + Instance: "", + }, + { + CounterId: 108, + Instance: "", + }, + { + CounterId: 109, + Instance: "", + }, + { + CounterId: 111, + Instance: "", + }, + { + CounterId: 214, + Instance: "", + }, + { + CounterId: 105, + Instance: "", + }, + { + CounterId: 106, + Instance: "", + }, + { + CounterId: 107, + Instance: "", + }, + { + CounterId: 103, + Instance: "", + }, + { + CounterId: 99, + Instance: "", + }, + { + CounterId: 30, + Instance: "", + }, + { + CounterId: 34, + Instance: "", + }, + { + CounterId: 38, + Instance: "", + }, + { + CounterId: 42, + Instance: "", + }, + { + CounterId: 71, + Instance: "", + }, + { + CounterId: 92, + Instance: "", + }, + { + CounterId: 104, + Instance: "", + }, + { + CounterId: 100, + Instance: "", + }, + { + CounterId: 31, + Instance: "", + }, + { + CounterId: 35, + Instance: "", + }, + { + CounterId: 39, + Instance: "", + }, + { + CounterId: 43, + Instance: "", + }, + { + CounterId: 72, + Instance: "", + }, + { + CounterId: 91, + Instance: "", + }, + { + CounterId: 152, + Instance: "", + }, + { + CounterId: 153, + Instance: "", + }, + { + CounterId: 157, + Instance: "", + }, + { + CounterId: 159, + Instance: "", + }, +} + +// ********************************************* Datacenter metrics *********************************** +var DatacenterMetrics = []types.PerfMetricId{ + { + CounterId: 256, + Instance: "", + }, + { + CounterId: 257, + Instance: "", + }, + { + CounterId: 258, + Instance: "", + }, + { + CounterId: 259, + Instance: "", + }, + { + CounterId: 260, + Instance: "", + }, + { + CounterId: 261, + Instance: "", + }, + { + CounterId: 262, + Instance: "", + }, + { + CounterId: 263, + Instance: "", + }, + { + CounterId: 264, + Instance: "", + }, + { + CounterId: 265, + Instance: "", + }, + { + CounterId: 266, + Instance: "", + }, + { + CounterId: 267, + Instance: "", + }, + { + CounterId: 268, + Instance: "", + }, + { + CounterId: 269, + Instance: "", + }, + { + CounterId: 270, + Instance: "", + }, + { + CounterId: 271, + Instance: "", + }, + { + CounterId: 272, + Instance: "", + }, + { + CounterId: 273, + Instance: "", + }, + { + CounterId: 274, + Instance: "", + }, + { + CounterId: 275, + Instance: "", + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go new file mode 100644 index 000000000..d14ec7439 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go @@ -0,0 +1,1862 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +var MetricData = map[string]map[int32][]int64{ + "VirtualMachine": VmMetricData, + "HostSystem": HostMetricData, + "ResourcePool": ResourcePoolMetricData, + "ClusterComputeResource": ClusterMetricData, + "Datastore": DatastoreMetricData, + "Datacenter": DatacenterMetricData, +} + +var VmMetricData = map[int32][]int64{ + 130: []int64{42, 57, 9, 13, 14, 25, 8, 16, 6, 13, 67, 34, 292, 89, 27, 75, 98, 59, 49, 85, 127, 116, 179, 196, 161, 170, 174, 35, 26, 20, + 25, 42, 10, 45, 24, 64, 9, 21, 6, 18, 19, 9, 16, 18, 5, 124, 97, 25, 18, 20, 28, 28, 22, 11, 12, 139, 155, 149, 179, 173, + 135, 73, 73, 67, 49, 37, 12, 28, 18, 36, 59, 18, 21, 17, 27, 137, 140, 118, 137, 265, 246, 250, 114, 43, 26, 17, 7, 36, 89, 15, + 45, 47, 49, 13, 47, 34, 52, 16, 7, 25}, + 155: []int64{2948499, 2948519, 2948539, 2948559, 2948579, 2948599, 2948619, 2948639, 2948659, 2948679, 2948699, 2948719, 2948739, 2948759, 2948779, 2948799, 2948819, 2948839, 2948859, 2948879, 2948899, 2948919, 2948939, 2948959, 2948979, 2948999, 2949019, 2949039, 2949059, 2949079, + 2949099, 2949119, 2949139, 2949159, 2949179, 2949199, 2949219, 2949239, 2949259, 2949279, 2949299, 2949319, 2949339, 2949359, 2949379, 2949399, 2949419, 2949439, 2949459, 2949479, 2949499, 2949519, 2949539, 2949559, 2949579, 2949599, 2949619, 2949639, 2949659, 2949679, + 2949699, 2949719, 2949739, 2949759, 2949779, 2949799, 2949819, 2949839, 2949859, 2949879, 2949899, 2949919, 2949939, 2949959, 2949979, 2949999, 2950019, 2950039, 2950059, 2950079, 2950099, 2950119, 2950139, 2950159, 2950179, 2950199, 2950219, 2950239, 2950259, 2950279, + 2950299, 2950319, 2950339, 2950359, 2950379, 2950399, 2950419, 2950439, 2950459, 2950479}, + 173: []int64{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 180, 12, 4, 1, 12, 8, 0, 6, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 1, 0, 17, 1, 1, 0, 2, 0, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 6, 0, + 3, 0, 0, 6, 6, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 7, 4, 6, 5, 86, 63, 80, 2, 0, 2, 0, 0, 0, 17, 0, + 0, 1, 0, 0, 4, 1, 0, 0, 1, 0}, + 399: []int64{4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 2, 12, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 2, 0, 0, 0, 0, 0, 1, 0, 3}, + 504: []int64{2000, 2200, 2200, 2200, 2200, 1700, 1700, 1700, 1700, 1700, 2300, 2300, 2300, 2300, 2300, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2000, 2000, 2000, 2000, 2000, + 1900, 1900, 1900, 1700, 1700, 1700, 1700, 1500, 1500, 1500, 1600, 1600, 1600, 1600, 1600, 2100, 4700, 4700, 4700, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, + 2000, 1600, 1600, 1600, 1600, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1900, 2600, 3900, 3900, 4200, 4300, 5100, 5500, 5500, 5500, 5500, 5500, 5500, 5500, 5500, 5500, + 5200, 5200, 5200, 5200, 4300, 3700, 2300, 2200, 2300, 2300}, + 174: []int64{368, 141, 143, 106, 119, 157, 88, 127, 137, 106, 211, 225, 202, 226, 234, 920, 268, 181, 204, 241, 219, 168, 221, 234, 184, 185, 236, 195, 168, 222, + 185, 189, 134, 130, 160, 122, 84, 113, 153, 95, 110, 141, 91, 108, 130, 3372, 1942, 151, 102, 158, 162, 100, 143, 122, 109, 211, 229, 173, 187, 237, + 200, 205, 241, 184, 204, 217, 182, 195, 219, 213, 211, 214, 189, 182, 245, 2671, 612, 1055, 595, 644, 747, 611, 336, 244, 118, 113, 128, 93, 94, 130, + 359, 131, 151, 94, 137, 149, 106, 109, 127, 124}, + 70: []int64{91, 585, 246, 114, 553, 348, 824, 848, 827, 882, 632, 500, 647, 805, 425, 971, 789, 1001, 910, 1013, 338, 713, 496, 168, 201, 886, 124, 968, 768, 736, + 612, 859, 973, 64, 312, 449, 38, 839, 807, 571, 83, 862, 1015, 333, 818, 173, 396, 520, 171, 678, 160, 203, 991, 549, 776, 524, 390, 228, 576, 307, + 1005, 93, 893, 475, 451, 141, 98, 439, 95, 104, 739, 630, 275, 701, 722, 16, 207, 468, 310, 387, 217, 377, 684, 969, 396, 1010, 866, 914, 181, 621, 995, + 831, 278, 530, 465, 745, 704, 762, 545, 544}, + 473: []int64{30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 27, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, + 133: []int64{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 1, 1, 0}, + 348: []int64{1100, 1200, 1200, 1000, 1200, 1200, 1300, 900, 900, 900, 1800, 1800, 1900, 1200, 1200, 1200, 1200, 1300, 1200, 1400, 1500, 1400, 1200, 1000, 1100, 1200, 1200, 1000, 900, 800, + 900, 1000, 1000, 1100, 1300, 1400, 1300, 900, 900, 900, 1100, 1100, 1000, 800, 900, 2500, 4000, 4300, 2600, 1400, 1300, 1300, 1000, 800, 900, 1100, 1100, 1000, 900, 900, + 1000, 900, 1100, 1000, 1300, 1300, 1300, 1000, 900, 900, 1200, 1200, 1100, 800, 1000, 2200, 3200, 4400, 4100, 4500, 4900, 5000, 4200, 2600, 1500, 1100, 1200, 1100, 900, 800, + 1000, 1200, 1200, 1000, 1200, 1400, 1400, 1100, 1000, 1100}, + 422: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 146: []int64{1914, 1692, 2171, 2999, 2254, 2014, 1687, 1823, 2251, 3286, 1916, 1903, 4747, 1782, 2203, 2301, 1853, 4708, 5656, 2070, 5121, 1839, 1987, 4985, 3396, 1857, 2212, 1822, 1689, 1917, + 1831, 1862, 2163, 3297, 1996, 2070, 1871, 1868, 2199, 3065, 1718, 2055, 1825, 1692, 2169, 2685, 1867, 1917, 3203, 2016, 2132, 1713, 1881, 1989, 3266, 1886, 2182, 1748, 1819, 2060, + 1752, 1931, 2123, 2909, 2026, 2015, 1681, 1792, 2184, 3277, 1639, 2075, 1690, 1740, 5110, 7545, 7854, 9835, 10912, 10197, 10426, 12296, 3728, 2135, 3253, 1784, 5195, 1824, 1578, 1959, + 1772, 1917, 2176, 3091, 2022, 4991, 1829, 4629, 5412, 3269}, + 463: []int64{277, 274, 338, 383, 297, 274, 275, 274, 339, 541, 288, 259, 752, 276, 338, 276, 274, 729, 838, 292, 838, 275, 275, 748, 542, 274, 338, 274, 274, 277, + 277, 275, 337, 392, 291, 276, 274, 274, 337, 541, 274, 278, 274, 276, 338, 279, 274, 274, 390, 293, 338, 274, 275, 276, 543, 274, 339, 274, 277, 274, + 275, 275, 337, 391, 289, 277, 275, 275, 339, 541, 274, 274, 274, 275, 810, 520, 535, 592, 668, 562, 605, 575, 329, 276, 542, 274, 828, 274, 274, 276, + 276, 278, 339, 390, 289, 753, 277, 747, 812, 541}, + 472: []int64{281, 281, 347, 392, 304, 280, 282, 280, 347, 555, 295, 265, 770, 282, 347, 283, 280, 749, 861, 299, 861, 282, 281, 767, 556, 280, 347, 280, 280, 283, + 283, 282, 345, 401, 298, 282, 280, 281, 346, 556, 280, 284, 280, 282, 347, 285, 280, 281, 399, 300, 347, 280, 282, 282, 557, 280, 347, 280, 283, 281, + 281, 281, 346, 401, 295, 283, 281, 281, 347, 555, 280, 281, 280, 281, 832, 530, 546, 603, 681, 572, 617, 585, 336, 283, 556, 280, 850, 280, 280, 282, + 281, 284, 347, 400, 296, 772, 283, 767, 834, 555}, + 147: []int64{842, 813, 1012, 1671, 1013, 717, 821, 706, 1005, 1804, 868, 782, 2000, 755, 986, 947, 691, 1958, 2756, 967, 2241, 708, 755, 1939, 1716, 706, 1047, 715, 711, 825, + 838, 722, 904, 1800, 882, 800, 661, 805, 1098, 1685, 676, 913, 774, 738, 960, 1241, 755, 804, 1738, 985, 983, 729, 703, 745, 1630, 721, 1148, 769, 825, 807, + 741, 793, 1035, 1636, 1005, 809, 720, 756, 1076, 1737, 677, 824, 663, 714, 2056, 5216, 5689, 7065, 7549, 7205, 7517, 8701, 2154, 855, 1724, 772, 2254, 749, 705, 754, + 758, 878, 1049, 1683, 896, 2047, 729, 1907, 2105, 1704}, + 2: []int64{776, 604, 442, 846, 463, 524, 454, 410, 439, 607, 1540, 404, 759, 477, 484, 646, 683, 537, 1027, 473, 746, 429, 538, 527, 632, 603, 449, 441, 386, 405, + 492, 579, 430, 928, 648, 550, 447, 408, 444, 540, 666, 390, 427, 417, 435, 3590, 2309, 394, 751, 571, 621, 398, 413, 392, 567, 652, 437, 402, 509, 403, + 534, 604, 440, 825, 471, 569, 435, 430, 442, 563, 770, 400, 444, 418, 563, 2381, 1941, 1925, 2335, 2025, 2530, 2252, 868, 443, 594, 571, 602, 417, 388, 411, + 727, 600, 471, 825, 546, 713, 431, 522, 587, 544}, + 148: []int64{218, 203, 246, 299, 225, 245, 202, 203, 246, 416, 205, 243, 220, 203, 246, 337, 203, 256, 315, 219, 264, 203, 203, 259, 416, 203, 246, 203, 202, 245, + 203, 203, 245, 308, 215, 245, 203, 203, 246, 415, 203, 245, 203, 203, 245, 427, 203, 244, 308, 216, 245, 202, 203, 245, 416, 203, 246, 202, 203, 245, + 203, 203, 245, 306, 217, 245, 202, 203, 246, 416, 202, 245, 202, 203, 259, 510, 462, 659, 772, 808, 928, 1177, 384, 260, 416, 203, 260, 203, 202, 245, + 218, 203, 245, 306, 217, 259, 203, 216, 260, 416}, + 402: []int64{3278, 2525, 1849, 3540, 1919, 2330, 1902, 1734, 1847, 2544, 6355, 1703, 3167, 1986, 2096, 2826, 2870, 2240, 4305, 2010, 3145, 1824, 2268, 2234, 2706, 2527, 1901, 1834, 1653, 1723, + 2097, 2407, 1811, 3960, 2643, 2540, 1859, 1735, 1892, 2288, 2747, 1635, 1845, 1759, 1798, 14863, 9491, 1680, 3272, 2287, 2612, 1686, 1750, 1643, 2387, 2719, 1845, 1689, 2202, 1687, + 2255, 2533, 1818, 3440, 1994, 2365, 1850, 1806, 1843, 2352, 3217, 1682, 1859, 1788, 2376, 10120, 8065, 7951, 9802, 8339, 10497, 9331, 3611, 1890, 2510, 2444, 2522, 1734, 1667, 1707, + 3036, 2513, 1987, 3455, 2276, 2964, 1814, 2178, 2413, 2269}, + 503: []int64{1200, 1200, 1200, 1200, 1200, 1100, 1100, 1100, 1100, 1100, 1200, 1200, 1200, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1400, 1400, 1200, 1200, 1200, 1200, 1200, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1000, 1100, 1400, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, + 1400, 1100, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1100, 1100, 1100, 1000, 1100, 1300, 1500, 1700, 1900, 2100, 2500, 2700, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, + 2600, 2400, 2100, 1900, 1700, 1400, 1200, 1100, 1100, 1100}, + 421: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 184: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 466: []int64{20, 20, 23, 22, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 21, 20, 21, 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, 20, 20, + 20, 20, 20, 25, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 21, 20, + 20, 20, 20, 24, 20, 21, 20, 20, 20, 20, 20, 21, 20, 21, 20, 20, 20, 21, 20, 20, 20, 20, 20, 23, 20, 20, 20, 20, 20, 20, + 21, 20, 20, 20, 20, 20, 21, 20, 20, 20}, + 410: []int64{976, 899, 657, 904, 171, 606, 607, 707, 823, 331, 255, 421, 230, 1001, + 937, 467, 738, 287, 904, 962, 518, 391, 593, 593, 59, 874, 364, 873, 728, 727, 533, + 328, 957, 637, 973, 1014, 259, 160, 698, 589, 933, 283, 385, 393, 129, 414, 16, 800, + 105, 150, 905, 278, 131, 115, 678, 738, 444, 411, 388, 402, 541, 428, 970, 260, 56, + 794, 975, 480, 644, 110, 702, 93, 240, 322, 651, 370, 261, 589, 72, 259, 405, 965, + 927, 519, 210, 291, 688, 758, 942, 301, 253, 605, 677, 995, 509, 478, 646, 3, 472, 1007, + }, + 505: []int64{1100, 1100, 1100, 1100, 1100, 1000, 1000, 1000, 1000, 1000, 1100, 1100, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1300, 1300, 1300, 1100, 1200, 1100, 1100, 1100, + 1100, 1100, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1300, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, + 1300, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1200, 1400, 1600, 1800, 2000, 2300, 2500, 2600, 2600, 2600, 2600, 2600, 2600, 2600, 2600, + 2400, 2200, 2000, 1800, 1600, 1400, 1100, 1100, 1100, 1100}, + 149: []int64{277, 274, 338, 383, 297, 274, 275, 274, 339, 541, 288, 259, 752, 276, 338, 276, 274, 729, 838, 292, 838, 275, 275, 748, 542, 274, 338, 274, 274, 277, + 277, 275, 337, 392, 291, 276, 274, 274, 337, 541, 274, 278, 274, 276, 338, 279, 274, 274, 390, 293, 338, 274, 275, 276, 543, 274, 339, 274, 277, 274, + 275, 275, 337, 391, 289, 277, 275, 275, 339, 541, 274, 274, 274, 275, 810, 520, 535, 592, 668, 562, 605, 575, 329, 276, 542, 274, 828, 274, 274, 276, + 276, 278, 339, 390, 289, 753, 277, 747, 812, 541}, + 509: []int64{2200, 2200, 2200, 2200, 4000, 4000, 4000, 1300, 1200, 1900, 5400, 5400, 5400, 2200, 2200, 2000, 2200, 2200, 2200, 4100, 4100, 4100, 1700, 1900, 1900, 1900, 1800, 1400, 1200, 1200, + 1300, 2000, 2000, 2000, 4600, 4600, 4600, 1500, 1500, 1600, 2400, 2400, 2400, 1300, 1400, 10500, 10900, 10900, 10900, 3900, 3900, 3900, 1500, 1300, 1700, 2000, 2000, 2000, 1500, 1500, + 1500, 1500, 2500, 2500, 3700, 3700, 3700, 1600, 1400, 1700, 2400, 2400, 2400, 1500, 2200, 6600, 6600, 6600, 4700, 7400, 7400, 7400, 6800, 5100, 4800, 1900, 2300, 2300, 2300, 1400, + 2200, 2200, 2200, 2000, 3700, 3700, 3700, 3300, 2200, 2200}, + 143: []int64{496, 477, 584, 682, 522, 519, 478, 477, 585, 958, 494, 503, 972, 480, 585, 614, 477, 985, 1153, 511, 1103, 479, 479, 1007, 959, 478, 585, 477, 477, 522, + 480, 479, 583, 701, 507, 521, 477, 478, 583, 957, 477, 523, 477, 479, 584, 706, 478, 519, 698, 510, 584, 476, 479, 521, 959, 478, 585, 477, 480, 520, + 478, 479, 583, 698, 506, 522, 478, 478, 585, 957, 477, 520, 476, 478, 1070, 1030, 998, 1251, 1441, 1371, 1534, 1752, 714, 537, 958, 477, 1088, 477, 477, 521, + 495, 482, 585, 697, 507, 1012, 480, 964, 1073, 957}, + 471: []int64{198, 197, 239, 287, 218, 239, 197, 197, 240, 398, 200, 239, 213, 197, 240, 322, 198, 248, 301, 213, 250, 197, 198, 249, 398, 198, 240, 197, 197, 238, + 198, 198, 239, 301, 204, 239, 198, 198, 240, 397, 197, 239, 197, 197, 239, 421, 198, 238, 300, 205, 239, 197, 198, 239, 398, 198, 240, 197, 197, 239, + 198, 198, 239, 293, 211, 239, 197, 197, 240, 397, 197, 239, 197, 197, 250, 491, 456, 651, 758, 800, 921, 1171, 379, 254, 398, 197, 250, 197, 197, 239, + 197, 198, 239, 293, 211, 249, 197, 207, 251, 397}, + 511: []int64{1900, 2000, 1900, 1900, 1900, 1700, 1700, 1700, 1700, 1700, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 1900, 1900, 1900, 1900, 1900, + 1800, 1800, 1800, 1700, 1700, 1700, 1700, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 2000, 4600, 4600, 4600, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, + 2000, 1500, 1500, 1500, 1500, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1700, 2500, 3700, 3900, 3900, 4100, 4700, 5100, 5100, 5100, 5100, 5100, 5100, 5100, 5100, 5100, + 4800, 4800, 4800, 4800, 4000, 3700, 2200, 2000, 2200, 2200}, + 467: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 37: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 508: []int64{1200, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1200, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1200, 1200, 1200, 1200, 1200, + 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1300, 1300, 1400, 1500, 1500, 1600, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, + 1600, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500}, + 90: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 404: []int64{34, 25, 29, 30, 28, 26, 24, 24, 25, 31, 27, 27, 27, 26, 26, 30, 30, 29, 37, 34, 35, 27, 27, 38, 32, 22, 26, 29, 25, 27, + 31, 22, 23, 29, 24, 27, 24, 25, 29, 30, 24, 24, 27, 23, 24, 26, 26, 26, 26, 24, 27, 26, 24, 24, 26, 27, 23, 22, 23, 25, + 32, 25, 25, 31, 27, 28, 24, 22, 26, 26, 24, 25, 28, 24, 28, 64, 46, 45, 64, 67, 58, 48, 30, 26, 30, 28, 28, 29, 26, 29, + 34, 26, 28, 31, 25, 25, 25, 31, 25, 30}, + 460: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 398: []int64{270, 288, 299, 243, 285, 298, 304, 229, 216, 228, 420, 415, 442, 276, 290, 278, 298, 307, 297, 331, 364, 338, 279, 242, 269, 289, 277, 252, 212, 203, + 212, 241, 245, 259, 320, 339, 321, 226, 215, 225, 271, 262, 253, 205, 209, 586, 942, 999, 618, 340, 311, 310, 232, 196, 212, 260, 266, 249, 221, 215, + 235, 219, 256, 236, 309, 300, 306, 232, 214, 227, 292, 283, 270, 205, 234, 525, 750, 1023, 949, 1051, 1130, 1168, 975, 599, 363, 266, 293, 269, 229, 196, + 247, 283, 294, 238, 295, 333, 341, 270, 251, 259}, + 403: []int64{54000, 57600, 59800, 48600, 57000, 59600, 60800, 45800, 43200, 45600, 84000, 83000, 88400, 55200, 58000, 55600, 59600, 61400, 59400, 66200, 72800, 67600, 55800, 48400, 53800, 57800, 55400, 50400, 42400, 40600, + 42400, 48200, 49000, 51800, 64000, 67800, 64200, 45200, 43000, 45000, 54200, 52400, 50600, 41000, 41800, 117200, 188400, 199800, 123600, 68000, 62200, 62000, 46400, 39200, 42400, 52000, 53200, 49800, 44200, 43000, + 47000, 43800, 51200, 47200, 61800, 60000, 61200, 46400, 42800, 45400, 58400, 56600, 54000, 41000, 46800, 105000, 150000, 204600, 189800, 210200, 226000, 233600, 195000, 119800, 72600, 53200, 58600, 53800, 45800, 39200, + 49400, 56600, 58800, 47600, 59000, 66600, 68200, 54000, 50200, 51800}, + 397: []int64{50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50}, + 41: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 94: []int64{341, 881, 851, 214, 263, 802, 777, 58, 661, 231, 255, 494, 192, 302, 90, 371, 709, 164, 58, 1, 511, 711, 1005, 556, 457, 869, 708, 994, 668, 826, 112, 633, 901, 345, 317, 199, 199, 168, 981, 665, 29, 436, 225, 426, 309, 333, 757, 696, 840, 210, 500, 343, 651, 717, 803, 869, 445, 907, 928, 268, 437, 583, 160, 478, 891, 471, 72, 448, 457, 499, 348, 527, 409, 731, 849, 572, 378, 33, 254, 414, 781, 322, 153, 755, 301, 583, 823, 55, 637, 233, 259, 6, 448, 217, 842, 921, 971, 419, 246, 289}, + 400: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 501: []int64{2300, 2300, 2300, 2300, 4000, 4000, 4000, 1400, 1400, 2100, 5500, 5500, 5500, 2200, 2200, 2000, 2300, 2300, 2300, 4200, 4200, 4200, 1700, 2100, 2100, 2100, 1900, 1500, 1300, 1400, + 1400, 2100, 2100, 2100, 4700, 4700, 4700, 1500, 1600, 1900, 2500, 2500, 2500, 1400, 1600, 11000, 11200, 11200, 11200, 3900, 3900, 3900, 1500, 1400, 1800, 2000, 2000, 2000, 1600, 1600, + 1600, 1500, 2600, 2600, 3700, 3700, 3700, 1700, 1500, 1900, 2500, 2500, 2500, 1600, 2400, 7700, 7700, 7700, 5100, 8000, 8000, 8000, 7200, 5500, 5200, 2200, 2400, 2400, 2400, 1600, + 2300, 2300, 2300, 2100, 3700, 3700, 3700, 3400, 2400, 2400}, + 498: []int64{2856065, 2856065, 2856095, 2856125, 2856125, 2856155, 2856185, 2856185, 2856215, 2856245, 2856245, 2856275, 2856305, 2856305, 2856335, 2856365, 2856365, 2856395, 2856425, 2856425, 2856455, 2856485, 2856485, 2856515, 2856545, 2856545, 2856575, 2856605, 2856605, 2856635, + 2856665, 2856665, 2856695, 2856725, 2856725, 2856755, 2856785, 2856785, 2856815, 2856845, 2856845, 2856875, 2856905, 2856905, 2856935, 2856965, 2856965, 2856995, 2857025, 2857025, 2857055, 2857085, 2857085, 2857115, 2857145, 2857145, 2857175, 2857205, 2857205, 2857235, + 2857265, 2857265, 2857295, 2857325, 2857325, 2857355, 2857385, 2857385, 2857415, 2857445, 2857445, 2857475, 2857505, 2857505, 2857535, 2857565, 2857565, 2857595, 2857625, 2857625, 2857655, 2857685, 2857685, 2857715, 2857745, 2857745, 2857775, 2857805, 2857805, 2857835, + 2857865, 2857865, 2857895, 2857925, 2857925, 2857955, 2857985, 2857985, 2858015, 2858045}, + 506: []int64{1300, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1300, 1300, 1300, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, + 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1300, 1300, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1300, 1300, 1300, 1300, 1300, + 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1400, 1400, 1500, 1500, 1600, 1700, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, 1800, + 1700, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1700, 1700}, + 510: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 514: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 159: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 86: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 6: []int64{357, 278, 204, 390, 213, 241, 209, 189, 202, 280, 709, 186, 349, 219, 223, 297, 314, 247, 473, 218, 343, 197, 248, 242, 291, 278, 206, 203, 178, 187, + 227, 266, 198, 427, 298, 253, 206, 188, 204, 248, 306, 179, 196, 192, 200, 1654, 1064, 181, 346, 263, 286, 183, 190, 180, 261, 300, 201, 185, 234, 185, + 246, 278, 202, 380, 217, 262, 200, 198, 204, 259, 354, 184, 204, 192, 259, 1097, 894, 887, 1076, 933, 1165, 1037, 399, 204, 273, 263, 277, 192, 179, 189, + 335, 276, 217, 380, 251, 328, 198, 240, 270, 250}, + 14: []int64{3010, 2320, 1660, 3264, 1748, 1986, 1713, 1545, 1647, 2295, 6083, 1508, 2913, 1790, 1847, 2477, 2621, 2028, 3960, 1778, 2868, 1603, 2057, 1970, 2417, 2302, 1688, 1648, 1462, 1516, + 1875, 2209, 1618, 3571, 2493, 2113, 1669, 1543, 1677, 2046, 2545, 1470, 1607, 1572, 1636, 14228, 9120, 1478, 2895, 2180, 2374, 1503, 1532, 1476, 2168, 2514, 1657, 1509, 1950, 1515, + 2036, 2321, 1643, 3190, 1773, 2165, 1639, 1617, 1654, 2143, 3004, 1479, 1672, 1570, 2106, 9318, 7534, 7434, 9078, 7821, 9839, 8745, 3350, 1693, 2242, 2204, 2282, 1564, 1447, 1541, + 2802, 2299, 1776, 3180, 2082, 2728, 1623, 1965, 2218, 2059}, + 131: []int64{369, 141, 143, 106, 119, 157, 88, 127, 137, 106, 211, 225, 202, 226, 234, 920, 268, 181, 204, 241, 219, 168, 221, 234, 184, 185, 236, 195, 168, 222, + 185, 189, 134, 130, 160, 122, 84, 113, 153, 95, 110, 141, 91, 108, 130, 3373, 1951, 151, 102, 158, 162, 100, 143, 122, 109, 211, 229, 173, 187, 237, + 200, 205, 241, 184, 204, 217, 182, 195, 219, 213, 211, 214, 189, 182, 245, 2671, 615, 1057, 602, 645, 747, 611, 336, 244, 118, 113, 128, 93, 94, 130, + 359, 131, 151, 94, 137, 149, 106, 109, 127, 124}, + 401: []int64{9, 9, 7, 10, 7, 9, 7, 7, 7, 7, 13, 8, 14, 10, 9, 11, 10, 9, 14, 11, 13, 8, 11, 11, 12, 11, 10, 8, 7, 8, + 8, 8, 7, 12, 8, 9, 8, 7, 7, 8, 9, 7, 7, 8, 7, 28, 21, 8, 10, 9, 9, 7, 8, 6, 8, 12, 10, 8, 10, 10, + 10, 10, 9, 11, 9, 10, 7, 8, 8, 10, 12, 7, 8, 7, 10, 34, 35, 32, 37, 35, 44, 39, 17, 7, 9, 8, 8, 7, 8, 6, + 11, 10, 7, 11, 9, 9, 8, 8, 9, 9}, + 24: []int64{3899, 3299, 3299, 3299, 3599, 3599, 3599, 3500, 3500, 3500, 3299, 3299, 3299, 3199, 3199, 3199, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3199, 3199, 3199, 3000, 3000, + 3000, 3399, 3399, 3399, 2899, 2899, 2899, 2899, 2899, 2899, 3199, 3199, 3199, 3500, 3500, 3500, 3099, 3099, 3099, 4000, 4000, 4000, 3099, 3099, 3099, 3199, 3199, 3199, 3000, 3000, + 3000, 2899, 2899, 2899, 2899, 2899, 2899, 3199, 3199, 3199, 3000, 3000, 3000, 3199, 3199, 3199, 3699, 3699, 3699, 3099, 3099, 3099, 3199, 3199, 3199, 3399, 3399, 3399, 3099, 3099, + 3099, 3399, 3399, 3399, 3500, 3500, 3500, 3500, 3299, 3299}, + 429: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 98: []int64{10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760}, + 106: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 386: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 29: []int64{10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, + 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760, 10485760}, + 507: []int64{2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2100, 2100, 2100, 2100, 2100, 2100, 2200, 2100, 2100, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, + 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2000, 2000, 2000, 2000, 2000, + 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1800, 1800, 1900, 1900, 1900, 1900, 1900, 2400, 2600, 3800, 3900, 3900, 4000, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, + 4100, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000}, + 33: []int64{4089444, 3460300, 3460300, 3460300, 3774872, 3774872, 3774872, 3670016, 3670016, 3670016, 3460300, 3460300, 3460300, 3355440, 3355440, 3355440, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3145728, 3355440, 3355440, 3355440, 3145728, 3145728, + 3145728, 3565156, 3565156, 3565156, 3040868, 3040868, 3040868, 3040868, 3040868, 3040868, 3355440, 3355440, 3355440, 3670016, 3670016, 3670016, 3250584, 3250584, 3250584, 4194304, 4194304, 4194304, 3250584, 3250584, 3250584, 3355440, 3355440, 3355440, 3145728, 3145728, + 3145728, 3040868, 3040868, 3040868, 3040868, 3040868, 3040868, 3355440, 3355440, 3355440, 3145728, 3145728, 3145728, 3355440, 3355440, 3355440, 3879728, 3879728, 3879728, 3250584, 3250584, 3250584, 3355440, 3355440, 3355440, 3565156, 3565156, 3565156, 3250584, 3250584, + 3250584, 3565156, 3565156, 3565156, 3670016, 3670016, 3670016, 3670016, 3460300, 3460300}, + 102: []int64{57856, 57760, 57760, 57760, 57664, 57664, 57664, 57888, 57888, 57888, 57904, 57904, 57808, 57920, 57920, 57920, 57952, 57952, 57952, 57856, 57856, 57856, 58000, 58000, 58000, 58016, 58016, 58016, 58032, 58032, + 57936, 57952, 57952, 57952, 57872, 57872, 57872, 57984, 57984, 57984, 57888, 57888, 57888, 57904, 57904, 57904, 57808, 57808, 57808, 57824, 57936, 57936, 58048, 58048, 58048, 57872, 57872, 57872, 57888, 57888, + 57888, 57904, 57904, 57904, 57936, 57936, 57936, 57840, 57840, 57840, 57760, 57760, 57760, 57872, 57872, 57776, 57696, 57696, 57696, 57808, 57808, 57808, 57712, 57824, 57824, 57744, 57744, 57744, 57760, 57760, + 57760, 57872, 57872, 57872, 57776, 58000, 58000, 58000, 57808, 57808}, + 418: []int64{84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, + 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252, 84252}, + 428: []int64{57856, 57760, 57760, 57760, 57664, 57664, 57664, 57888, 57888, 57888, 57904, 57904, 57808, 57920, 57920, 57920, 57952, 57952, 57952, 57856, 57856, 57856, 58000, 58000, 58000, 58016, 58016, 58016, 58032, 58032, + 57936, 57952, 57952, 57952, 57872, 57872, 57872, 57984, 57984, 57984, 57888, 57888, 57888, 57904, 57904, 57904, 57808, 57808, 57808, 57824, 57936, 57936, 58048, 58048, 58048, 57872, 57872, 57872, 57888, 57888, + 57888, 57904, 57904, 57904, 57936, 57936, 57936, 57840, 57840, 57840, 57760, 57760, 57760, 57872, 57872, 57776, 57696, 57696, 57696, 57808, 57808, 57808, 57712, 57824, 57824, 57744, 57744, 57744, 57760, 57760, + 57760, 57872, 57872, 57872, 57776, 58000, 58000, 58000, 57808, 57808}, + 420: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 423: []int64{10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, + 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208, 10502208}, + 105: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 107: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 515: []int64{160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160}, + 13: []int64{36563, 37352, 38027, 36325, 37964, 37547, 37994, 38163, 38047, 37327, 33506, 38166, 36687, 37878, 37787, 37009, 36970, 37616, 35525, 37828, 36681, 38041, 37565, 37560, 37119, 37335, 37939, 38025, 38231, 38159, + 37762, 32473, 38087, 35903, 37253, 37333, 38034, 38145, 37983, 37582, 37150, 38257, 38040, 38141, 38094, 24973, 30358, 38203, 36612, 37602, 37267, 38196, 38139, 38252, 37496, 37127, 38015, 38190, 37655, 38163, + 37575, 37335, 38040, 36407, 37874, 37506, 38043, 38091, 38034, 37519, 36656, 38197, 38011, 38107, 37491, 29567, 31711, 31815, 29910, 31346, 29216, 30433, 36241, 37986, 37356, 37431, 37356, 38137, 38201, 38167, + 36801, 37359, 37886, 36408, 37599, 36921, 38071, 37686, 37479, 37595}, + 502: []int64{1100, 1100, 1200, 900, 1100, 1200, 1200, 900, 800, 900, 1700, 1600, 1700, 1000, 1100, 1100, 1200, 1200, 1200, 1300, 1400, 1300, 1100, 900, 1000, 1100, 1100, 1000, 800, 800, + 800, 900, 1000, 1000, 1300, 1400, 1300, 900, 800, 900, 1000, 1000, 1000, 800, 800, 2400, 3900, 4100, 2600, 1400, 1200, 1200, 900, 800, 800, 1000, 1100, 1000, 900, 800, + 900, 900, 1000, 900, 1200, 1200, 1200, 900, 800, 900, 1100, 1100, 1100, 800, 900, 2000, 2900, 4100, 3800, 4200, 4500, 4700, 3900, 2400, 1400, 1000, 1100, 1100, 900, 800, + 1000, 1100, 1200, 900, 1200, 1300, 1400, 1100, 1000, 1000}, + 74: []int64{961, 1016, 502, 571, 475, 122, 219, 937, 428, 657, 356, 987, 332, 469, 465, 216, 708, 984, 519, 696, 420, 994, 454, 7, 223, 559, 320, 521, 632, 18, 280, 144, 48, 994, 584, 555, 665, 944, 831, 135, 40, 851, 210, 440, 679, 569, 908, 745, 552, 125, 783, 877, 317, 895, 458, 999, 50, 288, 600, 729, 716, 441, 713, 800, 378, 440, 225, 226, 384, 588, 982, 393, 736, 817, 453, 644, 255, 92, 671, 81, 586, 1019, 286, 247, 781, 524, 765, 762, 217, 941, 595, 478, 597, 294, 648, 327, 1019, 706, 826, 813}, + 85: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 465: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 464: []int64{51, 34, 48, 60, 36, 43, 41, 36, 38, 45, 35, 40, 44, 36, 35, 50, 35, 33, 40, 37, 41, 44, 35, 41, 42, 36, 31, 43, 44, 45, + 42, 45, 46, 37, 40, 41, 46, 43, 32, 49, 42, 36, 34, 43, 29, 47, 38, 42, 41, 37, 40, 37, 43, 33, 39, 38, 49, 31, 43, 46, + 40, 39, 34, 51, 39, 51, 45, 49, 41, 36, 34, 34, 45, 42, 45, 271, 410, 524, 558, 291, 176, 92, 43, 62, 36, 46, 40, 39, 34, 40, + 39, 38, 49, 34, 41, 51, 44, 29, 47, 37}, + 396: []int64{117, 89, 89, 113, 87, 124, 84, 85, 88, 107, 113, 88, 146, 47, 101, 132, 106, 97, 139, 104, 118, 95, 95, 119, 119, 92, 91, 89, 85, 91, + 100, 84, 85, 141, 76, 152, 84, 88, 97, 103, 87, 77, 99, 82, 78, 199, 133, 90, 135, 71, 94, 85, 92, 79, 95, 92, 83, 80, 99, 81, + 101, 91, 83, 108, 95, 91, 89, 83, 87, 102, 80, 90, 89, 92, 111, 292, 202, 205, 276, 225, 253, 223, 111, 89, 111, 100, 102, 86, 95, 83, + 110, 93, 93, 114, 89, 106, 80, 99, 87, 98}, + 426: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 427: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 125: []int64{411, 198, 152, 119, 134, 183, 96, 143, 144, 119, 279, 259, 494, 316, 261, 995, 366, 240, 253, 327, 346, 285, 400, 430, 345, 356, 410, 230, 194, 243, + 211, 231, 144, 176, 185, 186, 93, 135, 160, 113, 129, 151, 107, 127, 135, 3497, 2048, 176, 121, 178, 191, 129, 165, 133, 122, 351, 385, 322, 367, 410, + 336, 279, 315, 251, 253, 255, 194, 223, 238, 249, 270, 233, 210, 200, 273, 2808, 755, 1175, 739, 910, 993, 861, 451, 287, 144, 130, 135, 130, 183, 146, + 404, 178, 200, 108, 185, 184, 159, 126, 135, 150}, + 11: []int64{36582, 37370, 38034, 36337, 37967, 37562, 38002, 38168, 38054, 37329, 33533, 38186, 36723, 37909, 37798, 37050, 37006, 37642, 35547, 37852, 36713, 38071, 37616, 37615, 37164, 37383, 37993, 38045, 38247, 38169, + 37776, 37500, 38095, 35924, 37261, 37351, 38038, 38160, 37990, 37591, 37158, 38263, 38047, 38148, 38100, 25033, 30406, 38214, 36618, 37614, 37277, 38207, 38152, 38261, 37506, 37169, 38060, 38221, 37703, 38210, + 37614, 37369, 38078, 36434, 37898, 37522, 38051, 38104, 38049, 37544, 36685, 38214, 38024, 38116, 37515, 29627, 31741, 31857, 29938, 31389, 29257, 30473, 36265, 38002, 37366, 37444, 37365, 38149, 38225, 38177, + 36823, 37378, 37901, 36420, 37620, 36931, 38085, 37698, 37484, 37604}, + 516: []int64{6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000}, + 462: []int64{218, 203, 246, 299, 225, 245, 202, 203, 246, 416, 205, 243, 220, 203, 246, 337, 203, 256, 315, 219, 264, 203, 203, 259, 416, 203, 246, 203, 202, 245, + 203, 203, 245, 308, 215, 245, 203, 203, 246, 415, 203, 245, 203, 203, 245, 427, 203, 244, 308, 216, 245, 202, 203, 245, 416, 203, 246, 202, 203, 245, + 203, 203, 245, 306, 217, 245, 202, 203, 246, 416, 202, 245, 202, 203, 259, 510, 462, 659, 772, 808, 928, 1177, 384, 260, 416, 203, 260, 203, 202, 245, + 218, 203, 245, 306, 217, 259, 203, 216, 260, 416}, + 417: []int64{2726296, 2411724, 2411724, 2411724, 2831152, 2831152, 2831152, 2726296, 2726296, 2726296, 2411724, 2411724, 2411724, 2621440, 2621440, 2621440, 2306864, 2306864, 2306864, 2306864, 2306864, 2306864, 2411724, 2411724, 2411724, 2516580, 2516580, 2516580, 2202008, 2202008, + 2202008, 2516580, 2516580, 2516580, 2097152, 2097152, 2097152, 2097152, 2306864, 2411724, 2726296, 2726296, 2726296, 2411724, 2411724, 2411724, 2306864, 2306864, 2306864, 3145728, 3145728, 3145728, 2306864, 2306864, 2306864, 2411724, 2411724, 2411724, 2306864, 2306864, + 2306864, 2097152, 2202008, 2306864, 2306864, 2306864, 2621440, 2621440, 2621440, 2621440, 2411724, 2411724, 2411724, 2621440, 2621440, 2621440, 2936012, 2936012, 2936012, 2621440, 2621440, 2726296, 2726296, 2726296, 2726296, 2516580, 2516580, 2516580, 2621440, 2621440, + 2621440, 2936012, 2936012, 2936012, 2516580, 2516580, 2516580, 2516580, 2306864, 2306864}, + 157: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 406: []int64{942, 615, 308, 1003, 67, 638, 951, 442, 100, 350, 477, 964, 469, 905, 622, 523, 679, 130, 457, 208, 710, 905, 781, 740, 608, 254, 286, 483, 205, 929, 88, 936, 730, 832, 144, 658, 558, 306, 19, 920, 254, 804, 458, 370, 328, 655, 43, 165, 653, 310, 369, 705, 188, 238, 170, 948, 535, 209, 293, 971, 787, 245, 377, 767, 807, 324, 896, 109, 178, 928, 954, 312, 26, 831, 816, 646, 159, 232, 997, 820, 387, 128, 28, 582, 1010, 705, 662, 815, 830, 946, 750, 637, 600, 847, 732, 566, 562, 406, 311, 609}, + 513: []int64{1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1800, 1800, 1900, 1900, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, + 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 1900, 1900, 1900, 1900, 1900, + 1800, 1700, 1800, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 2200, 2500, 3600, 3700, 3800, 3900, 3900, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900, 3900}, + 512: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 461: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 10: []int64{740, 967, 600, 858, 667, 588, 488, 323, 834, 600, 49, 486, 867, 163, 219, 532, + 224, 115, 377, 80, 671, 327, 77, 8, 995, 831, 594, 326, 595, 182, 152, 195, 897, 924, 995, + 393, 126, 296, 678, 494, 752, 198, 199, 184, 412, 600, 19, 454, 605, 481, 456, 54, 487, + 395, 24, 859, 670, 710, 339, 232, 300, 941, 187, 190, 779, 127, 252, 304, 580, 823, 30, + 43, 3, 30, 523, 670, 499, 474, 962, 588, 300, 978, 338, 772, 212, 435, 920, 958, 533, 650, + 39, 668, 185, 124, 851, 226, 356, 594, 247, 194}, + 12: []int64{137, 101, 116, 123, 114, 107, 96, 96, 103, 124, 111, 109, 108, 106, 106, 124, 122, 117, 149, 137, 141, 109, 110, 154, 128, 88, 107, 119, 102, 108, + 125, 91, 95, 116, 97, 108, 100, 103, 119, 122, 97, 99, 108, 94, 97, 106, 105, 106, 107, 98, 111, 105, 97, 98, 106, 111, 94, 90, 95, 100, + 131, 100, 103, 125, 108, 112, 97, 91, 107, 106, 98, 102, 116, 96, 112, 257, 186, 182, 259, 271, 232, 196, 123, 107, 122, 112, 114, 118, 104, 116, + 139, 107, 112, 126, 103, 103, 101, 125, 101, 122}, +} + +var HostMetricData = map[int32][]int64{ + 540: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 193: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 10, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 10, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 538: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 442: []int64{558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 558345748480, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, + 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, + 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, + 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, + 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, 559419490304, + }, + 184: []int64{6, 7, 24, 10, 12, 10, 11, 11, 15, 9, 6, 11, 10, 11, 11, 15, 14, 24, 8, 15, + 11, 14, 8, 9, 13, 11, 10, 10, 10, 8, 14, 11, 13, 15, 16, 13, 10, 12, 16, 16, + 13, 14, 11, 11, 13, 14, 11, 11, 11, 10, 8, 13, 16, 16, 10, 15, 9, 10, 10, 9, + 12, 10, 15, 10, 11, 19, 11, 11, 18, 11, 10, 10, 9, 13, 8, 11, 8, 12, 10, 10, + 11, 18, 12, 14, 14, 8, 11, 13, 11, 24, 12, 14, 18, 10, 13, 15, 13, 12, 20, 11, + }, + 417: []int64{4209028, 4597196, 4911776, 4890868, 4716732, 4949160, 5618444, 5299588, 5939276, 5373040, 5444172, 5360296, 6744416, 6827536, 6208836, 6481460, 6483476, 6441596, 6315764, 6396904, + 6292044, 6313012, 6319280, 6245880, 5176316, 5171796, 5486372, 5402552, 5406000, 5059972, 4956844, 5174332, 5447028, 5153364, 5147720, 4403340, 4361368, 4369400, 4862164, 4946880, + 4994708, 5517376, 5999716, 5998864, 5380208, 4834948, 4838024, 4282212, 4177360, 4330364, 4582024, 5022488, 5030444, 4881924, 5007848, 5085540, 5012204, 5012144, 5036856, 4942480, + 4187564, 4228672, 4155256, 4134280, 4132984, 4299164, 4445960, 4453264, 4159664, 4390344, 4383672, 4415064, 4918376, 4918656, 5222744, 5222808, 5225088, 4616912, 4218456, 4215328, + 4351644, 4812948, 4976436, 4494096, 4726508, 4721272, 5235008, 4857516, 4855644, 5054940, 4740304, 4796812, 4543444, 4312760, 4351020, 4560668, 5084960, 5092936, 5260772, 5072024, + }, + 465: []int64{135, 62, 9, 25, 9, 16, 8, 10, 3, 7, 12, 8, 13, 5, 13, 6, 13, 2, 12, 10, + 7, 9, 7, 19, 6, 10, 7, 12, 8, 4, 13, 14, 14, 1, 13, 12, 7, 1, 8, 14, + 13, 9, 3, 12, 8, 2, 5, 9, 17, 5, 13, 7, 15, 10, 5, 13, 10, 18, 6, 15, + 6, 17, 3, 6, 8, 8, 12, 9, 11, 3, 18, 7, 4, 1, 12, 10, 11, 7, 12, 16, + 5, 3, 1, 24, 11, 9, 11, 18, 12, 1, 8, 10, 15, 4, 11, 11, 12, 10, 2, 6, + }, + 445: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 158: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 516: []int64{6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000, + }, + 9: []int64{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + }, + 433: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 464: []int64{208, 119, 77, 99, 67, 76, 74, 62, 67, 73, 64, 72, 87, 61, 69, 96, 75, 56, 82, 62, + 77, 80, 57, 72, 88, 70, 61, 70, 76, 70, 67, 72, 76, 65, 71, 62, 81, 63, 58, 76, + 94, 99, 101, 104, 104, 107, 97, 57, 87, 63, 69, 75, 83, 56, 69, 81, 88, 84, 76, 71, + 70, 115, 47, 74, 76, 64, 98, 77, 72, 65, 80, 63, 72, 61, 64, 62, 91, 65, 58, 78, + 73, 63, 63, 84, 73, 79, 67, 68, 78, 73, 62, 68, 83, 56, 79, 71, 77, 94, 68, 56, + }, + 461: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 460: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 469: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 468: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 463: []int64{4529, 3139, 976, 1336, 1328, 854, 781, 678, 587, 874, 1296, 1092, 914, 657, 662, 862, 671, 1366, 724, 1384, + 595, 753, 766, 696, 697, 925, 1215, 579, 700, 644, 730, 595, 857, 1243, 1059, 1037, 937, 644, 449, 627, + 1002, 871, 626, 661, 594, 576, 543, 608, 1409, 1306, 579, 720, 479, 592, 641, 1576, 654, 660, 555, 648, + 606, 457, 580, 633, 1730, 985, 797, 451, 559, 768, 864, 1020, 638, 608, 641, 467, 622, 466, 687, 1507, + 542, 1115, 609, 472, 634, 1398, 556, 589, 730, 544, 625, 679, 525, 480, 1496, 1446, 1136, 683, 507, 704, + }, + 159: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 147: []int64{98787, 64540, 12850, 14793, 13898, 11584, 9842, 9220, 8157, 13929, 14763, 16435, 10855, 10541, 13461, 9241, 8298, 13911, 9665, 13714, + 8106, 9184, 9718, 10730, 11620, 10779, 18429, 7382, 10814, 13398, 8824, 8072, 9910, 12595, 10950, 11917, 12508, 8644, 6052, 10230, + 11355, 13255, 8252, 10033, 11957, 6777, 7435, 8673, 14327, 13369, 8016, 9588, 6494, 8082, 9718, 14035, 11684, 8576, 9269, 13208, + 7808, 6503, 7587, 8385, 16944, 11698, 10462, 6446, 7489, 10736, 11891, 15393, 8347, 9696, 12891, 6261, 8374, 6976, 8981, 15365, + 7323, 12960, 8301, 6383, 7699, 17905, 10476, 7616, 11062, 12148, 7518, 8798, 7209, 6363, 15726, 15193, 13103, 9463, 6583, 8581, + }, + 2: []int64{5216, 6422, 2301, 2399, 3513, 3670, 2479, 2777, 1948, 2395, 4382, 3535, 2610, 2991, 2086, 2249, 2980, 4164, 2341, 4394, + 2166, 2374, 2577, 3321, 2379, 3581, 2061, 2313, 3196, 3493, 2299, 2811, 2994, 2399, 3526, 3718, 2327, 3588, 2037, 2313, + 3351, 3459, 2269, 2940, 2039, 2267, 2935, 3661, 3132, 3684, 2261, 2318, 2543, 3373, 2315, 4170, 2265, 2348, 2654, 3427, + 2311, 2576, 2225, 3184, 4171, 3686, 2190, 2765, 2177, 2133, 3559, 3530, 2178, 3213, 2475, 2133, 2728, 3443, 2390, 4531, + 2388, 2188, 3001, 3636, 2125, 3588, 2281, 2203, 2861, 3476, 2124, 2860, 2463, 2142, 4806, 4150, 2169, 2695, 2160, 2194, + }, + 146: []int64{123085, 81730, 23478, 30517, 31220, 22570, 18686, 17187, 15034, 23327, 30538, 29852, 21611, 17841, 20520, 19804, 16652, 32333, 17640, 31898, + 15354, 17755, 19085, 17827, 19017, 22028, 30619, 14066, 18751, 21221, 17486, 15365, 20671, 27904, 24811, 25645, 22882, 16383, 11545, 17083, + 23937, 24473, 15364, 17625, 18616, 13334, 14162, 16791, 31671, 30553, 15054, 17695, 12414, 15992, 16789, 29615, 19038, 16113, 15550, 21144, + 14848, 12167, 14642, 15589, 39685, 24791, 19349, 12091, 14397, 18326, 22628, 28263, 15711, 16693, 20002, 11595, 15951, 13324, 16702, 34960, + 13979, 26177, 15704, 12997, 14929, 35171, 16772, 14289, 19393, 18969, 14908, 17101, 13600, 11905, 35064, 34309, 26614, 17578, 12759, 16810, + }, + 348: []int64{36000, 39300, 34400, 24500, 17700, 17700, 20100, 18600, 17100, 14600, 18300, 19200, 22300, 18700, 18300, 15100, 14800, 17300, 19600, 22900, + 20700, 18500, 14800, 15100, 17100, 19200, 18500, 16400, 15400, 16400, 18700, 18100, 18800, 16900, 18300, 17900, 19900, 20100, 18600, 16200, + 15800, 16700, 18900, 17900, 17300, 15000, 15000, 15600, 20300, 21400, 21600, 17100, 15000, 14800, 16900, 20700, 20400, 18300, 14900, 15500, + 17400, 17400, 16800, 16600, 19400, 20800, 20900, 18200, 16900, 14600, 16300, 16700, 19100, 17900, 18600, 16200, 15600, 14800, 17600, 21500, + 21700, 18900, 15200, 16100, 18200, 19900, 18600, 16700, 15100, 15400, 17600, 17300, 17100, 15400, 19400, 21300, 23000, 19100, 16300, 14500, + }, + 386: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 106: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 24: []int64{9387, 9390, 9388, 9389, 9389, 9387, 9388, 9389, 9388, 9389, 9390, 9388, 9389, 9390, 9390, 9392, 9391, 9390, 9388, 9388, + 9387, 9387, 9387, 9387, 9388, 9387, 9388, 9389, 9389, 9387, 9389, 9388, 9389, 9391, 9390, 9388, 9391, 9391, 9390, 9391, + 9392, 9388, 9388, 9387, 9388, 9388, 9388, 9389, 9388, 9388, 9389, 9388, 9389, 9388, 9389, 9388, 9389, 9391, 9389, 9388, + 9390, 9390, 9390, 9391, 9392, 9388, 9387, 9388, 9388, 9388, 9389, 9389, 9388, 9388, 9388, 9388, 9389, 9388, 9389, 9388, + 9388, 9390, 9390, 9390, 9390, 9389, 9391, 9390, 9391, 9388, 9389, 9388, 9388, 9388, 9388, 9390, 9388, 9388, 9388, 9389, + }, + 437: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 45: []int64{28758744, 28759192, 28759660, 28759688, 28759572, 28759656, 28759684, 28761964, 28759664, 28759716, 28761648, 28759596, 28759636, 28759652, 28761712, 28759628, 28761824, 28759660, 28759796, 28757672, + 28757696, 28757860, 28757692, 28757724, 28757712, 28757712, 28757672, 28757636, 28757652, 28757676, 28759828, 28757608, 28759684, 28757684, 28757700, 28757636, 28757712, 28759704, 28757676, 28757744, + 28757724, 28757648, 28757612, 28759848, 28759680, 28757680, 28759756, 28757808, 28757728, 28757740, 28757692, 28757724, 28759696, 28757752, 28757724, 28757660, 28757780, 28757660, 28759676, 28759784, + 28757752, 28759700, 28757688, 28757732, 28759700, 28757704, 28757668, 28757740, 28757676, 28759832, 28759628, 28759764, 28757720, 28757768, 28759680, 28757736, 28759712, 28757656, 28757668, 28759776, + 28757676, 28757652, 28759768, 28757724, 28757724, 28759676, 28759792, 28757680, 28757648, 28759740, 28757764, 28759876, 28757660, 28757652, 28759624, 28757780, 28759724, 28757648, 28759732, 28757768, + }, + 515: []int64{160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + }, + 512: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 504: []int64{38200, 40700, 40700, 40700, 40700, 40700, 41100, 41100, 41100, 41100, 41100, 41100, 41100, 41100, 41100, 40700, 26800, 26800, 27100, 31600, + 31600, 30600, 30600, 30600, 31600, 31600, 31600, 30600, 30600, 30600, 31600, 31600, 31600, 30600, 27000, 27400, 27500, 34800, 34800, 27500, + 27500, 27500, 36500, 36500, 36500, 27500, 27700, 27700, 36500, 36500, 36500, 28100, 27700, 27700, 28100, 28100, 28100, 27700, 27700, 27700, + 28100, 28100, 28100, 27700, 27700, 27700, 35000, 35000, 35000, 27700, 27600, 27600, 35000, 35000, 35000, 27600, 27600, 27600, 35400, 35400, + 35400, 29100, 29100, 29100, 34300, 34300, 34300, 29100, 29100, 29100, 34300, 34300, 34300, 29100, 26300, 27900, 34300, 34300, 34300, 27900, + }, + 509: []int64{56300, 56300, 56300, 45300, 26500, 26500, 40200, 40200, 40200, 23400, 45700, 45700, 45700, 39900, 39900, 23200, 20800, 25700, 36300, 36300, + 36300, 31100, 19300, 21900, 34300, 36700, 36700, 36700, 23100, 23100, 37900, 37900, 37900, 27000, 27000, 26900, 36700, 36700, 36700, 36100, + 36900, 36900, 36900, 36100, 36100, 26200, 27300, 27300, 44400, 44400, 44400, 27500, 20500, 21400, 35500, 44500, 44500, 44500, 22100, 22800, + 34600, 34600, 34600, 25500, 35300, 35300, 35300, 35000, 35000, 21300, 40300, 40300, 40300, 36600, 36600, 25400, 21400, 22000, 36200, 39900, + 39900, 39900, 22900, 22700, 33900, 37000, 37000, 37000, 21900, 23000, 36800, 36800, 36800, 19300, 41300, 41300, 41300, 35100, 35100, 19400, + }, + 13: []int64{55854, 44019, 91548, 91238, 77451, 76086, 89967, 87066, 96253, 92136, 66625, 77627, 88722, 83963, 94854, 93093, 84480, 69900, 91799, 67236, + 94009, 91442, 89091, 80204, 91615, 76760, 95271, 92658, 81344, 78020, 92539, 86149, 84145, 91137, 77621, 75411, 92107, 76879, 95544, 92520, + 79654, 78532, 92752, 84539, 95566, 92740, 84839, 77042, 81463, 75690, 92934, 92048, 89801, 79319, 92435, 69706, 92835, 92971, 86952, 78964, + 92614, 88676, 93272, 81870, 70002, 75928, 93396, 86942, 93717, 94338, 77321, 77673, 93967, 81264, 90382, 94398, 87290, 78692, 91395, 65516, + 91277, 94100, 83600, 76785, 94306, 76729, 92706, 93455, 85740, 78369, 94379, 85854, 90241, 94306, 62269, 70322, 93958, 87650, 94017, 93690, + }, + 505: []int64{23500, 24800, 24900, 24400, 24500, 24600, 25000, 25000, 24800, 24300, 23900, 23100, 22500, 21700, 20600, 18700, 17200, 17500, 17900, 18200, + 18100, 17600, 17500, 17700, 18100, 17700, 17600, 16900, 17000, 17200, 17600, 17700, 17500, 17100, 16800, 16900, 17400, 17800, 17600, 17200, + 17100, 17300, 17700, 17700, 17500, 17000, 17100, 16800, 17700, 17700, 17600, 17100, 16700, 16800, 17200, 17600, 17500, 17100, 17000, 17200, + 17600, 17500, 17400, 16900, 17100, 17200, 17600, 17700, 17600, 17100, 16900, 16900, 17300, 17400, 17600, 17100, 17100, 17200, 17300, 17500, + 17400, 16900, 16900, 17200, 17600, 17600, 17600, 17100, 17100, 16900, 17400, 17400, 17400, 17000, 17000, 17300, 17800, 17800, 17400, 17100, + }, + 157: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 388: []int64{3105, 3888, 1350, 1391, 1943, 2053, 1406, 1570, 1178, 1412, 2542, 1997, 1490, 1658, 1236, 1322, 1652, 2219, 1353, 2397, + 1273, 1376, 1460, 1857, 1389, 1993, 1231, 1352, 1761, 1961, 1336, 1574, 1686, 1385, 1931, 2030, 1380, 1954, 1204, 1366, + 1914, 1933, 1344, 1689, 1211, 1340, 1675, 2101, 1748, 2028, 1313, 1347, 1464, 1886, 1343, 2403, 1305, 1391, 1532, 1920, + 1358, 1480, 1282, 1788, 2261, 2023, 1288, 1576, 1283, 1278, 2002, 1949, 1281, 1796, 1411, 1240, 1552, 1909, 1384, 2483, + 1373, 1301, 1690, 1967, 1258, 2017, 1337, 1282, 1629, 1965, 1253, 1619, 1390, 1271, 2614, 2221, 1286, 1563, 1253, 1296, + }, + 155: []int64{2950229, 2950250, 2950269, 2950289, 2950309, 2950329, 2950349, 2950369, 2950389, 2950409, 2950429, 2950449, 2950469, 2950489, 2950509, 2950529, 2950549, 2950569, 2950589, 2950609, + 2950629, 2950649, 2950669, 2950689, 2950709, 2950729, 2950749, 2950769, 2950789, 2950809, 2950829, 2950849, 2950869, 2950889, 2950909, 2950929, 2950949, 2950969, 2950989, 2951009, + 2951029, 2951049, 2951069, 2951089, 2951109, 2951129, 2951149, 2951169, 2951189, 2951209, 2951229, 2951249, 2951269, 2951289, 2951309, 2951329, 2951349, 2951369, 2951389, 2951409, + 2951429, 2951449, 2951469, 2951489, 2951509, 2951529, 2951549, 2951569, 2951589, 2951609, 2951629, 2951649, 2951669, 2951689, 2951709, 2951729, 2951749, 2951769, 2951789, 2951809, + 2951829, 2951849, 2951869, 2951889, 2951909, 2951929, 2951949, 2951969, 2951989, 2952009, 2952029, 2952049, 2952069, 2952089, 2952109, 2952129, 2952149, 2952169, 2952189, 2952209, + }, + 404: []int64{46, 54, 34, 33, 37, 37, 35, 35, 33, 34, 43, 38, 34, 35, 34, 33, 35, 39, 33, 41, + 33, 34, 34, 37, 33, 37, 33, 33, 36, 37, 34, 35, 35, 33, 37, 37, 33, 37, 33, 33, + 39, 37, 34, 35, 33, 34, 36, 39, 37, 36, 34, 33, 34, 37, 33, 41, 33, 34, 34, 37, + 34, 34, 34, 35, 39, 38, 33, 36, 33, 33, 39, 37, 32, 34, 34, 32, 35, 37, 33, 41, + 34, 33, 35, 38, 33, 39, 33, 32, 35, 38, 34, 35, 34, 33, 42, 38, 33, 35, 32, 33, + }, + 65: []int64{30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, + 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, + 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, + 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, + 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, 30429, + }, + 130: []int64{316, 288, 31, 17, 70, 78, 8, 5, 13, 172, 8, 9, 234, 84, 286, 107, 42, 15, 10, 48, + 9, 10, 16, 4, 410, 8, 11, 141, 85, 283, 12, 9, 12, 21, 45, 572, 19, 14, 2, 147, + 46, 9, 139, 84, 280, 9, 26, 8, 14, 42, 15, 13, 7, 10, 93, 76, 16, 143, 82, 287, + 6, 6, 311, 20, 82, 34, 7, 6, 21, 45, 137, 16, 146, 83, 286, 4, 9, 5, 8, 69, + 20, 3, 18, 8, 8, 173, 9, 139, 84, 274, 8, 11, 8, 3, 76, 61, 7, 4, 7, 11, + }, + 395: []int64{7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, + 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, + 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, + 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, + 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, 7125, + }, + 392: []int64{5078, 6147, 2371, 2453, 3400, 3565, 2486, 2777, 2066, 2456, 4110, 3436, 2636, 2944, 2164, 2343, 2932, 3939, 2400, 4162, + 2265, 2439, 2599, 3240, 2426, 3443, 2166, 2371, 3127, 3394, 2360, 2783, 2950, 2453, 3410, 3576, 2426, 3452, 2126, 2400, + 3267, 3362, 2360, 2936, 2128, 2354, 2927, 3557, 3062, 3562, 2314, 2387, 2586, 3303, 2373, 4038, 2320, 2400, 2680, 3332, + 2385, 2613, 2275, 3132, 3966, 3540, 2273, 2756, 2272, 2243, 3406, 3411, 2261, 3155, 2512, 2207, 2731, 3332, 2445, 4277, + 2437, 2283, 2981, 3481, 2221, 3463, 2373, 2266, 2858, 3371, 2216, 2854, 2473, 2251, 4489, 3926, 2268, 2721, 2224, 2289, + }, + 168: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 10, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 10, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 11: []int64{3767685, 3766843, 3809485, 3802123, 3797075, 3794283, 3804460, 3803343, 3813172, 3813480, 3772726, 3795530, 3803912, 3801956, 3811636, 3811586, 3804529, 3783666, 3808189, 3783649, + 3810947, 3809723, 3804999, 3797668, 3808199, 3790673, 3812824, 3820071, 3791344, 3794066, 3807934, 3802632, 3800437, 3809786, 3796352, 3794083, 3808300, 3791286, 3812957, 3812179, + 3791058, 3797110, 3807338, 3801842, 3812268, 3809965, 3800048, 3796279, 3792819, 3795748, 3808166, 3810005, 3805475, 3797880, 3807963, 3786534, 3811175, 3821127, 3793409, 3798201, + 3808581, 3802765, 3811096, 3799097, 3788026, 3799350, 3803446, 3802916, 3810034, 3812160, 3790129, 3797411, 3810431, 3802124, 3804558, 3812784, 3803386, 3796951, 3809341, 3779330, + 3808717, 3819583, 3792378, 3799161, 3805583, 3790405, 3809761, 3812506, 3802618, 3794905, 3810449, 3803410, 3806050, 3812196, 3778959, 3789793, 3809308, 3803093, 3812233, 3810652, + }, + 443: []int64{35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, 35184372088832, + }, + 6: []int64{5946, 7321, 2624, 2735, 4005, 4184, 2826, 3166, 2221, 2730, 4996, 4030, 2975, 3409, 2378, 2563, 3397, 4747, 2668, 5009, + 2469, 2706, 2937, 3786, 2712, 4082, 2349, 2636, 3644, 3982, 2621, 3204, 3413, 2735, 4019, 4238, 2652, 4090, 2322, 2636, + 3820, 3943, 2586, 3351, 2325, 2584, 3346, 4173, 3570, 4200, 2577, 2642, 2899, 3845, 2639, 4753, 2582, 2676, 3025, 3906, + 2634, 2936, 2536, 3630, 4755, 4202, 2497, 3152, 2481, 2431, 4057, 4024, 2482, 3663, 2821, 2432, 3109, 3924, 2725, 5164, + 2722, 2494, 3421, 4145, 2423, 4090, 2600, 2511, 3261, 3962, 2421, 3260, 2808, 2441, 5479, 4731, 2472, 3072, 2462, 2501, + }, + 33: []int64{10290632, 11098228, 10794144, 10521580, 10347364, 10695132, 11637048, 11150420, 11454568, 10951244, 11043428, 11578212, 13717308, 13716504, 13286552, 12971972, 12974028, 12690972, 12376396, 12373608, + 11828348, 12247780, 12254008, 12316920, 11121524, 11200932, 12060768, 11851116, 11854604, 10879428, 11342532, 11360752, 11727820, 10700152, 10694468, 10159800, 10054908, 10241236, 10178260, 10304924, + 10468096, 11231940, 12406340, 12405528, 11430352, 10276920, 10279996, 9986332, 10070220, 10107804, 10862772, 10757980, 10765936, 10009244, 10407800, 10401684, 10118624, 10915480, 10919140, 11076432, + 10321520, 10320684, 9964144, 9125280, 9124024, 9374092, 9856432, 9863736, 9674992, 9779840, 9773128, 9909380, 10349780, 10350060, 10245204, 10580816, 10583136, 10163740, 9324880, 9321712, + 9709688, 10296824, 10565128, 10061812, 10923364, 10918128, 11400412, 11463328, 11461496, 11702728, 10570204, 10574244, 10278936, 9943392, 10002624, 9834784, 10233244, 10241220, 10702656, 10975280, + }, + 502: []int64{33600, 36700, 32300, 23200, 17300, 17300, 19600, 18200, 16700, 14200, 17800, 18700, 21800, 18300, 17900, 14700, 14400, 16900, 19200, 22500, + 20200, 18100, 14400, 14700, 16700, 18800, 18000, 16000, 15000, 16000, 18200, 17600, 18500, 16500, 17900, 17500, 19500, 19700, 18200, 15900, + 15500, 16300, 18500, 17500, 16900, 14600, 14700, 15200, 19800, 21000, 21200, 16700, 14700, 14400, 16500, 20200, 19900, 17800, 14500, 15000, + 17000, 17000, 16400, 16300, 19000, 20300, 20400, 17800, 16500, 14200, 16000, 16400, 18700, 17500, 18200, 15800, 15300, 14400, 17200, 21100, + 21300, 18500, 14800, 15700, 17800, 19500, 18200, 16300, 14700, 15000, 17200, 16900, 16800, 15100, 19000, 20900, 22600, 18700, 16000, 14200, + }, + 398: []int64{4356, 5034, 4468, 3401, 2288, 2406, 2883, 2712, 2439, 1928, 2642, 2820, 3379, 2703, 2553, 1991, 1938, 2455, 2883, 3400, + 2975, 2578, 1995, 2048, 2392, 2812, 2666, 2288, 2063, 2214, 2659, 2557, 2750, 2376, 2528, 2437, 2805, 2980, 2707, 2225, + 2182, 2358, 2755, 2530, 2380, 1957, 2023, 2150, 3032, 3112, 3147, 2296, 2036, 1989, 2390, 2899, 2844, 2439, 1948, 2022, + 2420, 2452, 2363, 2208, 2725, 2987, 3167, 2630, 2376, 1947, 2269, 2352, 2773, 2506, 2630, 2191, 2121, 1983, 2441, 3127, + 3164, 2729, 2059, 2244, 2625, 2947, 2693, 2299, 1996, 2047, 2488, 2443, 2434, 2079, 2719, 3087, 3410, 2790, 2272, 1937, + }, + 466: []int64{147, 79, 116, 164, 105, 79, 86, 90, 122, 152, 122, 96, 99, 84, 80, 116, 115, 88, 100, 79, + 76, 128, 122, 79, 84, 78, 81, 104, 104, 94, 116, 138, 82, 106, 93, 110, 112, 80, 82, 116, + 124, 111, 82, 82, 74, 100, 84, 145, 114, 74, 74, 172, 106, 150, 109, 76, 122, 132, 122, 78, + 135, 102, 74, 158, 108, 74, 121, 144, 74, 132, 124, 82, 211, 154, 127, 142, 84, 76, 115, 96, + 76, 128, 84, 72, 116, 157, 96, 126, 94, 107, 136, 132, 106, 158, 164, 96, 112, 137, 90, 142, + }, + 410: []int64{976, 899, 657, 904, 171, 606, 607, 707, 823, 331, 255, 421, 230, 1001, + 937, 467, 738, 287, 904, 962, 518, 391, 593, 593, 59, 874, 364, 873, 728, 727, 533, + 328, 957, 637, 973, 1014, 259, 160, 698, 589, 933, 283, 385, 393, 129, 414, 16, 800, + 105, 150, 905, 278, 131, 115, 678, 738, 444, 411, 388, 402, 541, 428, 970, 260, 56, + 794, 975, 480, 644, 110, 702, 93, 240, 322, 651, 370, 261, 589, 72, 259, 405, 965, + 927, 519, 210, 291, 688, 758, 942, 301, 253, 605, 677, 995, 509, 478, 646, 3, 472, 1007, + }, + 470: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 57: []int64{78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, 78208, + 78208, 78208, 78208, 78208, 78208, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, 77828, + 77824, 77824, 77824, 77824, 77824, 77824, 77848, 77844, 77832, 77832, 77832, 77828, 77824, 77824, 77824, 77824, 77824, 77824, 77824, 77824, + 77824, 77824, 77824, 77824, 77824, 77824, 77824, 77824, 77824, 77824, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, + 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, 77816, + }, + 29: []int64{58388608, 58386244, 58386248, 58386248, 58386416, 58388724, 58386336, 58386332, 58386320, 58386400, 58386332, 58386344, 58386332, 58386344, 58386380, 58386372, 58386212, 58386208, 58386208, 58386208, + 58386208, 58386196, 58386208, 58386208, 58386276, 58386196, 58386208, 58386208, 58386216, 58386216, 58388608, 58386216, 58386216, 58386216, 58386204, 58386212, 58386208, 58386208, 58386208, 58387404, + 58388600, 58386208, 58386208, 58386208, 58386208, 58386208, 58386208, 58386196, 58386208, 58386208, 58386208, 58386208, 58388684, 58386208, 58386344, 58386208, 58386196, 58386208, 58386216, 58386216, + 58386204, 58386216, 58386220, 58386220, 58388612, 58386220, 58386220, 58386220, 58386220, 58386208, 58386248, 58386248, 58386248, 58386236, 58386248, 58386248, 58386248, 58386248, 58386248, 58386248, + 58386248, 58386248, 58386236, 58386248, 58388640, 58386248, 58386240, 58386248, 58386248, 58386248, 58386248, 58388640, 58386248, 58386248, 58386248, 58386236, 58386248, 58386248, 58386248, 58386236, + }, + 90: []int64{6, 644, 90, 376, 809, 98, 902, 998, 526, 633, 973, 1019, 423, 410, 219, + 879, 566, 390, 109, 450, 489, 341, 61, 465, 29, 893, 134, 1022, 703, 73, 477, 976, + 172, 175, 65, 696, 410, 566, 430, 187, 300, 542, 305, 751, 606, 567, 905, 70, 369, + 524, 913, 829, 351, 456, 295, 29, 539, 694, 620, 1010, 441, 904, 706, 954, 777, 221, + 497, 586, 456, 694, 183, 631, 302, 391, 857, 864, 610, 880, 906, 299, 839, 399, 49, + 713, 220, 903, 788, 228, 256, 119, 562, 395, 991, 543, 205, 584, 130, 804, 70, 99, + }, + 406: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 424: []int64{1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, + 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, + 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, + 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, + 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, 1295864, + }, + 61: []int64{14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, 14336, + }, + 506: []int64{20000, 20600, 20600, 20400, 20400, 20400, 20600, 20700, 20600, 20400, 20500, 20500, 20700, 20700, 20700, 20300, 20400, 20500, 20700, 20800, + 20700, 20500, 20500, 20600, 20700, 20700, 20700, 20500, 20500, 20600, 20600, 20600, 20700, 20500, 20500, 20600, 20700, 20800, 20700, 20500, + 20200, 20000, 19600, 19300, 18900, 18200, 17700, 17700, 18000, 18000, 17900, 17800, 17700, 17800, 17900, 17900, 17900, 17700, 17600, 17700, + 17800, 17800, 17600, 17600, 17600, 17600, 17800, 17800, 17800, 17600, 17600, 17700, 17800, 17800, 17800, 17600, 17600, 17500, 17700, 17800, + 17800, 17600, 17500, 17600, 17700, 17800, 17700, 17600, 17600, 17600, 17800, 17700, 17700, 17400, 17600, 17700, 17800, 17900, 17800, 17700, + }, + 508: []int64{19400, 19900, 19900, 19700, 19700, 19800, 19900, 20000, 19900, 19700, 19800, 19800, 20000, 20000, 20000, 19700, 19700, 19800, 20000, 20100, + 20000, 19800, 19800, 19900, 20000, 20000, 20000, 19800, 19800, 19900, 20000, 19900, 20000, 19800, 19800, 19900, 20000, 20100, 20000, 19900, + 19600, 19300, 19100, 18800, 18400, 17800, 17300, 17300, 17600, 17600, 17500, 17400, 17300, 17400, 17500, 17500, 17500, 17300, 17200, 17300, + 17400, 17400, 17200, 17200, 17200, 17200, 17400, 17400, 17400, 17200, 17200, 17300, 17400, 17400, 17400, 17200, 17200, 17100, 17300, 17400, + 17400, 17200, 17100, 17200, 17300, 17400, 17300, 17200, 17200, 17200, 17400, 17300, 17300, 17000, 17200, 17300, 17400, 17500, 17400, 17300, + }, + 37: []int64{1116464, 1116460, 1116476, 1116472, 1116984, 1117312, 1117308, 1117040, 1117680, 1117680, 1117768, 1117768, 1117764, 1117780, 1117780, 1117780, 1118264, 1118004, 1118004, 1118004, + 1118184, 1118184, 1118176, 1118596, 1118596, 1118360, 1117724, 1117724, 1117724, 1117976, 1117976, 1118296, 1118292, 1118292, 1118036, 1117612, 1117608, 1117288, 1117300, 1117300, + 1117388, 1117812, 1117812, 1118232, 1118552, 1118552, 1118904, 1118628, 1118624, 1118296, 1118296, 1118288, 1118540, 1118624, 1118620, 1118708, 1119284, 1119280, 1119276, 1118396, + 1118388, 1118788, 1119028, 1119028, 1119508, 1119508, 1119504, 1119500, 1119420, 1119420, 1119156, 1119476, 1119476, 1118976, 1118976, 1118968, 1119028, 1119128, 1119124, 1119124, + 1118952, 1118952, 1119212, 1119196, 1119192, 1118868, 1118920, 1118920, 1118916, 1118916, 1118908, 1119224, 1119224, 1119224, 1119220, 1119216, 1119216, 1119148, 1118884, 1118880, + }, + 85: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 396: []int64{65, 76, 50, 49, 53, 54, 51, 50, 49, 49, 62, 56, 50, 49, 49, 49, 49, 53, 49, 58, + 49, 49, 49, 53, 49, 53, 49, 49, 50, 54, 49, 50, 48, 48, 51, 53, 49, 52, 49, 49, + 56, 54, 50, 51, 49, 49, 52, 56, 52, 51, 49, 48, 50, 53, 49, 59, 47, 49, 49, 53, + 49, 49, 49, 49, 54, 54, 49, 51, 49, 49, 55, 53, 48, 50, 48, 47, 50, 53, 48, 56, + 49, 48, 50, 54, 48, 55, 49, 48, 50, 55, 49, 49, 49, 48, 58, 52, 49, 51, 48, 48, + }, + 426: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 107: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 510: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 98: []int64{62902396, 62921636, 62904432, 62913104, 62912472, 62897712, 62903512, 62911892, 62909336, 62914452, 62917196, 62904156, 62915072, 62920036, 62917360, 62930320, 62924892, 62917404, 62902896, 62906684, + 62898772, 62900724, 62898848, 62899600, 62906108, 62902472, 62903632, 62909996, 62913516, 62902092, 62911576, 62909124, 62914036, 62927356, 62917200, 62908204, 62923924, 62925684, 62917196, 62925320, + 62930344, 62909300, 62904316, 62901588, 62905664, 62906196, 62906848, 62913096, 62908148, 62906556, 62912224, 62904436, 62916248, 62903068, 62911968, 62906208, 62913732, 62924492, 62915224, 62904880, + 62919844, 62921172, 62919572, 62924784, 62931284, 62908824, 62901488, 62903452, 62903008, 62905672, 62911408, 62910308, 62907216, 62904444, 62904628, 62908004, 62915428, 62904220, 62912192, 62909452, + 62905684, 62916360, 62919128, 62919116, 62916452, 62914768, 62924312, 62922776, 62923692, 62903832, 62915528, 62903128, 62904000, 62904420, 62906860, 62918812, 62906628, 62907844, 62904164, 62910788, + }, + 102: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 105: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 49: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 68: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 41: []int64{1050664, 1050664, 1050664, 1050660, 1050656, 1050656, 1050652, 1050648, 1050648, 1050648, 1050648, 1050648, 1050644, 1050644, 1050644, 1050644, 1050640, 1050640, 1050640, 1050640, + 1050640, 1050640, 1050632, 1050632, 1050632, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050612, 1050608, 1050604, 1050604, 1050604, + 1050588, 1050588, 1050588, 1050588, 1050588, 1050588, 1050932, 1050916, 1050916, 1050900, 1050900, 1050896, 1050888, 1050888, 1050884, 1050864, 1050864, 1050860, 1050856, 1050856, + 1050848, 1050848, 1050848, 1050848, 1050848, 1050848, 1050844, 1050840, 1050840, 1050840, 1050824, 1050824, 1050824, 1050820, 1050820, 1050812, 1050812, 1050812, 1050808, 1050808, + 1050808, 1050808, 1050800, 1050800, 1050796, 1050792, 1050792, 1050792, 1050788, 1050788, 1050780, 1050780, 1050780, 1050780, 1050776, 1050772, 1050772, 1050768, 1050764, 1050760, + }, + 440: []int64{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + }, + 441: []int64{268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + }, + 422: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 429: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 143: []int64{8765, 5677, 1947, 2716, 2821, 1860, 1596, 1424, 1238, 1784, 2685, 2330, 1867, 1402, 1389, 1764, 1412, 2895, 1478, 2934, + 1256, 1540, 1604, 1518, 1410, 1930, 2512, 1185, 1490, 1418, 1493, 1256, 1791, 2541, 2270, 2222, 1912, 1355, 958, 1282, + 2087, 1882, 1279, 1410, 1252, 1177, 1151, 1347, 2879, 2776, 1223, 1472, 1020, 1314, 1310, 2902, 1374, 1350, 1194, 1425, + 1239, 975, 1225, 1295, 3642, 2116, 1627, 963, 1182, 1567, 1806, 2185, 1304, 1303, 1348, 958, 1311, 1057, 1405, 3185, + 1147, 2278, 1285, 1069, 1297, 2895, 1175, 1205, 1551, 1214, 1279, 1427, 1113, 984, 3162, 3057, 2320, 1435, 1076, 1440, + }, + 131: []int64{4655, 3164, 3005, 3258, 3194, 3077, 3071, 2430, 2576, 2467, 2464, 3189, 2703, 1753, 2425, 1598, 2234, 2281, 2723, 2766, + 2130, 2329, 2275, 1503, 2062, 2067, 2520, 1644, 1862, 1863, 2102, 2138, 1872, 2436, 2331, 2555, 3023, 2370, 1893, 2109, + 2025, 1974, 2015, 1766, 2073, 2033, 1645, 1974, 2306, 2578, 2046, 2724, 2061, 1859, 1932, 2223, 1915, 2410, 1825, 1992, + 1723, 1552, 2076, 1931, 3267, 2736, 3099, 1421, 1897, 1773, 1973, 2563, 2185, 1572, 1948, 1545, 1881, 1639, 2266, 2916, + 2266, 2899, 1927, 1828, 2131, 2660, 1845, 1844, 1902, 1712, 1835, 2563, 2026, 1545, 4746, 7004, 3166, 2172, 2198, 1984, + }, + 125: []int64{4972, 3453, 3036, 3275, 3264, 3155, 3080, 2435, 2589, 2639, 2472, 3199, 2938, 1838, 2711, 1705, 2276, 2296, 2734, 2815, + 2139, 2339, 2291, 1508, 2473, 2076, 2532, 1785, 1947, 2146, 2114, 2148, 1885, 2458, 2376, 3128, 3042, 2384, 1895, 2256, + 2072, 1983, 2155, 1851, 2354, 2042, 1671, 1982, 2320, 2620, 2062, 2738, 2069, 1870, 2026, 2299, 1931, 2553, 1907, 2279, + 1729, 1558, 2388, 1951, 3349, 2771, 3106, 1428, 1918, 1819, 2110, 2579, 2331, 1656, 2234, 1550, 1891, 1645, 2274, 2985, + 2287, 2902, 1945, 1836, 2140, 2833, 1854, 1983, 1986, 1986, 1843, 2575, 2034, 1549, 4822, 7066, 3173, 2176, 2206, 1996, + }, + 27: []int64{29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, + 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, + 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, + 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, + 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, 29551, + }, + 419: []int64{57636, 57636, 57637, 57637, 57636, 57637, 57637, 57639, 57637, 57637, 57638, 57636, 57637, 57637, 57639, 57637, 57639, 57637, 57637, 57635, + 57635, 57635, 57635, 57635, 57635, 57635, 57635, 57635, 57635, 57635, 57637, 57635, 57637, 57635, 57635, 57635, 57635, 57637, 57635, 57635, + 57635, 57635, 57635, 57637, 57637, 57635, 57637, 57635, 57635, 57635, 57635, 57635, 57637, 57635, 57635, 57635, 57635, 57635, 57637, 57637, + 57635, 57637, 57635, 57635, 57637, 57635, 57635, 57635, 57635, 57637, 57637, 57637, 57635, 57635, 57637, 57635, 57637, 57635, 57635, 57637, + 57635, 57635, 57637, 57635, 57635, 57637, 57637, 57635, 57635, 57637, 57635, 57637, 57635, 57635, 57636, 57635, 57637, 57635, 57637, 57635, + }, + 511: []int64{36400, 40300, 40300, 38500, 38500, 38500, 40200, 40200, 40200, 40200, 40200, 40200, 40200, 40200, 40200, 39900, 26100, 26100, 26500, 31100, + 31100, 29600, 29600, 29600, 31100, 31100, 31100, 29600, 29600, 29600, 31100, 31100, 31100, 29600, 26600, 26900, 27000, 34300, 34300, 27000, + 27000, 27000, 36100, 36100, 36100, 27000, 27300, 27300, 36100, 36100, 36100, 27500, 27300, 27300, 27500, 27500, 27500, 27300, 27300, 27300, + 27500, 27500, 27500, 27300, 27300, 27300, 34600, 34600, 34600, 27300, 26700, 26700, 34600, 34600, 34600, 26700, 26700, 26700, 35000, 35000, + 35000, 28500, 28500, 28500, 33900, 33900, 33900, 28500, 28500, 28500, 33900, 33900, 33900, 28500, 25600, 27300, 33900, 33900, 33900, 27300, + }, + 12: []int64{17855, 20753, 13236, 12962, 14433, 14512, 13653, 13534, 12746, 13076, 16646, 14960, 13417, 13483, 13067, 12955, 13556, 15106, 13014, 16075, + 13035, 13094, 13233, 14367, 13043, 14539, 12820, 13046, 13940, 14320, 13203, 13483, 13483, 12890, 14226, 14402, 13045, 14350, 12809, 12948, + 15041, 14439, 13309, 13757, 12993, 13068, 13879, 15041, 14435, 14027, 13045, 12915, 13351, 14350, 13023, 16024, 12689, 13111, 13270, 14385, + 13087, 13285, 13071, 13725, 15293, 14793, 13024, 13870, 12994, 12916, 15175, 14214, 12551, 13424, 13055, 12480, 13549, 14215, 12944, 15988, + 13097, 12677, 13603, 14745, 12869, 15045, 12947, 12664, 13529, 14769, 13079, 13453, 13052, 12744, 16185, 14851, 13030, 13729, 12598, 12845, + }, + 539: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 427: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 399: []int64{71, 59, 0, 4, 15, 14, 2, 9, 0, 3, 79, 10, 91, 11, 2, 2, 2, 101, 0, 35, + 0, 0, 0, 36, 2, 36, 0, 0, 15, 0, 0, 9, 0, 0, 6, 18, 1, 12, 0, 0, + 103, 15, 5, 0, 0, 6, 0, 28, 6, 37, 21, 0, 7, 26, 4, 5, 0, 22, 0, 3, + 0, 2, 1, 38, 15, 23, 0, 0, 0, 0, 9, 2, 0, 20, 0, 0, 3, 3, 3, 77, + 6, 0, 4, 99, 0, 26, 0, 1, 0, 22, 0, 10, 5, 2, 70, 25, 0, 0, 2, 0, + }, + 467: []int64{2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, + 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 3, 2, + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 4, 0, 0, 1, 0, 0, 5, 0, 0, + }, + 149: []int64{4529, 3139, 976, 1336, 1328, 854, 781, 678, 587, 874, 1296, 1092, 914, 657, 662, 862, 671, 1366, 724, 1384, + 595, 753, 766, 696, 697, 925, 1215, 579, 700, 644, 730, 595, 857, 1243, 1059, 1037, 937, 644, 449, 627, + 1002, 871, 626, 661, 594, 576, 543, 608, 1409, 1306, 579, 720, 479, 592, 641, 1576, 654, 660, 555, 648, + 606, 457, 580, 633, 1730, 985, 797, 451, 559, 768, 864, 1020, 638, 608, 641, 467, 622, 466, 687, 1507, + 542, 1115, 609, 472, 634, 1398, 556, 589, 730, 544, 625, 679, 525, 480, 1496, 1446, 1136, 683, 507, 704, + }, + 501: []int64{61000, 61000, 61000, 49900, 27100, 27100, 41100, 41100, 41100, 23800, 47100, 47100, 47100, 40600, 40600, 23500, 21400, 26100, 36800, 36800, + 36800, 31600, 19600, 22400, 34800, 37300, 37300, 37300, 23700, 23700, 38500, 38500, 38500, 27400, 27400, 27500, 37200, 37200, 37200, 36500, + 37300, 37300, 37300, 36600, 36600, 27100, 27700, 27700, 45800, 45800, 45800, 28100, 20900, 22100, 36000, 45800, 45800, 45800, 22800, 23500, + 35000, 35000, 35000, 26000, 36100, 36100, 36100, 35400, 35400, 21600, 40900, 40900, 40900, 36900, 36900, 26300, 21800, 22600, 36500, 40500, + 40500, 40500, 23200, 23500, 34300, 37900, 37900, 37900, 22600, 23800, 37200, 37200, 37200, 19500, 41700, 41700, 41700, 35400, 35400, 19700, + }, + 133: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 10, 0, 0, 11, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 10, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 444: []int64{7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + }, + 414: []int64{2356756, 2354240, 2353756, 2353760, 2353824, 2353756, 2353756, 2353756, 2353620, 2353760, 2353756, 2353756, 2353620, 2353756, 2353712, 2353712, 2353580, 2353580, 2353580, 2355628, + 2355628, 2355500, 2355672, 2355672, 2355688, 2355672, 2355672, 2355672, 2355672, 2355716, 2355716, 2355716, 2355716, 2355716, 2355580, 2355716, 2355720, 2355672, 2355672, 2355672, + 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355536, 2355672, 2355672, 2355672, 2355672, 2355740, 2355672, 2355688, 2355672, 2355672, 2355676, 2355672, 2355672, + 2355536, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355536, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, + 2355672, 2355672, 2355536, 2355672, 2355672, 2355672, 2355536, 2355676, 2355812, 2355672, 2355672, 2355672, 2355672, 2355672, 2355672, 2355536, 2355672, 2355672, 2355672, 2355540, + }, + 514: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 513: []int64{34500, 36400, 36400, 35700, 35700, 35700, 36400, 36400, 36400, 35700, 35700, 35700, 36400, 36400, 36400, 35700, 35700, 35700, 36300, 36300, + 36300, 35700, 35700, 35700, 35700, 35700, 35700, 34600, 34600, 34600, 35700, 35700, 35700, 34600, 34600, 34600, 35700, 36100, 36100, 35700, + 34600, 34600, 36100, 36100, 36100, 31100, 27000, 27000, 27300, 27500, 27500, 27300, 27300, 27300, 27500, 27500, 27500, 27300, 27300, 27300, + 27500, 27500, 27500, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 27300, 28500, + 28500, 27500, 27300, 27300, 27500, 27500, 27500, 27300, 27300, 27300, 27500, 27500, 27500, 27300, 27300, 27300, 28500, 28500, 28500, 27300, + }, + 503: []int64{24600, 26100, 26200, 25700, 25700, 25800, 26300, 26300, 26100, 25500, 25100, 24200, 23500, 22500, 21300, 19300, 17600, 17900, 18300, 18700, + 18500, 18000, 17900, 18100, 18500, 18100, 17900, 17300, 17400, 17600, 18000, 18100, 17900, 17500, 17200, 17300, 17800, 18200, 18000, 17600, + 17500, 17700, 18100, 18000, 17900, 17400, 17400, 17200, 18100, 18100, 18000, 17500, 17000, 17200, 17600, 18000, 17900, 17500, 17400, 17600, + 18000, 17900, 17800, 17300, 17500, 17600, 18000, 18100, 18100, 17600, 17200, 17300, 17700, 17800, 18000, 17500, 17500, 17600, 17700, 17900, + 17700, 17300, 17300, 17600, 18000, 18000, 18000, 17500, 17500, 17300, 17800, 17800, 17800, 17400, 17400, 17700, 18200, 18200, 17800, 17400, + }, + 14: []int64{62600, 77075, 27623, 28796, 42164, 44052, 29757, 33336, 23381, 28748, 52594, 42428, 31328, 35896, 25039, 26988, 35767, 49973, 28095, 52738, + 25992, 28489, 30925, 39862, 28555, 42973, 24731, 27757, 38363, 41920, 27595, 33737, 35930, 28800, 42316, 44616, 27926, 43063, 24453, 27756, + 40219, 41513, 27233, 35284, 24476, 27207, 35227, 43938, 37587, 44219, 27139, 27820, 30524, 40477, 27790, 50045, 27185, 28176, 31853, 41129, + 27734, 30915, 26703, 38213, 50064, 44243, 26290, 33188, 26125, 25601, 42719, 42369, 26139, 38564, 29703, 25603, 32738, 41318, 28690, 54373, + 28665, 26258, 36017, 43638, 25508, 43062, 27378, 26439, 34338, 41717, 25492, 34329, 29567, 25705, 57680, 49805, 26032, 32345, 25920, 26333, + }, + 507: []int64{36500, 38200, 38200, 37800, 37800, 37800, 38200, 38200, 38200, 37800, 37800, 37800, 38200, 38200, 38200, 37800, 37800, 37800, 37800, 37800, + 37800, 37000, 37000, 37000, 37000, 37000, 37000, 36800, 36800, 36800, 37000, 37000, 37000, 36800, 36800, 36800, 37000, 37000, 37000, 36800, + 36500, 36500, 36600, 36600, 36500, 31600, 27500, 27500, 27700, 28100, 28100, 27700, 27700, 27700, 28100, 28100, 28100, 27700, 27700, 27700, + 28100, 28100, 28100, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 27700, 29100, + 29100, 28100, 27700, 27700, 28100, 28100, 28100, 27700, 27700, 27700, 28100, 28100, 28100, 27700, 27700, 27900, 29100, 29100, 29100, 27900, + }, + 86: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 462: []int64{4235, 2537, 970, 1379, 1492, 1006, 814, 746, 651, 909, 1389, 1238, 953, 744, 726, 901, 740, 1529, 754, 1550, + 660, 786, 838, 822, 712, 1004, 1297, 605, 789, 773, 763, 661, 933, 1297, 1211, 1185, 975, 711, 509, 654, + 1085, 1011, 653, 749, 657, 601, 607, 738, 1470, 1469, 643, 752, 541, 721, 669, 1326, 720, 689, 639, 777, + 633, 517, 645, 661, 1911, 1130, 830, 511, 622, 798, 941, 1165, 666, 694, 706, 490, 688, 590, 717, 1677, + 605, 1162, 675, 596, 662, 1496, 618, 615, 821, 670, 654, 748, 587, 503, 1666, 1611, 1184, 751, 568, 736, + }, + 148: []int64{4235, 2537, 970, 1379, 1492, 1006, 814, 746, 651, 909, 1389, 1238, 953, 744, 726, 901, 740, 1529, 754, 1550, + 660, 786, 838, 822, 712, 1004, 1297, 605, 789, 773, 763, 661, 933, 1297, 1211, 1185, 975, 711, 509, 654, + 1085, 1011, 653, 749, 657, 601, 607, 738, 1470, 1469, 643, 752, 541, 721, 669, 1326, 720, 689, 639, 777, + 633, 517, 645, 661, 1911, 1130, 830, 511, 622, 798, 941, 1165, 666, 694, 706, 490, 688, 590, 717, 1677, + 605, 1162, 675, 596, 662, 1496, 618, 615, 821, 670, 654, 748, 587, 503, 1666, 1611, 1184, 751, 568, 736, + }, +} + +var ResourcePoolMetricData = map[int32][]int64{ + 6: []int64{2648, 2660, 2642, 2704, 2653, 2610, 2679, 2637, 2688, 2575, 2703, 2546, 2629, 2689, 2653, 2564, 2717, 2545, 2613, 2672, + 2767, 2549, 2648, 2535, 2618, 2693, 2635, 2584, 2684, 2585, 2770, 2655, 2721, 2665, 2804, 2563, 2920, 2718, 2661, 2741, + 2731, 2617, 2692, 2716, 2627, 2612, 2725, 2536, 2705, 2757, 2741, 2574, 3086, 2513, 2748, 2689, 2678, 3847, 2742, 2552, + 2672, 2731, 2667, 2717, 2727, 2570, 2687, 2650, 2702, 3887, 2694, 2583, 2679, 2687, 2690, 2664, 2668, 2592, 2809, 2669, + 2610, 3783, 2672, 2576, 2705, 2693, 2768, 2665, 2764, 2666, 2684, 2743, 2721}, + 98: []int64{69961436, 69961085, 69960708, 69961322, 69961734, 69961582, 69960647, 69960520, 69961108, 69961043, 69959288, 69961340, 69963664, 69963803, 69966339, 69966730, 69966854, 69967577, 69969142, 69970332, + 69970629, 69970167, 69971088, 69970684, 69971038, 69971578, 69968726, 69968868, 69968092, 69968632, 69968387, 69968226, 69968412, 69967611, 69968527, 69969251, 69968896, 69968292, 69966611, 69966893, + 69966583, 69969648, 69969991, 69970006, 69970131, 69970476, 69970138, 69970011, 69969946, 69970596, 69970963, 69970303, 69970393, 69970626, 69970975, 69970635, 69970602, 69970758, 69970815, 69970774, + 69971567, 69974147, 69975787, 69973389, 69974243, 69974761, 69976130, 69977938, 69977197, 69976327, 69975736, 69975777, 69975205, 69974629, 69974275, 69973691, 69973552, 69972974, 69972629, 69972392, + 69973105, 69974080, 69976093, 69976312, 69979980, 69980007, 69984359, 69987261, 69988144, 69988443, 69987244, 69986857, 69986303}, + 29: []int64{71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71097821, 71098368, 71102190, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464}, + 33: []int64{14147864, 14298869, 13853549, 14071653, 14408592, 13569734, 13775254, 13631952, 14009437, 14864391, 15225092, 14491085, 14256903, 13928347, 13923454, 13900408, 14486205, 13712336, 13669000, 13853559, + 13605408, 14571477, 15720747, 15202728, 14281366, 14092624, 14070270, 14407903, 14308628, 13908775, 14154848, 13566956, 14234531, 14219868, 16074441, 14676380, 14672195, 14980482, 14745536, 14405798, + 14986710, 15169160, 14108018, 14105911, 13912964, 14536520, 15798325, 15342582, 14548403, 14673552, 15304788, 14523272, 15387281, 15152398, 14791723, 14362474, 13642436, 14774898, 16125462, 15111862, + 14085672, 14342207, 13367707, 15036358, 15538271, 14937092, 14194016, 13878714, 13884307, 14810548, 15532667, 15050322, 14081436, 14789578, 14602931, 14380633, 14739248, 14182827, 15072001, 14819650, + 14119919, 14589666, 16036683, 14730158, 14321214, 14659554, 14368049, 14447758, 14924502, 13787139, 14776992, 15789234, 14169540}, + 37: []int64{1224491, 1224767, 1224727, 1224610, 1224560, 1224513, 1224444, 1224411, 1224390, 1224364, 1224323, 1223250, 1222386, 1221184, 1220120, 1218849, 1217944, 1217003, 1215534, 1215959, + 1215276, 1214698, 1214640, 1214615, 1214655, 1214319, 1215025, 1214862, 1214388, 1214122, 1214082, 1214049, 1214000, 1213937, 1213708, 1213309, 1213506, 1213300, 1212838, 1212427, + 1211531, 1206346, 1206131, 1206061, 1205836, 1205722, 1205495, 1205681, 1205711, 1204664, 1204509, 1205405, 1205132, 1204909, 1204796, 1204754, 1204743, 1204720, 1204484, 1204448, + 1204636, 1204476, 1204354, 1204331, 1204079, 1203968, 1203899, 1203865, 1203811, 1203734, 1203865, 1203628, 1203251, 1203212, 1203098, 1203057, 1203938, 1203697, 1203608, 1203573, + 1203545, 1203465, 1202291, 1201669, 1201782, 1201631, 1201743, 1201529, 1201474, 1201407, 1199122, 1198521, 1198570}, + 70: []int64{91, 585, 246, 114, 553, 348, 824, 848, 827, 882, 632, 500, 647, 805, 425, 971, 789, 1001, 910, 1013, 338, 713, 496, 168, 201, 886, 124, 968, 768, 736, 612, 859, 973, 64, 312, 449, 38, 839, 807, 571, 83, 862, 1015, 333, 818, 173, 396, 520, 171, 678, 160, 203, 991, 549, 776, 524, 390, 228, 576, 307, 1005, 93, 893, 475, 451, 141, 98, 439, 95, 104, 739, 630, 275, 701, 722, 16, 207, 468, 310, 387, 217, 377, 684, 969, 396, 1010, 866, 914, 181, 621, 995, 831, 278, 530, 465, 745, 704, 762, 545, 544}, + 90: []int64{6, 644, 90, 376, 809, 98, 902, 998, 526, 633, 973, 1019, 423, 410, 219, + 879, 566, 390, 109, 450, 489, 341, 61, 465, 29, 893, 134, 1022, 703, 73, 477, 976, + 172, 175, 65, 696, 410, 566, 430, 187, 300, 542, 305, 751, 606, 567, 905, 70, 369, + 524, 913, 829, 351, 456, 295, 29, 539, 694, 620, 1010, 441, 904, 706, 954, 777, 221, + 497, 586, 456, 694, 183, 631, 302, 391, 857, 864, 610, 880, 906, 299, 839, 399, 49, + 713, 220, 903, 788, 228, 256, 119, 562, 395, 991, 543, 205, 584, 130, 804, 70, 99, + }, + 7: []int64{1406, 1419, 1426, 1412, 1413, 1408, 1472, 1426, 1462, 1424, 1447, 1403, 1433, 1429, 1420, 1395, 1447, 1396, 1406, 1413, + 1432, 1420, 1425, 1411, 1432, 1437, 1444, 1407, 1448, 1450, 1477, 1431, 1451, 1437, 1403, 1459, 1478, 1452, 1447, 1446, + 1410, 1441, 1445, 1415, 1433, 1435, 1458, 1419, 1441, 1476, 1310, 1482, 1451, 1458, 1455, 1428, 1446, 1443, 1436, 1449, + 1422, 1394, 1424, 1402, 1417, 1410, 1419, 1432, 1446, 1421, 1440, 1430, 1406, 1463, 1448, 1446, 1432, 1435, 1465, 1484, + 1443, 1451, 1414, 1446, 1412, 1429, 1442, 1424, 1497, 1458, 1490, 1463, 1533, 1482, 1473, 1468, 1467, 294, 294, 293, + }, + 8: []int64{6539, 7702, 6548, 8268, 6700, 7397, 6790, 7898, 6476, 6905, 6238, 7278, 6627, 7807, 5958, 6792, 6036, 6789, 6141, 7983, + 7889, 6401, 5709, 6512, 5807, 7728, 5975, 6809, 6144, 7257, 8149, 7885, 6501, 8131, 7308, 6462, 8264, 8044, 6631, 7954, + 7046, 7166, 6704, 7344, 6438, 6346, 6730, 6478, 6916, 7791, 6944, 6179, 7985, 6202, 6726, 8141, 6854, 9215, 6561, 6467, + 6547, 7569, 6386, 7388, 7036, 6134, 6651, 7371, 6545, 11069, 6235, 6345, 6048, 8274, 6422, 7397, 6544, 6905, 7577, 7600, + 5693, 8974, 6178, 6603, 6656, 7968, 7048, 7406, 6370, 7129, 5815, 7886, 6045, 8873, 6834, 7219, 6213, 1852, 583, 753, + }, + 16: []int64{6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, + 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, + 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, + 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, + 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 6428, 100, 100, 100, + }, + 17: []int64{14, 14, 14, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 14, 14, 14, + 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 14, 15, 14, 15, 14, 16, 15, 14, 15, + 15, 14, 14, 15, 14, 14, 15, 14, 15, 15, 15, 14, 17, 13, 15, 14, 14, 21, 15, 14, + 14, 15, 14, 15, 15, 14, 14, 14, 14, 21, 14, 14, 14, 14, 14, 14, 14, 14, 15, 14, + 14, 21, 14, 14, 15, 14, 15, 14, 15, 14, 14, 15, 15, 20, 15, 14, 14, 253, 184, 198, + }, + 18: []int64{2805, 3008, 2834, 2990, 2887, 2897, 2838, 2978, 2875, 2848, 2889, 2868, 2799, 3006, 2816, 2871, 2885, 2862, 2764, 2979, + 2813, 2966, 2885, 2841, 2816, 3021, 2825, 2884, 2896, 2868, 3005, 2990, 2858, 3027, 2985, 2878, 3136, 3049, 2840, 3057, + 2932, 2952, 2886, 3029, 2822, 2907, 2908, 2846, 2885, 3019, 2957, 2938, 3268, 2858, 2922, 3005, 2894, 4130, 2912, 2893, + 2877, 3010, 2896, 3021, 2943, 2885, 2873, 2961, 2870, 4165, 2865, 2906, 2835, 3017, 2871, 2934, 2842, 2883, 2955, 2996, + 2852, 4035, 2909, 2881, 2864, 3050, 2947, 2936, 2978, 2983, 2850, 3069, 2881, 4073, 3006, 2929, 2824, 549, 402, 429, + }, + 19: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, + }, + 20: []int64{196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 4, 4, 4, + }, + 22: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 30: []int64{71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71098368, 71100416, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 14680064, 14680064, 14680064, + }, + 31: []int64{71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, 71094272, + 71094272, 71094272, 71094272, 71094272, 71098368, 71098368, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 71102464, 14680064, 14680064, 14680064, + }, + 34: []int64{11984984, 12310048, 12089852, 11869644, 12131784, 11754300, 11806732, 11460704, 12268108, 12656084, 13316684, 12509284, 12362480, 12435872, 12236644, 11733332, 12320532, 11712352, 12194704, 11743820, + 11785764, 12603648, 12750452, 13044056, 12456848, 12194700, 12268112, 12519768, 12142276, 12456848, 12760936, 11995480, 11680904, 12477824, 13872424, 13117456, 12372964, 12855352, 12687536, 12551220, + 13253768, 12771416, 12026932, 11901100, 11796248, 12488304, 12530248, 13285224, 12729480, 12792396, 12918224, 12404420, 12844828, 12718996, 12792388, 12561704, 12016444, 12289072, 14312828, 13411048, + 12110816, 12089848, 11722844, 13002108, 13222312, 12656076, 12477820, 11953532, 12047904, 12760936, 13201340, 13106960, 12404420, 12561712, 12939200, 12582680, 12561704, 12142280, 12970648, 13138420, + 12477820, 12771420, 12519764, 12823848, 12456848, 13211828, 11984992, 12603648, 12698016, 12257620, 12729476, 12802884, 12519764, 12823852, 13379596, 12844820, 12624624, 4236240, 4341100, 4487900, + }, + 35: []int64{17406204, 17070628, 16022008, 16630184, 16797952, 14962948, 16493868, 15319468, 16672116, 17773168, 17500540, 16829408, 16493868, 15759872, 16042976, 17028680, 16892368, 15665488, 15749384, 16284196, + 15906708, 16850420, 18486248, 17668348, 17049608, 16441444, 16294680, 17332768, 17479532, 15382380, 15581652, 15455820, 17479532, 16147880, 18286976, 16609288, 16567348, 17343296, 16567264, 16619700, + 17374668, 17678756, 16703620, 17206936, 16735036, 16818920, 19377496, 18979120, 17668268, 16777024, 17227912, 17133576, 18444296, 17699768, 17133580, 16819008, 15508208, 18182080, 18958024, 17636860, + 16389092, 17227948, 15340432, 17951424, 19398464, 17867580, 16525400, 15969576, 16567272, 17322240, 18265960, 17217380, 16514832, 17123012, 16651156, 17217388, 17752164, 16797996, 17301312, 16965768, + 16640752, 17353780, 19786396, 16472900, 16756008, 16923780, 17343212, 17490056, 17825596, 15896180, 17500496, 18905632, 16913372, 17374748, 18737944, 17007748, 17196492, 5955908, 5221904, 5515508, + }, + 38: []int64{1224116, 1224140, 1224660, 1224576, 1224544, 1224472, 1224420, 1224404, 1224376, 1224348, 1224308, 1222636, 1221028, 1221104, 1219004, 1217960, 1217928, 1215552, 1215528, 1215884, + 1214788, 1214688, 1214632, 1214608, 1214404, 1214264, 1214148, 1214616, 1214152, 1214096, 1214064, 1214036, 1213972, 1213888, 1213556, 1213292, 1213264, 1213196, 1212664, 1211552, + 1211516, 1206068, 1206108, 1206048, 1205820, 1205496, 1205492, 1205468, 1204548, 1204572, 1204492, 1204240, 1204980, 1204828, 1204776, 1204740, 1204732, 1204696, 1204460, 1204440, + 1204424, 1204380, 1204336, 1204072, 1204016, 1203940, 1203892, 1203844, 1203796, 1203720, 1203688, 1203076, 1203056, 1203128, 1203084, 1203028, 1203740, 1203624, 1203580, 1203552, + 1203516, 1203448, 1201708, 1201616, 1201612, 1201516, 1201692, 1201520, 1201452, 1201384, 1198548, 1198516, 1198472, 1198576, 1198560, 1196536, 1196512, 0, 0, 0, + }, + 39: []int64{1224732, 1225764, 1224908, 1224660, 1224576, 1224544, 1224464, 1224420, 1224404, 1224376, 1224352, 1224320, 1223000, 1221336, 1221104, 1219004, 1217960, 1217728, 1215548, 1216128, + 1215840, 1214712, 1214656, 1214632, 1215200, 1214432, 1215632, 1215088, 1214612, 1214152, 1214092, 1214060, 1214032, 1213968, 1213888, 1213320, 1213612, 1213536, 1213176, 1212660, + 1211548, 1208264, 1206156, 1206080, 1205844, 1205812, 1205496, 1206136, 1205884, 1204784, 1204532, 1206052, 1205248, 1204968, 1204824, 1204780, 1204752, 1204740, 1204700, 1204460, + 1204796, 1204708, 1204376, 1204604, 1204268, 1203996, 1203908, 1203888, 1203824, 1203740, 1204148, 1203772, 1203408, 1203360, 1203124, 1203084, 1204252, 1203740, 1203620, 1203584, + 1203572, 1203516, 1203440, 1201708, 1201980, 1201896, 1201856, 1201540, 1201504, 1201448, 1201372, 1198532, 1198856, 1198604, 1198576, 1196552, 1196904, 0, 0, 0, + }, + 41: []int64{1055608, 1055673, 1055611, 1055552, 1055515, 1055476, 1055412, 1055381, 1055362, 1055339, 1055315, 1054702, 1054162, 1053129, 1053072, 1053034, 1053001, 1052964, 1052902, 1053140, + 1053065, 1052986, 1052956, 1052937, 1053154, 1053106, 1053207, 1053163, 1053114, 1053076, 1053048, 1053021, 1052985, 1052934, 1052884, 1052877, 1053076, 1053086, 1053020, 1052979, + 1052925, 1052908, 1052834, 1052773, 1052745, 1052715, 1052707, 1052783, 1052930, 1052939, 1052823, 1052902, 1052858, 1052810, 1052757, 1052723, 1052703, 1052680, 1052659, 1052649, + 1052844, 1052912, 1052870, 1052881, 1052877, 1052824, 1052791, 1052763, 1052717, 1052664, 1052715, 1052572, 1052357, 1052434, 1052378, 1052343, 1052500, 1052423, 1052385, 1052362, + 1052328, 1052257, 1051141, 1050565, 1050688, 1050780, 1050854, 1050744, 1050700, 1050671, 1050642, 1050621, 1050643, 1050660, 1050640, 1050610, 1050777, 0, 0, 0, + }, + 42: []int64{1055340, 1055544, 1055588, 1055528, 1055500, 1055440, 1055388, 1055376, 1055348, 1055328, 1055304, 1054396, 1052844, 1053096, 1053052, 1053016, 1052988, 1052920, 1052896, 1053104, + 1053060, 1052976, 1052948, 1052932, 1052864, 1053084, 1053024, 1053136, 1053100, 1053060, 1053032, 1053012, 1052968, 1052892, 1052880, 1052864, 1052844, 1053060, 1053004, 1052944, + 1052912, 1052788, 1052812, 1052760, 1052732, 1052708, 1052704, 1052684, 1052716, 1052880, 1052808, 1052780, 1052844, 1052784, 1052740, 1052712, 1052692, 1052664, 1052652, 1052644, + 1052640, 1052896, 1052852, 1052808, 1052852, 1052808, 1052784, 1052748, 1052704, 1052656, 1052632, 1052176, 1052164, 1052408, 1052364, 1052320, 1052444, 1052396, 1052368, 1052344, + 1052312, 1052244, 1050592, 1050528, 1050524, 1050756, 1050812, 1050736, 1050684, 1050656, 1050632, 1050616, 1050572, 1050648, 1050632, 1050604, 1050588, 0, 0, 0, + }, + 43: []int64{1055696, 1056120, 1055628, 1055588, 1055528, 1055500, 1055432, 1055388, 1055376, 1055348, 1055328, 1055308, 1054744, 1053152, 1053096, 1053052, 1053016, 1052988, 1052916, 1053220, + 1053072, 1053000, 1052968, 1052948, 1053416, 1053128, 1053340, 1053208, 1053136, 1053100, 1053056, 1053028, 1053008, 1052964, 1052892, 1052884, 1053172, 1053112, 1053040, 1053000, + 1052940, 1053068, 1052856, 1052792, 1052752, 1052724, 1052708, 1053040, 1053028, 1052968, 1052844, 1052988, 1052876, 1052832, 1052780, 1052732, 1052712, 1052692, 1052664, 1052652, + 1052976, 1052924, 1052892, 1053072, 1052904, 1052840, 1052800, 1052780, 1052728, 1052668, 1052884, 1052676, 1052504, 1052468, 1052404, 1052364, 1052556, 1052444, 1052392, 1052368, + 1052348, 1052308, 1052236, 1050592, 1050860, 1050808, 1050944, 1050752, 1050724, 1050680, 1050648, 1050624, 1050824, 1050672, 1050648, 1050612, 1050948, 0, 0, 0, + }, + 71: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 72: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 91: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 92: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 99: []int64{69960688, 69959600, 69960228, 69960116, 69960688, 69960736, 69959156, 69959576, 69960484, 69959796, 69957320, 69958684, 69961812, 69962888, 69964840, 69965848, 69965972, 69966228, 69968528, 69969252, + 69969080, 69968724, 69970196, 69969716, 69969888, 69970532, 69967824, 69967952, 69967564, 69967904, 69967848, 69967588, 69967500, 69966760, 69967660, 69968544, 69968168, 69966496, 69965724, 69965868, + 69965816, 69966268, 69968824, 69969272, 69968828, 69969344, 69969496, 69968924, 69969160, 69970168, 69970320, 69969004, 69969592, 69969720, 69970316, 69969928, 69969808, 69969612, 69969896, 69970544, + 69970444, 69971520, 69974856, 69972324, 69973136, 69974292, 69975128, 69976984, 69976008, 69975604, 69974656, 69975084, 69974348, 69973416, 69972924, 69972828, 69972744, 69972144, 69971712, 69971752, + 69972212, 69973544, 69973784, 69975728, 69975584, 69979180, 69981700, 69986452, 69987628, 69988032, 69985860, 69985764, 69985400, 69984384, 69983756, 69983760, 69983452, 14680064, 14680064, 14680064, + }, + 100: []int64{69963068, 69962232, 69962076, 69962484, 69963332, 69962460, 69962284, 69961492, 69962064, 69961940, 69960848, 69963564, 69965540, 69964756, 69967632, 69967936, 69967904, 69969332, 69969792, 69970912, + 69972048, 69971304, 69971508, 69971548, 69972064, 69972608, 69971052, 69969968, 69968996, 69969416, 69969212, 69968836, 69969444, 69968496, 69969572, 69969964, 69969912, 69970156, 69967196, 69967908, + 69967208, 69971704, 69970876, 69970952, 69971680, 69971172, 69970660, 69970884, 69971432, 69971980, 69971460, 69972160, 69971432, 69971556, 69971820, 69971812, 69971924, 69971856, 69972396, 69972084, + 69972636, 69975972, 69976760, 69974320, 69975224, 69976312, 69977512, 69978932, 69978144, 69976904, 69976420, 69976648, 69976040, 69975928, 69975108, 69974296, 69974592, 69973736, 69973496, 69973216, + 69973868, 69974892, 69977532, 69976804, 69981496, 69980680, 69985564, 69988184, 69988860, 69988992, 69989032, 69987924, 69987492, 69986820, 69984960, 69985268, 69985340, 14680064, 14680064, 14680064, + }, + 102: []int64{3492918, 3493174, 3492757, 3492740, 3493216, 3493191, 3493195, 3493207, 3493435, 3493248, 3492551, 3493147, 3493026, 3492751, 3492580, 3492757, 3492723, 3492774, 3492555, 3493055, + 3492784, 3492681, 3493216, 3492830, 3492892, 3492948, 3493046, 3493060, 3493087, 3492704, 3492637, 3492534, 3492642, 3492200, 3491916, 3492401, 3492365, 3492496, 3492244, 3492346, + 3492494, 3492328, 3492643, 3492845, 3492800, 3492768, 3492817, 3492966, 3492993, 3492775, 3492814, 3492854, 3492624, 3492659, 3492556, 3492909, 3492991, 3492511, 3492570, 3492676, + 3493124, 3493161, 3492891, 3492730, 3492821, 3492603, 3492387, 3492922, 3492765, 3492628, 3492580, 3492887, 3493048, 3492725, 3492645, 3492413, 3492408, 3492389, 3492519, 3492265, + 3492381, 3492345, 3492567, 3492055, 3492620, 3492210, 3492316, 3492033, 3491852, 3492023, 3492222, 3492334, 3492414, 3492141, 3492333, 3492270, 3492054, 99800, 99966, 100021, + }, + 103: []int64{3491848, 3492168, 3491848, 3491912, 3492200, 3492136, 3492088, 3491976, 3492280, 3492072, 3491768, 3491880, 3491992, 3491736, 3491608, 3491704, 3491720, 3491688, 3491400, 3492008, + 3491704, 3491496, 3491944, 3491672, 3491816, 3491640, 3491864, 3492152, 3491896, 3491336, 3491176, 3491016, 3491640, 3491112, 3490792, 3491272, 3491448, 3491592, 3491192, 3491352, + 3491320, 3491480, 3491416, 3491848, 3491864, 3491528, 3491832, 3491544, 3491624, 3491720, 3491656, 3491656, 3491464, 3491624, 3491608, 3492024, 3491960, 3491688, 3491112, 3491496, + 3491928, 3492040, 3491688, 3491400, 3491480, 3491528, 3491352, 3492152, 3491736, 3491348, 3491540, 3491764, 3491956, 3491508, 3491412, 3491316, 3491348, 3491460, 3491508, 3491348, + 3491172, 3491092, 3491288, 3490760, 3491264, 3491200, 3490984, 3490696, 3490568, 3490648, 3490824, 3491256, 3491240, 3491064, 3491192, 3491240, 3490744, 99416, 99752, 99704, + }, + 104: []int64{3494248, 3494072, 3493528, 3493720, 3494312, 3494168, 3494232, 3494216, 3494440, 3494360, 3493752, 3494504, 3494296, 3493784, 3493864, 3494424, 3493848, 3494056, 3493704, 3494152, + 3494024, 3493976, 3494216, 3493864, 3493912, 3494104, 3494264, 3494168, 3494248, 3493736, 3493960, 3494008, 3493464, 3493352, 3493128, 3493672, 3493528, 3493336, 3493336, 3493304, + 3493496, 3493288, 3493720, 3494040, 3493896, 3494104, 3494120, 3494264, 3494280, 3493880, 3493896, 3493928, 3493832, 3493720, 3493592, 3493816, 3493912, 3493496, 3493912, 3493672, + 3494024, 3494168, 3494264, 3493768, 3493832, 3493544, 3493480, 3494008, 3493768, 3493700, 3493556, 3493988, 3494212, 3494020, 3493828, 3493748, 3493476, 3493364, 3493556, 3493188, + 3493604, 3493576, 3493864, 3492936, 3493728, 3493120, 3493336, 3493016, 3492952, 3493080, 3493336, 3493352, 3493448, 3493144, 3493640, 3493320, 3493560, 100088, 100312, 100392, + }, + 105: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 106: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 107: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 108: []int64{254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, + 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, + 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, + 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, + 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 254812160, 14680064, 14680064, 14680064, + }, + 109: []int64{72669509, 72669222, 72668798, 72669432, 72669934, 72669814, 72668820, 72668626, 72669167, 72669100, 72667309, 72669518, 72671803, 72671876, 72674528, 72674987, 72675130, 72675893, 72677596, 72678840, + 72679130, 72678625, 72679555, 72679104, 72679477, 72680094, 72677130, 72677211, 72676337, 72676877, 72676613, 72676430, 72676661, 72675813, 72676695, 72677409, 72677011, 72676365, 72674592, 72674894, + 72674587, 72677618, 72677960, 72677989, 72678323, 72678753, 72677997, 72677835, 72677884, 72678533, 72678783, 72678153, 72678332, 72678647, 72679004, 72678684, 72678613, 72678731, 72678783, 72678797, + 72679536, 72682196, 72683921, 72681372, 72682292, 72682820, 72684300, 72686184, 72685409, 72684595, 72683952, 72683983, 72683356, 72682772, 72682415, 72681736, 72681594, 72680926, 72680580, 72680310, + 72681090, 72682132, 72684368, 72684699, 72688731, 72688798, 72693599, 72696711, 72697646, 72697938, 72696678, 72696250, 72695584, 72694773, 72693560, 72693871, 72693294, 14715452, 14715452, 14715452, + }, + 111: []int64{30656722, 31076179, 30770388, 30592011, 30996556, 30532182, 30390123, 30352947, 30675033, 31077121, 31877885, 31308104, 30952698, 30718327, 30548242, 30083717, 31245735, 30332823, 30207174, 30364905, + 30279320, 31032211, 32115237, 32021915, 30972413, 30812060, 30826516, 30672099, 30929837, 30838081, 30966531, 30490329, 30788887, 30599961, 32589503, 31589096, 31232156, 31685175, 31359139, 30879847, + 31365331, 31837189, 30903611, 30615977, 30361114, 31113485, 32588192, 31584467, 31259797, 31681825, 31810135, 31252656, 32144658, 31630300, 31588314, 31299303, 30411427, 31516131, 32632526, 31501616, + 30845373, 30970138, 30053117, 30947587, 31970379, 31453594, 31041957, 30678159, 30610308, 31591595, 32223776, 31467215, 30827138, 31322148, 31453916, 31040880, 31097992, 30641493, 31552559, 31244155, + 31054060, 31418432, 32604574, 31275788, 31245161, 31354098, 31005407, 30914706, 31448268, 30663530, 31529169, 32255806, 30915270, 31310240, 33316725, 31639878, 31426836, 4947895, 4803891, 4987044, + }, + 112: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 138: []int64{2230, 2625, 2415, 2525, 2444, 2452, 2567, 2789, 2390, 2748, 2639, 2602, 2475, 2902, 2513, 2845, 2500, 2471, 2566, 2865, + 2526, 2841, 2714, 2647, 2494, 2871, 2693, 2910, 2601, 2731, 2697, 2840, 2662, 3119, 3002, 2612, 2718, 3016, 2735, 2919, + 2864, 2973, 2713, 2782, 2290, 2544, 2365, 2346, 2323, 2851, 3113, 2561, 4712, 2480, 2570, 2801, 2484, 3698, 2650, 2606, + 2280, 2781, 2703, 2796, 2532, 2595, 2507, 2814, 2586, 3219, 2737, 2762, 2744, 2960, 2701, 2893, 2488, 2716, 3324, 2887, + 2641, 3578, 2718, 2797, 2781, 2970, 2637, 2917, 2638, 2763, 2521, 3081, 2977, 3492, 2563, 2511, 2277, 573, 296, 401, + }, + 139: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 152: []int64{1504328, 1575229, 1508808, 1539050, 1521242, 1501829, 1575085, 1588140, 1552456, 1612624, 1639628, 1537009, 1757880, 1629266, 1527363, 1627738, 1527973, 1533938, 1570509, 1570986, + 1567765, 1572046, 1611014, 1541704, 1585722, 1563972, 1559854, 1705802, 1580902, 1568416, 1592145, 1537276, 1605016, 1667988, 1727917, 1565331, 2161135, 1638339, 1562243, 1661089, + 1584488, 1584636, 1629115, 1601832, 1541515, 1597786, 1614639, 1601248, 1554451, 1760051, 2052848, 1585702, 3227857, 1567160, 1637085, 1542094, 1563545, 3143052, 1671157, 1556602, + 1595426, 1539979, 1573539, 1627501, 1602214, 1524304, 1528918, 1558122, 1587828, 2854876, 1617354, 1588144, 1562083, 1557448, 1583029, 1592644, 1552987, 1506212, 2721076, 1575108, + 1580946, 3205255, 1625244, 1557114, 1644929, 1716253, 1653792, 1612237, 1629766, 1748134, 1720512, 1606758, 1851552, 2960837, 1868642, 1616094, 1552098, 588169, 567729, 571114, + }, + 153: []int64{1210, 1210, 1212, 1214, 1206, 1224, 1224, 1202, 1190, 1332, 1260, 1186, 1256, 1292, 1290, 1238, 1256, 1204, 1280, 1200, + 1232, 1208, 1238, 1212, 1212, 1232, 1206, 1242, 1188, 1256, 1218, 1214, 1194, 1290, 1218, 1186, 1254, 1216, 1194, 1242, + 1202, 1212, 1316, 1230, 1180, 1262, 1730, 1204, 1238, 1222, 1204, 1376, 1418, 1238, 1208, 1218, 1208, 5360, 1204, 1222, + 1192, 1192, 1220, 1327, 1178, 1224, 1218, 1240, 1188, 5604, 1210, 1224, 1203, 1244, 1244, 1210, 1244, 1206, 1234, 1180, + 1226, 5422, 1268, 1188, 1216, 1222, 1196, 1200, 1240, 1198, 1208, 1206, 1254, 5459, 1234, 1180, 1388, 0, 0, 0, + }, + 157: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 159: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, +} + +var ClusterMetricData = map[int32][]int64{ + 6: []int64{2660, 2642, 2704, 2653, 2610, 2679, 2637, 2688, 2575, 2703, 2546, 2629, 2689, 2653, 2564, 2717, 2545, 2613, 2672, 2767, + 2549, 2648, 2535, 2618, 2693, 2635, 2584, 2684, 2585, 2770, 2655, 2721, 2665, 2804, 2563, 2920, 2718, 2661, 2741, 2731, + 2617, 2692, 2716, 2627, 2612, 2725, 2536, 2705, 2757, 2741, 2574, 3086, 2513, 2748, 2689, 2678, 3847, 2742, 2552, 2672, + 2731, 2667, 2717, 2727, 2570, 2687, 2650, 2702, 3887, 2694, 2583, 2679, 2687, 2690, 2664, 2668, 2592, 2809, 2669, 2610, + 3783, 2672, 2576, 2705, 2693, 2768, 2665, 2764, 2666, 2684, 2743, 2721, 3745, 2817, 2626, 2643}, + 98: []int64{80966231, 80972025, 80967147, 80971805, 80971461, 80960856, 80971698, 80968629, 80966792, 80968280, 80965688, 80968160, 80972184, 80967234, 80974374, 80973069, 80969175, 80972462, 80974107, 80971158, + 80973760, 80971466, 80972732, 80976757, 80968959, 80978902, 80973979, 80970096, 80972837, 80971344, 80970522, 80978912, 80973926, 80974815, 80982004, 80972623, 80975529, 80975408, 80974234, 80981847, + 80980402, 80980768, 80982646, 80978686, 80982500, 80984391, 80977749, 80983381, 80981437, 80983425, 80983920, 80977214, 80980461, 80983718, 80975363, 80982565, 80988168, 80977604, 80981236, 80977706, + 80983249, 80985807, 80977272, 80983595, 80987325, 80979731, 80987109, 80984116, 80986864, 80984657, 80983357, 80984733, 80983009, 80974655, 80981406, 80980158, 80977819, 80984935, 80980954, 80983489, + 80994774, 80985680, 80987050, 80996748, 80987352, 80996335, 80992486, 80991240, 80998195, 80990395, 80995222, 80997350, 80996714, 80992828, 80995344, 80991168}, + 29: []int64{73268364, 73268360, 73268358, 73268390, 73268427, 73268473, 73268419, 73268500, 73268407, 73268923, 73268921, 73269517, 73269343, 73269023, 73269710, 73268886, 73269368, 73269205, 73268503, 73268660, + 73268870, 73268673, 73268345, 73268344, 73268321, 73268895, 73268583, 73268411, 73268513, 73268571, 73268623, 73268251, 73268411, 73268306, 73268250, 73268253, 73268309, 73268317, 73269368, 73271047, + 73269682, 73268469, 73268720, 73268828, 73269641, 73269243, 73268832, 73269108, 73269050, 73268848, 73268895, 73268571, 73268889, 73268510, 73268253, 73268887, 73268927, 73268972, 73268729, 73268308, + 73268357, 73268252, 73268253, 73268572, 73268261, 73268299, 73268252, 73269763, 73269479, 73268300, 73268898, 73269226, 73268552, 73268331, 73268615, 73268571, 73268839, 73268481, 73268792, 73269221, + 73268894, 73269185, 73269022, 73272474, 73273345, 73276979, 73277015, 73277311, 73277095, 73277128, 73276683, 73276603, 73276938, 73276502, 73276687, 73276890}, + 33: []int64{14802617, 14334048, 14652589, 14878941, 14109341, 14296412, 14128174, 14512681, 15409736, 15727532, 15005265, 14784211, 14444092, 14427274, 14440723, 14999719, 14227289, 14192172, 14367760, 14124191, + 15086676, 16296614, 15694711, 14773850, 14615508, 14579159, 14913646, 14818759, 14431242, 14649121, 14070432, 14769608, 14726241, 16565988, 15190989, 15156258, 15454480, 15236560, 14920029, 15467985, + 15690148, 14625978, 14627532, 14433452, 15056912, 16335706, 15852718, 15089894, 15188408, 15779104, 15033057, 15910760, 15677495, 15311713, 14893944, 14156923, 15382805, 16640532, 15618825, 14590669, + 14815275, 13882064, 15580462, 16066677, 15450425, 14709417, 14396746, 14410821, 15454994, 16150884, 15504171, 14596072, 15298748, 15116741, 14893971, 15254242, 14718071, 15552055, 15301147, 14657525, + 15188266, 16529916, 15247158, 14850729, 15175486, 14894463, 14965769, 15417648, 14307234, 15317129, 16306939, 14662144, 15226145, 17060333, 15423605, 15096561}, + 49: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 90: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 7: []int64{1419, 1426, 1412, 1413, 1408, 1472, 1426, 1462, 1424, 1447, 1403, 1433, 1429, 1420, 1395, 1447, 1396, 1406, 1413, 1432, + 1420, 1425, 1411, 1432, 1437, 1444, 1407, 1448, 1450, 1477, 1431, 1451, 1437, 1403, 1459, 1478, 1452, 1447, 1446, 1410, + 1441, 1445, 1415, 1433, 1435, 1458, 1419, 1441, 1476, 1310, 1482, 1451, 1458, 1455, 1428, 1446, 1443, 1436, 1449, 1422, + 1394, 1424, 1402, 1417, 1410, 1419, 1432, 1446, 1421, 1440, 1430, 1406, 1463, 1448, 1446, 1432, 1435, 1465, 1484, 1443, + 1451, 1414, 1446, 1412, 1429, 1442, 1424, 1497, 1458, 1490, 1463, 1533, 1482, 1473, 1468, 1467, 294, 294, 293, 0, + }, + 8: []int64{7702, 6548, 8268, 6700, 7397, 6790, 7898, 6476, 6905, 6238, 7278, 6627, 7807, 5958, 6792, 6036, 6789, 6141, 7983, 7889, + 6401, 5709, 6512, 5807, 7728, 5975, 6809, 6144, 7257, 8149, 7885, 6501, 8131, 7308, 6462, 8264, 8044, 6631, 7954, 7046, + 7166, 6704, 7344, 6438, 6346, 6730, 6478, 6916, 7791, 6944, 6179, 7985, 6202, 6726, 8141, 6854, 9215, 6561, 6467, 6547, + 7569, 6386, 7388, 7036, 6134, 6651, 7371, 6545, 11069, 6235, 6345, 6048, 8274, 6422, 7397, 6544, 6905, 7577, 7600, 5693, + 8974, 6178, 6603, 6656, 7968, 7048, 7406, 6370, 7129, 5815, 7886, 6045, 8873, 6834, 7219, 6213, 1852, 583, 753, 0, + }, + 9: []int64{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, + }, + 15: []int64{16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, + 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, + 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, + 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, + 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 16008, 4608, 4608, 4608, 0, + }, + 17: []int64{1855, 1834, 1862, 1838, 1821, 1849, 1840, 1848, 1815, 1852, 1785, 1825, 1867, 1838, 1792, 1869, 1785, 1816, 1863, 1889, + 1805, 1827, 1782, 1819, 1871, 1824, 1805, 1853, 1808, 1897, 1850, 1870, 1869, 1895, 1795, 1964, 1888, 1840, 1883, 1873, + 1820, 1852, 1876, 1827, 1830, 1875, 1783, 1860, 1907, 1884, 1807, 2046, 1773, 1888, 1865, 1850, 2686, 1882, 1787, 1846, + 1887, 1844, 1868, 1871, 1811, 1853, 1844, 1857, 2700, 1856, 1804, 1854, 1871, 1853, 1839, 1846, 1812, 1915, 1855, 1819, + 2646, 1849, 1798, 1855, 1872, 1891, 1853, 1894, 1852, 1855, 1890, 1876, 2635, 1918, 1830, 1827, 560, 424, 451, 0, + }, + 18: []int64{2745, 2574, 2728, 2623, 2638, 2583, 2711, 2612, 2594, 2616, 2601, 2536, 2746, 2556, 2605, 2627, 2593, 2500, 2714, 2551, + 2718, 2599, 2578, 2556, 2754, 2559, 2623, 2636, 2605, 2741, 2728, 2596, 2758, 2718, 2626, 2855, 2783, 2582, 2791, 2663, + 2683, 2619, 2764, 2556, 2648, 2642, 2580, 2626, 2764, 2686, 2677, 2974, 2597, 2663, 2737, 2633, 3805, 2649, 2633, 2613, + 2760, 2622, 2757, 2680, 2623, 2607, 2699, 2602, 3839, 2600, 2643, 2570, 2757, 2608, 2675, 2572, 2619, 2680, 2749, 2580, + 3712, 2635, 2619, 2597, 2783, 2681, 2684, 2702, 2718, 2585, 2802, 2617, 3739, 2738, 2666, 2565, 532, 386, 412, 0, + }, + 19: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + }, + 20: []int64{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 0, + }, + 21: []int64{196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 4, 4, 4, 0, + }, + 22: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 27: []int64{29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, + 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, + 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, + 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, + 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 29682, 131, 131, 131, 0, + }, + 30: []int64{73268344, 73268280, 73268276, 73268344, 73268348, 73268280, 73268164, 73268236, 73268168, 73268232, 73268152, 73268232, 73268164, 73268236, 73268164, 73268244, 73268232, 73268232, 73268260, 73268256, + 73268328, 73268324, 73268256, 73268324, 73268232, 73268232, 73268232, 73268232, 73268232, 73268152, 73268164, 73268232, 73268232, 73268232, 73268164, 73268232, 73268164, 73268232, 73268236, 73271020, + 73268232, 73268236, 73268168, 73268232, 73268232, 73268236, 73268164, 73268232, 73268232, 73268232, 73268232, 73268232, 73268232, 73268232, 73268232, 73268232, 73268432, 73268396, 73268244, 73268232, + 73268232, 73268164, 73268232, 73268232, 73268236, 73268232, 73268232, 73268232, 73268232, 73268164, 73268232, 73269180, 73268232, 73268232, 73268232, 73268428, 73268248, 73268244, 73268232, 73268244, + 73268244, 73268180, 73268244, 73268248, 73272328, 73274396, 73276432, 73276432, 73276444, 73276424, 73276424, 73276424, 73276424, 73276344, 73276424, 73276424, 14890228, 14890228, 14890240, 0, + }, + 31: []int64{73268368, 73268372, 73268372, 73268568, 73269088, 73269596, 73270732, 73271360, 73270648, 73270648, 73271360, 73271128, 73270648, 73270652, 73271360, 73272952, 73270648, 73271460, 73270744, 73270744, + 73271452, 73270824, 73268432, 73268356, 73268928, 73270736, 73270736, 73270648, 73270976, 73270732, 73270648, 73268256, 73270648, 73268972, 73268300, 73268260, 73268648, 73268960, 73271048, 73271116, + 73272952, 73270492, 73270652, 73271360, 73272480, 73271084, 73271364, 73270652, 73270648, 73271360, 73271080, 73270648, 73270648, 73270168, 73268260, 73270840, 73271560, 73271136, 73270904, 73268840, + 73269812, 73268340, 73268256, 73270652, 73268344, 73268968, 73268260, 73273700, 73273612, 73268984, 73271852, 73269560, 73271360, 73269444, 73270892, 73270344, 73271104, 73271008, 73270988, 73271360, + 73271312, 73270796, 73273624, 73275220, 73274936, 73279560, 73278936, 73279296, 73278852, 73279436, 73278840, 73278840, 73279544, 73276620, 73278848, 73280600, 14890312, 14890240, 14891172, 0, + }, + 34: []int64{13573636, 13002248, 13232404, 13175356, 13275844, 13230176, 13127300, 13568144, 13612048, 14592480, 13627248, 13985164, 13411512, 13174864, 12907024, 13597756, 13035444, 13325464, 12784236, 13117220, + 14368280, 14369512, 14242768, 13654828, 13504268, 13671344, 13702612, 13565052, 13809900, 14009700, 13128836, 13452396, 13911836, 15183136, 14288752, 13997060, 14624404, 13999096, 13946744, 14215416, + 14398652, 13538060, 12956208, 13435088, 14117772, 13809576, 14619364, 14017428, 14045920, 14123604, 13776464, 14910084, 14461688, 14374812, 13518124, 13266716, 13290340, 15790532, 14513540, 13337576, + 13707496, 12310184, 14176152, 14751044, 14524840, 13523504, 13161340, 13209344, 14672408, 14764948, 14025352, 13578740, 13831184, 13996332, 14060404, 13740364, 13589484, 14216632, 13945008, 13504136, + 14340892, 14902536, 14285608, 13537676, 14050268, 12958476, 14072020, 13737044, 13660844, 14156448, 15279864, 13640448, 14496604, 15288784, 14111028, 13936984, 4518340, 4622284, 4559412, 0, + }, + 35: []int64{16451724, 15740832, 16075320, 16662552, 14687076, 15559032, 15035376, 15928468, 17382060, 17301940, 16063212, 15857696, 15416452, 15831532, 16184788, 16503796, 15361564, 15465240, 15591476, 15277916, + 16013604, 18002948, 16912700, 16135880, 16086316, 15500396, 17031640, 16554584, 15236076, 15360668, 15132064, 17019276, 16012024, 17925268, 16065972, 16684352, 16621572, 16073528, 16623412, 17827680, + 16495588, 15456200, 16758360, 15778444, 16543684, 18657400, 18034944, 16920652, 16651804, 17215456, 17034072, 17876912, 17218256, 16420608, 16388500, 14953544, 17862656, 17755284, 17335396, 15667204, + 16453040, 15328760, 17585044, 17356552, 16685544, 15928732, 15615012, 15483988, 16272684, 17680048, 17019220, 15510164, 16777088, 16537912, 15886852, 16338096, 15759460, 16660716, 17019064, 15951896, + 16177416, 18331856, 16097232, 15953764, 16517084, 16434732, 16266236, 16630780, 15445868, 16788272, 17628480, 16335328, 16473208, 18507932, 17039820, 17177604, 5901968, 5127288, 5483576, 0, + }, + 37: []int64{1133164, 1133556, 1132948, 1132536, 1132687, 1133608, 1133749, 1133162, 1133226, 1135034, 1132928, 1130504, 1130466, 1127930, 1127539, 1127419, 1126692, 1125126, 1123936, 1123639, + 1124080, 1123182, 1123585, 1123228, 1122690, 1125536, 1125400, 1126177, 1125636, 1125881, 1126043, 1125876, 1126648, 1125743, 1125018, 1125371, 1125976, 1127658, 1127351, 1127686, + 1124517, 1124154, 1124262, 1124115, 1123758, 1124131, 1124254, 1124213, 1123537, 1123298, 1123893, 1123808, 1123529, 1123294, 1123588, 1123590, 1123511, 1123305, 1123449, 1122702, + 1120122, 1118483, 1120873, 1120026, 1119508, 1118141, 1116332, 1117074, 1117943, 1118530, 1118493, 1119064, 1119641, 1119993, 1120578, 1120717, 1121297, 1121658, 1121876, 1121164, + 1120189, 1118066, 1117956, 1117838, 1118358, 1117828, 1115200, 1114318, 1114018, 1115218, 1115605, 1116157, 1116889, 1118043, 1117833, 1118344, 0, 0, 0, 0, + }, + 38: []int64{1132264, 1132876, 1132384, 1131660, 1131872, 1132060, 1133136, 1132780, 1132640, 1133488, 1131120, 1129464, 1129632, 1126672, 1127056, 1126920, 1125480, 1124752, 1123396, 1122604, + 1122968, 1122800, 1123056, 1122520, 1122064, 1123224, 1125052, 1125684, 1125204, 1125464, 1125496, 1125228, 1125624, 1125508, 1124612, 1124848, 1124632, 1127172, 1126804, 1127332, + 1124032, 1123832, 1123756, 1123700, 1123444, 1123928, 1123924, 1123364, 1122904, 1123072, 1123112, 1123276, 1123036, 1123052, 1123296, 1122964, 1123380, 1122864, 1122680, 1122496, + 1118300, 1117848, 1120032, 1119496, 1117980, 1117040, 1115356, 1116388, 1117464, 1118092, 1118000, 1118240, 1119296, 1119428, 1120028, 1119716, 1120656, 1120840, 1121528, 1120408, + 1119624, 1117096, 1117664, 1117132, 1117776, 1116904, 1114352, 1113940, 1113740, 1113848, 1115252, 1115068, 1116460, 1117764, 1117288, 1117388, 0, 0, 0, 0, + }, + 39: []int64{1134064, 1133888, 1133276, 1133192, 1133524, 1134976, 1134692, 1133616, 1133920, 1136052, 1135580, 1131236, 1130960, 1129384, 1127876, 1128104, 1127552, 1125508, 1124832, 1124620, + 1125204, 1123664, 1124280, 1123960, 1123272, 1126440, 1125924, 1126524, 1126032, 1126188, 1126616, 1126588, 1127508, 1126272, 1125348, 1126056, 1127596, 1128352, 1128132, 1128284, + 1125216, 1124744, 1124736, 1124616, 1124636, 1124380, 1124460, 1124596, 1124072, 1123452, 1124528, 1124260, 1123956, 1123600, 1123916, 1124012, 1123756, 1123820, 1123672, 1123008, + 1122752, 1119104, 1121480, 1120868, 1119976, 1119144, 1117272, 1117404, 1118668, 1119372, 1118868, 1119612, 1119992, 1120568, 1121432, 1121404, 1121876, 1121984, 1122428, 1121896, + 1120704, 1119616, 1118340, 1119168, 1118960, 1118660, 1115880, 1114716, 1114284, 1116084, 1116240, 1116992, 1117680, 1118596, 1118360, 1118904, 0, 0, 0, 0, + }, + 41: []int64{1055673, 1055611, 1055552, 1055515, 1055476, 1055412, 1055381, 1055362, 1055339, 1055315, 1054702, 1054162, 1053129, 1053072, 1053034, 1053001, 1052964, 1052902, 1053140, 1053065, + 1052986, 1052956, 1052937, 1053154, 1053106, 1053207, 1053163, 1053114, 1053076, 1053048, 1053021, 1052985, 1052934, 1052884, 1052877, 1053076, 1053086, 1053020, 1052979, 1052925, + 1052908, 1052834, 1052773, 1052745, 1052715, 1052707, 1052783, 1052930, 1052939, 1052823, 1052902, 1052858, 1052810, 1052757, 1052723, 1052703, 1052680, 1052659, 1052649, 1052844, + 1052912, 1052870, 1052881, 1052877, 1052824, 1052791, 1052763, 1052717, 1052664, 1052715, 1052572, 1052357, 1052434, 1052378, 1052343, 1052500, 1052423, 1052385, 1052362, 1052328, + 1052257, 1051141, 1050565, 1050688, 1050780, 1050854, 1050744, 1050700, 1050671, 1050642, 1050621, 1050643, 1050660, 1050640, 1050610, 1050777, 0, 0, 0, 0, + }, + 42: []int64{1055544, 1055588, 1055528, 1055500, 1055440, 1055388, 1055376, 1055348, 1055328, 1055304, 1054396, 1052844, 1053096, 1053052, 1053016, 1052988, 1052920, 1052896, 1053104, 1053060, + 1052976, 1052948, 1052932, 1052864, 1053084, 1053024, 1053136, 1053100, 1053060, 1053032, 1053012, 1052968, 1052892, 1052880, 1052864, 1052844, 1053060, 1053004, 1052944, 1052912, + 1052788, 1052812, 1052760, 1052732, 1052708, 1052704, 1052684, 1052716, 1052880, 1052808, 1052780, 1052844, 1052784, 1052740, 1052712, 1052692, 1052664, 1052652, 1052644, 1052640, + 1052896, 1052852, 1052808, 1052852, 1052808, 1052784, 1052748, 1052704, 1052656, 1052632, 1052176, 1052164, 1052408, 1052364, 1052320, 1052444, 1052396, 1052368, 1052344, 1052312, + 1052244, 1050592, 1050528, 1050524, 1050756, 1050812, 1050736, 1050684, 1050656, 1050632, 1050616, 1050572, 1050648, 1050632, 1050604, 1050588, 0, 0, 0, 0, + }, + 43: []int64{1056120, 1055628, 1055588, 1055528, 1055500, 1055432, 1055388, 1055376, 1055348, 1055328, 1055308, 1054744, 1053152, 1053096, 1053052, 1053016, 1052988, 1052916, 1053220, 1053072, + 1053000, 1052968, 1052948, 1053416, 1053128, 1053340, 1053208, 1053136, 1053100, 1053056, 1053028, 1053008, 1052964, 1052892, 1052884, 1053172, 1053112, 1053040, 1053000, 1052940, + 1053068, 1052856, 1052792, 1052752, 1052724, 1052708, 1053040, 1053028, 1052968, 1052844, 1052988, 1052876, 1052832, 1052780, 1052732, 1052712, 1052692, 1052664, 1052652, 1052976, + 1052924, 1052892, 1053072, 1052904, 1052840, 1052800, 1052780, 1052728, 1052668, 1052884, 1052676, 1052504, 1052468, 1052404, 1052364, 1052556, 1052444, 1052392, 1052368, 1052348, + 1052308, 1052236, 1050592, 1050860, 1050808, 1050944, 1050752, 1050724, 1050680, 1050648, 1050624, 1050824, 1050672, 1050648, 1050612, 1050948, 0, 0, 0, 0, + }, + 91: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 92: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 99: []int64{80955148, 80960404, 80957508, 80955548, 80957400, 80950612, 80956196, 80958740, 80954664, 80951436, 80955712, 80955416, 80957924, 80959820, 80956868, 80955900, 80960360, 80957508, 80957732, 80957688, + 80959004, 80958536, 80957416, 80963656, 80959360, 80961324, 80960448, 80959620, 80957772, 80962312, 80959300, 80965516, 80958040, 80961036, 80967952, 80962692, 80961740, 80960276, 80962328, 80963768, + 80969220, 80964288, 80966832, 80969276, 80967472, 80966404, 80967664, 80968120, 80969608, 80970192, 80967012, 80963952, 80963904, 80968148, 80969840, 80968256, 80971992, 80965796, 80967800, 80969552, + 80967412, 80971864, 80966940, 80966896, 80972116, 80967868, 80969156, 80971276, 80972072, 80968776, 80973300, 80966892, 80966320, 80968164, 80967288, 80966168, 80966892, 80971512, 80967080, 80970084, + 80979524, 80974924, 80972848, 80981664, 80977260, 80979240, 80982364, 80978940, 80979776, 80982316, 80979048, 80983128, 80978060, 80978928, 80982384, 80981824, 18079872, 18080924, 18080340, 0, + }, + 100: []int64{80996308, 81003320, 80991996, 81001012, 81007940, 80983840, 81010980, 80990568, 81003736, 81002540, 80987020, 80990684, 81000464, 80989804, 81013404, 81007044, 80992728, 81003756, 80996512, 81009852, + 81003316, 80996392, 80995840, 81005208, 80991676, 81015008, 81001284, 80992808, 80998680, 81006744, 81000124, 81007504, 81013256, 81010716, 81011904, 80995596, 81007392, 80999712, 80999676, 81005240, + 81000508, 81020312, 81008460, 81006528, 81001688, 81017056, 80995256, 81012348, 81003216, 81018092, 81018360, 81002940, 81017784, 81031588, 80990180, 81009528, 81020616, 81019428, 81003884, 81001308, + 81025468, 81010316, 80994628, 81013328, 81019276, 80998984, 81018968, 81005740, 81025968, 81007368, 81007112, 81017240, 81017928, 80988336, 81018752, 81007952, 81019756, 81022204, 81003308, 81016856, + 81021608, 81015380, 81012848, 81022628, 81009976, 81023636, 81018212, 81020392, 81021388, 81007928, 81025372, 81028804, 81037136, 81019656, 81018072, 81023468, 18107732, 18088460, 18093904, 0, + }, + 102: []int64{3493174, 3492757, 3492740, 3493216, 3493191, 3493195, 3493207, 3493435, 3493248, 3492551, 3493147, 3493026, 3492751, 3492580, 3492757, 3492723, 3492774, 3492555, 3493055, 3492784, + 3492681, 3493216, 3492830, 3492892, 3492948, 3493046, 3493060, 3493087, 3492704, 3492637, 3492534, 3492642, 3492200, 3491916, 3492401, 3492365, 3492496, 3492244, 3492346, 3492494, + 3492328, 3492643, 3492845, 3492800, 3492768, 3492817, 3492966, 3492993, 3492775, 3492814, 3492854, 3492624, 3492659, 3492556, 3492909, 3492991, 3492511, 3492570, 3492676, 3493124, + 3493161, 3492891, 3492730, 3492821, 3492603, 3492387, 3492922, 3492765, 3492628, 3492580, 3492887, 3493048, 3492725, 3492645, 3492413, 3492408, 3492389, 3492519, 3492265, 3492381, + 3492345, 3492567, 3492055, 3492620, 3492210, 3492316, 3492033, 3491852, 3492023, 3492222, 3492334, 3492414, 3492141, 3492333, 3492270, 3492054, 99800, 99966, 100021, 0, + }, + 103: []int64{3492168, 3491848, 3491912, 3492200, 3492136, 3492088, 3491976, 3492280, 3492072, 3491768, 3491880, 3491992, 3491736, 3491608, 3491704, 3491720, 3491688, 3491400, 3492008, 3491704, + 3491496, 3491944, 3491672, 3491816, 3491640, 3491864, 3492152, 3491896, 3491336, 3491176, 3491016, 3491640, 3491112, 3490792, 3491272, 3491448, 3491592, 3491192, 3491352, 3491320, + 3491480, 3491416, 3491848, 3491864, 3491528, 3491832, 3491544, 3491624, 3491720, 3491656, 3491656, 3491464, 3491624, 3491608, 3492024, 3491960, 3491688, 3491112, 3491496, 3491928, + 3492040, 3491688, 3491400, 3491480, 3491528, 3491352, 3492152, 3491736, 3491348, 3491540, 3491764, 3491956, 3491508, 3491412, 3491316, 3491348, 3491460, 3491508, 3491348, 3491172, + 3491092, 3491288, 3490760, 3491264, 3491200, 3490984, 3490696, 3490568, 3490648, 3490824, 3491256, 3491240, 3491064, 3491192, 3491240, 3490744, 99416, 99752, 99704, 0, + }, + 104: []int64{3494072, 3493528, 3493720, 3494312, 3494168, 3494232, 3494216, 3494440, 3494360, 3493752, 3494504, 3494296, 3493784, 3493864, 3494424, 3493848, 3494056, 3493704, 3494152, 3494024, + 3493976, 3494216, 3493864, 3493912, 3494104, 3494264, 3494168, 3494248, 3493736, 3493960, 3494008, 3493464, 3493352, 3493128, 3493672, 3493528, 3493336, 3493336, 3493304, 3493496, + 3493288, 3493720, 3494040, 3493896, 3494104, 3494120, 3494264, 3494280, 3493880, 3493896, 3493928, 3493832, 3493720, 3493592, 3493816, 3493912, 3493496, 3493912, 3493672, 3494024, + 3494168, 3494264, 3493768, 3493832, 3493544, 3493480, 3494008, 3493768, 3493700, 3493556, 3493988, 3494212, 3494020, 3493828, 3493748, 3493476, 3493364, 3493556, 3493188, 3493604, + 3493576, 3493864, 3492936, 3493728, 3493120, 3493336, 3493016, 3492952, 3493080, 3493336, 3493352, 3493448, 3493144, 3493640, 3493320, 3493560, 100088, 100312, 100392, 0, + }, + 105: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 106: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 107: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 108: []int64{100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, + 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, + 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, + 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, + 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 100443136, 33440768, 33440768, 33440768, 0, + }, + 109: []int64{72669222, 72668798, 72669432, 72669934, 72669814, 72668820, 72668626, 72669167, 72669100, 72667309, 72669518, 72671803, 72671876, 72674528, 72674987, 72675130, 72675893, 72677596, 72678840, 72679130, + 72678625, 72679555, 72679104, 72679477, 72680094, 72677130, 72677211, 72676337, 72676877, 72676613, 72676430, 72676661, 72675813, 72676695, 72677409, 72677011, 72676365, 72674592, 72674894, 72674587, + 72677618, 72677960, 72677989, 72678323, 72678753, 72677997, 72677835, 72677884, 72678533, 72678783, 72678153, 72678332, 72678647, 72679004, 72678684, 72678613, 72678731, 72678783, 72678797, 72679536, + 72682196, 72683921, 72681372, 72682292, 72682820, 72684300, 72686184, 72685409, 72684595, 72683952, 72683983, 72683356, 72682772, 72682415, 72681736, 72681594, 72680926, 72680580, 72680310, 72681090, + 72682132, 72684368, 72684699, 72688731, 72688798, 72693599, 72696711, 72697646, 72697938, 72696678, 72696250, 72695584, 72694773, 72693560, 72693871, 72693294, 14715452, 14715452, 14715452, 0, + }, + 110: []int64{96343490, 96342832, 96342800, 96342813, 96342773, 96342675, 96342782, 96342826, 96342815, 96342861, 96342789, 96341979, 96340788, 96342668, 96342873, 96342834, 96343836, 96344837, 96344957, 96344919, + 96344922, 96344913, 96344860, 96344784, 96342984, 96342845, 96342836, 96342835, 96342796, 96342736, 96342898, 96341904, 96340786, 96340814, 96340822, 96340680, 96340807, 96340771, 96340876, 96340861, + 96340790, 96342570, 96342010, 96340804, 96340866, 96340821, 96340878, 96340695, 96340747, 96340721, 96340671, 96340718, 96340694, 96340533, 96340689, 96340734, 96340601, 96342637, 96342677, 96342548, + 96341423, 96340784, 96340744, 96340733, 96340718, 96340553, 96340810, 96340796, 96338504, 96340784, 96340735, 96341365, 96342774, 96342974, 96342750, 96342740, 96342711, 96339961, 96338666, 96338781, + 96336571, 96338619, 96338627, 96338497, 96339187, 96340659, 96341191, 96340702, 96340668, 96340546, 96340669, 96340734, 96339668, 96341872, 96340711, 96340541, 31694132, 31694104, 31694086, 0, + }, + 111: []int64{35632290, 35304782, 35227097, 35519814, 35125423, 34976530, 34924498, 35243128, 35664707, 36446316, 35876655, 35535231, 35289302, 35106530, 34678142, 35814198, 34900775, 34783747, 34930870, 34849678, + 35598604, 36742932, 36565451, 35517423, 35388206, 35389394, 35231873, 35493640, 35414609, 35526398, 35058473, 35362573, 35161627, 37159410, 36158944, 35771391, 36214553, 35906735, 35450783, 35904378, + 36413394, 35474727, 35190698, 34936447, 35688174, 37181402, 36150647, 35858610, 36253248, 36363912, 35830285, 36718428, 36200915, 36164304, 35874877, 34981992, 36086876, 37201282, 36061698, 35405163, + 35497549, 34623703, 35548273, 36554619, 36022158, 35613522, 35251515, 35192877, 36187359, 36897172, 35976279, 35386235, 35895938, 36021694, 35603572, 35667641, 35231012, 36123482, 35816696, 35626919, + 35994572, 37177668, 35848603, 35831990, 35926579, 35576224, 35488252, 35996734, 35238379, 36125143, 36828845, 35485371, 35885228, 37879992, 36198896, 35990422, 6872535, 6728553, 6911962, 0, + }, + 112: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 138: []int64{2696, 2502, 2601, 2536, 2519, 2635, 2854, 2456, 2870, 2725, 2702, 2544, 3016, 2605, 2896, 2610, 2536, 2614, 2979, 2597, + 2915, 2805, 2712, 2560, 2940, 2773, 3052, 2688, 2800, 2765, 2964, 2692, 3180, 3094, 2709, 2784, 3084, 2804, 2980, 2969, + 3072, 2794, 2890, 2363, 2617, 2474, 2405, 2394, 2921, 3178, 2663, 4804, 2547, 2631, 2915, 2554, 4245, 2754, 2678, 2350, + 2891, 2771, 2865, 2622, 2703, 2574, 2899, 2658, 3804, 2875, 2813, 2824, 3045, 2767, 2961, 2576, 2811, 3421, 2954, 2718, + 4225, 2811, 2863, 2896, 3039, 2705, 2992, 2736, 2877, 2591, 3146, 3090, 4025, 2644, 2625, 2336, 580, 302, 408, 0, + }, + 139: []int64{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, + }, + 150: []int64{768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 256000, 256000, 256000, 0, + }, + 151: []int64{768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, + 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 768000, 256000, 256000, 256000, 0, + }, + 152: []int64{2213, 2079, 2147, 2099, 2074, 2207, 2243, 2166, 2281, 2328, 2138, 2557, 2312, 2132, 2297, 2117, 2136, 2198, 2207, 2191, + 2212, 2273, 2153, 2224, 2200, 2173, 2464, 2212, 2204, 2239, 2143, 2259, 2392, 2422, 2161, 3320, 2306, 2153, 2355, 2193, + 2206, 2286, 2235, 2130, 2214, 2262, 2225, 2141, 2546, 3101, 2206, 5338, 2174, 2298, 2126, 2158, 4908, 2354, 2179, 2253, + 2143, 2207, 2318, 2225, 2115, 2121, 2181, 2232, 4384, 2284, 2241, 2183, 2185, 2218, 2250, 2158, 2083, 4414, 2212, 2222, + 5061, 2300, 2184, 2339, 2374, 2237, 2267, 2241, 2396, 2467, 2248, 2686, 4545, 2561, 2263, 2135, 580, 561, 564, 0, + }, + 153: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 157: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 158: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 159: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 256: []int64{245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + }, + 257: []int64{9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + }, + 258: []int64{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + }, + 259: []int64{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + }, + 260: []int64{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + }, + 261: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 262: []int64{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + }, + 263: []int64{227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + }, + 264: []int64{9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + }, + 265: []int64{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + }, + 266: []int64{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + }, + 267: []int64{95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + }, + 268: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 269: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 270: []int64{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + }, + 271: []int64{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + }, + 272: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 273: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 274: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 275: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 2: []int64{1662, 1651, 1690, 1658, 1631, 1674, 1648, 1680, 1609, 1689, 1591, 1643, 1680, 1658, 1602, 1698, 1590, 1633, 1670, 1729, + 1593, 1655, 1584, 1636, 1683, 1646, 1615, 1677, 1615, 1731, 1659, 1700, 1665, 1752, 1601, 1825, 1698, 1663, 1713, 1706, + 1635, 1682, 1697, 1641, 1632, 1703, 1585, 1690, 1723, 1713, 1608, 1928, 1570, 1717, 1680, 1673, 2404, 1713, 1595, 1670, + 1706, 1666, 1698, 1704, 1606, 1679, 1656, 1688, 2429, 1683, 1614, 1674, 1679, 1681, 1665, 1667, 1620, 1755, 1668, 1631, + 2364, 1670, 1610, 1690, 1683, 1730, 1665, 1727, 1666, 1677, 1714, 1700, 2340, 1760, 1641, 1651, 0, + }, + 3: []int64{886, 891, 882, 883, 880, 920, 891, 913, 890, 904, 876, 895, 893, 887, 871, 904, 872, 878, 883, 895, + 887, 890, 881, 895, 898, 902, 879, 905, 906, 923, 894, 906, 898, 876, 911, 923, 907, 904, 903, 881, + 900, 903, 884, 895, 896, 911, 886, 900, 922, 818, 926, 906, 911, 909, 892, 903, 901, 897, 905, 888, + 871, 890, 876, 885, 881, 886, 895, 903, 888, 900, 893, 878, 914, 905, 903, 895, 896, 915, 927, 901, + 906, 883, 903, 882, 893, 901, 890, 935, 911, 931, 914, 958, 926, 920, 917, 916, 183, 183, 183, 0, + }, + 4: []int64{4813, 4092, 5167, 4187, 4623, 4243, 4936, 4047, 4315, 3898, 4548, 4141, 4879, 3723, 4245, 3772, 4243, 3838, 4989, 4930, + 4000, 3568, 4070, 3629, 4830, 3734, 4255, 3840, 4535, 5093, 4928, 4063, 5081, 4567, 4038, 5165, 5027, 4144, 4971, 4403, + 4478, 4190, 4590, 4023, 3966, 4206, 4048, 4322, 4869, 4340, 3861, 4990, 3876, 4203, 5088, 4283, 5759, 4100, 4041, 4091, + 4730, 3991, 4617, 4397, 3833, 4156, 4606, 4090, 6918, 3896, 3965, 3780, 5171, 4013, 4623, 4090, 4315, 4735, 4750, 3558, + 5608, 3861, 4126, 4160, 4980, 4405, 4628, 3981, 4455, 3634, 4928, 3778, 5545, 4271, 4511, 3883, 1157, 364, 470, 0, + }, + 24: []int64{8408, 8409, 8408, 8409, 8409, 8408, 8409, 8408, 8408, 8408, 8408, 8408, 8409, 8408, 8409, 8409, 8408, 8409, 8409, 8408, + 8409, 8409, 8409, 8409, 8408, 8409, 8409, 8408, 8409, 8408, 8408, 8409, 8409, 8409, 8410, 8409, 8409, 8409, 8409, 8410, + 8409, 8409, 8410, 8409, 8410, 8410, 8409, 8410, 8410, 8410, 8410, 8409, 8409, 8410, 8409, 8410, 8410, 8409, 8409, 8409, + 8410, 8410, 8409, 8410, 8410, 8409, 8410, 8410, 8410, 8410, 8410, 8410, 8410, 8409, 8409, 8409, 8409, 8410, 8409, 8410, + 8411, 8410, 8410, 8411, 8410, 8411, 8411, 8410, 8411, 8410, 8411, 8411, 8411, 8411, 8411, 8410, 1810, 1810, 1810, 0, + }, + 25: []int64{8407, 8407, 8407, 8407, 8407, 8406, 8407, 8407, 8407, 8406, 8407, 8407, 8407, 8407, 8407, 8407, 8407, 8407, 8407, 8407, + 8407, 8407, 8407, 8408, 8407, 8407, 8407, 8407, 8407, 8407, 8407, 8408, 8407, 8407, 8408, 8408, 8407, 8407, 8407, 8408, + 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, + 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8409, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, 8408, + 8409, 8409, 8408, 8409, 8409, 8409, 8409, 8409, 8409, 8409, 8409, 8410, 8409, 8409, 8409, 8409, 1809, 1810, 1809, 0, + }, + 50: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 26: []int64{8411, 8412, 8411, 8412, 8412, 8410, 8413, 8411, 8412, 8412, 8410, 8411, 8412, 8410, 8413, 8412, 8411, 8412, 8411, 8412, + 8412, 8411, 8411, 8412, 8411, 8413, 8412, 8411, 8411, 8412, 8411, 8412, 8413, 8412, 8413, 8411, 8412, 8411, 8411, 8412, + 8411, 8413, 8412, 8412, 8412, 8413, 8411, 8413, 8412, 8413, 8413, 8412, 8413, 8415, 8410, 8412, 8413, 8413, 8412, 8412, + 8414, 8413, 8411, 8413, 8413, 8411, 8413, 8412, 8414, 8412, 8412, 8413, 8413, 8410, 8413, 8412, 8413, 8414, 8412, 8413, + 8414, 8413, 8413, 8414, 8412, 8414, 8413, 8413, 8414, 8412, 8414, 8414, 8415, 8413, 8413, 8414, 1812, 1810, 1811, 0, + }, + 51: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, +} + +var DatastoreMetricData = map[int32][]int64{ + 180: []int64{1, 5, 3, 1, 3, 39, 19, 13, 5, 0, 1, 0, 1, 1, 1, 1, 1, 1, 15, 9, + 17, 1, 2, 0, 1, 25, 0, 13, 23, 4, 26, 7, 2, 2, 480, 1, 0, 55, 2, 4, + 1, 0, 5, 6, 6, 18, 3, 155, 120, 13, 330, 7, 10, 2, 0, 247, 1, 1, 89, 1, + 22, 13, 18, 2, 11, 0, 1, 184, 4, 0, 1, 1, 0, 1, 0, 5, 595, 1, 37, 320, + 7, 9, 73, 27, 2, 7, 5, 4, 149, 0, 2, 190, 13, 14, 0, 0, 0, 0}, + 181: []int64{433, 464, 439, 426, 490, 460, 455, 510, 544, 466, 657, 526, 457, 538, 448, 456, 488, 482, 470, 479, + 506, 470, 500, 469, 479, 591, 495, 474, 483, 448, 486, 567, 553, 461, 522, 506, 455, 497, 470, 470, + 516, 485, 434, 480, 501, 477, 448, 468, 783, 473, 1630, 454, 516, 430, 457, 912, 546, 483, 424, 444, + 471, 535, 466, 445, 442, 471, 505, 738, 525, 512, 480, 463, 499, 514, 469, 424, 937, 485, 460, 920, + 528, 475, 480, 466, 445, 503, 474, 497, 452, 489, 687, 781, 555, 498, 447, 0, 0, 0}, + 187: []int64{434, 469, 442, 427, 493, 499, 474, 523, 549, 466, 658, 526, 458, 539, 449, 457, 489, 483, 485, 488, + 523, 471, 502, 469, 480, 616, 495, 487, 506, 452, 512, 574, 555, 463, 1002, 507, 455, 552, 472, 474, + 517, 485, 439, 486, 507, 495, 451, 623, 903, 486, 1960, 461, 526, 432, 457, 1159, 547, 484, 513, 445, + 493, 548, 484, 447, 453, 471, 506, 922, 529, 512, 481, 464, 499, 515, 469, 429, 1532, 486, 497, 1240, + 535, 484, 553, 493, 447, 510, 479, 501, 601, 489, 689, 971, 568, 512, 447, 0, 0, 0}, + 281: []int64{174225912, 174227200, 174230104, 174230532, 174237664, 174237600, 174239588, 174235728, 174234644, 174234904, 174235132, 174236888, 174237012, 174240640, 174240148, 174246032}, + 282: []int64{3536110027, 3536111315, 3536114219, 3536114647, 3536121779, 3536121715, 3536123703, 3536119843, 3536118759, 3536066971, 3536067199, 3536067623, 3536067747, 3536066811, 3536066319, 3536066979}, + 283: []int64{426434020, 426425152, 426411808, 426402768, 426387204, 426370512, 426355764, 426340480, 426076860, 426176184, 426064540, 426487536, 426370184, 426424376, 426320528, 426406408}, + 286: []int64{3536110027, 3536111315, 3536114219, 3536114647, 3536121779, 3536121715, 3536123703, 3536119843, 3536118759, 3536066971, 3536067199, 3536067623, 3536067747, 3536066811, 3536066319, 3536066979}, + 287: []int64{174225912, 174227200, 174230104, 174230532, 174237664, 174237600, 174239588, 174235728, 174234644, 174234904, 174235132, 174236888, 174237012, 174240640, 174240148, 174246032}, + 288: []int64{133298, 133303, 133311, 133316, 133328, 133337, 133346, 133352, 133491, 133437, 133496, 133273, 133335, 133308, 133363, 133320}, +} + +var DatacenterMetricData = map[int32][]int64{ + 256: []int64{1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, + 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, + 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, + 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, + 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, + }, + 257: []int64{833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + }, + 258: []int64{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + }, + 259: []int64{6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + }, + 260: []int64{151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + }, + 261: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 262: []int64{353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + }, + 263: []int64{598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, + 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, + 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, + 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, + 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, + }, + 264: []int64{1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + }, + 265: []int64{19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + }, + 266: []int64{16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + 267: []int64{3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, + 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, + 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, + 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, + 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409, + }, + 268: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 269: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 270: []int64{646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + }, + 271: []int64{34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + }, + 272: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, + 273: []int64{3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + }, + 274: []int64{124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + }, + 275: []int64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go new file mode 100644 index 000000000..afe18dd8c --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go @@ -0,0 +1,52 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import ( + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +var RootFolder = mo.Folder{ + ManagedEntity: mo.ManagedEntity{ + ExtensibleManagedObject: mo.ExtensibleManagedObject{ + Self: types.ManagedObjectReference{Type: "Folder", Value: "group-d1"}, + Value: nil, + AvailableField: nil, + }, + Parent: (*types.ManagedObjectReference)(nil), + CustomValue: nil, + OverallStatus: "green", + ConfigStatus: "green", + ConfigIssue: nil, + EffectiveRole: []int32{-1}, + Permission: []types.Permission{ + { + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "Folder", Value: "group-d1"}, + Principal: "VSPHERE.LOCAL\\Administrator", + Group: false, + RoleId: -1, + Propagate: true, + }, + { + DynamicData: types.DynamicData{}, + Entity: &types.ManagedObjectReference{Type: "Folder", Value: "group-d1"}, + Principal: "VSPHERE.LOCAL\\Administrators", + Group: true, + RoleId: -1, + Propagate: true, + }, + }, + Name: "Datacenters", + DisabledMethod: nil, + RecentTask: nil, + DeclaredAlarmState: nil, + AlarmActionsEnabled: (*bool)(nil), + Tag: nil, + }, + ChildType: []string{"Folder", "Datacenter"}, + ChildEntity: nil, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go new file mode 100644 index 000000000..19dc5d01a --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go @@ -0,0 +1,80 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import ( + "github.com/google/uuid" + + "github.com/vmware/govmomi/internal" + "github.com/vmware/govmomi/vim25/types" +) + +// ServiceContent is the default template for the ServiceInstance content property. +// Capture method: +// govc object.collect -s -dump - content +var ServiceContent = types.ServiceContent{ + RootFolder: types.ManagedObjectReference{Type: "Folder", Value: "group-d1"}, + PropertyCollector: types.ManagedObjectReference{Type: "PropertyCollector", Value: "propertyCollector"}, + ViewManager: &types.ManagedObjectReference{Type: "ViewManager", Value: "ViewManager"}, + About: types.AboutInfo{ + Name: "VMware vCenter Server", + FullName: "VMware vCenter Server 6.5.0 build-5973321", + Vendor: "VMware, Inc.", + Version: "6.5.0", + Build: "5973321", + LocaleVersion: "INTL", + LocaleBuild: "000", + OsType: "linux-x64", + ProductLineId: "vpx", + ApiType: "VirtualCenter", + ApiVersion: "6.5", + InstanceUuid: internal.OID(string(uuid.NodeID())).String(), + LicenseProductName: "VMware VirtualCenter Server", + LicenseProductVersion: "6.0", + }, + Setting: &types.ManagedObjectReference{Type: "OptionManager", Value: "VpxSettings"}, + UserDirectory: &types.ManagedObjectReference{Type: "UserDirectory", Value: "UserDirectory"}, + SessionManager: &types.ManagedObjectReference{Type: "SessionManager", Value: "SessionManager"}, + AuthorizationManager: &types.ManagedObjectReference{Type: "AuthorizationManager", Value: "AuthorizationManager"}, + ServiceManager: &types.ManagedObjectReference{Type: "ServiceManager", Value: "ServiceMgr"}, + PerfManager: &types.ManagedObjectReference{Type: "PerformanceManager", Value: "PerfMgr"}, + ScheduledTaskManager: &types.ManagedObjectReference{Type: "ScheduledTaskManager", Value: "ScheduledTaskManager"}, + AlarmManager: &types.ManagedObjectReference{Type: "AlarmManager", Value: "AlarmManager"}, + EventManager: &types.ManagedObjectReference{Type: "EventManager", Value: "EventManager"}, + TaskManager: &types.ManagedObjectReference{Type: "TaskManager", Value: "TaskManager"}, + ExtensionManager: &types.ManagedObjectReference{Type: "ExtensionManager", Value: "ExtensionManager"}, + CustomizationSpecManager: &types.ManagedObjectReference{Type: "CustomizationSpecManager", Value: "CustomizationSpecManager"}, + CustomFieldsManager: &types.ManagedObjectReference{Type: "CustomFieldsManager", Value: "CustomFieldsManager"}, + AccountManager: (*types.ManagedObjectReference)(nil), + DiagnosticManager: &types.ManagedObjectReference{Type: "DiagnosticManager", Value: "DiagMgr"}, + LicenseManager: &types.ManagedObjectReference{Type: "LicenseManager", Value: "LicenseManager"}, + SearchIndex: &types.ManagedObjectReference{Type: "SearchIndex", Value: "SearchIndex"}, + FileManager: &types.ManagedObjectReference{Type: "FileManager", Value: "FileManager"}, + DatastoreNamespaceManager: &types.ManagedObjectReference{Type: "DatastoreNamespaceManager", Value: "DatastoreNamespaceManager"}, + VirtualDiskManager: &types.ManagedObjectReference{Type: "VirtualDiskManager", Value: "virtualDiskManager"}, + VirtualizationManager: (*types.ManagedObjectReference)(nil), + SnmpSystem: &types.ManagedObjectReference{Type: "HostSnmpSystem", Value: "SnmpSystem"}, + VmProvisioningChecker: &types.ManagedObjectReference{Type: "VirtualMachineProvisioningChecker", Value: "ProvChecker"}, + VmCompatibilityChecker: &types.ManagedObjectReference{Type: "VirtualMachineCompatibilityChecker", Value: "CompatChecker"}, + OvfManager: &types.ManagedObjectReference{Type: "OvfManager", Value: "OvfManager"}, + IpPoolManager: &types.ManagedObjectReference{Type: "IpPoolManager", Value: "IpPoolManager"}, + DvSwitchManager: &types.ManagedObjectReference{Type: "DistributedVirtualSwitchManager", Value: "DVSManager"}, + HostProfileManager: &types.ManagedObjectReference{Type: "HostProfileManager", Value: "HostProfileManager"}, + ClusterProfileManager: &types.ManagedObjectReference{Type: "ClusterProfileManager", Value: "ClusterProfileManager"}, + ComplianceManager: &types.ManagedObjectReference{Type: "ProfileComplianceManager", Value: "MoComplianceManager"}, + LocalizationManager: &types.ManagedObjectReference{Type: "LocalizationManager", Value: "LocalizationManager"}, + StorageResourceManager: &types.ManagedObjectReference{Type: "StorageResourceManager", Value: "StorageResourceManager"}, + GuestOperationsManager: &types.ManagedObjectReference{Type: "GuestOperationsManager", Value: "guestOperationsManager"}, + OverheadMemoryManager: &types.ManagedObjectReference{Type: "OverheadMemoryManager", Value: "OverheadMemoryManager"}, + CertificateManager: &types.ManagedObjectReference{Type: "CertificateManager", Value: "certificateManager"}, + IoFilterManager: &types.ManagedObjectReference{Type: "IoFilterManager", Value: "IoFilterManager"}, + VStorageObjectManager: &types.ManagedObjectReference{Type: "VcenterVStorageObjectManager", Value: "VStorageObjectManager"}, + HostSpecManager: &types.ManagedObjectReference{Type: "HostSpecificationManager", Value: "HostSpecificationManager"}, + CryptoManager: &types.ManagedObjectReference{Type: "CryptoManagerKmip", Value: "CryptoManager"}, + HealthUpdateManager: &types.ManagedObjectReference{Type: "HealthUpdateManager", Value: "HealthUpdateManager"}, + FailoverClusterConfigurator: &types.ManagedObjectReference{Type: "FailoverClusterConfigurator", Value: "FailoverClusterConfigurator"}, + FailoverClusterManager: &types.ManagedObjectReference{Type: "FailoverClusterManager", Value: "FailoverClusterManager"}, + TenantManager: &types.ManagedObjectReference{Type: "TenantTenantManager", Value: "TenantManager"}, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go new file mode 100644 index 000000000..0334196dc --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go @@ -0,0 +1,66 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import "github.com/vmware/govmomi/vim25/types" + +// TODO: figure out whether this is Setting or AdvancedOptions - see esx/setting.go for the difference + +// Setting is captured from VC's ServiceContent.OptionManager.setting +var Setting = []types.BaseOptionValue{ + // This list is currently pruned to include sso options only with sso.enabled set to false + &types.OptionValue{ + Key: "config.vpxd.sso.sts.uri", + Value: "https://127.0.0.1/sts/STSService/vsphere.local", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.solutionUser.privateKey", + Value: "/etc/vmware-vpx/ssl/vcsoluser.key", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.solutionUser.name", + Value: "vpxd-b643d01c-928f-469b-96a5-d571d762a78e@vsphere.local", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.solutionUser.certificate", + Value: "/etc/vmware-vpx/ssl/vcsoluser.crt", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.groupcheck.uri", + Value: "https://127.0.0.1/sso-adminserver/sdk/vsphere.local", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.enabled", + Value: "false", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.default.isGroup", + Value: "false", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.default.admin", + Value: "Administrator@vsphere.local", + }, + &types.OptionValue{ + Key: "config.vpxd.sso.admin.uri", + Value: "https://127.0.0.1/sso-adminserver/sdk/vsphere.local", + }, + &types.OptionValue{ + Key: "VirtualCenter.InstanceName", + Value: "127.0.0.1", + }, + &types.OptionValue{ + Key: "event.batchsize", + Value: int32(2000), + }, + &types.OptionValue{ + Key: "event.maxAge", + Value: int32(30), + }, + &types.OptionValue{ + Key: "event.maxAgeEnabled", + Value: bool(true), + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go new file mode 100644 index 000000000..49d6a4796 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go @@ -0,0 +1,11121 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vpx + +import "github.com/vmware/govmomi/vim25/types" + +// Description is the default template for the TaskManager description property. +// Capture method: +// govc object.collect -s -dump TaskManager:TaskManager description +var Description = types.TaskDescription{ + MethodInfo: []types.BaseElementDescription{ + &types.ElementDescription{ + Description: types.Description{ + Label: "createEntry", + Summary: "createEntry", + }, + Key: "host.OperationCleanupManager.createEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntry", + Summary: "updateEntry", + }, + Key: "host.OperationCleanupManager.updateEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryEntry", + Summary: "queryEntry", + }, + Key: "host.OperationCleanupManager.queryEntry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disabled guest operations", + Summary: "Returns a list of guest operations not supported by a virtual machine", + }, + Key: "vm.guest.GuestOperationsManager.queryDisabledMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSpecification", + Summary: "updateHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.updateHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecification", + Summary: "updateHostSubSpecification", + }, + Key: "profile.host.HostSpecificationManager.updateHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostSpecification", + Summary: "retrieveHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.retrieveHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSubSpecification", + Summary: "deleteHostSubSpecification", + }, + Key: "profile.host.HostSpecificationManager.deleteHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSpecification", + Summary: "deleteHostSpecification", + }, + Key: "profile.host.HostSpecificationManager.deleteHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getUpdatedHosts", + Summary: "getUpdatedHosts", + }, + Key: "profile.host.HostSpecificationManager.getUpdatedHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set graphics manager custom value", + Summary: "Sets the value of a custom field of the graphics manager", + }, + Key: "host.GraphicsManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh graphics information", + Summary: "Refresh graphics device information", + }, + Key: "host.GraphicsManager.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check if shared graphics is active", + Summary: "Check if shared graphics is active on the host", + }, + Key: "host.GraphicsManager.isSharedGraphicsActive", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateGraphicsConfig", + Summary: "updateGraphicsConfig", + }, + Key: "host.GraphicsManager.updateGraphicsConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration option descriptor", + Summary: "Get the list of configuration option keys available in this browser", + }, + Key: "EnvironmentBrowser.queryConfigOptionDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure option query", + Summary: "Search for a specific configuration option", + }, + Key: "EnvironmentBrowser.queryConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConfigOptionEx", + Summary: "queryConfigOptionEx", + }, + Key: "EnvironmentBrowser.queryConfigOptionEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration target", + Summary: "Search for a specific configuration target", + }, + Key: "EnvironmentBrowser.queryConfigTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query target capabilities", + Summary: "Query for compute-resource capabilities associated with this browser", + }, + Key: "EnvironmentBrowser.queryTargetCapabilities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine provisioning operation policy", + Summary: "Query environment browser for information about the virtual machine provisioning operation policy", + }, + Key: "EnvironmentBrowser.queryProvisioningPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConfigTargetSpec", + Summary: "queryConfigTargetSpec", + }, + Key: "EnvironmentBrowser.queryConfigTargetSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set scheduled task custom value", + Summary: "Sets the value of a custom field of a scheduled task", + }, + Key: "scheduler.ScheduledTask.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove scheduled task", + Summary: "Remove the scheduled task", + }, + Key: "scheduler.ScheduledTask.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure scheduled task", + Summary: "Reconfigure the scheduled task properties", + }, + Key: "scheduler.ScheduledTask.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Run scheduled task", + Summary: "Run the scheduled task immediately", + }, + Key: "scheduler.ScheduledTask.run", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query CMMDS", + Summary: "Queries CMMDS contents in the vSAN cluster", + }, + Key: "host.VsanInternalSystem.queryCmmds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query physical vSAN disks", + Summary: "Queries the physical vSAN disks", + }, + Key: "host.VsanInternalSystem.queryPhysicalVsanDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects", + Summary: "Queries the vSAN objects in the cluster", + }, + Key: "host.VsanInternalSystem.queryVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects on physical disks", + Summary: "Queries the vSAN objects that have at least one component on the current set of physical disks", + }, + Key: "host.VsanInternalSystem.queryObjectsOnPhysicalVsanDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Drop ownership of DOM objects", + Summary: "Drop ownership of the DOM objects that are owned by this host", + }, + Key: "host.VsanInternalSystem.abdicateDomOwnership", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN statistics", + Summary: "Gathers low level statistic counters from the vSAN cluster", + }, + Key: "host.VsanInternalSystem.queryVsanStatistics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigures vSAN objects", + Summary: "Reconfigures the vSAN objects in the cluster", + }, + Key: "host.VsanInternalSystem.reconfigureDomObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSAN objects that are currently synchronizing data", + Summary: "Queries vSAN objects that are updating stale components or synchronizing new replicas", + }, + Key: "host.VsanInternalSystem.querySyncingVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Run diagnostics on vSAN disks", + Summary: "Runs diagnostic tests on vSAN physical disks and verifies if objects are successfully created on the disks", + }, + Key: "host.VsanInternalSystem.runVsanPhysicalDiskDiagnostics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attributes of vSAN objects", + Summary: "Shows the extended attributes of the vSAN objects", + }, + Key: "host.VsanInternalSystem.getVsanObjExtAttrs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configurable vSAN objects", + Summary: "Identifies the vSAN objects that can be reconfigured using the assigned storage policy in the current cluster", + }, + Key: "host.VsanInternalSystem.reconfigurationSatisfiable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN objects available for provisioning", + Summary: "Identifies the vSAN objects that are available for provisioning using the assigned storage policy in the current cluster", + }, + Key: "host.VsanInternalSystem.canProvisionObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteVsanObjects", + Summary: "deleteVsanObjects", + }, + Key: "host.VsanInternalSystem.deleteVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vSAN object format", + Summary: "Upgrade vSAN object format, to fit in vSAN latest features", + }, + Key: "host.VsanInternalSystem.upgradeVsanObjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryVsanObjectUuidsByFilter", + Summary: "queryVsanObjectUuidsByFilter", + }, + Key: "host.VsanInternalSystem.queryVsanObjectUuidsByFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN entities available for decommissioning", + Summary: "Identifies the vSAN entities that are available for decommissioning in the current cluster", + }, + Key: "host.VsanInternalSystem.canDecommission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Authenticate credentials in guest", + Summary: "Authenticate credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.validateCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire credentials in guest", + Summary: "Acquire credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.acquireCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Release credentials in guest", + Summary: "Release credentials in the guest operating system", + }, + Key: "vm.guest.AuthManager.releaseCredentials", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create user", + Summary: "Creates a local user account", + }, + Key: "host.LocalAccountManager.createUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update user", + Summary: "Updates a local user account", + }, + Key: "host.LocalAccountManager.updateUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create group", + Summary: "Creates a local group account", + }, + Key: "host.LocalAccountManager.createGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete user", + Summary: "Removes a local user account", + }, + Key: "host.LocalAccountManager.removeUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove group", + Summary: "Removes a local group account", + }, + Key: "host.LocalAccountManager.removeGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Assign user to group", + Summary: "Assign user to group", + }, + Key: "host.LocalAccountManager.assignUserToGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unassign user from group", + Summary: "Unassigns a user from a group", + }, + Key: "host.LocalAccountManager.unassignUserFromGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add an image library", + Summary: "Register an image library server with vCenter", + }, + Key: "ImageLibraryManager.addLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update image library", + Summary: "Update image library information", + }, + Key: "ImageLibraryManager.updateLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an image library", + Summary: "Unregister an image library server from vCenter", + }, + Key: "ImageLibraryManager.removeLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import from image library", + Summary: "Import files from the image library", + }, + Key: "ImageLibraryManager.importLibraryMedia", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export to image library", + Summary: "Export files to the image library", + }, + Key: "ImageLibraryManager.exportMediaToLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Publish to image library", + Summary: "Publish files from datastore to image library", + }, + Key: "ImageLibraryManager.publishMediaToLibrary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.ContentLibrary.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.ContentLibrary.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.ContentLibrary.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.ContentLibrary.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.ContentLibrary.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.ContentLibrary.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.ContentLibrary.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set EVC manager custom value", + Summary: "Sets the value of a custom field for an Enhanced vMotion Compatibility manager", + }, + Key: "cluster.TransitionalEVCManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure cluster EVC", + Summary: "Enable/reconfigure Enhanced vMotion Compatibility for a cluster", + }, + Key: "cluster.TransitionalEVCManager.configureEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable cluster EVC", + Summary: "Disable Enhanced vMotion Compatibility for a cluster", + }, + Key: "cluster.TransitionalEVCManager.disableEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate EVC mode for cluster", + Summary: "Test the validity of configuring Enhanced vMotion Compatibility mode on the managed cluster", + }, + Key: "cluster.TransitionalEVCManager.checkConfigureEVC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host for EVC cluster", + Summary: "Tests the validity of adding a host into the Enhanced vMotion Compatibility cluster", + }, + Key: "cluster.TransitionalEVCManager.checkAddHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "lookupVmOverheadMemory", + Summary: "lookupVmOverheadMemory", + }, + Key: "OverheadMemoryManager.lookupVmOverheadMemory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set event history latest page size", + Summary: "Set the last page viewed size of event history", + }, + Key: "event.EventHistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind event history", + Summary: "Moves view to the oldest item of event history", + }, + Key: "event.EventHistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset event history", + Summary: "Moves view to the newest item of event history", + }, + Key: "event.EventHistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove event history", + Summary: "Removes the event history collector", + }, + Key: "event.EventHistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read next event history", + Summary: "Reads view from current position of event history, and then the position is moved to the next newer page", + }, + Key: "event.EventHistoryCollector.readNext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read previous event history", + Summary: "Reads view from current position of event history and moves the position to the next older page", + }, + Key: "event.EventHistoryCollector.readPrev", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set managed entity custom value", + Summary: "Sets the value of a custom field of a managed entity", + }, + Key: "ManagedEntity.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload managed entity", + Summary: "Reload the entity state", + }, + Key: "ManagedEntity.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename managed entity", + Summary: "Rename this entity", + }, + Key: "ManagedEntity.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove entity", + Summary: "Deletes the entity and removes it from parent folder", + }, + Key: "ManagedEntity.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the entity", + }, + Key: "ManagedEntity.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the entity", + }, + Key: "ManagedEntity.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ManagedEntity.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set a custom value for EVC manager", + Summary: "Sets a value in the custom field for Enhanced vMotion Compatibility manager", + }, + Key: "cluster.EVCManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable/reconfigure EVC", + Summary: "Enable/reconfigure Enhanced vMotion Compatibility in a cluster", + }, + Key: "cluster.EVCManager.configureEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable cluster EVC", + Summary: "Disable Enhanced vMotion Compatibility in a cluster", + }, + Key: "cluster.EVCManager.disableEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate EVC configuration", + Summary: "Validates the configuration of Enhanced vMotion Compatibility mode in the managed cluster", + }, + Key: "cluster.EVCManager.checkConfigureEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate hosts in EVC", + Summary: "Validates new hosts in the Enhanced vMotion Compatibility cluster", + }, + Key: "cluster.EVCManager.checkAddHostEvc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host profile description", + Summary: "Retrieve host profile description", + }, + Key: "profile.host.HostProfile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete host profile", + Summary: "Delete host profile", + }, + Key: "profile.host.HostProfile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach host profile", + Summary: "Attach host profile to host or cluster", + }, + Key: "profile.host.HostProfile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach host profile", + Summary: "Detach host profile from host or cluster", + }, + Key: "profile.host.HostProfile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of a host or cluster against a host profile", + }, + Key: "profile.host.HostProfile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host profile", + Summary: "Export host profile to a file", + }, + Key: "profile.host.HostProfile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update reference host", + Summary: "Update reference host", + }, + Key: "profile.host.HostProfile.updateReferenceHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host profile", + Summary: "Update host profile", + }, + Key: "profile.host.HostProfile.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validate", + Summary: "validate", + }, + Key: "profile.host.HostProfile.validate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute profile", + Summary: "Execute profile", + }, + Key: "profile.host.HostProfile.execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a host profile", + Summary: "Create a host profile", + }, + Key: "profile.host.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.host.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.host.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply host configuration", + Summary: "Apply host configuration", + }, + Key: "profile.host.ProfileManager.applyHostConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMetadata", + Summary: "queryMetadata", + }, + Key: "profile.host.ProfileManager.queryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate configuration task list for host profile", + Summary: "Generates a list of configuration tasks to be performed when applying a host profile", + }, + Key: "profile.host.ProfileManager.generateConfigTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate task list", + Summary: "Generate task list", + }, + Key: "profile.host.ProfileManager.generateTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile metadata", + Summary: "Query profile metadata", + }, + Key: "profile.host.ProfileManager.queryProfileMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query metadata for profile categories", + Summary: "Retrieves the metadata for a set of profile categories", + }, + Key: "profile.host.ProfileManager.queryProfileCategoryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query metadata for profile components", + Summary: "Retrieves the metadata for a set of profile components", + }, + Key: "profile.host.ProfileManager.queryProfileComponentMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile structure", + Summary: "Gets information about the structure of a profile", + }, + Key: "profile.host.ProfileManager.queryProfileStructure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create default profile", + Summary: "Create default profile", + }, + Key: "profile.host.ProfileManager.createDefaultProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host customizations", + Summary: "Update host customizations for host", + }, + Key: "profile.host.ProfileManager.updateAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host customizations", + Summary: "Validate host customizations for host", + }, + Key: "profile.host.ProfileManager.validateAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host customizations", + Summary: "Returns the host customization data associated with a particular host", + }, + Key: "profile.host.ProfileManager.retrieveAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveAnswerFileForProfile", + Summary: "retrieveAnswerFileForProfile", + }, + Key: "profile.host.ProfileManager.retrieveAnswerFileForProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host customizations", + Summary: "Export host customizations for host", + }, + Key: "profile.host.ProfileManager.exportAnswerFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check host customizations status", + Summary: "Check the status of the host customizations against associated profile", + }, + Key: "profile.host.ProfileManager.checkAnswerFileStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host customization status", + Summary: "Returns the status of the host customization data associated with the specified hosts", + }, + Key: "profile.host.ProfileManager.queryAnswerFileStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host customizations", + Summary: "Update host customizations", + }, + Key: "profile.host.ProfileManager.updateHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validateHostCustomizations", + Summary: "validateHostCustomizations", + }, + Key: "profile.host.ProfileManager.validateHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostCustomizations", + Summary: "retrieveHostCustomizations", + }, + Key: "profile.host.ProfileManager.retrieveHostCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostCustomizationsForProfile", + Summary: "retrieveHostCustomizationsForProfile", + }, + Key: "profile.host.ProfileManager.retrieveHostCustomizationsForProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export host customizations", + Summary: "Export host customizations", + }, + Key: "profile.host.ProfileManager.exportCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import host customizations", + Summary: "Import host customizations", + }, + Key: "profile.host.ProfileManager.importCustomizations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pre-check Remediation", + Summary: "Checks customization data and host state is valid for remediation", + }, + Key: "profile.host.ProfileManager.generateHostConfigTaskSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Batch apply host configuration", + Summary: "Batch apply host configuration", + }, + Key: "profile.host.ProfileManager.applyEntitiesConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare validation of settings to be copied", + Summary: "Generate differences between source and target host profile to validate settings to be copied", + }, + Key: "profile.host.ProfileManager.validateComposition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy settings to host profiles", + Summary: "Copy settings to host profiles", + }, + Key: "profile.host.ProfileManager.compositeProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create inventory view", + Summary: "Create a view for browsing the inventory and tracking changes to open folders", + }, + Key: "view.ViewManager.createInventoryView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create container view", + Summary: "Create a view for monitoring the contents of a single container", + }, + Key: "view.ViewManager.createContainerView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create list view", + Summary: "Create a view for getting updates", + }, + Key: "view.ViewManager.createListView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create list view", + Summary: "Create a list view from an existing view", + }, + Key: "view.ViewManager.createListViewFromView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add key", + Summary: "Add the specified key to the current host", + }, + Key: "encryption.CryptoManager.addKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add keys", + Summary: "Add the specified keys to the current host", + }, + Key: "encryption.CryptoManager.addKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove key", + Summary: "Remove the specified key from the current host", + }, + Key: "encryption.CryptoManager.removeKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove keys", + Summary: "Remove the specified keys from the current host", + }, + Key: "encryption.CryptoManager.removeKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all keys", + Summary: "List all the keys registered on the current host", + }, + Key: "encryption.CryptoManager.listKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.AntiAffinityGroup.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.AntiAffinityGroup.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.AntiAffinityGroup.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.AntiAffinityGroup.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.AntiAffinityGroup.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.AntiAffinityGroup.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.AntiAffinityGroup.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query supported switch specification", + Summary: "Query supported switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.querySupportedSwitchSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible hosts for a vSphere Distributed Switch specification", + Summary: "Returns a list of hosts that are compatible with a given vSphere Distributed Switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostForNewDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible hosts for existing vSphere Distributed Switch", + Summary: "Returns a list of hosts that are compatible with an existing vSphere Distributed Switch", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostForExistingDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compatible host specification", + Summary: "Query compatible host specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryCompatibleHostSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query feature capabilities for vSphere Distributed Switch specification", + Summary: "Queries feature capabilities available for a given vSphere Distributed Switch specification", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryFeatureCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query switch by UUID", + Summary: "Query switch by UUID", + }, + Key: "dvs.DistributedVirtualSwitchManager.querySwitchByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration target", + Summary: "Query configuration target", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryDvsConfigTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compatibility of hosts against a vSphere Distributed Switch version", + Summary: "Check compatibility of hosts against a vSphere Distributed Switch version", + }, + Key: "dvs.DistributedVirtualSwitchManager.checkCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update opaque data for set of entities", + Summary: "Update opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.updateOpaqueData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update opaque data for set of entities", + Summary: "Update opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.updateOpaqueDataEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch opaque data for set of entities", + Summary: "Fetch opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.fetchOpaqueData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch opaque data for set of entities", + Summary: "Fetch opaque data for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.fetchOpaqueDataEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute opaque command for set of entities", + Summary: "Execute opaque command for set of entities", + }, + Key: "dvs.DistributedVirtualSwitchManager.executeOpaqueCommand", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify vNetwork Distributed Switch host", + Summary: "Rectify vNetwork Distributed Switch host", + }, + Key: "dvs.DistributedVirtualSwitchManager.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export configuration of the entity", + Summary: "Export configuration of the entity", + }, + Key: "dvs.DistributedVirtualSwitchManager.exportEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import configuration of the entity", + Summary: "Import configuration of the entity", + }, + Key: "dvs.DistributedVirtualSwitchManager.importEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "dvs.DistributedVirtualSwitchManager.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query uplink team information", + Summary: "Query uplink team information", + }, + Key: "dvs.DistributedVirtualSwitchManager.QueryDvpgUplinkTeam", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHostNetworkResource", + Summary: "queryHostNetworkResource", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryHostNetworkResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryVwirePort", + Summary: "queryVwirePort", + }, + Key: "dvs.DistributedVirtualSwitchManager.queryVwirePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance of host against profile", + Summary: "Checks compliance of a host against a profile", + }, + Key: "profile.host.profileEngine.ComplianceManager.checkHostCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query expression metadata", + Summary: "Queries the metadata for the given expression names", + }, + Key: "profile.host.profileEngine.ComplianceManager.queryExpressionMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get the default compliance from host configuration subprofiles", + Summary: "Get the default compliance from host configuration subprofiles", + }, + Key: "profile.host.profileEngine.ComplianceManager.getDefaultCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move file", + Summary: "Move the file, folder, or disk from source datacenter to destination datacenter", + }, + Key: "FileManager.move", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move file", + Summary: "Move the source file or folder to destination datacenter", + }, + Key: "FileManager.moveFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy file", + Summary: "Copy the file, folder, or disk from source datacenter to destination datacenter", + }, + Key: "FileManager.copy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy file", + Summary: "Copy the source file or folder to destination datacenter", + }, + Key: "FileManager.copyFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete file", + Summary: "Delete the file, folder, or disk from source datacenter", + }, + Key: "FileManager.delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete file", + Summary: "Delete the source file or folder from the datastore", + }, + Key: "FileManager.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make Directory", + Summary: "Create a directory using the specified name", + }, + Key: "FileManager.makeDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change owner", + Summary: "Change the owner of the specified file to the specified user", + }, + Key: "FileManager.changeOwner", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.TagPolicyOption.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.TagPolicyOption.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.TagPolicyOption.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.TagPolicyOption.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.TagPolicyOption.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.TagPolicyOption.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.TagPolicyOption.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve cluster profile description", + Summary: "Retrieve cluster profile description", + }, + Key: "profile.cluster.ClusterProfile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete cluster profile", + Summary: "Delete cluster profile", + }, + Key: "profile.cluster.ClusterProfile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach cluster profile", + Summary: "Attach cluster profile to cluster", + }, + Key: "profile.cluster.ClusterProfile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach cluster profile", + Summary: "Detach cluster profile from cluster", + }, + Key: "profile.cluster.ClusterProfile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of a cluster against a cluster profile", + }, + Key: "profile.cluster.ClusterProfile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export cluster profile", + Summary: "Export cluster profile to a file", + }, + Key: "profile.cluster.ClusterProfile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update cluster profile", + Summary: "Update configuration of cluster profile", + }, + Key: "profile.cluster.ClusterProfile.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check", + Summary: "Check for dependencies, conflicts, and obsolete updates", + }, + Key: "host.PatchManager.Check", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan", + Summary: "Scan the host for patch status", + }, + Key: "host.PatchManager.Scan", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan", + Summary: "Scan the host for patch status", + }, + Key: "host.PatchManager.ScanV2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stage", + Summary: "Stage the updates to the host", + }, + Key: "host.PatchManager.Stage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install", + Summary: "Install the patch", + }, + Key: "host.PatchManager.Install", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install", + Summary: "Install the patch", + }, + Key: "host.PatchManager.InstallV2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall", + Summary: "Uninstall the patch", + }, + Key: "host.PatchManager.Uninstall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query", + Summary: "Query the host for installed bulletins", + }, + Key: "host.PatchManager.Query", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query process information", + Summary: "Retrieves information regarding processes", + }, + Key: "host.SystemDebugManager.queryProcessInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure AutoStart Manager", + Summary: "Changes the power on or power off sequence", + }, + Key: "host.AutoStartManager.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Auto power On", + Summary: "Powers On virtual machines according to the current AutoStart configuration", + }, + Key: "host.AutoStartManager.autoPowerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Auto power Off", + Summary: "Powers Off virtual machines according to the current AutoStart configuration", + }, + Key: "host.AutoStartManager.autoPowerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove managed object", + Summary: "Remove the managed objects", + }, + Key: "view.ManagedObjectView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove list view", + Summary: "Remove the list view object", + }, + Key: "view.ListView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Modify list view", + Summary: "Modify the list view", + }, + Key: "view.ListView.modify", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset list view", + Summary: "Reset the list view", + }, + Key: "view.ListView.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset view", + Summary: "Resets a set of objects in a given view", + }, + Key: "view.ListView.resetFromView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Creates a registry key", + Summary: "Creates a registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.createRegistryKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Lists all registry subkeys for a specified registry key", + Summary: "Lists all registry subkeys for a specified registry key in the Windows guest operating system.", + }, + Key: "vm.guest.WindowsRegistryManager.listRegistryKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deletes a registry key", + Summary: "Deletes a registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.deleteRegistryKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sets and creates a registry value", + Summary: "Sets and creates a registry value in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.setRegistryValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Lists all registry values for a specified registry key", + Summary: "Lists all registry values for a specified registry key in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.listRegistryValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deletes a registry value", + Summary: "Deletes a registry value in the Windows guest operating system", + }, + Key: "vm.guest.WindowsRegistryManager.deleteRegistryValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register Fault Tolerant Secondary VM", + Summary: "Registers a Secondary VM with a Fault Tolerant Primary VM", + }, + Key: "host.FaultToleranceManager.registerSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister Fault Tolerant Secondary VM", + Summary: "Unregister a Secondary VM from the associated Primary VM", + }, + Key: "host.FaultToleranceManager.unregisterSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make Primary VM", + Summary: "Test Fault Tolerance failover by making a Secondary VM in a Fault Tolerance pair the Primary VM", + }, + Key: "host.FaultToleranceManager.makePrimary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Make peer VM primary", + Summary: "Makes the peer VM primary and terminates the local virtual machine", + }, + Key: "host.FaultToleranceManager.goLivePeerVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop Fault Tolerant virtual machine", + Summary: "Stop a specified virtual machine in a Fault Tolerant pair", + }, + Key: "host.FaultToleranceManager.terminateFaultTolerantVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable Secondary VM", + Summary: "Disable Fault Tolerance on a specified Secondary VM", + }, + Key: "host.FaultToleranceManager.disableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable Secondary VM", + Summary: "Enable Fault Tolerance on a specified Secondary VM", + }, + Key: "host.FaultToleranceManager.enableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start Fault Tolerant Secondary VM", + Summary: "Start Fault Tolerant Secondary VM on remote host", + }, + Key: "host.FaultToleranceManager.startSecondaryOnRemoteHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister Fault Tolerance", + Summary: "Unregister the Fault Tolerance service", + }, + Key: "host.FaultToleranceManager.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set local VM component health", + Summary: "Sets the component health information of the specified local virtual machine", + }, + Key: "host.FaultToleranceManager.setLocalVMComponentHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get peer VM component health", + Summary: "Gets component health information of the FT peer of the specified local virtual machine", + }, + Key: "host.FaultToleranceManager.getPeerVMComponentHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vCenter HA cluster mode", + Summary: "Set vCenter HA cluster mode", + }, + Key: "vcha.FailoverClusterManager.setClusterMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getClusterMode", + Summary: "getClusterMode", + }, + Key: "vcha.FailoverClusterManager.getClusterMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getClusterHealth", + Summary: "getClusterHealth", + }, + Key: "vcha.FailoverClusterManager.getClusterHealth", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate failover", + Summary: "Initiate a failover from active vCenter Server node to the passive node", + }, + Key: "vcha.FailoverClusterManager.initiateFailover", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "executeStep", + Summary: "executeStep", + }, + Key: "modularity.WorkflowStepHandler.executeStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "undoStep", + Summary: "undoStep", + }, + Key: "modularity.WorkflowStepHandler.undoStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "finalizeStep", + Summary: "finalizeStep", + }, + Key: "modularity.WorkflowStepHandler.finalizeStep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.TagPolicy.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.TagPolicy.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.TagPolicy.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.TagPolicy.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.TagPolicy.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.TagPolicy.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.TagPolicy.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "CreateVRP", + Summary: "CreateVRP", + }, + Key: "VRPResourceManager.CreateVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "UpdateVRP", + Summary: "UpdateVRP", + }, + Key: "VRPResourceManager.UpdateVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DeleteVRP", + Summary: "DeleteVRP", + }, + Key: "VRPResourceManager.DeleteVRP", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DeployVM", + Summary: "DeployVM", + }, + Key: "VRPResourceManager.DeployVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "UndeployVM", + Summary: "UndeployVM", + }, + Key: "VRPResourceManager.UndeployVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "SetManagedByVDC", + Summary: "SetManagedByVDC", + }, + Key: "VRPResourceManager.SetManagedByVDC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetAllVRPIds", + Summary: "GetAllVRPIds", + }, + Key: "VRPResourceManager.GetAllVRPIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetRPSettings", + Summary: "GetRPSettings", + }, + Key: "VRPResourceManager.GetRPSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPSettings", + Summary: "GetVRPSettings", + }, + Key: "VRPResourceManager.GetVRPSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPUsage", + Summary: "GetVRPUsage", + }, + Key: "VRPResourceManager.GetVRPUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetVRPofVM", + Summary: "GetVRPofVM", + }, + Key: "VRPResourceManager.GetVRPofVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "GetChildRPforHub", + Summary: "GetChildRPforHub", + }, + Key: "VRPResourceManager.GetChildRPforHub", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create directory", + Summary: "Creates a top-level directory on the specified datastore", + }, + Key: "DatastoreNamespaceManager.CreateDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete directory", + Summary: "Deletes the specified top-level directory from the datastore", + }, + Key: "DatastoreNamespaceManager.DeleteDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "ConvertNamespacePathToUuidPath", + Summary: "ConvertNamespacePathToUuidPath", + }, + Key: "DatastoreNamespaceManager.ConvertNamespacePathToUuidPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.VirtualDatacenter.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.VirtualDatacenter.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.VirtualDatacenter.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.VirtualDatacenter.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.VirtualDatacenter.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.VirtualDatacenter.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.VirtualDatacenter.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile description", + Summary: "Retrieve profile description", + }, + Key: "profile.Profile.retrieveDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove profile", + Summary: "Remove profile", + }, + Key: "profile.Profile.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Associate entities", + Summary: "Associate entities with the profile", + }, + Key: "profile.Profile.associateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Dissociate entities", + Summary: "Dissociate entities from the profile", + }, + Key: "profile.Profile.dissociateEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance against the profile", + }, + Key: "profile.Profile.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export profile", + Summary: "Export profile to a file", + }, + Key: "profile.Profile.exportProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getNetworkIpSettings", + Summary: "getNetworkIpSettings", + }, + Key: "vdcs.IpManager.getNetworkIpSettings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "allocate", + Summary: "allocate", + }, + Key: "vdcs.IpManager.allocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "release", + Summary: "release", + }, + Key: "vdcs.IpManager.release", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "releaseAll", + Summary: "releaseAll", + }, + Key: "vdcs.IpManager.releaseAll", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryAll", + Summary: "queryAll", + }, + Key: "vdcs.IpManager.queryAll", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datastore cluster custom value", + Summary: "Sets the value of a custom field of a datastore cluster", + }, + Key: "StoragePod.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datastore cluster", + Summary: "Reloads the datastore cluster", + }, + Key: "StoragePod.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a datastore cluster", + Summary: "Rename a datastore cluster", + }, + Key: "StoragePod.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a datastore cluster", + Summary: "Remove a datastore cluster", + }, + Key: "StoragePod.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tags to datastore cluster", + Summary: "Adds a set of tags to a datastore cluster", + }, + Key: "StoragePod.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tags from datastore cluster", + Summary: "Removes a set of tags from a datastore cluster", + }, + Key: "StoragePod.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "StoragePod.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create folder", + Summary: "Creates a new folder", + }, + Key: "StoragePod.createFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move datastores into a datastore cluster", + Summary: "Move datastores into a datastore cluster", + }, + Key: "StoragePod.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a new virtual machine", + }, + Key: "StoragePod.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this datastore cluster", + }, + Key: "StoragePod.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Creates a new cluster compute-resource in this datastore cluster", + }, + Key: "StoragePod.createCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Creates a new cluster compute-resource in this datastore cluster", + }, + Key: "StoragePod.createClusterEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host", + Summary: "Creates a new single-host compute-resource", + }, + Key: "StoragePod.addStandaloneHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host and enable lockdown mode", + Summary: "Creates a new single-host compute-resource and enables lockdown mode on the host", + }, + Key: "StoragePod.addStandaloneHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datacenter", + Summary: "Create a new datacenter with the given name", + }, + Key: "StoragePod.createDatacenter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister and delete", + Summary: "Recursively deletes all child virtual machine folders and unregisters all virtual machines", + }, + Key: "StoragePod.unregisterAndDestroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vSphere Distributed Switch", + Summary: "Creates a vSphere Distributed Switch", + }, + Key: "StoragePod.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datastore cluster", + Summary: "Creates a new datastore cluster", + }, + Key: "StoragePod.createStoragePod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare to upgrade", + Summary: "Deletes the content of the temporary directory on the host", + }, + Key: "AgentManager.prepareToUpgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade", + Summary: "Validates and executes the installer/uninstaller executable uploaded to the temporary directory", + }, + Key: "AgentManager.upgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure host power management policy", + Summary: "Configure host power management policy", + }, + Key: "host.PowerSystem.configurePolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set network custom Value", + Summary: "Sets the value of a custom field of a network", + }, + Key: "Network.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload network", + Summary: "Reload information about the network", + }, + Key: "Network.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename network", + Summary: "Rename network", + }, + Key: "Network.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete network", + Summary: "Deletes a network if it is not used by any host or virtual machine", + }, + Key: "Network.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the network", + }, + Key: "Network.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the network", + }, + Key: "Network.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Network.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network", + Summary: "Remove network", + }, + Key: "Network.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve argument description for event type", + Summary: "Retrieves the argument meta-data for a given event type", + }, + Key: "event.EventManager.retrieveArgumentDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create event collector", + Summary: "Creates an event collector to retrieve all server events based on a filter", + }, + Key: "event.EventManager.createCollector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Log user event", + Summary: "Logs a user-defined event", + }, + Key: "event.EventManager.logUserEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get events", + Summary: "Provides the events selected by the specified filter", + }, + Key: "event.EventManager.QueryEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query events by IDs", + Summary: "Returns the events specified by a list of IDs", + }, + Key: "event.EventManager.queryEventsById", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Post event", + Summary: "Posts the specified event", + }, + Key: "event.EventManager.postEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query latest events in event filter", + Summary: "Query the latest events in the specified filter", + }, + Key: "event.EventManager.queryLastEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual disk", + Summary: "Create the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.createVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual disk", + Summary: "Delete the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.deleteVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk information", + Summary: "Queries information about a virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move virtual disk", + Summary: "Move the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.moveVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy virtual disk", + Summary: "Copy the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.copyVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend virtual disk", + Summary: "Expand the capacity of a virtual disk to the new capacity", + }, + Key: "VirtualDiskManager.extendVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk fragmentation", + Summary: "Return the percentage of fragmentation of the sparse virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskFragmentation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Defragment virtual disk", + Summary: "Defragment a sparse virtual disk", + }, + Key: "VirtualDiskManager.defragmentVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Shrink virtual disk", + Summary: "Shrink a sparse virtual disk", + }, + Key: "VirtualDiskManager.shrinkVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate virtual disk", + Summary: "Inflate a sparse virtual disk up to the full size", + }, + Key: "VirtualDiskManager.inflateVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Zero out virtual disk", + Summary: "Explicitly zero out the virtual disk.", + }, + Key: "VirtualDiskManager.eagerZeroVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fill virtual disk", + Summary: "Overwrite all blocks of the virtual disk with zeros", + }, + Key: "VirtualDiskManager.zeroFillVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Optimally eager zero the virtual disk", + Summary: "Optimally eager zero a VMFS thick virtual disk.", + }, + Key: "VirtualDiskManager.optimizeEagerZeroVirtualDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual disk UUID", + Summary: "Set the UUID for the disk, either a datastore path or a URL referring to the virtual disk", + }, + Key: "VirtualDiskManager.setVirtualDiskUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk UUID", + Summary: "Get the virtual disk SCSI inquiry page data", + }, + Key: "VirtualDiskManager.queryVirtualDiskUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk geometry", + Summary: "Get the disk geometry information for the virtual disk", + }, + Key: "VirtualDiskManager.queryVirtualDiskGeometry", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reparent disks", + Summary: "Reparent disks", + }, + Key: "VirtualDiskManager.reparentDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a child disk", + Summary: "Create a new disk and attach it to the end of disk chain specified", + }, + Key: "VirtualDiskManager.createChildDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "revertToChildDisk", + Summary: "revertToChildDisk", + }, + Key: "VirtualDiskManager.revertToChildDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate disks", + Summary: "Consolidate a list of disks to the parent most disk", + }, + Key: "VirtualDiskManager.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "importUnmanagedSnapshot", + Summary: "importUnmanagedSnapshot", + }, + Key: "VirtualDiskManager.importUnmanagedSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "releaseManagedSnapshot", + Summary: "releaseManagedSnapshot", + }, + Key: "VirtualDiskManager.releaseManagedSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "enableUPIT", + Summary: "enableUPIT", + }, + Key: "VirtualDiskManager.enableUPIT", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "disableUPIT", + Summary: "disableUPIT", + }, + Key: "VirtualDiskManager.disableUPIT", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryObjectInfo", + Summary: "queryObjectInfo", + }, + Key: "VirtualDiskManager.queryObjectInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryObjectTypes", + Summary: "queryObjectTypes", + }, + Key: "VirtualDiskManager.queryObjectTypes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a virtual disk object", + Summary: "Create a virtual disk object", + }, + Key: "vslm.host.VStorageObjectManager.createDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register a legacy disk to be a virtual disk object", + Summary: "Register a legacy disk to be a virtual disk object", + }, + Key: "vslm.host.VStorageObjectManager.registerDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend a virtual disk to the new capacity", + Summary: "Extend a virtual disk to the new capacity", + }, + Key: "vslm.host.VStorageObjectManager.extendDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate a thin virtual disk", + Summary: "Inflate a thin virtual disk", + }, + Key: "vslm.host.VStorageObjectManager.inflateDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a virtual storage object", + Summary: "Rename a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.renameVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update storage policy on a virtual storage object", + Summary: "Update storage policy on a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.updateVStorageObjectPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a virtual storage object", + Summary: "Delete a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.deleteVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a virtual storage object", + Summary: "Retrieve a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.retrieveVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveVStorageObjectState", + Summary: "retrieveVStorageObjectState", + }, + Key: "vslm.host.VStorageObjectManager.retrieveVStorageObjectState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List virtual storage objects on a datastore", + Summary: "List virtual storage objects on a datastore", + }, + Key: "vslm.host.VStorageObjectManager.listVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone a virtual storage object", + Summary: "Clone a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.cloneVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate a virtual storage object", + Summary: "Relocate a virtual storage object", + }, + Key: "vslm.host.VStorageObjectManager.relocateVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconcile datastore inventory", + Summary: "Reconcile datastore inventory", + }, + Key: "vslm.host.VStorageObjectManager.reconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Schedule reconcile datastore inventory", + Summary: "Schedule reconcile datastore inventory", + }, + Key: "vslm.host.VStorageObjectManager.scheduleReconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion send operation", + Summary: "Prepare a vMotion send operation", + }, + Key: "host.VMotionManager.prepareSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare VMotion send operation asynchronously", + Summary: "Prepares a VMotion send operation asynchronously", + }, + Key: "host.VMotionManager.prepareSourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion receive operation", + Summary: "Prepare a vMotion receive operation", + }, + Key: "host.VMotionManager.prepareDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare vMotion receive operation asynchronously", + Summary: "Prepares a vMotion receive operation asynchronously", + }, + Key: "host.VMotionManager.prepareDestinationEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate vMotion receive operation", + Summary: "Initiate a vMotion receive operation", + }, + Key: "host.VMotionManager.initiateDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate vMotion send operation", + Summary: "Initiate a vMotion send operation", + }, + Key: "host.VMotionManager.initiateSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate VMotion send operation", + Summary: "Initiates a VMotion send operation", + }, + Key: "host.VMotionManager.initiateSourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete vMotion source notification", + Summary: "Tell the source that vMotion migration is complete (success or failure)", + }, + Key: "host.VMotionManager.completeSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete vMotion receive notification", + Summary: "Tell the destination that vMotion migration is complete (success or failure)", + }, + Key: "host.VMotionManager.completeDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Commit vMotion destination upgrade", + Summary: "Reparent the disks at destination and commit the redo logs at the end of a vMotion migration", + }, + Key: "host.VMotionManager.upgradeDestination", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMotionManager memory mirror migrate flag", + Summary: "Enables or disables VMotionManager memory mirror migrate", + }, + Key: "host.VMotionManager.updateMemMirrorFlag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMigrationIds", + Summary: "queryMigrationIds", + }, + Key: "host.VMotionManager.queryMigrationIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecificationByFile", + Summary: "updateHostSubSpecificationByFile", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.updateHostSubSpecificationByFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateHostSubSpecificationByData", + Summary: "updateHostSubSpecificationByData", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.updateHostSubSpecificationByData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveHostSpecification", + Summary: "retrieveHostSpecification", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.retrieveHostSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "deleteHostSubSpecification", + Summary: "deleteHostSubSpecification", + }, + Key: "profile.host.profileEngine.HostSpecificationAgent.deleteHostSubSpecification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addKey", + Summary: "addKey", + }, + Key: "encryption.CryptoManagerKmip.addKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addKeys", + Summary: "addKeys", + }, + Key: "encryption.CryptoManagerKmip.addKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKey", + Summary: "removeKey", + }, + Key: "encryption.CryptoManagerKmip.removeKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKeys", + Summary: "removeKeys", + }, + Key: "encryption.CryptoManagerKmip.removeKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listKeys", + Summary: "listKeys", + }, + Key: "encryption.CryptoManagerKmip.listKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerKmipServer", + Summary: "registerKmipServer", + }, + Key: "encryption.CryptoManagerKmip.registerKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "markDefault", + Summary: "markDefault", + }, + Key: "encryption.CryptoManagerKmip.markDefault", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateKmipServer", + Summary: "updateKmipServer", + }, + Key: "encryption.CryptoManagerKmip.updateKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeKmipServer", + Summary: "removeKmipServer", + }, + Key: "encryption.CryptoManagerKmip.removeKmipServer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listKmipServers", + Summary: "listKmipServers", + }, + Key: "encryption.CryptoManagerKmip.listKmipServers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveKmipServersStatus", + Summary: "retrieveKmipServersStatus", + }, + Key: "encryption.CryptoManagerKmip.retrieveKmipServersStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateKey", + Summary: "generateKey", + }, + Key: "encryption.CryptoManagerKmip.generateKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveKmipServerCert", + Summary: "retrieveKmipServerCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveKmipServerCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uploadKmipServerCert", + Summary: "uploadKmipServerCert", + }, + Key: "encryption.CryptoManagerKmip.uploadKmipServerCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateSelfSignedClientCert", + Summary: "generateSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.generateSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateClientCsr", + Summary: "generateClientCsr", + }, + Key: "encryption.CryptoManagerKmip.generateClientCsr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveSelfSignedClientCert", + Summary: "retrieveSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveClientCsr", + Summary: "retrieveClientCsr", + }, + Key: "encryption.CryptoManagerKmip.retrieveClientCsr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveClientCert", + Summary: "retrieveClientCert", + }, + Key: "encryption.CryptoManagerKmip.retrieveClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateSelfSignedClientCert", + Summary: "updateSelfSignedClientCert", + }, + Key: "encryption.CryptoManagerKmip.updateSelfSignedClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateKmsSignedCsrClientCert", + Summary: "updateKmsSignedCsrClientCert", + }, + Key: "encryption.CryptoManagerKmip.updateKmsSignedCsrClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uploadClientCert", + Summary: "uploadClientCert", + }, + Key: "encryption.CryptoManagerKmip.uploadClientCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister extension", + Summary: "Unregisters an extension", + }, + Key: "ExtensionManager.unregisterExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find extension", + Summary: "Find an extension", + }, + Key: "ExtensionManager.findExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register extension", + Summary: "Registers an extension", + }, + Key: "ExtensionManager.registerExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update extension", + Summary: "Updates extension information", + }, + Key: "ExtensionManager.updateExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get server public key", + Summary: "Get vCenter Server's public key", + }, + Key: "ExtensionManager.getPublicKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extension public key", + Summary: "Set public key of the extension", + }, + Key: "ExtensionManager.setPublicKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extension certificate", + Summary: "Update the stored authentication certificate for a specified extension", + }, + Key: "ExtensionManager.setCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update extension data", + Summary: "Updates extension-specific data associated with an extension", + }, + Key: "ExtensionManager.updateExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data", + Summary: "Retrieves extension-specific data associated with an extension", + }, + Key: "ExtensionManager.queryExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data keys", + Summary: "Retrieves extension-specific data keys associated with an extension", + }, + Key: "ExtensionManager.queryExtensionDataKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear extension data", + Summary: "Clears extension-specific data associated with an extension", + }, + Key: "ExtensionManager.clearExtensionData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query extension data usage", + Summary: "Retrieves statistics about the amount of data being stored by extensions registered with vCenter Server", + }, + Key: "ExtensionManager.queryExtensionDataUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query entities managed by extension", + Summary: "Finds entities managed by an extension", + }, + Key: "ExtensionManager.queryManagedBy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query statistics about IP allocation usage", + Summary: "Query statistics about IP allocation usage, system-wide or for specified extensions", + }, + Key: "ExtensionManager.queryExtensionIpAllocationUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable replication of virtual machine", + Summary: "Enable replication of virtual machine", + }, + Key: "HbrManager.enableReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable replication of virtual machine", + Summary: "Disable replication of virtual machine", + }, + Key: "HbrManager.disableReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure replication for virtual machine", + Summary: "Reconfigure replication for virtual machine", + }, + Key: "HbrManager.reconfigureReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve replication configuration of virtual machine", + Summary: "Retrieve replication configuration of virtual machine", + }, + Key: "HbrManager.retrieveReplicationConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pause replication of virtual machine", + Summary: "Pause replication of virtual machine", + }, + Key: "HbrManager.pauseReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resume replication of virtual machine", + Summary: "Resume replication of virtual machine", + }, + Key: "HbrManager.resumeReplication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start a replication resynchronization for virtual machine", + Summary: "Start a replication resynchronization for virtual machine", + }, + Key: "HbrManager.fullSync", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start new replication instance for virtual machine", + Summary: "Start extraction and transfer of a new replication instance for virtual machine", + }, + Key: "HbrManager.createInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replicate powered-off virtual machine", + Summary: "Transfer a replication instance for powered-off virtual machine", + }, + Key: "HbrManager.startOfflineInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop replication of powered-off virtual machine", + Summary: "Stop replication of powered-off virtual machine", + }, + Key: "HbrManager.stopOfflineInstance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine replication state", + Summary: "Qureies the current state of a replicated virtual machine", + }, + Key: "HbrManager.queryReplicationState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryReplicationCapabilities", + Summary: "queryReplicationCapabilities", + }, + Key: "HbrManager.queryReplicationCapabilities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set storage custom value", + Summary: "Sets the value of a custom field of a host storage system", + }, + Key: "host.StorageSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve disk partition information", + Summary: "Gets the partition information for the disks named by the device names", + }, + Key: "host.StorageSystem.retrieveDiskPartitionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Compute disk partition information", + Summary: "Computes the disk partition information given the desired disk layout", + }, + Key: "host.StorageSystem.computeDiskPartitionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Compute disk partition information for resize", + Summary: "Compute disk partition information for resizing a partition", + }, + Key: "host.StorageSystem.computeDiskPartitionInfoForResize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update disk partitions", + Summary: "Change the partitions on the disk by supplying a partition specification and the device name", + }, + Key: "host.StorageSystem.updateDiskPartitions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Format VMFS", + Summary: "Formats a new VMFS on a disk partition", + }, + Key: "host.StorageSystem.formatVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mount VMFS volume", + Summary: "Mounts an unmounted VMFS volume", + }, + Key: "host.StorageSystem.mountVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount VMFS volume", + Summary: "Unmount a mounted VMFS volume", + }, + Key: "host.StorageSystem.unmountVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount VMFS volumes", + Summary: "Unmounts one or more mounted VMFS volumes", + }, + Key: "host.StorageSystem.unmountVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "mountVmfsVolumeEx", + Summary: "mountVmfsVolumeEx", + }, + Key: "host.StorageSystem.mountVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmapVmfsVolumeEx", + Summary: "unmapVmfsVolumeEx", + }, + Key: "host.StorageSystem.unmapVmfsVolumeEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for unmounted VMFS volume", + Summary: "Removes the state information for a previously unmounted VMFS volume", + }, + Key: "host.StorageSystem.deleteVmfsVolumeState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan VMFS", + Summary: "Rescan for new VMFS volumes", + }, + Key: "host.StorageSystem.rescanVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend VMFS", + Summary: "Extend a VMFS by attaching a disk partition", + }, + Key: "host.StorageSystem.attachVmfsExtent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Expand VMFS extent", + Summary: "Expand the capacity of the VMFS extent", + }, + Key: "host.StorageSystem.expandVmfsExtent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade VMFS", + Summary: "Upgrade the VMFS to the current VMFS version", + }, + Key: "host.StorageSystem.upgradeVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate virtual machine disks", + Summary: "Relocate the disks for all virtual machines into directories if stored in the ROOT", + }, + Key: "host.StorageSystem.upgradeVmLayout", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unbound VMFS volumes", + Summary: "Query for the list of unbound VMFS volumes", + }, + Key: "host.StorageSystem.queryUnresolvedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve VMFS volumes", + Summary: "Resolve the detected copies of VMFS volumes", + }, + Key: "host.StorageSystem.resolveMultipleUnresolvedVmfsVolumes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve VMFS volumes", + Summary: "Resolves the detected copies of VMFS volumes", + }, + Key: "host.StorageSystem.resolveMultipleUnresolvedVmfsVolumesEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount force mounted VMFS", + Summary: "Unmounts a force mounted VMFS volume", + }, + Key: "host.StorageSystem.unmountForceMountedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan HBA", + Summary: "Rescan a specific storage adapter for new storage devices", + }, + Key: "host.StorageSystem.rescanHba", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan all HBAs", + Summary: "Rescan all storage adapters for new storage devices", + }, + Key: "host.StorageSystem.rescanAllHba", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change Software Internet SCSI Status", + Summary: "Enables or disables Software Internet SCSI", + }, + Key: "host.StorageSystem.updateSoftwareInternetScsiEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI discovery properties", + Summary: "Updates the discovery properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiDiscoveryProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI authentication properties", + Summary: "Updates the authentication properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiAuthenticationProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI digest properties", + Summary: "Update the digest properties of an Internet SCSI host bus adapter or target", + }, + Key: "host.StorageSystem.updateInternetScsiDigestProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI advanced options", + Summary: "Update the advanced options of an Internet SCSI host bus adapter or target", + }, + Key: "host.StorageSystem.updateInternetScsiAdvancedOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI IP properties", + Summary: "Updates the IP properties for an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiIPProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI name", + Summary: "Updates the name of an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Internet SCSI alias", + Summary: "Updates the alias of an Internet SCSI host bus adapter", + }, + Key: "host.StorageSystem.updateInternetScsiAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Internet SCSI send targets", + Summary: "Adds send target entries to the host bus adapter discovery list", + }, + Key: "host.StorageSystem.addInternetScsiSendTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Internet SCSI send targets", + Summary: "Removes send target entries from the host bus adapter discovery list", + }, + Key: "host.StorageSystem.removeInternetScsiSendTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Internet SCSI static targets ", + Summary: "Adds static target entries to the host bus adapter discovery list", + }, + Key: "host.StorageSystem.addInternetScsiStaticTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Internet SCSI static targets", + Summary: "Removes static target entries from the host bus adapter discovery list", + }, + Key: "host.StorageSystem.removeInternetScsiStaticTargets", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable multiple path", + Summary: "Enable a path for a logical unit", + }, + Key: "host.StorageSystem.enableMultipathPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable multiple path", + Summary: "Disable a path for a logical unit", + }, + Key: "host.StorageSystem.disableMultipathPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set logical unit policy", + Summary: "Set the multipath policy for a logical unit ", + }, + Key: "host.StorageSystem.setMultipathLunPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query path selection policy options", + Summary: "Queries the set of path selection policy options", + }, + Key: "host.StorageSystem.queryPathSelectionPolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query storage array type policy options", + Summary: "Queries the set of storage array type policy options", + }, + Key: "host.StorageSystem.queryStorageArrayTypePolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update SCSI LUN display name", + Summary: "Updates the display name of a SCSI LUN", + }, + Key: "host.StorageSystem.updateScsiLunDisplayName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach SCSI LUN", + Summary: "Blocks I/O operations to the attached SCSI LUN", + }, + Key: "host.StorageSystem.detachScsiLun", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach SCSI LUNs", + Summary: "Blocks I/O operations to one or more attached SCSI LUNs", + }, + Key: "host.StorageSystem.detachScsiLunEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for detached SCSI LUN", + Summary: "Removes the state information for a previously detached SCSI LUN", + }, + Key: "host.StorageSystem.deleteScsiLunState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach SCSI LUN", + Summary: "Allow I/O issue to the specified detached SCSI LUN", + }, + Key: "host.StorageSystem.attachScsiLun", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach SCSI LUNs", + Summary: "Enables I/O operations to one or more detached SCSI LUNs", + }, + Key: "host.StorageSystem.attachScsiLunEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh host storage system", + Summary: "Refresh the storage information and settings to pick up any changes that have occurred", + }, + Key: "host.StorageSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Discover FCOE storage", + Summary: "Discovers new storage using FCOE", + }, + Key: "host.StorageSystem.discoverFcoeHbas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update FCOE HBA state", + Summary: "Mark or unmark the specified FCOE HBA for removal from the host system", + }, + Key: "host.StorageSystem.markForRemoval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Format VFFS", + Summary: "Formats a new VFFS on a SSD disk", + }, + Key: "host.StorageSystem.formatVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend VFFS", + Summary: "Extends a VFFS by attaching a SSD disk", + }, + Key: "host.StorageSystem.extendVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete VFFS", + Summary: "Deletes a VFFS from the host", + }, + Key: "host.StorageSystem.destroyVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mounts VFFS volume", + Summary: "Mounts an unmounted VFFS volume", + }, + Key: "host.StorageSystem.mountVffsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmounts VFFS volume", + Summary: "Unmounts a mounted VFFS volume", + }, + Key: "host.StorageSystem.unmountVffsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete state information for unmounted VFFS volume", + Summary: "Removes the state information for a previously unmounted VFFS volume", + }, + Key: "host.StorageSystem.deleteVffsVolumeState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rescan VFFS", + Summary: "Rescans for new VFFS volumes", + }, + Key: "host.StorageSystem.rescanVffs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available SSD disks", + Summary: "Queries available SSD disks", + }, + Key: "host.StorageSystem.queryAvailableSsds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set NFS user", + Summary: "Sets an NFS user", + }, + Key: "host.StorageSystem.setNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change NFS user password", + Summary: "Changes the password of an NFS user", + }, + Key: "host.StorageSystem.changeNFSUserPassword", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query NFS user", + Summary: "Queries an NFS user", + }, + Key: "host.StorageSystem.queryNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear NFS user", + Summary: "Deletes an NFS user", + }, + Key: "host.StorageSystem.clearNFSUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn on disk locator LEDs", + Summary: "Turns on one or more disk locator LEDs", + }, + Key: "host.StorageSystem.turnDiskLocatorLedOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn off locator LEDs", + Summary: "Turns off one or more disk locator LEDs", + }, + Key: "host.StorageSystem.turnDiskLocatorLedOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a flash disk", + Summary: "Marks the disk as a flash disk", + }, + Key: "host.StorageSystem.markAsSsd", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a HDD disk", + Summary: "Marks the disk as a HDD disk", + }, + Key: "host.StorageSystem.markAsNonSsd", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a local disk", + Summary: "Marks the disk as a local disk", + }, + Key: "host.StorageSystem.markAsLocal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark the disk as a remote disk", + Summary: "Marks the disk as a remote disk", + }, + Key: "host.StorageSystem.markAsNonLocal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "QueryIoFilterProviderId", + Summary: "QueryIoFilterProviderId", + }, + Key: "host.StorageSystem.QueryIoFilterProviderId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "FetchIoFilterSharedSecret", + Summary: "FetchIoFilterSharedSecret", + }, + Key: "host.StorageSystem.FetchIoFilterSharedSecret", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMFS unmap priority", + Summary: "Updates the priority of VMFS space reclamation operation", + }, + Key: "host.StorageSystem.updateVmfsUnmapPriority", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query VMFS config option", + Summary: "Query VMFS config option", + }, + Key: "host.StorageSystem.queryVmfsConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate vMotion migration of VMs to hosts", + Summary: "Checks whether the specified VMs can be migrated with vMotion to all the specified hosts", + }, + Key: "vm.check.ProvisioningChecker.queryVMotionCompatibilityEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate migration of VM to destination", + Summary: "Checks whether the VM can be migrated to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkMigrate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate relocation of VM to destination", + Summary: "Checks whether the VM can be relocated to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkRelocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evaluate cloning VM to destination", + Summary: "Checks whether the VM can be cloned to the specified destination host, resource pool, and datastores", + }, + Key: "vm.check.ProvisioningChecker.checkClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "checkInstantClone", + Summary: "checkInstantClone", + }, + Key: "vm.check.ProvisioningChecker.checkInstantClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster profile", + Summary: "Create cluster profile", + }, + Key: "profile.cluster.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.cluster.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.cluster.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare a vCenter HA setup", + Summary: "Prepare vCenter HA setup on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.prepare", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy a vCenter HA cluster", + Summary: "Deploy and configure vCenter HA on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.deploy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure a vCenter HA cluster", + Summary: "Configure vCenter HA on the local vCenter Server", + }, + Key: "vcha.FailoverClusterConfigurator.configure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create passive node", + Summary: "Create a passive node in a vCenter HA Cluster", + }, + Key: "vcha.FailoverClusterConfigurator.createPassiveNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create witness node", + Summary: "Create a witness node in a vCenter HA Cluster", + }, + Key: "vcha.FailoverClusterConfigurator.createWitnessNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getConfig", + Summary: "getConfig", + }, + Key: "vcha.FailoverClusterConfigurator.getConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Destroy the vCenter HA cluster", + Summary: "Destroy the vCenter HA cluster setup and remove all configuration files", + }, + Key: "vcha.FailoverClusterConfigurator.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get current time", + Summary: "Returns the current time on the server", + }, + Key: "ServiceInstance.currentTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve content", + Summary: "Get the properties of the service instance", + }, + Key: "ServiceInstance.retrieveContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve internal properties", + Summary: "Retrieves the internal properties of the service instance", + }, + Key: "ServiceInstance.retrieveInternalContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate migration", + Summary: "Checks for errors and warnings of virtual machines migrated from one host to another", + }, + Key: "ServiceInstance.validateMigration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vMotion compatibility", + Summary: "Validates the vMotion compatibility of a set of hosts", + }, + Key: "ServiceInstance.queryVMotionCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve product components", + Summary: "Component information for bundled products", + }, + Key: "ServiceInstance.retrieveProductComponents", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vSphere Distributed Switch", + Summary: "Create vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove vSphere Distributed Switch", + Summary: "Remove vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.removeDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.reconfigureDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPort", + Summary: "Update dvPort", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.updatePorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete ports", + Summary: "Delete ports", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.deletePorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve port state", + Summary: "Retrieve port state", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.fetchPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone port", + Summary: "Clone port", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.clonePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vSphere Distributed Switch configuration specification", + Summary: "Retrieve vSphere Distributed Switch configuration specification", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDvsConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Groups", + Summary: "Update Distributed Port Group", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.updateDVPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve port group keys for vSphere Distributed Switch", + Summary: "Retrieve the list of port group keys on a given vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve distributed virtual port group specification", + Summary: "Retrievs the configuration specification for distributed virtual port groups", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPortgroupConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Load port", + Summary: "Load port", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.loadDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve the list of port keys on the given vSphere Distributed Switch", + Summary: "Retrieve the list of port keys on the given vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.retrieveDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPorts", + Summary: "Update dvPort", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Groups", + Summary: "Update Distributed Port Group", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch", + Summary: "Update vSphere Distributed Switch", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDvs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch list", + Summary: "Update vSphere Distributed Switch list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDvsList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Distributed Port Group list", + Summary: "Update Distributed Port Group list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortgroupList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update dvPort list", + Summary: "Update dvPort list", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.applyDVPortList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute opaque command", + Summary: "Execute opaque command", + }, + Key: "dvs.HostDistributedVirtualSwitchManager.executeOpaqueCommand", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create default host profile of specified type", + Summary: "Creates a default host profile of the specified type", + }, + Key: "profile.host.profileEngine.HostProfileManager.createDefaultProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile policy option metadata", + Summary: "Gets the profile policy option metadata for the specified policy names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile metadata", + Summary: "Gets the profile metadata for the specified profile names and profile types", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile category metadata", + Summary: "Gets the profile category metadata for the specified category names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileCategoryMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile component metadata", + Summary: "Gets the profile component metadata for the specified component names", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileComponentMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute host profile manager engine", + Summary: "Executes the host profile manager engine", + }, + Key: "profile.host.profileEngine.HostProfileManager.execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Bookkeep host profile", + Summary: "Bookkeep host profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.bookKeep", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile description", + Summary: "Retrieves description of a profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.retrieveProfileDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update configuration tasks from host configuration", + Summary: "Update configuration tasks from host configuration", + }, + Key: "profile.host.profileEngine.HostProfileManager.updateTaskConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateTaskList", + Summary: "generateTaskList", + }, + Key: "profile.host.profileEngine.HostProfileManager.generateTaskList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateHostConfigTaskSpec", + Summary: "generateHostConfigTaskSpec", + }, + Key: "profile.host.profileEngine.HostProfileManager.generateHostConfigTaskSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve profile from host configuration", + Summary: "Retrieves a profile from the host's configuration", + }, + Key: "profile.host.profileEngine.HostProfileManager.retrieveProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare host profile for export", + Summary: "Prepares a host profile for export", + }, + Key: "profile.host.profileEngine.HostProfileManager.prepareExport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query user input policy options", + Summary: "Gets a list of policy options that are set to require user inputs", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryUserInputPolicyOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query profile structure", + Summary: "Gets information about the structure of a profile", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryProfileStructure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply host configuration", + Summary: "Applies the specified host configuration to the host", + }, + Key: "profile.host.profileEngine.HostProfileManager.applyHostConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host profile manager state", + Summary: "Gets the current state of the host profile manager and plug-ins on a host", + }, + Key: "profile.host.profileEngine.HostProfileManager.queryState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check virtual machine's compatibility on host", + Summary: "Checks whether a virtual machine is compatible on a host", + }, + Key: "vm.check.CompatibilityChecker.checkCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compatibility of a VM specification on a host", + Summary: "Checks compatibility of a VM specification on a host", + }, + Key: "vm.check.CompatibilityChecker.checkVMCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query service list", + Summary: "Location information that needs to match a service", + }, + Key: "ServiceManager.queryServiceList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove inventory view", + Summary: "Remove the inventory view object", + }, + Key: "view.InventoryView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open inventory view folder", + Summary: "Adds the child objects of a given managed entity to the view", + }, + Key: "view.InventoryView.openFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Close inventory view", + Summary: "Notify the server that folders have been closed", + }, + Key: "view.InventoryView.closeFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure host update proxy", + Summary: "Reconfigure host update proxy", + }, + Key: "host.HostUpdateProxyManager.reconfigureHostUpdateProxy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve configuration of the host update proxy", + Summary: "Retrieve configuration of the host update proxy", + }, + Key: "host.HostUpdateProxyManager.retrieveHostUpdateProxyConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update VMCI access rights", + Summary: "Updates VMCI (Virtual Machine Communication Interface) access rights for one or more virtual machines", + }, + Key: "host.VmciAccessManager.updateAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve VMCI service rights granted to virtual machine", + Summary: "Retrieve VMCI (Virtual Machine Communication Interface) service rights granted to a VM", + }, + Key: "host.VmciAccessManager.retrieveGrantedServices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machines with access to VMCI service", + Summary: "Gets the VMs with granted access to a service", + }, + Key: "host.VmciAccessManager.queryAccessToService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "promoteDisks", + Summary: "promoteDisks", + }, + Key: "host.LowLevelProvisioningManager.promoteDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine on disk", + }, + Key: "host.LowLevelProvisioningManager.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine", + Summary: "Deletes a virtual machine on disk", + }, + Key: "host.LowLevelProvisioningManager.deleteVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine without deleting its virtual disks", + Summary: "Deletes a virtual machine from its storage, all virtual machine files are deleted except its associated virtual disks", + }, + Key: "host.LowLevelProvisioningManager.deleteVmExceptDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual machine recovery information", + Summary: "Retrieves virtual machine recovery information", + }, + Key: "host.LowLevelProvisioningManager.retrieveVmRecoveryInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve last virtual machine migration status", + Summary: "Retrieves the last virtual machine migration status if available", + }, + Key: "host.LowLevelProvisioningManager.retrieveLastVmMigrationStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine", + Summary: "Reconfigures the virtual machine", + }, + Key: "host.LowLevelProvisioningManager.reconfigVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload disks", + Summary: "Reloads virtual disk information", + }, + Key: "host.LowLevelProvisioningManager.reloadDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate disks", + Summary: "Consolidates virtual disks", + }, + Key: "host.LowLevelProvisioningManager.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update snapshot layout information", + Summary: "Updates the snapshot layout information of a virtual machine and reloads its snapshots", + }, + Key: "host.LowLevelProvisioningManager.relayoutSnapshots", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reserve files for provisioning", + Summary: "Reserves files or directories on a datastore to be used for a provisioning", + }, + Key: "host.LowLevelProvisioningManager.reserveFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete files", + Summary: "Deletes a list of files from a datastore", + }, + Key: "host.LowLevelProvisioningManager.deleteFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extract NVRAM content", + Summary: "Extracts the NVRAM content from a checkpoint file", + }, + Key: "host.LowLevelProvisioningManager.extractNvramContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "setCustomValue", + Summary: "setCustomValue", + }, + Key: "external.ContentLibraryItem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "reload", + Summary: "reload", + }, + Key: "external.ContentLibraryItem.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rename", + Summary: "rename", + }, + Key: "external.ContentLibraryItem.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "destroy", + Summary: "destroy", + }, + Key: "external.ContentLibraryItem.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addTag", + Summary: "addTag", + }, + Key: "external.ContentLibraryItem.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeTag", + Summary: "removeTag", + }, + Key: "external.ContentLibraryItem.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "external.ContentLibraryItem.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete container view", + Summary: "Remove a list view object from current contents of this view", + }, + Key: "view.ContainerView.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datastore custom value", + Summary: "Sets the value of a custom field of a datastore", + }, + Key: "Datastore.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datastore", + Summary: "Reload information about the datastore", + }, + Key: "Datastore.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datastore", + Summary: "Renames a datastore", + }, + Key: "Datastore.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastore", + Summary: "Removes a datastore if it is not used by any host or virtual machine", + }, + Key: "Datastore.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Tag", + Summary: "Add a set of tags to the datastore", + }, + Key: "Datastore.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the datastore", + }, + Key: "Datastore.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Datastore.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh datastore", + Summary: "Refreshes free space on this datastore", + }, + Key: "Datastore.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh storage information", + Summary: "Refresh the storage information of the datastore", + }, + Key: "Datastore.refreshStorageInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual machine files", + Summary: "Update virtual machine files on the datastore", + }, + Key: "Datastore.updateVirtualMachineFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datastore", + Summary: "Rename the datastore", + }, + Key: "Datastore.renameDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete datastore", + Summary: "Delete datastore", + }, + Key: "Datastore.destroyDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replace embedded file paths", + Summary: "Replace embedded file paths on the datastore", + }, + Key: "Datastore.replaceEmbeddedFilePaths", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter SDRS maintenance mode", + Summary: "Virtual machine evacuation recommendations from the selected datastore are generated for SDRS maintenance mode", + }, + Key: "Datastore.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit SDRS maintenance mode", + Summary: "Exit SDRS maintenance mode", + }, + Key: "Datastore.exitMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get native clone capability", + Summary: "Check if the datastore supports native clone", + }, + Key: "Datastore.isNativeCloneCapable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cleanup locks", + Summary: "Cleanup lock files on NFSV3 datastore", + }, + Key: "Datastore.cleanupLocks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateVVolVirtualMachineFiles", + Summary: "updateVVolVirtualMachineFiles", + }, + Key: "Datastore.updateVVolVirtualMachineFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create scheduled task", + Summary: "Create a scheduled task", + }, + Key: "scheduler.ScheduledTaskManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve scheduled task", + Summary: "Available scheduled tasks defined on the entity", + }, + Key: "scheduler.ScheduledTaskManager.retrieveEntityScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create scheduled task", + Summary: "Create a scheduled task", + }, + Key: "scheduler.ScheduledTaskManager.createObjectScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve scheduled task", + Summary: "Available scheduled tasks defined on the object", + }, + Key: "scheduler.ScheduledTaskManager.retrieveObjectScheduledTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add role", + Summary: "Add a new role", + }, + Key: "AuthorizationManager.addRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove role", + Summary: "Remove a role", + }, + Key: "AuthorizationManager.removeRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update role", + Summary: "Update a role's name and/or privileges", + }, + Key: "AuthorizationManager.updateRole", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reassign permissions", + Summary: "Reassign all permissions of a role to another role", + }, + Key: "AuthorizationManager.mergePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get role permissions", + Summary: "Gets all the permissions that use a particular role", + }, + Key: "AuthorizationManager.retrieveRolePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get entity permissions", + Summary: "Get permissions defined on an entity", + }, + Key: "AuthorizationManager.retrieveEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get permissions", + Summary: "Get the permissions defined for all users", + }, + Key: "AuthorizationManager.retrieveAllPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrievePermissions", + Summary: "retrievePermissions", + }, + Key: "AuthorizationManager.retrievePermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set entity permission rules", + Summary: "Define or update permission rules on an entity", + }, + Key: "AuthorizationManager.setEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset entity permission rules", + Summary: "Reset permission rules on an entity to the provided set", + }, + Key: "AuthorizationManager.resetEntityPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove entity permission", + Summary: "Remove a permission rule from the entity", + }, + Key: "AuthorizationManager.removeEntityPermission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disabled methods", + Summary: "Get the list of source objects that have been disabled on the target entity", + }, + Key: "AuthorizationManager.queryDisabledMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable authorization methods", + Summary: "Gets the set of method names to be disabled", + }, + Key: "AuthorizationManager.disableMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable authorization methods", + Summary: "Gets the set of method names to be enabled", + }, + Key: "AuthorizationManager.enableMethods", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check privileges on a managed entity", + Summary: "Checks whether a session holds a set of privileges on a managed entity", + }, + Key: "AuthorizationManager.hasPrivilegeOnEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check privileges on a set of managed entities", + Summary: "Checks whether a session holds a set of privileges on a set of managed entities", + }, + Key: "AuthorizationManager.hasPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasUserPrivilegeOnEntities", + Summary: "hasUserPrivilegeOnEntities", + }, + Key: "AuthorizationManager.hasUserPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchUserPrivilegeOnEntities", + Summary: "fetchUserPrivilegeOnEntities", + }, + Key: "AuthorizationManager.fetchUserPrivilegeOnEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check method invocation privileges", + Summary: "Checks whether a session holds a set of privileges required to invoke a specified method", + }, + Key: "AuthorizationManager.checkMethodInvocation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query required permissions", + Summary: "Get the permission requirements for the specified request", + }, + Key: "AuthorizationManager.queryPermissions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "", + Summary: "", + }, + Key: "ServiceDirectory.queryServiceEndpointList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register service endpoint", + Summary: "Registers a service endpoint", + }, + Key: "ServiceDirectory.registerService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister service endpoint", + Summary: "Unregisters a service endpoint", + }, + Key: "ServiceDirectory.unregisterService", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query options view", + Summary: "Returns nodes in the option hierarchy", + }, + Key: "option.OptionManager.queryView", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update option values", + Summary: "Updates one or more properties", + }, + Key: "option.OptionManager.updateValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "validate", + Summary: "validate", + }, + Key: "vdcs.NicManager.validate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "bind", + Summary: "bind", + }, + Key: "vdcs.NicManager.bind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unbind", + Summary: "unbind", + }, + Key: "vdcs.NicManager.unbind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Specification exists", + Summary: "Check the existence of a specification", + }, + Key: "CustomizationSpecManager.exists", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get specification", + Summary: "Gets a specification", + }, + Key: "CustomizationSpecManager.get", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create new specification", + Summary: "Create a new specification", + }, + Key: "CustomizationSpecManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Overwrite specification", + Summary: "Overwrite an existing specification", + }, + Key: "CustomizationSpecManager.overwrite", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete specification", + Summary: "Delete a specification", + }, + Key: "CustomizationSpecManager.delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Duplicate specification", + Summary: "Duplicate a specification", + }, + Key: "CustomizationSpecManager.duplicate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename specification", + Summary: "Rename a specification", + }, + Key: "CustomizationSpecManager.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert specification item", + Summary: "Convert a specification item to XML text", + }, + Key: "CustomizationSpecManager.specItemToXml", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert XML item", + Summary: "Convert an XML string to a specification item", + }, + Key: "CustomizationSpecManager.xmlToSpecItem", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate required resources", + Summary: "Validate that required resources are available on the server to customize a particular guest operating system", + }, + Key: "CustomizationSpecManager.checkResources", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set cluster resource custom value", + Summary: "Sets the value of a custom field for a cluster of objects as a unified compute-resource", + }, + Key: "ClusterComputeResource.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload cluster", + Summary: "Reloads the cluster", + }, + Key: "ClusterComputeResource.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename cluster", + Summary: "Rename the compute-resource", + }, + Key: "ClusterComputeResource.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove cluster", + Summary: "Deletes the cluster compute-resource and removes it from its parent folder (if any)", + }, + Key: "ClusterComputeResource.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the cluster", + }, + Key: "ClusterComputeResource.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Removes a set of tags from the cluster", + }, + Key: "ClusterComputeResource.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ClusterComputeResource.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure cluster", + Summary: "Reconfigures a cluster", + }, + Key: "ClusterComputeResource.reconfigureEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure cluster", + Summary: "Reconfigures a cluster", + }, + Key: "ClusterComputeResource.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply recommendation", + Summary: "Applies a recommendation", + }, + Key: "ClusterComputeResource.applyRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel recommendation", + Summary: "Cancels a recommendation", + }, + Key: "ClusterComputeResource.cancelRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recommended power On hosts", + Summary: "Get recommendations for a location to power on a specific virtual machine", + }, + Key: "ClusterComputeResource.recommendHostsForVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add host", + Summary: "Adds a new host to the cluster", + }, + Key: "ClusterComputeResource.addHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add host and enable lockdown", + Summary: "Adds a new host to the cluster and enables lockdown mode on the host", + }, + Key: "ClusterComputeResource.addHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move host into cluster", + Summary: "Moves a set of existing hosts into the cluster", + }, + Key: "ClusterComputeResource.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move host into cluster", + Summary: "Moves a host into the cluster", + }, + Key: "ClusterComputeResource.moveHostInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh recommendations", + Summary: "Refreshes the list of recommendations", + }, + Key: "ClusterComputeResource.refreshRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve EVC", + Summary: "Retrieve Enhanced vMotion Compatibility information for this cluster", + }, + Key: "ClusterComputeResource.evcManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve transitional EVC manager", + Summary: "Retrieve the transitional EVC manager for this cluster", + }, + Key: "ClusterComputeResource.transitionalEVCManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve DAS advanced runtime information", + Summary: "Retrieve DAS advanced runtime information for this cluster", + }, + Key: "ClusterComputeResource.retrieveDasAdvancedRuntimeInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vShpere HA data for cluster", + Summary: "Retrieves HA data for a cluster", + }, + Key: "ClusterComputeResource.retrieveDasData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check VM admission in vSphere HA cluster", + Summary: "Checks if HA admission control allows a set of virtual machines to be powered on in the cluster", + }, + Key: "ClusterComputeResource.checkDasAdmission", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check cluster for vSphere HA configuration", + Summary: "Check how the specified HA config will affect the cluster state if high availability is enabled", + }, + Key: "ClusterComputeResource.checkReconfigureDas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "checkReconfigureDasVmcp", + Summary: "checkReconfigureDasVmcp", + }, + Key: "ClusterComputeResource.checkReconfigureDasVmcp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DRS recommends hosts to evacuate", + Summary: "DRS recommends hosts to evacuate", + }, + Key: "ClusterComputeResource.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find Fault Tolerance compatible hosts for placing secondary VM", + Summary: "Find the set of Fault Tolerance compatible hosts for placing secondary of a given primary virtual machine", + }, + Key: "ClusterComputeResource.queryFaultToleranceCompatibleHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find Fault Tolerance compatible datastores for a VM", + Summary: "Find the set of Fault Tolerance compatible datastores for a given virtual machine", + }, + Key: "ClusterComputeResource.queryFaultToleranceCompatibleDatastores", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Verify FaultToleranceConfigSpec", + Summary: "Verify whether a given FaultToleranceConfigSpec satisfies the requirements for Fault Tolerance", + }, + Key: "ClusterComputeResource.verifyFaultToleranceConfigSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check Fault Tolerance compatibility for VM", + Summary: "Check whether a VM is compatible for turning on Fault Tolerance", + }, + Key: "ClusterComputeResource.queryCompatibilityForFaultTolerance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Call DRS for cross vMotion placement recommendations", + Summary: "Calls vSphere DRS for placement recommendations when migrating a VM across vCenter Server instances and virtual switches", + }, + Key: "ClusterComputeResource.placeVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find rules for VM", + Summary: "Locates all affinity and anti-affinity rules the specified VM participates in", + }, + Key: "ClusterComputeResource.findRulesForVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "stampAllRulesWithUuid", + Summary: "stampAllRulesWithUuid", + }, + Key: "ClusterComputeResource.stampAllRulesWithUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getResourceUsage", + Summary: "getResourceUsage", + }, + Key: "ClusterComputeResource.getResourceUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryDrmDumpHistory", + Summary: "queryDrmDumpHistory", + }, + Key: "ClusterComputeResource.queryDrmDumpHistory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "generateDrmBundle", + Summary: "generateDrmBundle", + }, + Key: "ClusterComputeResource.generateDrmBundle", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "waitForChanges", + Summary: "waitForChanges", + }, + Key: "cdc.ChangeLogCollector.waitForChanges", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "initializeSequence", + Summary: "initializeSequence", + }, + Key: "cdc.ChangeLogCollector.initializeSequence", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "exchangeSequence", + Summary: "exchangeSequence", + }, + Key: "cdc.ChangeLogCollector.exchangeSequence", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate a certificate signing request", + Summary: "Generates a certificate signing request (CSR) for the host", + }, + Key: "host.CertificateManager.generateCertificateSigningRequest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate a certificate signing request using the specified Distinguished Name", + Summary: "Generates a certificate signing request (CSR) for the host using the specified Distinguished Name", + }, + Key: "host.CertificateManager.generateCertificateSigningRequestByDn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install a server certificate", + Summary: "Installs a server certificate for the host", + }, + Key: "host.CertificateManager.installServerCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replace CA certificates and certificate revocation lists", + Summary: "Replaces the CA certificates and certificate revocation lists (CRLs) on the host", + }, + Key: "host.CertificateManager.replaceCACertificatesAndCRLs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify services affected by SSL credentials change", + Summary: "Notifies the host services affected by SSL credentials change", + }, + Key: "host.CertificateManager.notifyAffectedServices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List CA certificates", + Summary: "Lists the CA certificates on the host", + }, + Key: "host.CertificateManager.listCACertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List CA certificate revocation lists", + Summary: "Lists the CA certificate revocation lists (CRLs) on the host", + }, + Key: "host.CertificateManager.listCACertificateRevocationLists", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set CPU scheduler system custom value", + Summary: "Sets the value of a custom field of a host CPU scheduler", + }, + Key: "host.CpuSchedulerSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable hyperthreading", + Summary: "Enable hyperthreads as schedulable resources", + }, + Key: "host.CpuSchedulerSystem.enableHyperThreading", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable hyperthreading", + Summary: "Disable hyperthreads as schedulable resources", + }, + Key: "host.CpuSchedulerSystem.disableHyperThreading", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Search datastore", + Summary: "Returns the information for the files that match the given search criteria", + }, + Key: "host.DatastoreBrowser.search", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Search datastore subfolders", + Summary: "Returns the information for the files that match the given search criteria", + }, + Key: "host.DatastoreBrowser.searchSubFolders", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete datastore file", + Summary: "Deletes the specified files from the datastore", + }, + Key: "host.DatastoreBrowser.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update configuration", + Summary: "Update the date and time on the host", + }, + Key: "host.DateTimeSystem.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available time zones", + Summary: "Retrieves the list of available time zones on the host", + }, + Key: "host.DateTimeSystem.queryAvailableTimeZones", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query date and time", + Summary: "Get the current date and time on the host", + }, + Key: "host.DateTimeSystem.queryDateTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update date or time", + Summary: "Update the date/time on the host", + }, + Key: "host.DateTimeSystem.updateDateTime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh", + Summary: "Refresh the date and time settings", + }, + Key: "host.DateTimeSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire disk lease", + Summary: "Acquire a lease for the files associated with the virtual disk referenced by the given datastore path", + }, + Key: "host.DiskManager.acquireLease", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire lease extension", + Summary: "Acquires a lease for the files associated with the virtual disk of a virtual machine", + }, + Key: "host.DiskManager.acquireLeaseExt", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Renew all leases", + Summary: "Resets the watchdog timer and confirms that all the locks for all the disks managed by this watchdog are still valid", + }, + Key: "host.DiskManager.renewAllLeases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set task custom value", + Summary: "Sets the value of a custom field of a task", + }, + Key: "Task.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel", + Summary: "Cancels a running/queued task", + }, + Key: "Task.cancel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update progress", + Summary: "Update task progress", + }, + Key: "Task.UpdateProgress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set task state", + Summary: "Sets task state", + }, + Key: "Task.setState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update task description", + Summary: "Updates task description with the current phase of the task", + }, + Key: "Task.UpdateDescription", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Renew disk lease", + Summary: "Renew a lease to prevent it from timing out", + }, + Key: "host.DiskManager.Lease.renew", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Release disk lease", + Summary: "End the lease if it is still active", + }, + Key: "host.DiskManager.Lease.release", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocate blocks", + Summary: "Prepare for writing to blocks", + }, + Key: "host.DiskManager.Lease.allocateBlocks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear lazy zero", + Summary: "Honor the contents of a block range", + }, + Key: "host.DiskManager.Lease.clearLazyZero", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Map disk region", + Summary: "Mapping a specified region of a virtual disk", + }, + Key: "host.DiskManager.Lease.MapDiskRegion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update ESX agent configuration", + Summary: "Updates the ESX agent configuration of a host", + }, + Key: "host.EsxAgentHostManager.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset to factory default", + Summary: "Reset the configuration to factory default", + }, + Key: "host.FirmwareSystem.resetToFactoryDefaults", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Backup configuration", + Summary: "Backup the configuration of the host", + }, + Key: "host.FirmwareSystem.backupConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration upload URL", + Summary: "Host configuration must be uploaded for a restore operation", + }, + Key: "host.FirmwareSystem.queryConfigUploadURL", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restore configuration", + Summary: "Restore configuration of the host", + }, + Key: "host.FirmwareSystem.restoreConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Flush firmware configuration", + Summary: "Writes the configuration of the firmware system to persistent storage", + }, + Key: "host.FirmwareSystem.syncConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryQuantumMinutes", + Summary: "queryQuantumMinutes", + }, + Key: "host.FirmwareSystem.queryQuantumMinutes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "querySyncsPerQuantum", + Summary: "querySyncsPerQuantum", + }, + Key: "host.FirmwareSystem.querySyncsPerQuantum", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh hardware information", + Summary: "Refresh hardware information", + }, + Key: "host.HealthStatusSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset system health sensors", + Summary: "Resets the state of the sensors of the IPMI subsystem", + }, + Key: "host.HealthStatusSystem.resetSystemHealthInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear hardware IPMI System Event Log", + Summary: "Clear hardware IPMI System Event Log", + }, + Key: "host.HealthStatusSystem.clearSystemEventLog", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh hardware IPMI System Event Log", + Summary: "Refresh hardware IPMI System Event Log", + }, + Key: "host.HealthStatusSystem.FetchSystemEventLog", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve access entries", + Summary: "Retrieves the access mode for each user or group with access permissions on the host", + }, + Key: "host.HostAccessManager.retrieveAccessEntries", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change access mode", + Summary: "Changes the access mode for a user or group on the host", + }, + Key: "host.HostAccessManager.changeAccessMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve special DCUI access users", + Summary: "Retrieves the list of users with special access to DCUI", + }, + Key: "host.HostAccessManager.queryDcuiAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update special DCUI access users", + Summary: "Updates the list of users with special access to DCUI", + }, + Key: "host.HostAccessManager.updateDcuiAccess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve system users", + Summary: "Retrieve the list of special system users on the host", + }, + Key: "host.HostAccessManager.querySystemUsers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system users", + Summary: "Updates the list of special system users on the host", + }, + Key: "host.HostAccessManager.updateSystemUsers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query lockdown exceptions", + Summary: "Queries the current list of user exceptions for lockdown mode", + }, + Key: "host.HostAccessManager.queryLockdownExceptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update lockdown exceptions", + Summary: "Updates the current list of user exceptions for lockdown mode", + }, + Key: "host.HostAccessManager.updateLockdownExceptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change lockdown mode", + Summary: "Changes lockdown mode on the host", + }, + Key: "host.HostAccessManager.changeLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get acceptance level for host image configuration", + Summary: "Get acceptance level settings for host image configuration", + }, + Key: "host.ImageConfigManager.queryHostAcceptanceLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host image profile", + Summary: "Queries the current host image profile information", + }, + Key: "host.ImageConfigManager.queryHostImageProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update acceptance level", + Summary: "Updates the acceptance level of a host", + }, + Key: "host.ImageConfigManager.updateAcceptanceLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchSoftwarePackages", + Summary: "fetchSoftwarePackages", + }, + Key: "host.ImageConfigManager.fetchSoftwarePackages", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "installDate", + Summary: "installDate", + }, + Key: "host.ImageConfigManager.installDate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host kernel modules", + Summary: "Retrieves information about the kernel modules on the host", + }, + Key: "host.KernelModuleSystem.queryModules", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update kernel module option", + Summary: "Specifies the options to be passed to the kernel module when loaded", + }, + Key: "host.KernelModuleSystem.updateModuleOptionString", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query kernel module options", + Summary: "Retrieves the options configured to be passed to a kernel module when loaded", + }, + Key: "host.KernelModuleSystem.queryConfiguredModuleOptionString", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set memory manager custom value", + Summary: "Sets the value of a custom field of a host memory manager system", + }, + Key: "host.MemoryManagerSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set console memory reservation", + Summary: "Set the configured service console memory reservation", + }, + Key: "host.MemoryManagerSystem.reconfigureServiceConsoleReservation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine reservation", + Summary: "Updates the virtual machine reservation information", + }, + Key: "host.MemoryManagerSystem.reconfigureVirtualMachineReservation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query proxy information", + Summary: "Query the common message bus proxy service information", + }, + Key: "host.MessageBusProxy.retrieveInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure proxy", + Summary: "Configure the common message bus proxy service", + }, + Key: "host.MessageBusProxy.configure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove proxy configuration", + Summary: "Remove the common message proxy service configuration and disable the service", + }, + Key: "host.MessageBusProxy.unconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start proxy", + Summary: "Start the common message bus proxy service", + }, + Key: "host.MessageBusProxy.start", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop proxy", + Summary: "Stop the common message bus proxy service", + }, + Key: "host.MessageBusProxy.stop", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload proxy", + Summary: "Reload the common message bus proxy service and enable any configuration changes", + }, + Key: "host.MessageBusProxy.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set service custom value", + Summary: "Sets the value of a custom field of a host service system.", + }, + Key: "host.ServiceSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update service activation policy", + Summary: "Updates the activation policy of the service", + }, + Key: "host.ServiceSystem.updatePolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start service", + Summary: "Starts the service", + }, + Key: "host.ServiceSystem.start", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop service", + Summary: "Stops the service", + }, + Key: "host.ServiceSystem.stop", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restart service", + Summary: "Restarts the service", + }, + Key: "host.ServiceSystem.restart", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall service", + Summary: "Uninstalls the service", + }, + Key: "host.ServiceSystem.uninstall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh service information", + Summary: "Refresh the service information and settings to detect any changes made directly on the host", + }, + Key: "host.ServiceSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure SNMP agent", + Summary: "Reconfigure the SNMP agent", + }, + Key: "host.SnmpSystem.reconfigureSnmpAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send test notification", + Summary: "Send test notification", + }, + Key: "host.SnmpSystem.sendTestNotification", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash resource", + Summary: "Configures virtual flash resource on a list of SSD devices", + }, + Key: "host.VFlashManager.configureVFlashResourceEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash resource", + Summary: "Configures virtual flash resource on a host", + }, + Key: "host.VFlashManager.configureVFlashResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual flash resource", + Summary: "Removes virtual flash resource from a host", + }, + Key: "host.VFlashManager.removeVFlashResource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual flash host swap cache", + Summary: "Configures virtual flash host swap cache", + }, + Key: "host.VFlashManager.configureHostVFlashCache", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual flash module configuration options from a host", + Summary: "Retrieves virtual flash module configuration options from a host", + }, + Key: "host.VFlashManager.getVFlashModuleDefaultConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query disks for use in vSAN cluster", + Summary: "Queries disk eligibility for use in the vSAN cluster", + }, + Key: "host.VsanSystem.queryDisksForVsan", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add disks to vSAN", + Summary: "Adds the selected disks to the vSAN cluster", + }, + Key: "host.VsanSystem.addDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initialize disks in the vSAN cluster", + Summary: "Initializes the selected disks to be used in the vSAN cluster", + }, + Key: "host.VsanSystem.initializeDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove disk from vSAN", + Summary: "Removes the disks that are used in the vSAN cluster", + }, + Key: "host.VsanSystem.removeDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove disk group from vSAN", + Summary: "Removes the selected disk group from the vSAN cluster", + }, + Key: "host.VsanSystem.removeDiskMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmountDiskMapping", + Summary: "unmountDiskMapping", + }, + Key: "host.VsanSystem.unmountDiskMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSAN configuration", + Summary: "Updates the vSAN configuration for this host", + }, + Key: "host.VsanSystem.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve vSAN runtime information", + Summary: "Retrieves the current vSAN runtime information for this host", + }, + Key: "host.VsanSystem.queryHostStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Evacuate this host from vSAN cluster", + Summary: "Evacuates the specified host from the vSAN cluster", + }, + Key: "host.VsanSystem.evacuateNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recommission this host back to vSAN cluster", + Summary: "Recommissions the host back to vSAN cluster", + }, + Key: "host.VsanSystem.recommissionNode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a ticket to register the vSAN VASA Provider", + Summary: "Retrieves a ticket to register the VASA Provider for vSAN in the Storage Monitoring Service", + }, + Key: "host.VsanSystem.fetchVsanSharedSecret", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Join Windows Domain", + Summary: "Enables ActiveDirectory authentication on the host", + }, + Key: "host.ActiveDirectoryAuthentication.joinDomain", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Join Windows Domain through vSphere Authentication Proxy service", + Summary: "Enables Active Directory authentication on the host using a vSphere Authentication Proxy server", + }, + Key: "host.ActiveDirectoryAuthentication.joinDomainWithCAM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import the certificate of vSphere Authentication Proxy server", + Summary: "Import the certificate of vSphere Authentication Proxy server to ESXi's authentication store", + }, + Key: "host.ActiveDirectoryAuthentication.importCertificateForCAM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Leave Windows Domain", + Summary: "Disables ActiveDirectory authentication on the host", + }, + Key: "host.ActiveDirectoryAuthentication.leaveCurrentDomain", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable Smart Card Authentication", + Summary: "Enables smart card authentication of ESXi Direct Console UI users", + }, + Key: "host.ActiveDirectoryAuthentication.enableSmartCardAuthentication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install a Smart Card Trust Anchor", + Summary: "Installs a smart card trust anchor on the host", + }, + Key: "host.ActiveDirectoryAuthentication.installSmartCardTrustAnchor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "replaceSmartCardTrustAnchors", + Summary: "replaceSmartCardTrustAnchors", + }, + Key: "host.ActiveDirectoryAuthentication.replaceSmartCardTrustAnchors", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a Smart Card Trust Anchor", + Summary: "Removes an installed smart card trust anchor from the host", + }, + Key: "host.ActiveDirectoryAuthentication.removeSmartCardTrustAnchor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Smart Card Trust Anchor", + Summary: "Removes the installed smart card trust anchor from the host", + }, + Key: "host.ActiveDirectoryAuthentication.removeSmartCardTrustAnchorByFingerprint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List Smart Card Trust Anchors", + Summary: "Lists the smart card trust anchors installed on the host", + }, + Key: "host.ActiveDirectoryAuthentication.listSmartCardTrustAnchors", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable Smart Card Authentication", + Summary: "Disables smart card authentication of ESXi Direct Console UI users", + }, + Key: "host.ActiveDirectoryAuthentication.disableSmartCardAuthentication", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update local swap datastore", + Summary: "Changes the datastore for virtual machine swap files", + }, + Key: "host.DatastoreSystem.updateLocalSwapDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve disks for VMFS datastore", + Summary: "Retrieves the list of disks that can be used to contain VMFS datastore extents", + }, + Key: "host.DatastoreSystem.queryAvailableDisksForVmfs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore create options", + Summary: "Queries options for creating a new VMFS datastore for a disk", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreCreateOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create VMFS datastore", + Summary: "Creates a new VMFS datastore", + }, + Key: "host.DatastoreSystem.createVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore extend options", + Summary: "Queries options for extending an existing VMFS datastore for a disk", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreExtendOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query VMFS datastore expand options", + Summary: "Query the options available for expanding the extents of a VMFS datastore", + }, + Key: "host.DatastoreSystem.queryVmfsDatastoreExpandOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend datastore", + Summary: "Extends an existing VMFS datastore", + }, + Key: "host.DatastoreSystem.extendVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Expand VMFS datastore", + Summary: "Expand the capacity of a VMFS datastore extent", + }, + Key: "host.DatastoreSystem.expandVmfsDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "processVmfsDatastoreUpdate", + Summary: "processVmfsDatastoreUpdate", + }, + Key: "host.DatastoreSystem.processVmfsDatastoreUpdate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create NAS datastore", + Summary: "Creates a new Network Attached Storage (NAS) datastore", + }, + Key: "host.DatastoreSystem.createNasDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create local datastore", + Summary: "Creates a new local datastore", + }, + Key: "host.DatastoreSystem.createLocalDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Virtual Volume datastore", + Summary: "Updates the Virtual Volume datastore configuration according to the provided settings", + }, + Key: "host.DatastoreSystem.UpdateVvolDatastoreInternal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a datastore backed by a Virtual Volume storage container", + }, + Key: "host.DatastoreSystem.createVvolDatastoreInternal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a Virtuial Volume datastore", + }, + Key: "host.DatastoreSystem.createVvolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastore", + Summary: "Removes a datastore from a host", + }, + Key: "host.DatastoreSystem.removeDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datastores", + Summary: "Removes one or more datastores from a host", + }, + Key: "host.DatastoreSystem.removeDatastoreEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure datastore principal", + Summary: "Configures datastore principal user for the host", + }, + Key: "host.DatastoreSystem.configureDatastorePrincipal", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unbound VMFS volumes", + Summary: "Gets the list of unbound VMFS volumes", + }, + Key: "host.DatastoreSystem.queryUnresolvedVmfsVolumes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resignature unresolved VMFS volume", + Summary: "Resignature unresolved VMFS volume with new VMFS identifier", + }, + Key: "host.DatastoreSystem.resignatureUnresolvedVmfsVolume", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "NotifyDatastore", + Summary: "NotifyDatastore", + }, + Key: "host.DatastoreSystem.NotifyDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check accessibility", + Summary: "Check if the file objects for the specified virtual machine IDs are accessible", + }, + Key: "host.DatastoreSystem.checkVmFileAccessibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set firewall custom value", + Summary: "Sets the value of a custom field of a host firewall system", + }, + Key: "host.FirewallSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update default firewall policy", + Summary: "Updates the default firewall policy", + }, + Key: "host.FirewallSystem.updateDefaultPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open firewall ports", + Summary: "Open the firewall ports belonging to the specified ruleset", + }, + Key: "host.FirewallSystem.enableRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Block firewall ports", + Summary: "Block the firewall ports belonging to the specified ruleset", + }, + Key: "host.FirewallSystem.disableRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update allowed IP list of the firewall ruleset", + Summary: "Update the allowed IP list of the specified ruleset", + }, + Key: "host.FirewallSystem.updateRuleset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh firewall information", + Summary: "Refresh the firewall information and settings to detect any changes made directly on the host", + }, + Key: "host.FirewallSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set network custom value", + Summary: "Sets the value of a custom field of a host network system", + }, + Key: "host.NetworkSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network configuration", + Summary: "Network configuration information", + }, + Key: "host.NetworkSystem.updateNetworkConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update DNS configuration", + Summary: "Update the DNS configuration for the host", + }, + Key: "host.NetworkSystem.updateDnsConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP route configuration", + Summary: "Update IP route configuration", + }, + Key: "host.NetworkSystem.updateIpRouteConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update console IP route configuration", + Summary: "Update console IP route configuration", + }, + Key: "host.NetworkSystem.updateConsoleIpRouteConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP route table configuration", + Summary: "Applies the IP route table configuration for the host", + }, + Key: "host.NetworkSystem.updateIpRouteTableConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual switch", + Summary: "Add a new virtual switch to the system", + }, + Key: "host.NetworkSystem.addVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual switch", + Summary: "Remove an existing virtual switch from the system", + }, + Key: "host.NetworkSystem.removeVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual switch", + Summary: "Updates the properties of the virtual switch", + }, + Key: "host.NetworkSystem.updateVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add port group", + Summary: "Add a port group to the virtual switch", + }, + Key: "host.NetworkSystem.addPortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove port group", + Summary: "Remove a port group from the virtual switch", + }, + Key: "host.NetworkSystem.removePortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure port group", + Summary: "Reconfigure a port group on the virtual switch", + }, + Key: "host.NetworkSystem.updatePortGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update physical NIC link speed", + Summary: "Configure link speed and duplexity", + }, + Key: "host.NetworkSystem.updatePhysicalNicLinkSpeed", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network hint", + Summary: "Request network hint information for a physical NIC", + }, + Key: "host.NetworkSystem.queryNetworkHint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual NIC", + Summary: "Add a virtual host or service console NIC", + }, + Key: "host.NetworkSystem.addVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual NIC", + Summary: "Remove a virtual host or service console NIC", + }, + Key: "host.NetworkSystem.removeVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update virtual NIC", + Summary: "Configure virtual host or VMkernel NIC", + }, + Key: "host.NetworkSystem.updateVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add service console virtual NIC", + Summary: "Add a virtual service console NIC", + }, + Key: "host.NetworkSystem.addServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove service console virtual NIC", + Summary: "Remove a virtual service console NIC", + }, + Key: "host.NetworkSystem.removeServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update service console virtual NIC", + Summary: "Update IP configuration for a service console virtual NIC", + }, + Key: "host.NetworkSystem.updateServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Restart virtual network adapter interface", + Summary: "Restart the service console virtual network adapter interface", + }, + Key: "host.NetworkSystem.restartServiceConsoleVirtualNic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh network information", + Summary: "Refresh the network information and settings to detect any changes that have occurred", + }, + Key: "host.NetworkSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Invoke API call on host with transactionId", + Summary: "Invoke API call on host with transactionId", + }, + Key: "host.NetworkSystem.invokeHostTransactionCall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Commit transaction to confirm that host is connected to vCenter Server", + Summary: "Commit transaction to confirm that host is connected to vCenter Server", + }, + Key: "host.NetworkSystem.commitTransaction", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performHostOpaqueNetworkDataOperation", + Summary: "performHostOpaqueNetworkDataOperation", + }, + Key: "host.NetworkSystem.performHostOpaqueNetworkDataOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve available diagnostic partitions", + Summary: "Retrieves a list of available diagnostic partitions", + }, + Key: "host.DiagnosticSystem.queryAvailablePartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change active diagnostic partition", + Summary: "Changes the active diagnostic partition to a different partition", + }, + Key: "host.DiagnosticSystem.selectActivePartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve diagnostic partitionable disks", + Summary: "Retrieves a list of disks that can be used to contain a diagnostic partition", + }, + Key: "host.DiagnosticSystem.queryPartitionCreateOptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve diagnostic partition creation description", + Summary: "Retrieves the diagnostic partition creation description for a disk", + }, + Key: "host.DiagnosticSystem.queryPartitionCreateDesc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create diagnostic partition", + Summary: "Creates a diagnostic partition according to the provided creation specification", + }, + Key: "host.DiagnosticSystem.createDiagnosticPartition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vApp custom value", + Summary: "Sets the value of a custom field on a vApp", + }, + Key: "VirtualApp.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload vApp", + Summary: "Reload the vApp", + }, + Key: "VirtualApp.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vApp", + Summary: "Rename the vApp", + }, + Key: "VirtualApp.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vApp", + Summary: "Delete the vApp, including all child vApps and virtual machines", + }, + Key: "VirtualApp.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the vApp", + }, + Key: "VirtualApp.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the vApp", + }, + Key: "VirtualApp.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "VirtualApp.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vApp resource configuration", + Summary: "Updates the resource configuration for the vApp", + }, + Key: "VirtualApp.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move into vApp", + Summary: "Moves a set of entities into this vApp", + }, + Key: "VirtualApp.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update child resource configuration", + Summary: "Change resource configuration of a set of children of the vApp", + }, + Key: "VirtualApp.updateChildResourceConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create resource pool", + Summary: "Creates a new resource pool", + }, + Key: "VirtualApp.createResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vApp children", + Summary: "Deletes all child resource pools recursively", + }, + Key: "VirtualApp.destroyChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vApp", + Summary: "Creates a child vApp of this vApp", + }, + Key: "VirtualApp.createVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine in this vApp", + }, + Key: "VirtualApp.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this vApp", + }, + Key: "VirtualApp.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "VirtualApp.importVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Virtual App resource configuration options", + Summary: "Returns configuration options for a set of resources for a Virtual App", + }, + Key: "VirtualApp.queryResourceConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh Virtual App runtime information", + Summary: "Refreshes the resource usage runtime information for a Virtual App", + }, + Key: "VirtualApp.refreshRuntime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vApp Configuration", + Summary: "Updates the vApp configuration", + }, + Key: "VirtualApp.updateVAppConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update linked children", + Summary: "Updates the list of linked children", + }, + Key: "VirtualApp.updateLinkedChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone vApp", + Summary: "Clone the vApp, including all child entities", + }, + Key: "VirtualApp.clone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the vApp as an OVF template", + }, + Key: "VirtualApp.exportVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start vApp", + Summary: "Starts the vApp", + }, + Key: "VirtualApp.powerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop vApp", + Summary: "Stops the vApp", + }, + Key: "VirtualApp.powerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend vApp", + Summary: "Suspends the vApp", + }, + Key: "VirtualApp.suspend", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister vApp", + Summary: "Unregister all child virtual machines and remove the vApp", + }, + Key: "VirtualApp.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual NIC custom value", + Summary: "Set the value of a custom filed of a host's virtual NIC manager", + }, + Key: "host.VirtualNicManager.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network configuration", + Summary: "Gets the network configuration for the specified NIC type", + }, + Key: "host.VirtualNicManager.queryNetConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Select virtual NIC", + Summary: "Select the virtual NIC to be used for the specified NIC type", + }, + Key: "host.VirtualNicManager.selectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deselect virtual NIC", + Summary: "Deselect the virtual NIC used for the specified NIC type", + }, + Key: "host.VirtualNicManager.deselectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download overhead computation script", + Summary: "Download overhead computation scheme script", + }, + Key: "OverheadService.downloadScript", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download host configuration", + Summary: "Download host configuration consumed by overhead computation script", + }, + Key: "OverheadService.downloadHostConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download VM configuration", + Summary: "Download VM configuration consumed by overhead computation script", + }, + Key: "OverheadService.downloadVMXConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add an alias to the alias store in the guest", + Summary: "Add an alias to the alias store in the guest operating system", + }, + Key: "vm.guest.AliasManager.addAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an alias from the alias store in the guest", + Summary: "Remove an alias from the alias store in the guest operating system", + }, + Key: "vm.guest.AliasManager.removeAlias", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove all aliases associated with a SSO Server certificate from the guest", + Summary: "Remove all aliases associated with a SSO Server certificate from the guest operating system", + }, + Key: "vm.guest.AliasManager.removeAliasByCert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all aliases for a user in the guest", + Summary: "List all aliases for a user in the guest operating system", + }, + Key: "vm.guest.AliasManager.listAliases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List all mapped aliases in the guest", + Summary: "List all mapped aliases in the guest operating system", + }, + Key: "vm.guest.AliasManager.listMappedAliases", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a directory in the guest", + Summary: "Create a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.makeDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a file in the guest", + Summary: "Delete a file in the guest operating system", + }, + Key: "vm.guest.FileManager.deleteFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a directory in the guest", + Summary: "Delete a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.deleteDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move or rename a directory in the guest", + Summary: "Move or rename a directory in the guest operating system", + }, + Key: "vm.guest.FileManager.moveDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move or rename a file in the guest", + Summary: "Move or rename a file in the guest operating system", + }, + Key: "vm.guest.FileManager.moveFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a temporary file in the guest", + Summary: "Create a temporary file in the guest operating system", + }, + Key: "vm.guest.FileManager.createTemporaryFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a temporary directory in the guest", + Summary: "Create a temporary directory in the guest operating system", + }, + Key: "vm.guest.FileManager.createTemporaryDirectory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List files or directories in the guest", + Summary: "List files or directories in the guest operating system", + }, + Key: "vm.guest.FileManager.listFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Change the attributes of a file in the guest", + Summary: "Change the attributes of a file in the guest operating system", + }, + Key: "vm.guest.FileManager.changeFileAttributes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiates an operation to transfer a file from the guest", + Summary: "Initiates an operation to transfer a file from the guest operating system", + }, + Key: "vm.guest.FileManager.initiateFileTransferFromGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiates an operation to transfer a file to the guest", + Summary: "Initiates an operation to transfer a file to the guest operating system", + }, + Key: "vm.guest.FileManager.initiateFileTransferToGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start a program in the guest", + Summary: "Start a program in the guest operating system", + }, + Key: "vm.guest.ProcessManager.startProgram", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List processes in the guest", + Summary: "List processes in the guest operating system", + }, + Key: "vm.guest.ProcessManager.listProcesses", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Terminate a process in the guest", + Summary: "Terminate a process in the guest operating system", + }, + Key: "vm.guest.ProcessManager.terminateProcess", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read an environment variable in the guest", + Summary: "Read an environment variable in the guest operating system", + }, + Key: "vm.guest.ProcessManager.readEnvironmentVariable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove view", + Summary: "Remove view", + }, + Key: "view.View.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve associated License Data objects", + Summary: "Retrieves all the associated License Data objects", + }, + Key: "LicenseDataManager.queryEntityLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve license data associated with managed entity", + Summary: "Retrieves the license data associated with a specified managed entity", + }, + Key: "LicenseDataManager.queryAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update entity license container", + Summary: "Updates the license container associated with a specified managed entity", + }, + Key: "LicenseDataManager.updateAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply associated license data to managed entity", + Summary: "Applies associated license data to a managed entity", + }, + Key: "LicenseDataManager.applyAssociatedLicenseData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update assigned license", + Summary: "Updates the license assigned to an entity", + }, + Key: "LicenseAssignmentManager.updateAssignedLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove assigned license", + Summary: "Removes an assignment of a license to an entity", + }, + Key: "LicenseAssignmentManager.removeAssignedLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query assigned licenses", + Summary: "Queries for all the licenses assigned to an entity or all entities", + }, + Key: "LicenseAssignmentManager.queryAssignedLicenses", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check feature availability", + Summary: "Checks if the corresponding features are licensed for a list of entities", + }, + Key: "LicenseAssignmentManager.isFeatureAvailable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update in-use status of a licensed feature", + Summary: "Updates in-use status of a licensed feature", + }, + Key: "LicenseAssignmentManager.updateFeatureInUse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register licenseable entity", + Summary: "Registers a licenseable entity", + }, + Key: "LicenseAssignmentManager.registerEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister licenseable entity", + Summary: "Unregisters an existing licenseable entity and releases any serial numbers assigned to it.", + }, + Key: "LicenseAssignmentManager.unregisterEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update license entity usage count", + Summary: "Updates the usage count of a license entity", + }, + Key: "LicenseAssignmentManager.updateUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upload license file", + Summary: "Uploads a license file to vCenter Server", + }, + Key: "LicenseAssignmentManager.uploadLicenseFile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryAssignedLicensesEx", + Summary: "queryAssignedLicensesEx", + }, + Key: "LicenseAssignmentManager.queryAssignedLicensesEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntity", + Summary: "updateEntity", + }, + Key: "LicenseAssignmentManager.updateEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateEntitiesProperties", + Summary: "updateEntitiesProperties", + }, + Key: "LicenseAssignmentManager.updateEntitiesProperties", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set backup agent custom value", + Summary: "Set backup agent custom value", + }, + Key: "vm.BackupAgent.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start virtual machine backup", + Summary: "Start a backup operation inside the virtual machine guest", + }, + Key: "vm.BackupAgent.startBackup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop virtual machine backup", + Summary: "Stop a backup operation in a virtual machine", + }, + Key: "vm.BackupAgent.abortBackup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify virtual machine snapshot completion", + Summary: "Notify the virtual machine when a snapshot operation is complete", + }, + Key: "vm.BackupAgent.notifySnapshotCompletion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Wait for guest event", + Summary: "Wait for an event delivered by the virtual machine guest", + }, + Key: "vm.BackupAgent.waitForEvent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create namespace", + Summary: "Create a virtual machine namespace", + }, + Key: "vm.NamespaceManager.createNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete namespace", + Summary: "Delete the virtual machine namespace", + }, + Key: "vm.NamespaceManager.deleteNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete all namespaces", + Summary: "Delete all namespaces associated with the virtual machine", + }, + Key: "vm.NamespaceManager.deleteAllNamespaces", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update namespace", + Summary: "Reconfigure the virtual machine namespace", + }, + Key: "vm.NamespaceManager.updateNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query namespace", + Summary: "Retrieve detailed information about the virtual machine namespace", + }, + Key: "vm.NamespaceManager.queryNamespace", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List namespaces", + Summary: "Retrieve the list of all namespaces for a virtual machine", + }, + Key: "vm.NamespaceManager.listNamespaces", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send event to the virtual machine", + Summary: "Queue event for delivery to the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.sendEventToGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch events from the virtual machine", + Summary: "Retrieve events sent by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.fetchEventsFromGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update data", + Summary: "Update key/value pairs accessible by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.updateData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve data", + Summary: "Retrieve key/value pairs set by the agent in the virtual machine", + }, + Key: "vm.NamespaceManager.retrieveData", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Pause", + Summary: "Pauses a virtual machine", + }, + Key: "vm.PauseManager.pause", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unpause", + Summary: "Unpauses a virtual machine", + }, + Key: "vm.PauseManager.unpause", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power on and pause", + Summary: "Powers on a virtual machine and pauses it immediately", + }, + Key: "vm.PauseManager.powerOnPaused", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure host cache performance enhancement", + Summary: "Configures host cache by allocating space on a low latency device (usually a solid state drive) for enhanced system performance", + }, + Key: "host.CacheConfigurationManager.configureCache", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query whether virtual NIC is used by iSCSI multi-pathing", + Summary: "Query whether virtual NIC is used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryVnicStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query whether physical NIC is used by iSCSI multi-pathing", + Summary: "Query whether physical NIC is used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryPnicStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query all the virtual NICs used by iSCSI multi-pathing", + Summary: "Query all the virtual NICs used by iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryBoundVnics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query candidate virtual NICs that can be used for iSCSI multi-pathing", + Summary: "Query candidate virtual NICs that can be used for iSCSI multi-pathing", + }, + Key: "host.IscsiManager.queryCandidateNics", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add virtual NIC to iSCSI Adapter", + Summary: "Add virtual NIC to iSCSI Adapter", + }, + Key: "host.IscsiManager.bindVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove virtual NIC from iSCSI Adapter", + Summary: "Remove virtual NIC from iSCSI Adapter", + }, + Key: "host.IscsiManager.unbindVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query migration dependencies for migrating the physical and virtual NICs", + Summary: "Query migration dependencies for migrating the physical and virtual NICs", + }, + Key: "host.IscsiManager.queryMigrationDependencies", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set PCI passthrough system custom value", + Summary: "Set PCI Passthrough system custom value", + }, + Key: "host.PciPassthruSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh PCI passthrough device information", + Summary: "Refresh the available PCI passthrough device information", + }, + Key: "host.PciPassthruSystem.refresh", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update PCI passthrough configuration", + Summary: "Update PCI passthrough device configuration", + }, + Key: "host.PciPassthruSystem.updatePassthruConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query network protocol profiles", + Summary: "Queries the list of network protocol profiles for a datacenter", + }, + Key: "IpPoolManager.queryIpPools", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create network protocol profile", + Summary: "Creates a new network protocol profile", + }, + Key: "IpPoolManager.createIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network protocol profile", + Summary: "Updates a network protocol profile on a datacenter", + }, + Key: "IpPoolManager.updateIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Destroy network protocol profile", + Summary: "Destroys a network protocol profile on the given datacenter", + }, + Key: "IpPoolManager.destroyIpPool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocates an IPv4 address", + Summary: "Allocates an IPv4 address from an IP pool", + }, + Key: "IpPoolManager.allocateIpv4Address", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Allocates an IPv6 address", + Summary: "Allocates an IPv6 address from an IP pool", + }, + Key: "IpPoolManager.allocateIpv6Address", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Releases an IP allocation", + Summary: "Releases an IP allocation back to an IP pool", + }, + Key: "IpPoolManager.releaseIpAllocation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query IP allocations", + Summary: "Query IP allocations by IP pool and extension key", + }, + Key: "IpPoolManager.queryIPAllocations", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh the CA certificates on the host", + Summary: "Refreshes the CA certificates on the host", + }, + Key: "CertificateManager.refreshCACertificatesAndCRLs", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh the subject certificate on the host", + Summary: "Refreshes the subject certificate on the host", + }, + Key: "CertificateManager.refreshCertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revoke the subject certificate of a host", + Summary: "Revokes the subject certificate of a host", + }, + Key: "CertificateManager.revokeCertificates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query entity provider summary", + Summary: "Get information about the performance statistics that can be queried for a particular entity", + }, + Key: "PerformanceManager.queryProviderSummary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query available metrics", + Summary: "Gets available performance statistic metrics for the specified managed entity between begin and end times", + }, + Key: "PerformanceManager.queryAvailableMetric", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query counter", + Summary: "Get counter information for the list of counter IDs passed in", + }, + Key: "PerformanceManager.queryCounter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query counter by level", + Summary: "All performance data over 1 year old are deleted from the vCenter database", + }, + Key: "PerformanceManager.queryCounterByLevel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query performance statistics", + Summary: "Gets the performance statistics for the entity", + }, + Key: "PerformanceManager.queryStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get composite statistics", + Summary: "Get performance statistics for the entity and the breakdown across its child entities", + }, + Key: "PerformanceManager.queryCompositeStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Summarizes performance statistics", + Summary: "Summarizes performance statistics at the specified interval", + }, + Key: "PerformanceManager.summarizeStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create historical interval", + Summary: "Add a new historical interval configuration", + }, + Key: "PerformanceManager.createHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove historical interval", + Summary: "Remove a historical interval configuration", + }, + Key: "PerformanceManager.removeHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update historical interval", + Summary: "Update a historical interval configuration if it exists", + }, + Key: "PerformanceManager.updateHistoricalInterval", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update counter level mapping", + Summary: "Update counter to level mapping", + }, + Key: "PerformanceManager.updateCounterLevelMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset counter level mapping", + Summary: "Reset counter to level mapping to the default values", + }, + Key: "PerformanceManager.resetCounterLevelMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query internal performance counters", + Summary: "Queries all internal counters, supported by this performance manager", + }, + Key: "PerformanceManager.queryPerfCounterInt", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable performance counters", + Summary: "Enable a counter or a set of counters in the counters collection of this performance manager", + }, + Key: "PerformanceManager.enableStat", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable performance counters", + Summary: "Exclude a counter or a set of counters from the counters collection of this performance manager", + }, + Key: "PerformanceManager.disableStat", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerProvider", + Summary: "registerProvider", + }, + Key: "ExternalStatsManager.registerProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unregisterProvider", + Summary: "unregisterProvider", + }, + Key: "ExternalStatsManager.unregisterProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "isRegistered", + Summary: "isRegistered", + }, + Key: "ExternalStatsManager.isRegistered", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getRegisteredProviders", + Summary: "getRegisteredProviders", + }, + Key: "ExternalStatsManager.getRegisteredProviders", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getEnabledClusters", + Summary: "getEnabledClusters", + }, + Key: "ExternalStatsManager.getEnabledClusters", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "updateStats", + Summary: "updateStats", + }, + Key: "ExternalStatsManager.updateStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create task collector", + Summary: "Creates a task collector to retrieve all tasks that have executed on the server based on a filter", + }, + Key: "TaskManager.createCollector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create task", + Summary: "Create a task", + }, + Key: "TaskManager.createTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "createTaskWithEntityName", + Summary: "createTaskWithEntityName", + }, + Key: "TaskManager.createTaskWithEntityName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set host custom value", + Summary: "Sets the value of a custom field of an host", + }, + Key: "HostSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload host system", + Summary: "Reloads the host system", + }, + Key: "HostSystem.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename host", + Summary: "Rename this host", + }, + Key: "HostSystem.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove host", + Summary: "Removes the host", + }, + Key: "HostSystem.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the host", + }, + Key: "HostSystem.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the host", + }, + Key: "HostSystem.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "HostSystem.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query TPM attestation information", + Summary: "Provides details of the secure boot and TPM status", + }, + Key: "HostSystem.queryTpmAttestationReport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query connection information", + Summary: "Connection information about a host", + }, + Key: "HostSystem.queryConnectionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve internal host capabilities", + Summary: "Retrieves vCenter Server-specific internal host capabilities", + }, + Key: "HostSystem.retrieveInternalCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "", + Summary: "", + }, + Key: "HostSystem.retrieveInternalConfigManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system resources", + Summary: "Update the configuration of the system resource hierarchy", + }, + Key: "HostSystem.updateSystemResources", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update system swap configuration", + Summary: "Update the configuration of the system swap", + }, + Key: "HostSystem.updateSystemSwapConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconnect host", + Summary: "Reconnects to a host", + }, + Key: "HostSystem.reconnect", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disconnect host", + Summary: "Disconnects from a host", + }, + Key: "HostSystem.disconnect", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter maintenance mode", + Summary: "Puts the host in maintenance mode", + }, + Key: "HostSystem.enterMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit maintenance mode", + Summary: "Disables maintenance mode", + }, + Key: "HostSystem.exitMaintenanceMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate host reboot", + Summary: "Initiates a host reboot", + }, + Key: "HostSystem.reboot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate host shutdown", + Summary: "Initiates a host shutdown", + }, + Key: "HostSystem.shutdown", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter standby mode", + Summary: "Puts this host into standby mode", + }, + Key: "HostSystem.enterStandbyMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit standby mode", + Summary: "Brings this host out of standby mode", + }, + Key: "HostSystem.exitStandbyMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query host overhead", + Summary: "Determines the amount of memory overhead necessary to power on a virtual machine with the specified characteristics", + }, + Key: "HostSystem.queryOverhead", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query memory overhead", + Summary: "Query memory overhead", + }, + Key: "HostSystem.queryOverheadEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere HA host", + Summary: "Reconfigures the host for vSphere HA", + }, + Key: "HostSystem.reconfigureDAS", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Patch Manager", + Summary: "Retrieves a reference to Patch Manager", + }, + Key: "HostSystem.retrievePatchManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update host system flags", + Summary: "Update the flags of the host system", + }, + Key: "HostSystem.updateFlags", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send Wake-on-LAN packet", + Summary: "Send Wake-on-LAN packets to the physical NICs specified", + }, + Key: "HostSystem.sendWakeOnLanPacket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable lockdown mode", + Summary: "Enable lockdown mode on this host", + }, + Key: "HostSystem.disableAdmin", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable lockdown mode", + Summary: "Disable lockdown mode on this host", + }, + Key: "HostSystem.enableAdmin", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable lockdown mode", + Summary: "Enable lockdown mode on this host", + }, + Key: "HostSystem.enterLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable lockdown mode", + Summary: "Disable lockdown mode on this host", + }, + Key: "HostSystem.exitLockdownMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update management server IP", + Summary: "Update information about the vCenter Server managing this host", + }, + Key: "HostSystem.updateManagementServerIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire CIM service", + Summary: "Establish a remote connection to a CIM interface", + }, + Key: "HostSystem.acquireCimServicesTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IPMI or ILO information used by DPM", + Summary: "Update IPMI or ILO information for this host used by DPM", + }, + Key: "HostSystem.updateIpmi", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update SSL thumbprint registry", + Summary: "Updates the SSL thumbprint registry on the host", + }, + Key: "HostSystem.updateSslThumbprintInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve host hardware uptime", + Summary: "Retrieves the hardware uptime for the host in seconds", + }, + Key: "HostSystem.retrieveHardwareUptime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Dynamic Type Manager", + Summary: "Retrieves a reference to Dynamic Type Manager", + }, + Key: "HostSystem.retrieveDynamicTypeManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve Managed Method Executer", + Summary: "Retrieves a reference to Managed Method Executer", + }, + Key: "HostSystem.retrieveManagedMethodExecuter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine memory overhead", + Summary: "Query memory overhead for a virtual machine power on", + }, + Key: "HostSystem.queryOverheadEx2", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test EVC mode", + Summary: "Test an EVC mode on a host", + }, + Key: "HostSystem.testEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply EVC mode", + Summary: "Applies an EVC mode to a host", + }, + Key: "HostSystem.applyEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check whether the certificate is trusted by vCenter Server", + Summary: "Checks whether the certificate matches the host certificate that vCenter Server trusts", + }, + Key: "HostSystem.checkCertificateTrusted", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Prepare host", + Summary: "Prepare host for encryption", + }, + Key: "HostSystem.prepareCrypto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable encryption", + Summary: "Enable encryption on the current host", + }, + Key: "HostSystem.enableCrypto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure the host key", + Summary: "Configure the encryption key on the current host", + }, + Key: "HostSystem.configureCryptoKey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch set custom value", + Summary: "vSphere Distributed Switch set custom value", + }, + Key: "DistributedVirtualSwitch.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch reload", + Summary: "vSphere Distributed Switch reload", + }, + Key: "DistributedVirtualSwitch.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vSphere Distributed Switch", + Summary: "Rename vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete vSphere Distributed Switch", + Summary: "Delete vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch add tag", + Summary: "vSphere Distributed Switch add tag", + }, + Key: "DistributedVirtualSwitch.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch remove tag", + Summary: "vSphere Distributed Switch remove tag", + }, + Key: "DistributedVirtualSwitch.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "DistributedVirtualSwitch.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPort keys", + Summary: "Retrieve dvPort keys", + }, + Key: "DistributedVirtualSwitch.fetchPortKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPorts", + Summary: "Retrieve dvPorts", + }, + Key: "DistributedVirtualSwitch.fetchPorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query vSphere Distributed Switch used virtual LAN ID", + Summary: "Query vSphere Distributed Switch used virtual LAN ID", + }, + Key: "DistributedVirtualSwitch.queryUsedVlanId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch product specification operation", + Summary: "vSphere Distributed Switch product specification operation", + }, + Key: "DistributedVirtualSwitch.performProductSpecOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Merge vSphere Distributed Switches", + Summary: "Merge vSphere Distributed Switches", + }, + Key: "DistributedVirtualSwitch.merge", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "DistributedVirtualSwitch.addPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move dvPorts", + Summary: "Move dvPorts", + }, + Key: "DistributedVirtualSwitch.movePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch capability", + Summary: "Update vSphere Distributed Switch capability", + }, + Key: "DistributedVirtualSwitch.updateCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure dvPort", + Summary: "Reconfigure dvPort", + }, + Key: "DistributedVirtualSwitch.reconfigurePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh dvPort state", + Summary: "Refresh dvPort state", + }, + Key: "DistributedVirtualSwitch.refreshPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify host in vSphere Distributed Switch", + Summary: "Rectify host in vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network resource pools on vSphere Distributed Switch", + Summary: "Update network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.updateNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add network resource pools on vSphere Distributed Switch", + Summary: "Add network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.addNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network resource pools on vSphere Distributed Switch", + Summary: "Remove network resource pools on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.removeNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure a network resource pool on a distributed switch", + Summary: "Reconfigures the network resource pool on a distributed switch", + }, + Key: "DistributedVirtualSwitch.reconfigureVmVnicNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network I/O control on vSphere Distributed Switch", + Summary: "Update network I/O control on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.enableNetworkResourceManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get vSphere Distributed Switch configuration spec to rollback", + Summary: "Get vSphere Distributed Switch configuration spec to rollback", + }, + Key: "DistributedVirtualSwitch.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "DistributedVirtualSwitch.addPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update health check configuration on vSphere Distributed Switch", + Summary: "Update health check configuration on vSphere Distributed Switch", + }, + Key: "DistributedVirtualSwitch.updateHealthCheckConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "DistributedVirtualSwitch.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Annotate OVF section tree", + Summary: "Annotates the given OVF section tree with configuration choices for this OVF consumer", + }, + Key: "OvfConsumer.annotateOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate instantiation OVF section tree", + Summary: "Validates that this OVF consumer can accept an instantiation OVF section tree", + }, + Key: "OvfConsumer.validateInstantiationOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Request registration of OVF section tree nodes", + Summary: "Notifies the OVF consumer that the specified OVF section tree nodes should be registered", + }, + Key: "OvfConsumer.registerEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Request managed entities unregistration from OVF consumer", + Summary: "Notifies the OVF consumer that the specified managed entities should be unregistered", + }, + Key: "OvfConsumer.unregisterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify OVF consumer for cloned entities", + Summary: "Notifies the OVF consumer that the specified entities have been cloned", + }, + Key: "OvfConsumer.cloneEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Populate entity OVF section tree", + Summary: "Create OVF sections for the given managed entities and populate the entity OVF section tree", + }, + Key: "OvfConsumer.populateEntityOst", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve public OVF environment sections for virtual machine ", + Summary: "Retrieves the public OVF environment sections that this OVF consumer has for a given virtual machine", + }, + Key: "OvfConsumer.retrievePublicOvfEnvironmentSections", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Notify OVF consumer for virtual machine power on", + Summary: "Notifies the OVF consumer that a virtual machine is about to be powered on", + }, + Key: "OvfConsumer.notifyPowerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set snapshot custom value", + Summary: "Sets the value of a custom field of a virtual machine snapshot", + }, + Key: "vm.Snapshot.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revert snapshot", + Summary: "Change the execution state of the virtual machine to the state of this snapshot", + }, + Key: "vm.Snapshot.revert", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove snapshot", + Summary: "Remove snapshot and delete its associated storage", + }, + Key: "vm.Snapshot.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename snapshot", + Summary: "Rename the snapshot", + }, + Key: "vm.Snapshot.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Linked Clone", + Summary: "Create a linked clone from this snapshot", + }, + Key: "vm.Snapshot.createLinkedClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Export the snapshot as an OVF template", + }, + Key: "vm.Snapshot.exportSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check compliance", + Summary: "Check compliance of host or cluster against a profile", + }, + Key: "profile.ComplianceManager.checkCompliance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compliance status", + Summary: "Query compliance status", + }, + Key: "profile.ComplianceManager.queryComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryEntitiesByComplianceStatus", + Summary: "queryEntitiesByComplianceStatus", + }, + Key: "profile.ComplianceManager.queryEntitiesByComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear compliance history", + Summary: "Clear historical compliance data", + }, + Key: "profile.ComplianceManager.clearComplianceStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query expression metadata", + Summary: "Query expression metadata", + }, + Key: "profile.ComplianceManager.queryExpressionMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create alarm", + Summary: "Create a new alarm", + }, + Key: "alarm.AlarmManager.create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve alarm", + Summary: "Get available alarms defined on the entity", + }, + Key: "alarm.AlarmManager.getAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get alarm actions enabled", + Summary: "Checks if alarm actions are enabled for an entity", + }, + Key: "alarm.AlarmManager.getAlarmActionsEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm actions enabled", + Summary: "Enables or disables firing alarm actions for an entity", + }, + Key: "alarm.AlarmManager.setAlarmActionsEnabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get alarm state", + Summary: "The state of instantiated alarms on the entity", + }, + Key: "alarm.AlarmManager.getAlarmState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acknowledge alarm", + Summary: "Stops alarm actions from firing until the alarm next triggers on an entity", + }, + Key: "alarm.AlarmManager.acknowledgeAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm status", + Summary: "Sets the status of an alarm for an entity", + }, + Key: "alarm.AlarmManager.setAlarmStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "clearTriggeredAlarms", + Summary: "clearTriggeredAlarms", + }, + Key: "alarm.AlarmManager.clearTriggeredAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "testSMTPSetup", + Summary: "testSMTPSetup", + }, + Key: "alarm.AlarmManager.testSMTPSetup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create private alarm on managed entity", + Summary: "Creates a Private (trigger-only) Alarm on a managed entity", + }, + Key: "alarm.AlarmManager.createPrivateAlarm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query private alarms on managed entity", + Summary: "Retrieves all of the Private (trigger-only) Alarms defined on the specified managed entity", + }, + Key: "alarm.AlarmManager.queryPrivateAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sync triggered alarms list", + Summary: "Retrieves the full list of currently-triggered Alarms, as a list of triggers", + }, + Key: "alarm.AlarmManager.syncTriggeredAlarms", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve queued-up alarm triggers", + Summary: "Retrieves any queued-up alarm triggers representing Alarm state changes since the last time this method was called", + }, + Key: "alarm.AlarmManager.retrieveTriggers", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update the VASA provider state", + Summary: "Updates the VASA provider state for the specified datastores", + }, + Key: "VasaVvolManager.updateVasaProviderState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Virtual Volume datastore", + Summary: "Creates a new Virtual Volume datastore", + }, + Key: "VasaVvolManager.createVVolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove Virtual Volume datastore", + Summary: "Remove Virtual Volume datastore from specified hosts", + }, + Key: "VasaVvolManager.removeVVolDatastore", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update the VASA client context", + Summary: "Updates the VASA client context on the host", + }, + Key: "VasaVvolManager.updateVasaClientContext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "fetchRelocatedMACAddress", + Summary: "fetchRelocatedMACAddress", + }, + Key: "NetworkManager.fetchRelocatedMACAddress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check MAC addresses in use", + Summary: "Checks the MAC addresses used by this vCenter Server instance", + }, + Key: "NetworkManager.checkIfMACAddressInUse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reclaim MAC addresses", + Summary: "Reclaims the MAC addresses that are not used by remote vCenter Server instances", + }, + Key: "NetworkManager.reclaimMAC", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create new identity binding", + Summary: "Creates a new identity binding between the host and vCenter Server", + }, + Key: "host.TpmManager.requestIdentity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Verify authenticity of credential", + Summary: "Verifies the authenticity and correctness of the supplied attestation credential", + }, + Key: "host.TpmManager.verifyCredential", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate integrity report", + Summary: "Generates an integrity report for the selected components", + }, + Key: "host.TpmManager.generateReport", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group set custom value", + Summary: "Distributed Port Group set custom value", + }, + Key: "dvs.DistributedVirtualPortgroup.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload Distributed Port Group", + Summary: "Reload Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename Distributed Port Group", + Summary: "Rename Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Distributed Port Group", + Summary: "Delete Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag to Distributed Port Group", + Summary: "Add tag to Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group remove tag", + Summary: "Distributed Port Group remove tag", + }, + Key: "dvs.DistributedVirtualPortgroup.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "dvs.DistributedVirtualPortgroup.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Distributed Port Group delete network", + Summary: "Distributed Port Group delete network", + }, + Key: "dvs.DistributedVirtualPortgroup.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure Distributed Port Group", + Summary: "Reconfigure Distributed Port Group", + }, + Key: "dvs.DistributedVirtualPortgroup.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get Distributed Port Group configuration spec to rollback", + Summary: "Get Distributed Port Group configuration spec to rollback", + }, + Key: "dvs.DistributedVirtualPortgroup.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set alarm custom value", + Summary: "Sets the value of a custom field of an alarm", + }, + Key: "alarm.Alarm.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove alarm", + Summary: "Remove the alarm", + }, + Key: "alarm.Alarm.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure alarm", + Summary: "Reconfigure the alarm", + }, + Key: "alarm.Alarm.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set compute-resource custom value", + Summary: "Sets the value of a custom field for a unified compute resource", + }, + Key: "ComputeResource.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload resource", + Summary: "Reloads the resource", + }, + Key: "ComputeResource.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename compute-resource", + Summary: "Rename the compute-resource", + }, + Key: "ComputeResource.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove host", + Summary: "Removes the host resource", + }, + Key: "ComputeResource.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to this object", + }, + Key: "ComputeResource.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Removes a set of tags from this object", + }, + Key: "ComputeResource.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ComputeResource.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure compute-resource", + Summary: "Reconfigures a compute-resource", + }, + Key: "ComputeResource.reconfigureEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set latest page size", + Summary: "Set the last page viewed size and contain at most maxCount items in the page", + }, + Key: "HistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind", + Summary: "Move the scroll position to the oldest item", + }, + Key: "HistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset", + Summary: "Move the scroll position to the item just above the last page viewed", + }, + Key: "HistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove collector", + Summary: "Remove the collector from server", + }, + Key: "HistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update specific metadata", + Summary: "Update specific metadata for the given owner and list of virtual machine IDs", + }, + Key: "vm.MetadataManager.updateMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve specific metadata", + Summary: "Retrieve specific metadata for the given owner and list of virtual machine IDs", + }, + Key: "vm.MetadataManager.retrieveMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve all metadata", + Summary: "Retrieve all metadata for the given owner and datastore", + }, + Key: "vm.MetadataManager.retrieveAllMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clear metadata", + Summary: "Clear all metadata for the given owner and datastore", + }, + Key: "vm.MetadataManager.clearMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query latest statistics for a virtual machine", + Summary: "Queries the latest values of performance statistics of a virtual machine", + }, + Key: "InternalStatsCollector.queryLatestVmStats", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch set custom value", + Summary: "vSphere Distributed Switch set custom value", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload vSphere Distributed Switch", + Summary: "Reload vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename vSphere Distributed Switch", + Summary: "Rename vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove vSphere Distributed Switch", + Summary: "Remove vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch add tag", + Summary: "vSphere Distributed Switch add tag", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch remove tag", + Summary: "vSphere Distributed Switch remove tag", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPort keys", + Summary: "Retrieve dvPort keys", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.fetchPortKeys", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve dvPorts", + Summary: "Retrieve dvPorts", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.fetchPorts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query used virtual LAN ID", + Summary: "Query used virtual LAN ID", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.queryUsedVlanId", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSphere Distributed Switch", + Summary: "Reconfigure vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSphere Distributed Switch product specification operation", + Summary: "vSphere Distributed Switch product specification operation", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.performProductSpecOperation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Merge vSphere Distributed Switch", + Summary: "Merge vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.merge", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Groups", + Summary: "Add Distributed Port Groups", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addPortgroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move dvPort", + Summary: "Move dvPort", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.movePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSphere Distributed Switch capability", + Summary: "Update vSphere Distributed Switch capability", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateCapability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure dvPort", + Summary: "Reconfigure dvPort", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigurePort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh dvPort state", + Summary: "Refresh dvPort state", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.refreshPortState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rectify vSphere Distributed Switch host", + Summary: "Rectify vSphere Distributed Switch host", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rectifyHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network resource pools on vSphere Distributed Switch", + Summary: "Update network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add network resource pools on vSphere Distributed Switch", + Summary: "Add network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove network resource pools on vSphere Distributed Switch", + Summary: "Remove network resource pools on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.removeNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure a network resource pool on a distributed switch", + Summary: "Reconfigures a network resource pool on a distributed switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.reconfigureVmVnicNetworkResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update network I/O control on vSphere Distributed Switch", + Summary: "Update network I/O control on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.enableNetworkResourceManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get vSphere Distributed Switch configuration spec to rollback", + Summary: "Get vSphere Distributed Switch configuration spec to rollback", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.rollback", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Distributed Port Group", + Summary: "Add Distributed Port Group", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.addPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update health check configuration on vSphere Distributed Switch", + Summary: "Update health check configuration on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateHealthCheckConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Look up portgroup based on portgroup key", + Summary: "Look up portgroup based on portgroup key", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.lookupPortgroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Link Aggregation Control Protocol groups on vSphere Distributed Switch", + Summary: "Update Link Aggregation Control Protocol groups on vSphere Distributed Switch", + }, + Key: "dvs.VmwareDistributedVirtualSwitch.updateLacpGroupConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a virtual disk object", + Summary: "Create a virtual disk object", + }, + Key: "vslm.vcenter.VStorageObjectManager.createDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register a legacy disk to be a virtual disk object", + Summary: "Register a legacy disk to be a virtual disk object", + }, + Key: "vslm.vcenter.VStorageObjectManager.registerDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extend a virtual disk to the new capacity", + Summary: "Extend a virtual disk to the new capacity", + }, + Key: "vslm.vcenter.VStorageObjectManager.extendDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inflate a thin virtual disk", + Summary: "Inflate a thin virtual disk", + }, + Key: "vslm.vcenter.VStorageObjectManager.inflateDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename a virtual storage object", + Summary: "Rename a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.renameVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update storage policy on a virtual storage object", + Summary: "Update storage policy on a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.updateVStorageObjectPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete a virtual storage object", + Summary: "Delete a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.deleteVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve a virtual storage object", + Summary: "Retrieve a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.retrieveVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveVStorageObjectState", + Summary: "retrieveVStorageObjectState", + }, + Key: "vslm.vcenter.VStorageObjectManager.retrieveVStorageObjectState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "List virtual storage objects on a datastore", + Summary: "List virtual storage objects on a datastore", + }, + Key: "vslm.vcenter.VStorageObjectManager.listVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone a virtual storage object", + Summary: "Clone a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.cloneVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate a virtual storage object", + Summary: "Relocate a virtual storage object", + }, + Key: "vslm.vcenter.VStorageObjectManager.relocateVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "attachTagToVStorageObject", + Summary: "attachTagToVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.attachTagToVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "detachTagFromVStorageObject", + Summary: "detachTagFromVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.detachTagFromVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listVStorageObjectsAttachedToTag", + Summary: "listVStorageObjectsAttachedToTag", + }, + Key: "vslm.vcenter.VStorageObjectManager.listVStorageObjectsAttachedToTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "listTagsAttachedToVStorageObject", + Summary: "listTagsAttachedToVStorageObject", + }, + Key: "vslm.vcenter.VStorageObjectManager.listTagsAttachedToVStorageObject", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconcile datastore inventory", + Summary: "Reconcile datastore inventory", + }, + Key: "vslm.vcenter.VStorageObjectManager.reconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Schedule reconcile datastore inventory", + Summary: "Schedule reconcile datastore inventory", + }, + Key: "vslm.vcenter.VStorageObjectManager.scheduleReconcileDatastoreInventory", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check group membership", + Summary: "Check whether a user is a member of a given list of groups", + }, + Key: "UserDirectory.checkGroupMembership", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get user groups", + Summary: "Searches for users and groups", + }, + Key: "UserDirectory.retrieveUserGroups", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create profile", + Summary: "Create profile", + }, + Key: "profile.ProfileManager.createProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query policy metadata", + Summary: "Query policy metadata", + }, + Key: "profile.ProfileManager.queryPolicyMetadata", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find associated profile", + Summary: "Find associated profile", + }, + Key: "profile.ProfileManager.findAssociatedProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate host for OVF package compatibility", + Summary: "Validates if a host is compatible with the requirements in an OVF package", + }, + Key: "OvfManager.validateHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Parse OVF descriptor", + Summary: "Parses and validates an OVF descriptor", + }, + Key: "OvfManager.parseDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert OVF descriptor", + Summary: "Convert OVF descriptor to entity specification", + }, + Key: "OvfManager.createImportSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create an OVF descriptor", + Summary: "Creates an OVF descriptor from either a VM or vApp", + }, + Key: "OvfManager.createDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Parse OVF Descriptor at URL", + Summary: "Parses and validates an OVF descriptor at a given URL", + }, + Key: "OvfManager.parseDescriptorAtUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys an OVF template from a URL", + }, + Key: "OvfManager.importOvfAtUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export as OVF template", + Summary: "Uploads OVF template to a remote server", + }, + Key: "OvfManager.exportOvfToUrl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update global message", + Summary: "Updates the system global message", + }, + Key: "SessionManager.updateMessage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by token", + Summary: "Logs on to the server through token representing principal identity", + }, + Key: "SessionManager.loginByToken", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login", + Summary: "Create a login session", + }, + Key: "SessionManager.login", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by SSPI", + Summary: "Log on to the server using SSPI passthrough authentication", + }, + Key: "SessionManager.loginBySSPI", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by SSL thumbprint", + Summary: "Log on to the server using SSL thumbprint authentication", + }, + Key: "SessionManager.loginBySSLThumbprint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login by session ticket", + Summary: "Log on to the server using a session ticket", + }, + Key: "SessionManager.loginBySessionTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire session ticket", + Summary: "Acquire a ticket for authenticating to a remote service", + }, + Key: "SessionManager.acquireSessionTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Logout", + Summary: "Logout and end the current session", + }, + Key: "SessionManager.logout", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire local ticket", + Summary: "Acquire one-time ticket for authenticating server-local client", + }, + Key: "SessionManager.acquireLocalTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire generic service ticket", + Summary: "Acquire a one-time credential that may be used to make the specified request", + }, + Key: "SessionManager.acquireGenericServiceTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Terminate session", + Summary: "Logout and end the provided list of sessions", + }, + Key: "SessionManager.terminate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set locale", + Summary: "Set the session locale for determining the languages used for messages and formatting data", + }, + Key: "SessionManager.setLocale", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension", + Summary: "Creates a privileged login session for an extension", + }, + Key: "SessionManager.loginExtension", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension", + Summary: "Invalid subject name", + }, + Key: "SessionManager.loginExtensionBySubjectName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Login extension by certificate", + Summary: "Login extension by certificate", + }, + Key: "SessionManager.loginExtensionByCertificate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Impersonate user", + Summary: "Convert session to impersonate specified user", + }, + Key: "SessionManager.impersonateUser", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Session active query", + Summary: "Validates that a currently active session exists", + }, + Key: "SessionManager.sessionIsActive", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire clone ticket", + Summary: "Acquire a session-specific ticket string that can be used to clone the current session", + }, + Key: "SessionManager.acquireCloneTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone session", + Summary: "Clone the specified session and associate it with the current connection", + }, + Key: "SessionManager.cloneSession", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open remote disk for read/write", + Summary: "Opens a disk on a virtual machine for read/write access", + }, + Key: "NfcService.randomAccessOpen", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Open remote disk for read", + Summary: "Opens a disk on a virtual machine for read access", + }, + Key: "NfcService.randomAccessOpenReadonly", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "randomAccessFileOpen", + Summary: "randomAccessFileOpen", + }, + Key: "NfcService.randomAccessFileOpen", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read virtual machine files", + Summary: "Read files associated with a virtual machine", + }, + Key: "NfcService.getVmFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Write virtual machine files", + Summary: "Write files associated with a virtual machine", + }, + Key: "NfcService.putVmFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Manipulate file paths", + Summary: "Permission to manipulate file paths", + }, + Key: "NfcService.fileManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Manipulate system-related file paths", + Summary: "Permission to manipulate all system related file paths", + }, + Key: "NfcService.systemManagement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "getServerNfcLibVersion", + Summary: "getServerNfcLibVersion", + }, + Key: "NfcService.getServerNfcLibVersion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "registerProvider", + Summary: "registerProvider", + }, + Key: "HealthUpdateManager.registerProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unregisterProvider", + Summary: "unregisterProvider", + }, + Key: "HealthUpdateManager.unregisterProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryProviderList", + Summary: "queryProviderList", + }, + Key: "HealthUpdateManager.queryProviderList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasProvider", + Summary: "hasProvider", + }, + Key: "HealthUpdateManager.hasProvider", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryProviderName", + Summary: "queryProviderName", + }, + Key: "HealthUpdateManager.queryProviderName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHealthUpdateInfos", + Summary: "queryHealthUpdateInfos", + }, + Key: "HealthUpdateManager.queryHealthUpdateInfos", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addMonitoredEntities", + Summary: "addMonitoredEntities", + }, + Key: "HealthUpdateManager.addMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeMonitoredEntities", + Summary: "removeMonitoredEntities", + }, + Key: "HealthUpdateManager.removeMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryMonitoredEntities", + Summary: "queryMonitoredEntities", + }, + Key: "HealthUpdateManager.queryMonitoredEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "hasMonitoredEntity", + Summary: "hasMonitoredEntity", + }, + Key: "HealthUpdateManager.hasMonitoredEntity", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryUnmonitoredHosts", + Summary: "queryUnmonitoredHosts", + }, + Key: "HealthUpdateManager.queryUnmonitoredHosts", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "postHealthUpdates", + Summary: "postHealthUpdates", + }, + Key: "HealthUpdateManager.postHealthUpdates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryHealthUpdates", + Summary: "queryHealthUpdates", + }, + Key: "HealthUpdateManager.queryHealthUpdates", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addFilter", + Summary: "addFilter", + }, + Key: "HealthUpdateManager.addFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterList", + Summary: "queryFilterList", + }, + Key: "HealthUpdateManager.queryFilterList", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterName", + Summary: "queryFilterName", + }, + Key: "HealthUpdateManager.queryFilterName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterInfoIds", + Summary: "queryFilterInfoIds", + }, + Key: "HealthUpdateManager.queryFilterInfoIds", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFilterEntities", + Summary: "queryFilterEntities", + }, + Key: "HealthUpdateManager.queryFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "addFilterEntities", + Summary: "addFilterEntities", + }, + Key: "HealthUpdateManager.addFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeFilterEntities", + Summary: "removeFilterEntities", + }, + Key: "HealthUpdateManager.removeFilterEntities", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "removeFilter", + Summary: "removeFilter", + }, + Key: "HealthUpdateManager.removeFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set vMotion custom value", + Summary: "Sets the value of a custom field of a host vMotion system", + }, + Key: "host.VMotionSystem.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IP configuration", + Summary: "Update the IP configuration of the vMotion virtual NIC", + }, + Key: "host.VMotionSystem.updateIpConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Select vMotion virtual NIC", + Summary: "Select the virtual NIC to be used for vMotion", + }, + Key: "host.VMotionSystem.selectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deselect vMotion virtual NIC", + Summary: "Deselect the virtual NIC to be used for vMotion", + }, + Key: "host.VMotionSystem.deselectVnic", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add custom field", + Summary: "Creates a new custom property", + }, + Key: "CustomFieldsManager.addFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove custom field", + Summary: "Removes a custom property", + }, + Key: "CustomFieldsManager.removeFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename custom property", + Summary: "Renames a custom property", + }, + Key: "CustomFieldsManager.renameFieldDefinition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set custom field", + Summary: "Assigns a value to a custom property", + }, + Key: "CustomFieldsManager.setField", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get ManagedEntities", + Summary: "Get the list of ManagedEntities that the name is a Substring of the custom field name and the value is a Substring of the field value.", + }, + Key: "CustomFieldsManager.getEntitiesWithCustomFieldAndValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomFields", + Summary: "retrieveCustomFields", + }, + Key: "CustomFieldsManager.retrieveCustomFields", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure virtual disk digest", + Summary: "Controls the configuration of the digests for the virtual disks", + }, + Key: "CbrcManager.configureDigest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Recompute virtual disk digest", + Summary: "Recomputes the digest for the given virtual disks, if necessary", + }, + Key: "CbrcManager.recomputeDigest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk digest configuration", + Summary: "Returns the current configuration of the digest for the given digest-enabled virtual disks", + }, + Key: "CbrcManager.queryDigestInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual disk digest runtime information", + Summary: "Returns the status of runtime digest usage for the given digest-enabled virtual disks", + }, + Key: "CbrcManager.queryDigestRuntimeInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get diagnostic files", + Summary: "Gets the list of diagnostic files for a given system", + }, + Key: "DiagnosticManager.queryDescriptions", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Browse diagnostic manager", + Summary: "Returns part of a log file", + }, + Key: "DiagnosticManager.browse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Generate system logs bundles", + Summary: "Instructs the server to generate system logs bundles", + }, + Key: "DiagnosticManager.generateLogBundles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query file hash", + Summary: "Queries file integrity information", + }, + Key: "DiagnosticManager.queryFileHash", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure workload model calculation parameters for datastore", + Summary: "Configures calculation parameters used for computation of workload model for a datastore", + }, + Key: "DrsStatsManager.configureWorkloadCharacterization", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query current workload model calculation parameters", + Summary: "Queries a host for the current workload model calculation parameters", + }, + Key: "DrsStatsManager.queryWorkloadCharacterization", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure datastore correlation detector", + Summary: "Configures datastore correlation detector with datastore to datastore cluster mappings", + }, + Key: "DrsStatsManager.configureCorrelationDetector", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore correlation result", + Summary: "Queries correlation detector for a list of datastores correlated to a given datastore", + }, + Key: "DrsStatsManager.queryCorrelationResult", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update agent virtual machine information", + Summary: "Updates agent virtual machine information", + }, + Key: "EsxAgentConfigManager.updateAgentVmInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query agent virtual machine information", + Summary: "Returns the state for each of the specified agent virtual machines", + }, + Key: "EsxAgentConfigManager.queryAgentVmInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update compute resource agent information", + Summary: "Updates the number of required agent virtual machines for one or more compute resources", + }, + Key: "EsxAgentConfigManager.updateComputeResourceAgentInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query compute resource agent information", + Summary: "Retrieves the agent information for one or more compute resources", + }, + Key: "EsxAgentConfigManager.queryComputeResourceAgentInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set extensible custom value", + Summary: "Sets the value of a custom field of an extensible managed object", + }, + Key: "ExtensibleManagedObject.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get lease download manifest", + Summary: "Gets the download manifest for this lease", + }, + Key: "HttpNfcLease.getManifest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Complete the lease", + Summary: "The lease completed successfully", + }, + Key: "HttpNfcLease.complete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "End the lease", + Summary: "The lease has ended", + }, + Key: "HttpNfcLease.abort", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update lease progress", + Summary: "Updates lease progress", + }, + Key: "HttpNfcLease.progress", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install IO Filter", + Summary: "Installs an IO Filter on a compute resource", + }, + Key: "IoFilterManager.installIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall IO Filter", + Summary: "Uninstalls an IO Filter from a compute resource", + }, + Key: "IoFilterManager.uninstallIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade IO Filter", + Summary: "Upgrades an IO Filter on a compute resource", + }, + Key: "IoFilterManager.upgradeIoFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query IO Filter installation issues", + Summary: "Queries IO Filter installation issues on a compute resource", + }, + Key: "IoFilterManager.queryIssue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryIoFilterInfo", + Summary: "queryIoFilterInfo", + }, + Key: "IoFilterManager.queryIoFilterInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve IO Filter installation errors on host", + Summary: "Resolves IO Filter installation errors on a host", + }, + Key: "IoFilterManager.resolveInstallationErrorsOnHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resolve IO Filter installation errors on cluster", + Summary: "Resolves IO Filter installation errors on a cluster", + }, + Key: "IoFilterManager.resolveInstallationErrorsOnCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query information about virtual disks using IO Filter", + Summary: "Queries information about virtual disks that use an IO Filter installed on a compute resource", + }, + Key: "IoFilterManager.queryDisksUsingFilter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update IO Filter policy", + Summary: "Updates the policy to IO Filter mapping in vCenter Server", + }, + Key: "IoFilterManager.updateIoFilterPolicy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query supported features", + Summary: "Searches the current license source for licenses available from this system", + }, + Key: "LicenseManager.querySupportedFeatures", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query license source", + Summary: "Searches the current license source for licenses available for each feature known to this system", + }, + Key: "LicenseManager.querySourceAvailability", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query license usage", + Summary: "Returns the list of features and the number of licenses that have been reserved", + }, + Key: "LicenseManager.queryUsage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set product edition", + Summary: "Defines the product edition", + }, + Key: "LicenseManager.setEdition", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check feature", + Summary: "Checks if a feature is enabled", + }, + Key: "LicenseManager.checkFeature", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable license", + Summary: "Enable a feature that is marked as user-configurable", + }, + Key: "LicenseManager.enable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable license", + Summary: "Release licenses for a user-configurable feature", + }, + Key: "LicenseManager.disable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure license source", + Summary: "Allows reconfiguration of the License Manager license source", + }, + Key: "LicenseManager.configureSource", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Installing license", + Summary: "Installing license", + }, + Key: "LicenseManager.updateLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add license", + Summary: "Adds a new license to the license inventory", + }, + Key: "LicenseManager.addLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove license", + Summary: "Removes a license from the license inventory", + }, + Key: "LicenseManager.removeLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Decode license", + Summary: "Decodes the license to return the properties of that license key", + }, + Key: "LicenseManager.decodeLicense", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update license label", + Summary: "Update a license's label", + }, + Key: "LicenseManager.updateLabel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove license label", + Summary: "Removes a license's label", + }, + Key: "LicenseManager.removeLabel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get License Data Manager", + Summary: "Gets the License Data Manager", + }, + Key: "LicenseManager.queryLicenseDataManager", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Activate remote hard enforcement", + Summary: "Activates the remote hard enforcement", + }, + Key: "LicenseManager.activateRemoteHardEnforcement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add end point", + Summary: "Add a service whose connections are to be proxied", + }, + Key: "ProxyService.addEndpoint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove end point", + Summary: "End point to be detached", + }, + Key: "ProxyService.removeEndpoint", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Estimate database size", + Summary: "Estimates the database size required to store VirtualCenter data", + }, + Key: "ResourcePlanningManager.estimateDatabaseSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by UUID", + Summary: "Finds a virtual machine or host by UUID", + }, + Key: "SearchIndex.findByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find virtual machine by datastore path", + Summary: "Finds a virtual machine by its location on a datastore", + }, + Key: "SearchIndex.findByDatastorePath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by DNS", + Summary: "Finds a virtual machine or host by its DNS name", + }, + Key: "SearchIndex.findByDnsName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by IP", + Summary: "Finds a virtual machine or host by IP address", + }, + Key: "SearchIndex.findByIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find entity by inventory path", + Summary: "Finds a virtual machine or host based on its location in the inventory", + }, + Key: "SearchIndex.findByInventoryPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find folder child", + Summary: "Finds an immediate child of a folder", + }, + Key: "SearchIndex.findChild", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by UUID", + Summary: "Find entities based on their UUID", + }, + Key: "SearchIndex.findAllByUuid", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by DNS name", + Summary: "Find by DNS name", + }, + Key: "SearchIndex.findAllByDnsName", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Find by IP address", + Summary: "Find entities based on their IP address", + }, + Key: "SearchIndex.findAllByIp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "findAllInstantCloneParentInGroup", + Summary: "findAllInstantCloneParentInGroup", + }, + Key: "SearchIndex.findAllInstantCloneParentInGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "findAllInstantCloneChildrenOfGroup", + Summary: "findAllInstantCloneChildrenOfGroup", + }, + Key: "SearchIndex.findAllInstantCloneChildrenOfGroup", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute client service", + Summary: "Execute the client service", + }, + Key: "SimpleCommand.Execute", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage I/O Control on datastore", + Summary: "Configure Storage I/O Control on datastore", + }, + Key: "StorageResourceManager.ConfigureDatastoreIORM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage I/O Control on datastore", + Summary: "Configure Storage I/O Control on datastore", + }, + Key: "StorageResourceManager.ConfigureDatastoreIORMOnHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Storage I/O Control configuration options", + Summary: "Query Storage I/O Control configuration options", + }, + Key: "StorageResourceManager.QueryIORMConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get storage I/O resource management device model", + Summary: "Returns the device model computed for a given datastore by storage DRS", + }, + Key: "StorageResourceManager.GetStorageIORMDeviceModel", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query datastore performance summary", + Summary: "Query datastore performance metrics in summary form", + }, + Key: "StorageResourceManager.queryDatastorePerformanceSummary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply a Storage DRS recommendation", + Summary: "Apply a Storage DRS recommendation", + }, + Key: "StorageResourceManager.applyRecommendationToPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply Storage DRS recommendations", + Summary: "Apply Storage DRS recommendations", + }, + Key: "StorageResourceManager.applyRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel storage DRS recommendation", + Summary: "Cancels a storage DRS recommendation", + }, + Key: "StorageResourceManager.cancelRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh storage DRS recommendation", + Summary: "Refreshes the storage DRS recommendations on the specified datastore cluster", + }, + Key: "StorageResourceManager.refreshRecommendation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "refreshRecommendationsForPod", + Summary: "refreshRecommendationsForPod", + }, + Key: "StorageResourceManager.refreshRecommendationsForPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure Storage DRS", + Summary: "Configure Storage DRS on a datastore cluster", + }, + Key: "StorageResourceManager.configureStorageDrsForPod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Invoke storage DRS for placement recommendations", + Summary: "Invokes storage DRS for placement recommendations", + }, + Key: "StorageResourceManager.recommendDatastores", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "rankForPlacement", + Summary: "rankForPlacement", + }, + Key: "StorageResourceManager.rankForPlacement", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryStorageStatisticsByProfile", + Summary: "queryStorageStatisticsByProfile", + }, + Key: "StorageResourceManager.queryStorageStatisticsByProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set latest page size", + Summary: "Set the last page viewed size and contain at most maxCount items in the page", + }, + Key: "TaskHistoryCollector.setLatestPageSize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rewind", + Summary: "Move the scroll position to the oldest item", + }, + Key: "TaskHistoryCollector.rewind", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset", + Summary: "Move the scroll position to the item just above the last page viewed", + }, + Key: "TaskHistoryCollector.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove collector", + Summary: "Remove the collector from server", + }, + Key: "TaskHistoryCollector.remove", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read next", + Summary: "The scroll position is moved to the next new page after the read", + }, + Key: "TaskHistoryCollector.readNext", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Read previous", + Summary: "The scroll position is moved to the next older page after the read", + }, + Key: "TaskHistoryCollector.readPrev", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performUpgradePreflightCheck", + Summary: "performUpgradePreflightCheck", + }, + Key: "VsanUpgradeSystem.performUpgradePreflightCheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryUpgradeStatus", + Summary: "queryUpgradeStatus", + }, + Key: "VsanUpgradeSystem.queryUpgradeStatus", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "performUpgrade", + Summary: "performUpgrade", + }, + Key: "VsanUpgradeSystem.performUpgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set a custom property to an opaque network", + Summary: "Sets the value of a custom field of an opaque network", + }, + Key: "OpaqueNetwork.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload an opaque network", + Summary: "Reloads the information about the opaque network", + }, + Key: "OpaqueNetwork.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename an opaque network", + Summary: "Renames an opaque network", + }, + Key: "OpaqueNetwork.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete opaque network", + Summary: "Deletes an opaque network if it is not used by any host or virtual machine", + }, + Key: "OpaqueNetwork.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add a tag to an opaque network", + Summary: "Adds a set of tags to the opaque network", + }, + Key: "OpaqueNetwork.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove a tag from an opaque network", + Summary: "Removes a set of tags from the opaque network", + }, + Key: "OpaqueNetwork.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "OpaqueNetwork.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove an opaque network", + Summary: "Removes an opaque network", + }, + Key: "OpaqueNetwork.destroyNetwork", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set resource pool custom value", + Summary: "Sets the value of a custom field of a resource pool of physical resources", + }, + Key: "ResourcePool.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload resource pool", + Summary: "Reload the resource pool", + }, + Key: "ResourcePool.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename resource pool", + Summary: "Rename the resource pool", + }, + Key: "ResourcePool.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete resource pool", + Summary: "Delete the resource pool, which also deletes its contents and removes it from its parent folder (if any)", + }, + Key: "ResourcePool.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the resource pool", + }, + Key: "ResourcePool.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the resource pool", + }, + Key: "ResourcePool.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "ResourcePool.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update resource pool configuration", + Summary: "Updates the resource pool configuration", + }, + Key: "ResourcePool.updateConfig", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move into resource pool", + Summary: "Moves a set of resource pools or virtual machines into this pool", + }, + Key: "ResourcePool.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update child resource configuration", + Summary: "Change the resource configuration of a set of children of the resource pool", + }, + Key: "ResourcePool.updateChildResourceConfiguration", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create resource pool", + Summary: "Creates a new resource pool", + }, + Key: "ResourcePool.createResourcePool", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete resource pool children", + Summary: "Removes all child resource pools recursively", + }, + Key: "ResourcePool.destroyChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create vApp", + Summary: "Creates a child vApp of this resource pool", + }, + Key: "ResourcePool.createVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Creates a virtual machine in this resource pool", + }, + Key: "ResourcePool.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to this resource pool", + }, + Key: "ResourcePool.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "ResourcePool.importVApp", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query resource pool resource configuration options", + Summary: "Returns configuration options for a set of resources for a resource pool", + }, + Key: "ResourcePool.queryResourceConfigOption", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh resource runtime information", + Summary: "Refreshes the resource usage runtime information", + }, + Key: "ResourcePool.refreshRuntime", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual machine custom value", + Summary: "Sets the value of a custom field of a virtual machine", + }, + Key: "VirtualMachine.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine", + Summary: "Reloads the virtual machine", + }, + Key: "VirtualMachine.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename virtual machine", + Summary: "Rename the virtual machine", + }, + Key: "VirtualMachine.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete virtual machine", + Summary: "Delete this virtual machine. Deleting this virtual machine also deletes its contents and removes it from its parent folder (if any).", + }, + Key: "VirtualMachine.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add Tag", + Summary: "Add a set of tags to the virtual machine", + }, + Key: "VirtualMachine.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the virtual machine", + }, + Key: "VirtualMachine.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "VirtualMachine.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Refresh virtual machine storage information", + Summary: "Refresh storage information for the virtual machine", + }, + Key: "VirtualMachine.refreshStorageInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve virtual machine backup agent", + Summary: "Retrieves the backup agent for the virtual machine", + }, + Key: "VirtualMachine.retrieveBackupAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine snapshot", + Summary: "Create a new snapshot of this virtual machine", + }, + Key: "VirtualMachine.createSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine snapshot", + Summary: "Create a new snapshot of this virtual machine", + }, + Key: "VirtualMachine.createSnapshotEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Revert to current snapshot", + Summary: "Reverts the virtual machine to the current snapshot", + }, + Key: "VirtualMachine.revertToCurrentSnapshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove all snapshots", + Summary: "Remove all the snapshots associated with this virtual machine", + }, + Key: "VirtualMachine.removeAllSnapshots", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Consolidate virtual machine disk files", + Summary: "Consolidate disk files of this virtual machine", + }, + Key: "VirtualMachine.consolidateDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Estimate virtual machine disks consolidation space requirement", + Summary: "Estimate the temporary space required to consolidate disk files.", + }, + Key: "VirtualMachine.estimateStorageRequirementForConsolidate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure virtual machine", + Summary: "Reconfigure this virtual machine", + }, + Key: "VirtualMachine.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade VM compatibility", + Summary: "Upgrade virtual machine compatibility to the latest version", + }, + Key: "VirtualMachine.upgradeVirtualHardware", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Extract OVF environment", + Summary: "Returns the XML document that represents the OVF environment", + }, + Key: "VirtualMachine.extractOvfEnvironment", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power On this virtual machine", + }, + Key: "VirtualMachine.powerOn", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power Off virtual machine", + Summary: "Power Off this virtual machine", + }, + Key: "VirtualMachine.powerOff", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend virtual machine", + Summary: "Suspend virtual machine", + }, + Key: "VirtualMachine.suspend", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset virtual machine", + Summary: "Reset this virtual machine", + }, + Key: "VirtualMachine.reset", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS shutdown", + Summary: "Issues a command to the guest operating system to perform a clean shutdown of all services", + }, + Key: "VirtualMachine.shutdownGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS reboot", + Summary: "Issues a command to the guest operating system asking it to perform a reboot", + }, + Key: "VirtualMachine.rebootGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiate guest OS standby", + Summary: "Issues a command to the guest operating system to prepare for a suspend operation", + }, + Key: "VirtualMachine.standbyGuest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Answer virtual machine question", + Summary: "Respond to a question that is blocking this virtual machine", + }, + Key: "VirtualMachine.answer", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Customize virtual machine guest OS", + Summary: "Customize a virtual machine's guest operating system", + }, + Key: "VirtualMachine.customize", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check customization specification", + Summary: "Check the customization specification against the virtual machine configuration", + }, + Key: "VirtualMachine.checkCustomizationSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Migrate virtual machine", + Summary: "Migrate a virtual machine's execution to a specific resource pool or host", + }, + Key: "VirtualMachine.migrate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Relocate virtual machine", + Summary: "Relocate the virtual machine to a specific location", + }, + Key: "VirtualMachine.relocate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone virtual machine", + Summary: "Creates a clone of this virtual machine", + }, + Key: "VirtualMachine.clone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "instantClone", + Summary: "instantClone", + }, + Key: "VirtualMachine.instantClone", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveInstantCloneChildren", + Summary: "retrieveInstantCloneChildren", + }, + Key: "VirtualMachine.retrieveInstantCloneChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveInstantCloneParent", + Summary: "retrieveInstantCloneParent", + }, + Key: "VirtualMachine.retrieveInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "markAsInstantCloneParent", + Summary: "markAsInstantCloneParent", + }, + Key: "VirtualMachine.markAsInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "unmarkAsInstantCloneParent", + Summary: "unmarkAsInstantCloneParent", + }, + Key: "VirtualMachine.unmarkAsInstantCloneParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "createForkChild", + Summary: "createForkChild", + }, + Key: "VirtualMachine.createForkChild", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "enableForkParent", + Summary: "enableForkParent", + }, + Key: "VirtualMachine.enableForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "disableForkParent", + Summary: "disableForkParent", + }, + Key: "VirtualMachine.disableForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveForkChildren", + Summary: "retrieveForkChildren", + }, + Key: "VirtualMachine.retrieveForkChildren", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveForkParent", + Summary: "retrieveForkParent", + }, + Key: "VirtualMachine.retrieveForkParent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the virtual machine as an OVF template", + }, + Key: "VirtualMachine.exportVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark virtual machine as template", + Summary: "Virtual machine is marked as a template", + }, + Key: "VirtualMachine.markAsTemplate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mark as virtual machine", + Summary: "Reassociate a virtual machine with a host or resource pool", + }, + Key: "VirtualMachine.markAsVirtualMachine", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister virtual machine", + Summary: "Removes this virtual machine from the inventory without removing any of the virtual machine files on disk", + }, + Key: "VirtualMachine.unregister", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reset guest OS information", + Summary: "Clears cached guest OS information", + }, + Key: "VirtualMachine.resetGuestInformation", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools Installer Mount", + Summary: "Mounts the tools CD installer as a CD-ROM for the guest", + }, + Key: "VirtualMachine.mountToolsInstaller", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Connect VMware Tools CD", + Summary: "Connects the VMware Tools CD image to the guest", + }, + Key: "VirtualMachine.mountToolsInstallerImage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount tools installer", + Summary: "Unmounts the tools installer", + }, + Key: "VirtualMachine.unmountToolsInstaller", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools install or upgrade", + Summary: "Issues a command to the guest operating system to install VMware Tools or upgrade to the latest revision", + }, + Key: "VirtualMachine.upgradeTools", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initiated VMware Tools upgrade", + Summary: "Upgrades VMware Tools in the virtual machine from specified CD image", + }, + Key: "VirtualMachine.upgradeToolsFromImage", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire virtual machine Mouse Keyboard Screen Ticket", + Summary: "Establishing a Mouse Keyboard Screen Ticket", + }, + Key: "VirtualMachine.acquireMksTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Acquire virtual machine service ticket", + Summary: "Establishing a specific remote virtual machine connection ticket", + }, + Key: "VirtualMachine.acquireTicket", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set console window screen resolution", + Summary: "Sets the console window's resolution as specified", + }, + Key: "VirtualMachine.setScreenResolution", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Defragment all disks", + Summary: "Defragment all virtual disks attached to this virtual machine", + }, + Key: "VirtualMachine.defragmentAllDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn On Fault Tolerance", + Summary: "Secondary VM created", + }, + Key: "VirtualMachine.createSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn On Fault Tolerance", + Summary: "Creates a secondary VM", + }, + Key: "VirtualMachine.createSecondaryEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Turn Off Fault Tolerance", + Summary: "Remove all secondaries for this virtual machine and turn off Fault Tolerance", + }, + Key: "VirtualMachine.turnOffFaultTolerance", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test failover", + Summary: "Test Fault Tolerance failover by making a Secondary VM in a Fault Tolerance pair the Primary VM", + }, + Key: "VirtualMachine.makePrimary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Test restarting Secondary VM", + Summary: "Test restart Secondary VM by stopping a Secondary VM in the Fault Tolerance pair", + }, + Key: "VirtualMachine.terminateFaultTolerantVM", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend Fault Tolerance", + Summary: "Suspend Fault Tolerance on this virtual machine", + }, + Key: "VirtualMachine.disableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Resume Fault Tolerance", + Summary: "Resume Fault Tolerance on this virtual machine", + }, + Key: "VirtualMachine.enableSecondary", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set virtual machine display topology", + Summary: "Set the display topology for the virtual machine", + }, + Key: "VirtualMachine.setDisplayTopology", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start recording", + Summary: "Start a recording session on this virtual machine", + }, + Key: "VirtualMachine.startRecording", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop recording", + Summary: "Stop a currently active recording session on this virtual machine", + }, + Key: "VirtualMachine.stopRecording", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start replaying", + Summary: "Start a replay session on this virtual machine", + }, + Key: "VirtualMachine.startReplaying", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop replaying", + Summary: "Stop a replay session on this virtual machine", + }, + Key: "VirtualMachine.stopReplaying", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Promote virtual machine disks", + Summary: "Promote disks of the virtual machine that have delta disk backings", + }, + Key: "VirtualMachine.promoteDisks", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Take virtual machine screenshot", + Summary: "Take a screenshot of a virtual machine's guest OS console", + }, + Key: "VirtualMachine.createScreenshot", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Put USB HID scan codes", + Summary: "Injects a sequence of USB HID scan codes into the keyboard", + }, + Key: "VirtualMachine.putUsbScanCodes", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query virtual machine disk changes", + Summary: "Query for changes to the virtual machine's disks since a given point in the past", + }, + Key: "VirtualMachine.queryChangedDiskAreas", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query unowned virtual machine files", + Summary: "Query files of the virtual machine not owned by the datastore principal user", + }, + Key: "VirtualMachine.queryUnownedFiles", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine from new configuration", + Summary: "Reloads the virtual machine from a new configuration file", + }, + Key: "VirtualMachine.reloadFromPath", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query Virtual Machine Fault Tolerance Compatibility", + Summary: "Check if virtual machine is compatible for Fault Tolerance", + }, + Key: "VirtualMachine.queryFaultToleranceCompatibility", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryFaultToleranceCompatibilityEx", + Summary: "queryFaultToleranceCompatibilityEx", + }, + Key: "VirtualMachine.queryFaultToleranceCompatibilityEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Suspend and resume the virtual machine", + Summary: "Suspend and resume the virtual machine", + }, + Key: "VirtualMachine.invokeFSR", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Hard stop virtual machine", + Summary: "Hard stop virtual machine", + }, + Key: "VirtualMachine.terminate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get native clone capability", + Summary: "Check if native clone is supported on the virtual machine", + }, + Key: "VirtualMachine.isNativeSnapshotCapable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure quorum file path prefix", + Summary: "Configures the quorum file path prefix for the virtual machine", + }, + Key: "VirtualMachine.configureQuorumFilePathPrefix", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Retrieve quorum file path prefix", + Summary: "Retrieves the quorum file path prefix for the virtual machine", + }, + Key: "VirtualMachine.retrieveQuorumFilePathPrefix", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Inject OVF Environment into virtual machine", + Summary: "Specifies the OVF Environments to be injected into and returned for a virtual machine", + }, + Key: "VirtualMachine.injectOvfEnvironment", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Wipe a Flex-SE virtual disk", + Summary: "Wipes a Flex-SE virtual disk", + }, + Key: "VirtualMachine.wipeDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Shrink a Flex-SE virtual disk", + Summary: "Shrinks a Flex-SE virtual disk", + }, + Key: "VirtualMachine.shrinkDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Send NMI", + Summary: "Sends a non-maskable interrupt (NMI) to the virtual machine", + }, + Key: "VirtualMachine.sendNMI", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload virtual machine", + Summary: "Reloads the virtual machine", + }, + Key: "VirtualMachine.reloadEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach a virtual disk", + Summary: "Attach an existing virtual disk to the virtual machine", + }, + Key: "VirtualMachine.attachDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detach a virtual disk", + Summary: "Detach a virtual disk from the virtual machine", + }, + Key: "VirtualMachine.detachDisk", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply EVC Mode", + Summary: "Apply EVC Mode to a virtual machine", + }, + Key: "VirtualMachine.applyEvcMode", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set datacenter custom value", + Summary: "Sets the value of a custom field of a datacenter", + }, + Key: "Datacenter.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload datacenter", + Summary: "Reloads the datacenter", + }, + Key: "Datacenter.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename datacenter", + Summary: "Rename the datacenter", + }, + Key: "Datacenter.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove datacenter", + Summary: "Deletes the datacenter and removes it from its parent folder (if any)", + }, + Key: "Datacenter.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the datacenter", + }, + Key: "Datacenter.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the datacenter", + }, + Key: "Datacenter.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Datacenter.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query connection information", + Summary: "Gets information of a host that can be used in the connection wizard", + }, + Key: "Datacenter.queryConnectionInfo", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "queryConnectionInfoViaSpec", + Summary: "queryConnectionInfoViaSpec", + }, + Key: "Datacenter.queryConnectionInfoViaSpec", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Initialize powering On", + Summary: "Initialize tasks for powering on virtual machines", + }, + Key: "Datacenter.powerOnVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Query configuration option descriptor", + Summary: "Retrieve the list of configuration option keys available in this datacenter", + }, + Key: "Datacenter.queryConfigOptionDescriptor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure datacenter", + Summary: "Reconfigures the datacenter", + }, + Key: "Datacenter.reconfigure", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set folder custom value", + Summary: "Sets the value of a custom field of a folder", + }, + Key: "Folder.setCustomValue", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reload folder", + Summary: "Reloads the folder", + }, + Key: "Folder.reload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rename folder", + Summary: "Rename the folder", + }, + Key: "Folder.rename", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete folder", + Summary: "Delete this object, deleting its contents and removing it from its parent folder (if any)", + }, + Key: "Folder.destroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add tag", + Summary: "Add a set of tags to the folder", + }, + Key: "Folder.addTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove tag", + Summary: "Remove a set of tags from the folder", + }, + Key: "Folder.removeTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "retrieveCustomValues", + Summary: "retrieveCustomValues", + }, + Key: "Folder.retrieveCustomValues", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create folder", + Summary: "Creates a new folder", + }, + Key: "Folder.createFolder", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Move entities", + Summary: "Moves a set of managed entities into this folder", + }, + Key: "Folder.moveInto", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create virtual machine", + Summary: "Create a new virtual machine", + }, + Key: "Folder.createVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Register virtual machine", + Summary: "Adds an existing virtual machine to the folder", + }, + Key: "Folder.registerVm", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Create a new cluster compute-resource in this folder", + }, + Key: "Folder.createCluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create cluster", + Summary: "Create a new cluster compute-resource in this folder", + }, + Key: "Folder.createClusterEx", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host", + Summary: "Create a new single-host compute-resource", + }, + Key: "Folder.addStandaloneHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add standalone host and enable lockdown", + Summary: "Create a new single-host compute-resource and enable lockdown mode on the host", + }, + Key: "Folder.addStandaloneHostWithAdminDisabled", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create datacenter", + Summary: "Create a new datacenter with the given name", + }, + Key: "Folder.createDatacenter", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unregister and Delete", + Summary: "Recursively deletes all child virtual machine folders and unregisters all virtual machines", + }, + Key: "Folder.unregisterAndDestroy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a vSphere Distributed Switch", + Summary: "Create a vSphere Distributed Switch", + }, + Key: "Folder.createDistributedVirtualSwitch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create a datastore cluster", + Summary: "Create a datastore cluster", + }, + Key: "Folder.createStoragePod", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Get boot devices", + Summary: "Get available boot devices for the host system", + }, + Key: "host.BootDeviceSystem.queryBootDevices", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update boot device", + Summary: "Update the boot device on the host system", + }, + Key: "host.BootDeviceSystem.updateBootDevice", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configuring vSphere HA", + Summary: "Configuring vSphere HA", + }, + Key: "DasConfig.ConfigureHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unconfiguring vSphere HA", + Summary: "Unconfiguring vSphere HA", + }, + Key: "DasConfig.UnconfigureHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Migrate virtual machine", + Summary: "Migrates a virtual machine from one host to another", + }, + Key: "Drm.ExecuteVMotionLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power on this virtual machine", + }, + Key: "Drm.ExecuteVmPowerOnLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter standby mode", + Summary: "Puts this host into standby mode", + }, + Key: "Drm.EnterStandbyLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Exit standby mode", + Summary: "Brings this host out of standby mode", + }, + Key: "Drm.ExitStandbyLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Power On virtual machine", + Summary: "Power On this virtual machine", + }, + Key: "Datacenter.ExecuteVmPowerOnLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vCenter Agent", + Summary: "Upgrade the vCenter Agent", + }, + Key: "Upgrade.UpgradeAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vCenter Agents on cluster hosts", + Summary: "Upgrade the vCenter Agents on all cluster hosts", + }, + Key: "ClusterUpgrade.UpgradeAgent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF template", + Summary: "Deploys a virtual machine or vApp", + }, + Key: "ResourcePool.ImportVAppLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set cluster suspended state", + Summary: "Set suspended state of the cluster", + }, + Key: "ClusterComputeResource.setSuspendedState", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the virtual machine as an OVF template", + }, + Key: "VirtualMachine.ExportVmLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF template", + Summary: "Exports the vApp as an OVF template", + }, + Key: "VirtualApp.ExportVAppLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Start Fault Tolerance Secondary VM", + Summary: "Start Secondary VM as the Primary VM is powered on", + }, + Key: "FaultTolerance.PowerOnSecondaryLRO", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Execute Storage vMotion for Storage DRS", + Summary: "Execute Storage vMotion migrations for Storage DRS", + }, + Key: "Drm.ExecuteStorageVmotionLro", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply recommendations for SDRS maintenance mode", + Summary: "Apply recommendations to enter into SDRS maintenance mode", + }, + Key: "Drm.ExecuteMaintenanceRecommendationsLro", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enter SDRS maintenance mode monitor task", + Summary: "Task that monitors the SDRS maintenance mode activity", + }, + Key: "Drm.TrackEnterMaintenanceLro", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "ResetSensor", + Summary: "ResetSensor", + }, + Key: "com.vmware.hardwarehealth.ResetSensor", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "ResetSelLog", + Summary: "ResetSelLog", + }, + Key: "com.vmware.hardwarehealth.ResetSelLog", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "RefreshHost", + Summary: "RefreshHost", + }, + Key: "com.vmware.hardwarehealth.RefreshHost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "install", + Summary: "install", + }, + Key: "eam.agent.install", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uninstall", + Summary: "uninstall", + }, + Key: "eam.agent.uninstall", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "upgrade", + Summary: "upgrade", + }, + Key: "eam.agent.upgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Bulk Remediation", + Summary: "Remediating hosts in bulk", + }, + Key: "com.vmware.rbd.bulkRemediateMapping", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Rule", + Summary: "Creating rule in Auto Deploy server", + }, + Key: "com.vmware.rbd.CreateRuleWithTransform", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Apply Image Profile", + Summary: "Applying Image profile to a host", + }, + Key: "com.vmware.rbd.ApplyImageProfile", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Edit Rule", + Summary: "Editing Auto Deploy rule", + }, + Key: "com.vmware.rbd.UpdateSpecWithTransform", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Repair Cache", + Summary: "Repairing Deploy cache in Auto Deploy server", + }, + Key: "com.vmware.rbd.RepairDeployCache", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Bulk Compliance Check", + Summary: "Compliance checking hosts in bulk", + }, + Key: "com.vmware.rbd.bulkMappingComplianceCheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Mount an ISO Library Item as a Virtual CD-ROM", + Summary: "Mount", + }, + Key: "com.vmware.vcenter.iso.Image.Mount", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Unmount a Virtual CD-ROM mounted with ISO backing", + Summary: "Unmount", + }, + Key: "com.vmware.vcenter.iso.Image.Unmount", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import OVF package", + Summary: "Create", + }, + Key: "com.vmware.ovfs.ImportSession.Create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Export OVF package", + Summary: "Create", + }, + Key: "com.vmware.ovfs.ExportSession.Create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Deploy OVF package from Content Library to Resource Pool", + Summary: "instantiate", + }, + Key: "com.vmware.ovfs.LibraryItem.instantiate", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Clone to OVF package in Content Library from Virtual Machine or Virtual Appliance", + Summary: "capture", + }, + Key: "com.vmware.ovfs.LibraryItem.capture", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Parse OVF package in Content Library", + Summary: "parse", + }, + Key: "com.vmware.ovfs.LibraryItem.parse", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scrub Database after Restore", + Summary: "Scrub", + }, + Key: "com.vmware.content.Scrub", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Library", + Summary: "Create", + }, + Key: "com.vmware.content.Library.Create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Library", + Summary: "Update", + }, + Key: "com.vmware.content.Library.Update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Library", + Summary: "Delete", + }, + Key: "com.vmware.content.Library.Delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Library Content", + Summary: "DeleteContent", + }, + Key: "com.vmware.content.Library.DeleteContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sync Library", + Summary: "Sync", + }, + Key: "com.vmware.content.Library.Sync", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Validate Library Content against the Storage Backing After Restore", + Summary: "Scrub", + }, + Key: "com.vmware.content.Library.Scrub", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Library Item", + Summary: "Create", + }, + Key: "com.vmware.content.LibraryItem.Create", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Library Item", + Summary: "Update", + }, + Key: "com.vmware.content.LibraryItem.Update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update Library Item Backing", + Summary: "UpdateBackings", + }, + Key: "com.vmware.content.LibraryItem.UpdateBackings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Library Item", + Summary: "Delete", + }, + Key: "com.vmware.content.LibraryItem.Delete", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Delete Library Item Content", + Summary: "DeleteContent", + }, + Key: "com.vmware.content.LibraryItem.DeleteContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "DeleteFileContent", + Summary: "DeleteFileContent", + }, + Key: "com.vmware.content.LibraryItem.DeleteFileContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upload Files to a Library Item", + Summary: "UploadContent", + }, + Key: "com.vmware.content.LibraryItem.UploadContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fetch Content of a Library Item", + Summary: "FetchContent", + }, + Key: "com.vmware.content.LibraryItem.FetchContent", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Copy Library Item", + Summary: "Copy", + }, + Key: "com.vmware.content.LibraryItem.Copy", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Sync Library Item", + Summary: "Sync", + }, + Key: "com.vmware.content.LibraryItem.Sync", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Waiting For Upload", + Summary: "WaitForUpload", + }, + Key: "com.vmware.content.LibraryItem.WaitForUpload", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Setting Library Item Tag", + Summary: "SetTag", + }, + Key: "com.vmware.content.LibraryItem.SetTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Removing Library Item Tag", + Summary: "RemoveTag", + }, + Key: "com.vmware.content.LibraryItem.RemoveTag", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install vSAN iSCSI target service", + Summary: "Install vSAN iSCSI target service", + }, + Key: "com.vmware.vsan.iscsi.tasks.installVibTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create Home Object and set vSAN iSCSI target service", + Summary: "Create Home Object and set vSAN iSCSI target service", + }, + Key: "com.vmware.vsan.iscsi.tasks.settingTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable vSAN iSCSI target service in cluster", + Summary: "Enable vSAN iSCSI target service in cluster", + }, + Key: "com.vmware.vsan.iscsi.tasks.enable", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Edit vSAN iSCSI target service in cluster", + Summary: "Edit vSAN iSCSI target service in cluster", + }, + Key: "com.vmware.vsan.iscsi.tasks.edit", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add a new iSCSI target", + Summary: "Add a new iSCSI target", + }, + Key: "com.vmware.vsan.iscsi.tasks.addTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Edit the iSCSI target", + Summary: "Edit the iSCSI target", + }, + Key: "com.vmware.vsan.iscsi.tasks.editTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove the iSCSI target", + Summary: "Remove the iSCSI target", + }, + Key: "com.vmware.vsan.iscsi.tasks.removeTarget", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add a new iSCSI LUN", + Summary: "Add a new iSCSI LUN", + }, + Key: "com.vmware.vsan.iscsi.tasks.addLUN", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Edit the iSCSI LUN", + Summary: "Edit the iSCSI LUN", + }, + Key: "com.vmware.vsan.iscsi.tasks.editLUN", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove the iSCSI LUN", + Summary: "Remove the iSCSI LUN", + }, + Key: "com.vmware.vsan.iscsi.tasks.removeLUN", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "VMDK Load Test", + Summary: "VMDK Load Test", + }, + Key: "com.vmware.vsan.health.tasks.runvmdkloadtest", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install vSAN health ESX extension", + Summary: "Install vSAN health ESX extension", + }, + Key: "com.vmware.vsan.health.tasks.health.preparecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall vSAN health ESX extension", + Summary: "Uninstall vSAN health ESX extension", + }, + Key: "com.vmware.vsan.health.tasks.health.uninstallcluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Install vSAN sizing ESX extension", + Summary: "Install vSAN sizing ESX extension", + }, + Key: "com.vmware.vsan.health.tasks.sizing.preparecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Uninstall vSAN sizing ESX extension", + Summary: "Uninstall vSAN sizing ESX extension", + }, + Key: "com.vmware.vsan.health.tasks.sizing.uninstallcluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "preparecluster", + Summary: "preparecluster", + }, + Key: "com.vmware.vsan.health.tasks.perfsvc.preparecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "uninstallcluster", + Summary: "uninstallcluster", + }, + Key: "com.vmware.vsan.health.tasks.perfsvc.uninstallcluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Fix vSAN Cluster Object Immediately", + Summary: "Fix vSAN Cluster Object Immediately", + }, + Key: "com.vmware.vsan.health.tasks.repairclusterobjects", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Rebalance vSAN Cluster", + Summary: "Rebalance vSAN Cluster", + }, + Key: "com.vmware.vsan.health.tasks.rebalancecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stop Rebalance vSAN Cluster", + Summary: "Stop Rebalance vSAN Cluster", + }, + Key: "com.vmware.vsan.health.tasks.stoprebalancecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upgrade vSAN disk format", + Summary: "Upgrade vSAN disk format", + }, + Key: "com.vmware.vsan.health.tasks.upgrade", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach vSAN support bundle to SR", + Summary: "Attach vSAN support bundle to SR", + }, + Key: "com.vmware.vsan.health.tasks.attachtosr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Attach vSAN support bundle to PR", + Summary: "Attach vSAN support bundle to PR", + }, + Key: "com.vmware.vsan.health.tasks.attachtopr", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download file from URL", + Summary: "Download file from URL", + }, + Key: "com.vmware.vsan.health.tasks.downloadfromurl", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Online check of vSAN health", + Summary: "Online check of vSAN health", + }, + Key: "com.vmware.vsan.health.tasks.performonlinehealthcheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remediate vSAN cluster", + Summary: "Remediate vSAN cluster", + }, + Key: "com.vmware.vsan.clustermgmt.tasks.remediatevsancluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remediate vSAN configurations", + Summary: "Remediate vSAN configurations", + }, + Key: "com.vmware.vsan.clustermgmt.tasks.remediatevc", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Enable vSAN performance service", + Summary: "Enable vSAN performance service", + }, + Key: "com.vmware.vsan.perfsvc.tasks.createstatsdb", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Disable vSAN performance service", + Summary: "Disable vSAN performance service", + }, + Key: "com.vmware.vsan.perfsvc.tasks.deletestatsdb", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Gathering data for performance diagnosis", + Summary: "Gathering data for performance diagnosis", + }, + Key: "com.vmware.vsan.perfsvc.tasks.runqueryfordiagnosis", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN: Update Software/Driver/Firmware", + Summary: "vSAN: Update Software/Driver/Firmware", + }, + Key: "com.vmware.vsan.patch.tasks.patch", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN: Migrate VSS to VDS", + Summary: "vSAN: Migrate VSS to VDS", + }, + Key: "com.vmware.vsan.vds.tasks.migratevss", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Create disk group on vSAN", + Summary: "Create disk group on vSAN", + }, + Key: "com.vmware.vsan.diskmgmt.tasks.initializediskmappings", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Add witness host", + Summary: "Add witness host to a stretched cluster", + }, + Key: "com.vmware.vsan.stretchedcluster.tasks.addwitnesshost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Replace witness host", + Summary: "Replace witness host for a stretched cluster", + }, + Key: "com.vmware.vsan.stretchedcluster.tasks.replacewitnesshost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remove witness host", + Summary: "Remove witness host from a stretched cluster", + }, + Key: "com.vmware.vsan.stretchedcluster.tasks.removewitnesshost", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert to a stretched cluster", + Summary: "Convert the given configuration to a stretched cluster", + }, + Key: "com.vmware.vsan.stretchedcluster.tasks.convert2stretchedcluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Set preferred fault domain", + Summary: "Set preferred fault domain for a stretched cluster", + }, + Key: "com.vmware.vsan.stretchedcluster.tasks.setpreferredfaultdomain", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Convert disk format for vSAN", + Summary: "Convert disk format for vSAN", + }, + Key: "com.vmware.vsan.diskconvertion.tasks.conversion", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Reconfigure vSAN cluster", + Summary: "Reconfigure vSAN cluster", + }, + Key: "com.vmware.vsan.clustermgmt.tasks.reconfigurecluster", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Regenerate new keys for encrypted vSAN cluster", + Summary: "Regenerate new keys for encrypted vSAN cluster", + }, + Key: "com.vmware.vsan.clustermgmt.tasks.rekey", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "vSAN operation precheck", + Summary: "vSAN operation precheck", + }, + Key: "com.vmware.vsan.clustermgmt.tasks.precheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Update vSAN configuration", + Summary: "Updates the vSAN configuration for this host", + }, + Key: "com.vmware.vsan.vsansystem.tasks.update", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan vSAN Objects", + Summary: "Scan vSAN Objects for issues", + }, + Key: "com.vmware.vsan.diskmgmt.tasks.objectscan", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Perform Convert disk format precheck", + Summary: "Perform Convert disk format precheck for issues that could be encountered", + }, + Key: "com.vmware.vsan.diskconvertion.tasks.precheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Perform compliance resource check task", + Summary: "Perform compliance resource check task", + }, + Key: "com.vmware.vsan.prechecker.tasks.complianceresourcecheck", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Download patch definitions", + Summary: "Download patch definitions", + }, + Key: "com.vmware.vcIntegrity.SigUpdateTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Check new notifications", + Summary: "Check new notifications", + }, + Key: "com.vmware.vcIntegrity.CheckNotificationTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Scan entity", + Summary: "Scan an entity", + }, + Key: "com.vmware.vcIntegrity.ScanTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remediate entity", + Summary: "Remediate an entity", + }, + Key: "com.vmware.vcIntegrity.RemediateTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Stage patches to entity", + Summary: "Stage patches to an entity", + }, + Key: "com.vmware.vcIntegrity.StageTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Discover virtual appliance", + Summary: "Discover virtual appliance", + }, + Key: "com.vmware.vcIntegrity.VaDiscoveryTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Detect Update Manager Guest Agent", + Summary: "Detect Update Manager Guest Agent installation on Linux VMs", + }, + Key: "com.vmware.vcIntegrity.DetectLinuxGATask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel detecting Update Manager GuestAgent", + Summary: "Cancel detecting Update Manager GuestAgent installation on Linux VMs", + }, + Key: "com.vmware.vcIntegrity.CancelDetectLinuxGATask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel download of patch definitions", + Summary: "Cancel download of patch definitions", + }, + Key: "com.vmware.vcIntegrity.CancelSigUpdateTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel scanning entity", + Summary: "Cancel scanning an entity", + }, + Key: "com.vmware.vcIntegrity.CancelScanTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel remediating entity", + Summary: "Cancel remediating an entity", + }, + Key: "com.vmware.vcIntegrity.CancelRemediateTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel discovering virtual appliance", + Summary: "Cancel discovering a virtual appliance", + }, + Key: "com.vmware.vcIntegrity.CancelVaDiscoveryTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Configure VMware Tools upgrade setting", + Summary: "Configure VMware Tools upgrade setting", + }, + Key: "com.vmware.vcIntegrity.ConfigureToolsUpgradeTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Import ESXi image", + Summary: "Import ESXi image", + }, + Key: "com.vmware.vcIntegrity.ImportRelease", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Upload offline patches", + Summary: "Upload offline patches", + }, + Key: "com.vmware.vcIntegrity.DownloadOfflinePatchTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Confirm importing offline patches", + Summary: "Confirm importing offline host patches", + }, + Key: "com.vmware.vcIntegrity.ConfirmOfflinePatchTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Cancel importing offline patches", + Summary: "Cancel importing offline host patches", + }, + Key: "com.vmware.vcIntegrity.CancelOfflinePatchTask", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Remediation pre-check", + Summary: "Remediation pre-check", + }, + Key: "com.vmware.vcIntegrity.RemediatePrecheckTask", + }, + }, + State: []types.BaseElementDescription{ + &types.ElementDescription{ + Description: types.Description{ + Label: "Queued", + Summary: "Task is queued", + }, + Key: "queued", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Running", + Summary: "Task is in progress", + }, + Key: "running", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Success", + Summary: "Task completed successfully", + }, + Key: "success", + }, + &types.ElementDescription{ + Description: types.Description{ + Label: "Error", + Summary: "Task completed with a failure", + }, + Key: "error", + }, + }, + Reason: []types.BaseTypeDescription{ + &types.TypeDescription{ + Description: types.Description{ + Label: "Scheduled task", + Summary: "Task started by a scheduled task", + }, + Key: "TaskReasonSchedule", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "User task", + Summary: "Task started by a specific user", + }, + Key: "TaskReasonUser", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "System task", + Summary: "Task started by the server", + }, + Key: "TaskReasonSystem", + }, + &types.TypeDescription{ + Description: types.Description{ + Label: "Alarm task", + Summary: "Task started by an alarm", + }, + Key: "TaskReasonAlarm", + }, + }, +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go b/stembuild/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go new file mode 100644 index 000000000..8923c97ea --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go @@ -0,0 +1,517 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package simulator + +import ( + "log" + "net/url" + "os" + "strings" + "time" + + "github.com/google/uuid" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type VStorageObject struct { + types.VStorageObject + types.VStorageObjectSnapshotInfo + Metadata []types.KeyValue +} + +type VcenterVStorageObjectManager struct { + mo.VcenterVStorageObjectManager + + objects map[types.ManagedObjectReference]map[types.ID]*VStorageObject +} + +func (m *VcenterVStorageObjectManager) init(*Registry) { + m.objects = make(map[types.ManagedObjectReference]map[types.ID]*VStorageObject) +} + +func (m *VcenterVStorageObjectManager) object(ds types.ManagedObjectReference, id types.ID) *VStorageObject { + if objects, ok := m.objects[ds]; ok { + return objects[id] + } + return nil +} + +func (m *VcenterVStorageObjectManager) Catalog() map[types.ManagedObjectReference]map[types.ID]*VStorageObject { + return m.objects +} + +func (m *VcenterVStorageObjectManager) ListVStorageObject(req *types.ListVStorageObject) soap.HasFault { + body := &methods.ListVStorageObjectBody{ + Res: &types.ListVStorageObjectResponse{}, + } + + if objects, ok := m.objects[req.Datastore]; ok { + for id := range objects { + body.Res.Returnval = append(body.Res.Returnval, id) + } + } + + return body +} + +func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(ctx *Context, req *types.RetrieveVStorageObject) soap.HasFault { + body := new(methods.RetrieveVStorageObjectBody) + + obj := m.object(req.Datastore, req.Id) + if obj == nil { + body.Fault_ = Fault("", new(types.NotFound)) + } else { + stat := m.statDatastoreBacking(ctx, req.Datastore, &req.Id) + if err := stat[req.Id]; err != nil { + body.Fault_ = Fault(err.Error(), new(types.NotFound)) + return body + } + body.Res = &types.RetrieveVStorageObjectResponse{ + Returnval: obj.VStorageObject, + } + } + + return body +} + +// statDatastoreBacking checks if object(s) backing file exists on the given datastore ref. +func (m *VcenterVStorageObjectManager) statDatastoreBacking(ctx *Context, ref types.ManagedObjectReference, id *types.ID) map[types.ID]error { + objs := m.objects[ref] // default to checking all objects + if id != nil { + // check for a specific object + objs = map[types.ID]*VStorageObject{ + *id: objs[*id], + } + } + res := make(map[types.ID]error, len(objs)) + ds := ctx.Map.Get(ref).(*Datastore) + dc := ctx.Map.getEntityDatacenter(ds) + fm := ctx.Map.FileManager() + + for _, obj := range objs { + backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) + file, _ := fm.resolve(ctx, &dc.Self, backing.FilePath) + _, res[obj.Config.Id] = os.Stat(file) + } + + return res +} + +func (m *VcenterVStorageObjectManager) ReconcileDatastoreInventoryTask(ctx *Context, req *types.ReconcileDatastoreInventory_Task) soap.HasFault { + task := CreateTask(m, "reconcileDatastoreInventory", func(*Task) (types.AnyType, types.BaseMethodFault) { + objs := m.objects[req.Datastore] + stat := m.statDatastoreBacking(ctx, req.Datastore, nil) + + for id, err := range stat { + if os.IsNotExist(err) { + log.Printf("removing disk %s from inventory: %s", id.Id, err) + delete(objs, id) + } + } + + return nil, nil + }) + + return &methods.ReconcileDatastoreInventory_TaskBody{ + Res: &types.ReconcileDatastoreInventory_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) RegisterDisk(ctx *Context, req *types.RegisterDisk) soap.HasFault { + body := new(methods.RegisterDiskBody) + + invalid := func() soap.HasFault { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "path"}) + return body + } + + u, err := url.Parse(req.Path) + if err != nil { + return invalid() + } + u.Path = strings.TrimPrefix(u.Path, folderPrefix) + + ds, err := ctx.svc.findDatastore(u.Query()) + if err != nil { + return invalid() + } + + st, err := os.Stat(ds.resolve(ctx, u.Path)) + if err != nil { + return invalid() + } + if st.IsDir() { + return invalid() + } + + path := (&object.DatastorePath{Datastore: ds.Name, Path: u.Path}).String() + + for _, obj := range m.objects[ds.Self] { + backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) + if backing.FilePath == path { + return invalid() + } + } + + creq := &types.CreateDisk_Task{ + Spec: types.VslmCreateSpec{ + Name: req.Name, + BackingSpec: &types.VslmCreateSpecDiskFileBackingSpec{ + VslmCreateSpecBackingSpec: types.VslmCreateSpecBackingSpec{ + Datastore: ds.Self, + Path: u.Path, + }, + }, + }, + } + + obj, fault := m.createObject(ctx, creq, true) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = &types.RegisterDiskResponse{ + Returnval: *obj, + } + + return body +} + +func (m *VcenterVStorageObjectManager) createObject(ctx *Context, req *types.CreateDisk_Task, register bool) (*types.VStorageObject, types.BaseMethodFault) { + dir := "fcd" + ref := req.Spec.BackingSpec.GetVslmCreateSpecBackingSpec().Datastore + ds := ctx.Map.Get(ref).(*Datastore) + dc := ctx.Map.getEntityDatacenter(ds) + + objects, ok := m.objects[ds.Self] + if !ok { + objects = make(map[types.ID]*VStorageObject) + m.objects[ds.Self] = objects + _ = os.MkdirAll(ds.resolve(ctx, dir), 0750) + } + + id := uuid.New().String() + obj := types.VStorageObject{ + Config: types.VStorageObjectConfigInfo{ + BaseConfigInfo: types.BaseConfigInfo{ + Id: types.ID{ + Id: id, + }, + Name: req.Spec.Name, + CreateTime: time.Now(), + KeepAfterDeleteVm: req.Spec.KeepAfterDeleteVm, + RelocationDisabled: types.NewBool(false), + NativeSnapshotSupported: types.NewBool(false), + ChangedBlockTrackingEnabled: types.NewBool(false), + Iofilter: nil, + }, + CapacityInMB: req.Spec.CapacityInMB, + ConsumptionType: []string{"disk"}, + ConsumerId: nil, + }, + } + + backing := req.Spec.BackingSpec.(*types.VslmCreateSpecDiskFileBackingSpec) + path := object.DatastorePath{ + Datastore: ds.Name, + Path: backing.Path, + } + if path.Path == "" { + path.Path = dir + "/" + id + ".vmdk" + } + + if !register { + err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ + Datacenter: &dc.Self, + Name: path.String(), + Spec: &types.FileBackedVirtualDiskSpec{CapacityKb: req.Spec.CapacityInMB * 1024}, + }) + if err != nil { + return nil, err + } + } + + obj.Config.Backing = &types.BaseConfigInfoDiskFileBackingInfo{ + BaseConfigInfoFileBackingInfo: types.BaseConfigInfoFileBackingInfo{ + BaseConfigInfoBackingInfo: types.BaseConfigInfoBackingInfo{ + Datastore: ds.Self, + }, + FilePath: path.String(), + BackingObjectId: uuid.New().String(), + Parent: nil, + DeltaSizeInMB: 0, + }, + ProvisioningType: backing.ProvisioningType, + } + + objects[obj.Config.Id] = &VStorageObject{VStorageObject: obj} + + return &obj, nil + +} + +func (m *VcenterVStorageObjectManager) CreateDiskTask(ctx *Context, req *types.CreateDisk_Task) soap.HasFault { + task := CreateTask(m, "createDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + return m.createObject(ctx, req, false) + }) + + return &methods.CreateDisk_TaskBody{ + Res: &types.CreateDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(ctx *Context, req *types.DeleteVStorageObject_Task) soap.HasFault { + task := CreateTask(m, "deleteDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj == nil { + return nil, &types.InvalidArgument{} + } + + if len(obj.Config.ConsumerId) != 0 { + return nil, &types.InvalidState{} + } + + backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) + ds := ctx.Map.Get(req.Datastore).(*Datastore) + dc := ctx.Map.getEntityDatacenter(ds) + dm := ctx.Map.VirtualDiskManager() + dm.DeleteVirtualDiskTask(ctx, &types.DeleteVirtualDisk_Task{ + Name: backing.FilePath, + Datacenter: &dc.Self, + }) + + delete(m.objects[req.Datastore], req.Id) + + return nil, nil + }) + + return &methods.DeleteVStorageObject_TaskBody{ + Res: &types.DeleteVStorageObject_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) RetrieveSnapshotInfo(req *types.RetrieveSnapshotInfo) soap.HasFault { + body := new(methods.RetrieveSnapshotInfoBody) + + obj := m.object(req.Datastore, req.Id) + if obj == nil { + body.Fault_ = Fault("", new(types.InvalidArgument)) + } else { + body.Res = &types.RetrieveSnapshotInfoResponse{ + Returnval: obj.VStorageObjectSnapshotInfo, + } + } + + return body +} + +func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(ctx *Context, req *types.VStorageObjectCreateSnapshot_Task) soap.HasFault { + task := CreateTask(m, "createSnapshot", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj == nil { + return nil, new(types.InvalidArgument) + } + + snapshot := types.VStorageObjectSnapshotInfoVStorageObjectSnapshot{ + Id: &types.ID{ + Id: uuid.New().String(), + }, + BackingObjectId: uuid.New().String(), + CreateTime: time.Now(), + Description: req.Description, + } + obj.Snapshots = append(obj.Snapshots, snapshot) + + return snapshot.Id, nil + }) + + return &methods.VStorageObjectCreateSnapshot_TaskBody{ + Res: &types.VStorageObjectCreateSnapshot_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) ExtendDiskTask(ctx *Context, req *types.ExtendDisk_Task) soap.HasFault { + task := CreateTask(m, "extendDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj == nil { + return nil, new(types.InvalidArgument) + } + + obj.Config.CapacityInMB = req.NewCapacityInMB + return nil, nil + }) + return &methods.ExtendDisk_TaskBody{ + Res: &types.ExtendDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(ctx *Context, req *types.DeleteSnapshot_Task) soap.HasFault { + task := CreateTask(m, "deleteSnapshot", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj != nil { + for i := range obj.Snapshots { + if *obj.Snapshots[i].Id == req.SnapshotId { + obj.Snapshots = append(obj.Snapshots[:i], obj.Snapshots[i+1:]...) + return nil, nil + } + } + } + return nil, new(types.InvalidArgument) + }) + + return &methods.DeleteSnapshot_TaskBody{ + Res: &types.DeleteSnapshot_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) tagID(id types.ID) types.ManagedObjectReference { + return types.ManagedObjectReference{ + Type: "fcd", + Value: id.Id, + } +} + +func (m *VcenterVStorageObjectManager) AttachTagToVStorageObject(ctx *Context, req *types.AttachTagToVStorageObject) soap.HasFault { + body := new(methods.AttachTagToVStorageObjectBody) + ref := m.tagID(req.Id) + + err := ctx.Map.tagManager.AttachTag(ref, types.VslmTagEntry{ + ParentCategoryName: req.Category, + TagName: req.Tag, + }) + + if err == nil { + body.Res = new(types.AttachTagToVStorageObjectResponse) + } else { + body.Fault_ = Fault("", err) + } + + return body +} + +func (m *VcenterVStorageObjectManager) DetachTagFromVStorageObject(ctx *Context, req *types.DetachTagFromVStorageObject) soap.HasFault { + body := new(methods.DetachTagFromVStorageObjectBody) + ref := m.tagID(req.Id) + + err := ctx.Map.tagManager.DetachTag(ref, types.VslmTagEntry{ + ParentCategoryName: req.Category, + TagName: req.Tag, + }) + + if err == nil { + body.Res = new(types.DetachTagFromVStorageObjectResponse) + } else { + body.Fault_ = Fault("", err) + } + + return body +} + +func (m *VcenterVStorageObjectManager) ListVStorageObjectsAttachedToTag(ctx *Context, req *types.ListVStorageObjectsAttachedToTag) soap.HasFault { + body := new(methods.ListVStorageObjectsAttachedToTagBody) + + refs, err := ctx.Map.tagManager.AttachedObjects(types.VslmTagEntry{ + ParentCategoryName: req.Category, + TagName: req.Tag, + }) + + if err == nil { + body.Res = new(types.ListVStorageObjectsAttachedToTagResponse) + for _, ref := range refs { + body.Res.Returnval = append(body.Res.Returnval, types.ID{Id: ref.Value}) + } + } else { + body.Fault_ = Fault("", err) + } + + return body +} + +func (m *VcenterVStorageObjectManager) ListTagsAttachedToVStorageObject(ctx *Context, req *types.ListTagsAttachedToVStorageObject) soap.HasFault { + body := new(methods.ListTagsAttachedToVStorageObjectBody) + ref := m.tagID(req.Id) + + tags, err := ctx.Map.tagManager.AttachedTags(ref) + + if err == nil { + body.Res = &types.ListTagsAttachedToVStorageObjectResponse{ + Returnval: tags, + } + } else { + body.Fault_ = Fault("", err) + } + + return body +} + +func (m *VcenterVStorageObjectManager) VCenterUpdateVStorageObjectMetadataExTask(ctx *Context, req *types.VCenterUpdateVStorageObjectMetadataEx_Task) soap.HasFault { + task := CreateTask(m, "updateVStorageObjectMetadataEx", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj == nil { + return nil, new(types.InvalidArgument) + } + + var metadata []types.KeyValue + + remove := func(key string) bool { + for _, dk := range req.DeleteKeys { + if key == dk { + return true + } + } + return false + } + + for _, kv := range obj.Metadata { + if !remove(kv.Key) { + metadata = append(metadata, kv) + } + } + + update := func(kv types.KeyValue) bool { + for i := range obj.Metadata { + if obj.Metadata[i].Key == kv.Key { + obj.Metadata[i] = kv + return true + } + } + return false + } + + for _, kv := range req.Metadata { + if !update(kv) { + metadata = append(metadata, kv) + } + } + + obj.Metadata = metadata + + return nil, nil + }) + + return &methods.VCenterUpdateVStorageObjectMetadataEx_TaskBody{ + Res: &types.VCenterUpdateVStorageObjectMetadataEx_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go new file mode 100644 index 000000000..4b8d52d44 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go @@ -0,0 +1,335 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "archive/tar" + "bufio" + "bytes" + "compress/gzip" + "io" + "log" + "math" + "net/url" + "os" + "path/filepath" + "strings" + "sync" + "time" + + "github.com/vmware/govmomi/toolbox/vix" +) + +// ArchiveScheme is the default scheme used to register the archive FileHandler +var ArchiveScheme = "archive" + +// ArchiveHandler implements a FileHandler for transferring directories. +type ArchiveHandler struct { + Read func(*url.URL, *tar.Reader) error + Write func(*url.URL, *tar.Writer) error +} + +// NewArchiveHandler returns a FileHandler implementation for transferring directories using gzip'd tar files. +func NewArchiveHandler() FileHandler { + return &ArchiveHandler{ + Read: archiveRead, + Write: archiveWrite, + } +} + +// Stat implements FileHandler.Stat +func (*ArchiveHandler) Stat(u *url.URL) (os.FileInfo, error) { + switch u.Query().Get("format") { + case "", "tar", "tgz": + // ok + default: + log.Printf("unknown archive format: %q", u) + return nil, vix.Error(vix.InvalidArg) + } + + return &archive{ + name: u.Path, + size: math.MaxInt64, + }, nil +} + +// Open implements FileHandler.Open +func (h *ArchiveHandler) Open(u *url.URL, mode int32) (File, error) { + switch mode { + case OpenModeReadOnly: + return h.newArchiveFromGuest(u) + case OpenModeWriteOnly: + return h.newArchiveToGuest(u) + default: + return nil, os.ErrNotExist + } +} + +// archive implements the hgfs.File and os.FileInfo interfaces. +type archive struct { + name string + size int64 + done func() error + + io.Reader + io.Writer +} + +// Name implementation of the os.FileInfo interface method. +func (a *archive) Name() string { + return a.name +} + +// Size implementation of the os.FileInfo interface method. +func (a *archive) Size() int64 { + return a.size +} + +// Mode implementation of the os.FileInfo interface method. +func (a *archive) Mode() os.FileMode { + return 0600 +} + +// ModTime implementation of the os.FileInfo interface method. +func (a *archive) ModTime() time.Time { + return time.Now() +} + +// IsDir implementation of the os.FileInfo interface method. +func (a *archive) IsDir() bool { + return false +} + +// Sys implementation of the os.FileInfo interface method. +func (a *archive) Sys() any { + return nil +} + +// The trailer is required since TransferFromGuest requires a Content-Length, +// which toolbox doesn't know ahead of time as the gzip'd tarball never touches the disk. +// HTTP clients need to be aware of this and stop reading when they see the 2nd gzip header. +var gzipHeader = []byte{0x1f, 0x8b, 0x08} // rfc1952 {ID1, ID2, CM} + +var gzipTrailer = true + +// newArchiveFromGuest returns an hgfs.File implementation to read a directory as a gzip'd tar. +func (h *ArchiveHandler) newArchiveFromGuest(u *url.URL) (File, error) { + r, w := io.Pipe() + + a := &archive{ + name: u.Path, + done: r.Close, + Reader: r, + Writer: w, + } + + var z io.Writer = w + var c io.Closer = io.NopCloser(nil) + + switch u.Query().Get("format") { + case "tgz": + gz := gzip.NewWriter(w) + z = gz + c = gz + } + + tw := tar.NewWriter(z) + + go func() { + err := h.Write(u, tw) + + _ = tw.Close() + _ = c.Close() + if gzipTrailer { + _, _ = w.Write(gzipHeader) + } + _ = w.CloseWithError(err) + }() + + return a, nil +} + +// newArchiveToGuest returns an hgfs.File implementation to expand a gzip'd tar into a directory. +func (h *ArchiveHandler) newArchiveToGuest(u *url.URL) (File, error) { + r, w := io.Pipe() + + buf := bufio.NewReader(r) + + a := &archive{ + name: u.Path, + Reader: buf, + Writer: w, + } + + var cerr error + var wg sync.WaitGroup + + a.done = func() error { + _ = w.Close() + // We need to wait for unpack to finish to complete its work + // and to propagate the error if any to Close. + wg.Wait() + return cerr + } + + wg.Add(1) + go func() { + defer wg.Done() + + c := func() error { + // Drain the pipe of tar trailer data (two null blocks) + if cerr == nil { + _, _ = io.Copy(io.Discard, a.Reader) + } + return nil + } + + header, _ := buf.Peek(len(gzipHeader)) + + if bytes.Equal(header, gzipHeader) { + gz, err := gzip.NewReader(a.Reader) + if err != nil { + _ = r.CloseWithError(err) + cerr = err + return + } + + c = gz.Close + a.Reader = gz + } + + tr := tar.NewReader(a.Reader) + + cerr = h.Read(u, tr) + + _ = c() + _ = r.CloseWithError(cerr) + }() + + return a, nil +} + +func (a *archive) Close() error { + return a.done() +} + +// archiveRead writes the contents of the given tar.Reader to the given directory. +func archiveRead(u *url.URL, tr *tar.Reader) error { + for { + header, err := tr.Next() + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + // validate to prevent directory traversal + if strings.Contains(header.Name, "..") { + log.Printf("skipping invalid entry with '..' in name: %s", header.Name) + continue + } + + name := filepath.Join(u.Path, header.Name) + mode := os.FileMode(header.Mode) + + switch header.Typeflag { + case tar.TypeDir: + err = os.MkdirAll(name, mode) + case tar.TypeReg: + _ = os.MkdirAll(filepath.Dir(name), 0750) + + var f *os.File + + f, err = os.OpenFile(name, os.O_CREATE|os.O_RDWR|os.O_TRUNC, mode) + if err == nil { + _, cerr := io.Copy(f, tr) + err = f.Close() + if cerr != nil { + err = cerr + } + } + case tar.TypeSymlink: + err = os.Symlink(header.Linkname, name) + } + + // TODO: Uid/Gid may not be meaningful here without some mapping. + // The other option to consider would be making use of the guest auth user ID. + // os.Lchown(name, header.Uid, header.Gid) + + if err != nil { + return err + } + } +} + +// archiveWrite writes the contents of the given source directory to the given tar.Writer. +func archiveWrite(u *url.URL, tw *tar.Writer) error { + info, err := os.Stat(u.Path) + if err != nil { + return err + } + + // Note that the VMX will trim any trailing slash. For example: + // "/foo/bar/?prefix=bar/" will end up here as "/foo/bar/?prefix=bar" + // Escape to avoid this: "/for/bar/?prefix=bar%2F" + prefix := u.Query().Get("prefix") + + dir := u.Path + + f := func(file string, fi os.FileInfo, err error) error { + if err != nil { + return filepath.SkipDir + } + + name := strings.TrimPrefix(file, dir) + name = strings.TrimPrefix(name, "/") + + if name == "" { + return nil // this is u.Path itself (which may or may not have a trailing "/") + } + + if prefix != "" { + name = prefix + name + } + + header, _ := tar.FileInfoHeader(fi, name) + + header.Name = name + + if header.Typeflag == tar.TypeDir { + header.Name += "/" + } + + var f *os.File + + if header.Typeflag == tar.TypeReg && fi.Size() != 0 { + f, err = os.Open(filepath.Clean(file)) + if err != nil { + if os.IsPermission(err) { + return nil + } + return err + } + } + + _ = tw.WriteHeader(header) + + if f != nil { + _, err = io.Copy(tw, f) + _ = f.Close() + } + + return err + } + + if info.IsDir() { + return filepath.Walk(u.Path, f) + } + + dir = filepath.Dir(dir) + + return f(u.Path, info, nil) +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go new file mode 100644 index 000000000..fe6858f4d --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go @@ -0,0 +1,61 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "bytes" + "encoding" + "encoding/binary" +) + +// MarshalBinary is a wrapper around binary.Write +func MarshalBinary(fields ...any) ([]byte, error) { + buf := new(bytes.Buffer) + + for _, p := range fields { + switch m := p.(type) { + case encoding.BinaryMarshaler: + data, err := m.MarshalBinary() + if err != nil { + return nil, ProtocolError(err) + } + + _, _ = buf.Write(data) + case []byte: + _, _ = buf.Write(m) + case string: + _, _ = buf.WriteString(m) + default: + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, ProtocolError(err) + } + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary is a wrapper around binary.Read +func UnmarshalBinary(data []byte, fields ...any) error { + buf := bytes.NewBuffer(data) + + for _, p := range fields { + switch m := p.(type) { + case encoding.BinaryUnmarshaler: + return m.UnmarshalBinary(buf.Bytes()) + case *[]byte: + *m = buf.Bytes() + return nil + default: + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return ProtocolError(err) + } + } + } + + return nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go new file mode 100644 index 000000000..a6b0fe34b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go @@ -0,0 +1,46 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "os" + "syscall" +) + +const attrMask = AttrValidAllocationSize | + AttrValidAccessTime | AttrValidWriteTime | AttrValidCreateTime | AttrValidChangeTime | + AttrValidSpecialPerms | AttrValidOwnerPerms | AttrValidGroupPerms | AttrValidOtherPerms | AttrValidEffectivePerms | + AttrValidUserID | AttrValidGroupID | AttrValidFileID | AttrValidVolID + +func (a *AttrV2) sysStat(info os.FileInfo) { + sys, ok := info.Sys().(*syscall.Stat_t) + + if !ok { + return + } + + a.AllocationSize = uint64(sys.Blocks * 512) + + nt := func(t syscall.Timespec) uint64 { + return uint64(t.Nano()) // TODO: this is supposed to be Windows NT system time, not needed atm + } + + a.AccessTime = nt(sys.Atim) + a.WriteTime = nt(sys.Mtim) + a.CreationTime = a.WriteTime // see HgfsGetCreationTime + a.AttrChangeTime = nt(sys.Ctim) + + a.SpecialPerms = uint8((sys.Mode & (syscall.S_ISUID | syscall.S_ISGID | syscall.S_ISVTX)) >> 9) + a.OwnerPerms = uint8((sys.Mode & syscall.S_IRWXU) >> 6) + a.GroupPerms = uint8((sys.Mode & syscall.S_IRWXG) >> 3) + a.OtherPerms = uint8(sys.Mode & syscall.S_IRWXO) + + a.UserID = sys.Uid + a.GroupID = sys.Gid + a.HostFileID = sys.Ino + a.VolumeID = uint32(sys.Dev) + + a.Mask |= attrMask +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go new file mode 100644 index 000000000..1e8eb5453 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go @@ -0,0 +1,15 @@ +//go:build !linux +// +build !linux + +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "os" +) + +func (a *AttrV2) sysStat(info os.FileInfo) { +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go new file mode 100644 index 000000000..9c1b745f4 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go @@ -0,0 +1,835 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "bytes" + "encoding/binary" + "fmt" + "log" + "os" + "strings" +) + +// See: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/include/hgfsProto.h + +// Opcodes for server operations as defined in hgfsProto.h +const ( + OpOpen = iota /* Open file */ + OpRead /* Read from file */ + OpWrite /* Write to file */ + OpClose /* Close file */ + OpSearchOpen /* Start new search */ + OpSearchRead /* Get next search response */ + OpSearchClose /* End a search */ + OpGetattr /* Get file attributes */ + OpSetattr /* Set file attributes */ + OpCreateDir /* Create new directory */ + OpDeleteFile /* Delete a file */ + OpDeleteDir /* Delete a directory */ + OpRename /* Rename a file or directory */ + OpQueryVolumeInfo /* Query volume information */ + OpOpenV2 /* Open file */ + OpGetattrV2 /* Get file attributes */ + OpSetattrV2 /* Set file attributes */ + OpSearchReadV2 /* Get next search response */ + OpCreateSymlink /* Create a symlink */ + OpServerLockChange /* Change the oplock on a file */ + OpCreateDirV2 /* Create a directory */ + OpDeleteFileV2 /* Delete a file */ + OpDeleteDirV2 /* Delete a directory */ + OpRenameV2 /* Rename a file or directory */ + OpOpenV3 /* Open file */ + OpReadV3 /* Read from file */ + OpWriteV3 /* Write to file */ + OpCloseV3 /* Close file */ + OpSearchOpenV3 /* Start new search */ + OpSearchReadV3 /* Read V3 directory entries */ + OpSearchCloseV3 /* End a search */ + OpGetattrV3 /* Get file attributes */ + OpSetattrV3 /* Set file attributes */ + OpCreateDirV3 /* Create new directory */ + OpDeleteFileV3 /* Delete a file */ + OpDeleteDirV3 /* Delete a directory */ + OpRenameV3 /* Rename a file or directory */ + OpQueryVolumeInfoV3 /* Query volume information */ + OpCreateSymlinkV3 /* Create a symlink */ + OpServerLockChangeV3 /* Change the oplock on a file */ + OpWriteWin32StreamV3 /* Write WIN32_STREAM_ID format data to file */ + OpCreateSessionV4 /* Create a session and return host capabilities. */ + OpDestroySessionV4 /* Destroy/close session. */ + OpReadFastV4 /* Read */ + OpWriteFastV4 /* Write */ + OpSetWatchV4 /* Start monitoring directory changes. */ + OpRemoveWatchV4 /* Stop monitoring directory changes. */ + OpNotifyV4 /* Notification for a directory change event. */ + OpSearchReadV4 /* Read V4 directory entries. */ + OpOpenV4 /* Open file */ + OpEnumerateStreamsV4 /* Enumerate alternative named streams for a file. */ + OpGetattrV4 /* Get file attributes */ + OpSetattrV4 /* Set file attributes */ + OpDeleteV4 /* Delete a file or a directory */ + OpLinkmoveV4 /* Rename/move/create hard link. */ + OpFsctlV4 /* Sending FS control requests. */ + OpAccessCheckV4 /* Access check. */ + OpFsyncV4 /* Flush all cached data to the disk. */ + OpQueryVolumeInfoV4 /* Query volume information. */ + OpOplockAcquireV4 /* Acquire OPLOCK. */ + OpOplockBreakV4 /* Break or downgrade OPLOCK. */ + OpLockByteRangeV4 /* Acquire byte range lock. */ + OpUnlockByteRangeV4 /* Release byte range lock. */ + OpQueryEasV4 /* Query extended attributes. */ + OpSetEasV4 /* Add or modify extended attributes. */ + OpNewHeader = 0xff /* Header op, must be unique, distinguishes packet headers. */ +) + +// Status codes +const ( + StatusSuccess = iota + StatusNoSuchFileOrDir + StatusInvalidHandle + StatusOperationNotPermitted + StatusFileExists + StatusNotDirectory + StatusDirNotEmpty + StatusProtocolError + StatusAccessDenied + StatusInvalidName + StatusGenericError + StatusSharingViolation + StatusNoSpace + StatusOperationNotSupported + StatusNameTooLong + StatusInvalidParameter + StatusNotSameDevice + StatusStaleSession + StatusTooManySessions + StatusTransportError +) + +// Flags for attr mask +const ( + AttrValidType = 1 << iota + AttrValidSize + AttrValidCreateTime + AttrValidAccessTime + AttrValidWriteTime + AttrValidChangeTime + AttrValidSpecialPerms + AttrValidOwnerPerms + AttrValidGroupPerms + AttrValidOtherPerms + AttrValidFlags + AttrValidAllocationSize + AttrValidUserID + AttrValidGroupID + AttrValidFileID + AttrValidVolID + AttrValidNonStaticFileID + AttrValidEffectivePerms + AttrValidExtendAttrSize + AttrValidReparsePoint + AttrValidShortName +) + +// HeaderVersion for HGFS protocol version 4 +const HeaderVersion = 0x1 + +// LargePacketMax is maximum size of an hgfs packet +const LargePacketMax = 0xf800 // HGFS_LARGE_PACKET_MAX + +// Packet flags +const ( + PacketFlagRequest = 1 << iota + PacketFlagReply + PacketFlagInfoExterror + PacketFlagValidFlags = 0x7 +) + +// Status is an error type that encapsulates an error status code and the cause +type Status struct { + Err error + Code uint32 +} + +func (s *Status) Error() string { + if s.Err != nil { + return s.Err.Error() + } + + return fmt.Sprintf("hgfs.Status=%d", s.Code) +} + +// errorStatus maps the given error type to a status code +func errorStatus(err error) uint32 { + if x, ok := err.(*Status); ok { + return x.Code + } + + switch { + case os.IsNotExist(err): + return StatusNoSuchFileOrDir + case os.IsExist(err): + return StatusFileExists + case os.IsPermission(err): + return StatusOperationNotPermitted + } + + return StatusGenericError +} + +// ProtocolError wraps the given error as a Status type +func ProtocolError(err error) error { + return &Status{ + Err: err, + Code: StatusProtocolError, + } +} + +// Request as defined in hgfsProto.h:HgfsRequest +type Request struct { + Handle uint32 + Op int32 +} + +// Reply as defined in hgfsProto.h:HgfsReply +type Reply struct { + Handle uint32 + Status uint32 +} + +// Header as defined in hgfsProto.h:HgfsHeader +type Header struct { + Version uint8 + Reserved1 [3]uint8 + Dummy int32 + PacketSize uint32 + HeaderSize uint32 + RequestID uint32 + Op int32 + Status uint32 + Flags uint32 + Information uint32 + SessionID uint64 + Reserved uint64 +} + +var ( + headerSize = uint32(binary.Size(new(Header))) + + packetSize = func(r *Packet) uint32 { + return headerSize + uint32(len(r.Payload)) + } +) + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (h *Header) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, h) + if err != nil { + return fmt.Errorf("reading hgfs header: %s", err) + } + + if h.Dummy != OpNewHeader { + return fmt.Errorf("expected hgfs header with OpNewHeader (%#x), got: %#x", OpNewHeader, h.Dummy) + } + + return nil +} + +// Packet encapsulates an hgfs Header and Payload +type Packet struct { + Header + + Payload []byte +} + +// Reply composes a new Packet with the given payload or error +func (r *Packet) Reply(payload any, err error) ([]byte, error) { + p := new(Packet) + + status := uint32(StatusSuccess) + + if err != nil { + status = errorStatus(err) + } else { + p.Payload, err = MarshalBinary(payload) + if err != nil { + return nil, err + } + } + + p.Header = Header{ + Version: HeaderVersion, + Dummy: OpNewHeader, + PacketSize: headerSize + uint32(len(p.Payload)), + HeaderSize: headerSize, + RequestID: r.RequestID, + Op: r.Op, + Status: status, + Flags: PacketFlagReply, + Information: 0, + SessionID: r.SessionID, + } + + if Trace { + rc := "OK" + if err != nil { + rc = err.Error() + } + fmt.Fprintf(os.Stderr, "[hgfs] response %#v [%s]\n", p.Header, rc) + } else if err != nil { + log.Printf("[hgfs] op=%d error: %s", r.Op, err) + } + + return p.MarshalBinary() +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *Packet) MarshalBinary() ([]byte, error) { + r.Header.PacketSize = packetSize(r) + + buf, _ := MarshalBinary(r.Header) + + return append(buf, r.Payload...), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *Packet) UnmarshalBinary(data []byte) error { + err := r.Header.UnmarshalBinary(data) + if err != nil { + return err + } + + r.Payload = data[r.HeaderSize:r.PacketSize] + + return nil +} + +// Capability as defined in hgfsProto.h:HgfsCapability +type Capability struct { + Op int32 + Flags uint32 +} + +// RequestCreateSessionV4 as defined in hgfsProto.h:HgfsRequestCreateSessionV4 +type RequestCreateSessionV4 struct { + NumCapabilities uint32 + MaxPacketSize uint32 + Flags uint32 + Reserved uint32 + Capabilities []Capability +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestCreateSessionV4) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.NumCapabilities = uint32(len(r.Capabilities)) + + fields := []*uint32{ + &r.NumCapabilities, + &r.MaxPacketSize, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + err := binary.Write(buf, binary.LittleEndian, &r.Capabilities[i]) + if err != nil { + return nil, err + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestCreateSessionV4) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []*uint32{ + &r.NumCapabilities, + &r.MaxPacketSize, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + var cap Capability + err := binary.Read(buf, binary.LittleEndian, &cap) + if err != nil { + return err + } + + r.Capabilities = append(r.Capabilities, cap) + } + + return nil +} + +// ReplyCreateSessionV4 as defined in hgfsProto.h:HgfsReplyCreateSessionV4 +type ReplyCreateSessionV4 struct { + SessionID uint64 + NumCapabilities uint32 + MaxPacketSize uint32 + IdentityOffset uint32 + Flags uint32 + Reserved uint32 + Capabilities []Capability +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyCreateSessionV4) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + fields := []any{ + &r.SessionID, + &r.NumCapabilities, + &r.MaxPacketSize, + &r.IdentityOffset, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + err := binary.Write(buf, binary.LittleEndian, &r.Capabilities[i]) + if err != nil { + return nil, err + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyCreateSessionV4) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []any{ + &r.SessionID, + &r.NumCapabilities, + &r.MaxPacketSize, + &r.IdentityOffset, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + var cap Capability + err := binary.Read(buf, binary.LittleEndian, &cap) + if err != nil { + return err + } + + r.Capabilities = append(r.Capabilities, cap) + } + + return nil +} + +// RequestDestroySessionV4 as defined in hgfsProto.h:HgfsRequestDestroySessionV4 +type RequestDestroySessionV4 struct { + Reserved uint64 +} + +// ReplyDestroySessionV4 as defined in hgfsProto.h:HgfsReplyDestroySessionV4 +type ReplyDestroySessionV4 struct { + Reserved uint64 +} + +// FileName as defined in hgfsProto.h:HgfsFileName +type FileName struct { + Length uint32 + Name string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (f *FileName) MarshalBinary() ([]byte, error) { + name := f.Name + f.Length = uint32(len(f.Name)) + if f.Length == 0 { + // field is defined as 'char name[1];', this byte is required for min sizeof() validation + name = "\x00" + } + return MarshalBinary(&f.Length, name) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (f *FileName) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + _ = binary.Read(buf, binary.LittleEndian, &f.Length) + + f.Name = string(buf.Next(int(f.Length))) + + return nil +} + +const serverPolicyRootShareName = "root" + +// FromString converts name to a FileName +func (f *FileName) FromString(name string) { + name = strings.TrimPrefix(name, "/") + + cp := strings.Split(name, "/") + + cp = append([]string{serverPolicyRootShareName}, cp...) + + f.Name = strings.Join(cp, "\x00") + f.Length = uint32(len(f.Name)) +} + +// Path converts FileName to a string +func (f *FileName) Path() string { + cp := strings.Split(f.Name, "\x00") + + if len(cp) == 0 || cp[0] != serverPolicyRootShareName { + return "" // TODO: not happening until if/when we handle Windows shares + } + + cp[0] = "" + + return strings.Join(cp, "/") +} + +// FileNameV3 as defined in hgfsProto.h:HgfsFileNameV3 +type FileNameV3 struct { + Length uint32 + Flags uint32 + CaseType int32 + ID uint32 + Name string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (f *FileNameV3) MarshalBinary() ([]byte, error) { + name := f.Name + f.Length = uint32(len(f.Name)) + if f.Length == 0 { + // field is defined as 'char name[1];', this byte is required for min sizeof() validation + name = "\x00" + } + return MarshalBinary(&f.Length, &f.Flags, &f.CaseType, &f.ID, name) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (f *FileNameV3) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []any{ + &f.Length, &f.Flags, &f.CaseType, &f.ID, + } + + for _, p := range fields { + if err := binary.Read(buf, binary.LittleEndian, p); err != nil { + return err + } + } + + f.Name = string(buf.Next(int(f.Length))) + + return nil +} + +// FromString converts name to a FileNameV3 +func (f *FileNameV3) FromString(name string) { + p := new(FileName) + p.FromString(name) + f.Name = p.Name + f.Length = p.Length +} + +// Path converts FileNameV3 to a string +func (f *FileNameV3) Path() string { + return (&FileName{Name: f.Name, Length: f.Length}).Path() +} + +// FileType +const ( + FileTypeRegular = iota + FileTypeDirectory + FileTypeSymlink +) + +// AttrV2 as defined in hgfsProto.h:HgfsAttrV2 +type AttrV2 struct { + Mask uint64 + Type int32 + Size uint64 + CreationTime uint64 + AccessTime uint64 + WriteTime uint64 + AttrChangeTime uint64 + SpecialPerms uint8 + OwnerPerms uint8 + GroupPerms uint8 + OtherPerms uint8 + AttrFlags uint64 + AllocationSize uint64 + UserID uint32 + GroupID uint32 + HostFileID uint64 + VolumeID uint32 + EffectivePerms uint32 + Reserved2 uint64 +} + +// RequestGetattrV2 as defined in hgfsProto.h:HgfsRequestGetattrV2 +type RequestGetattrV2 struct { + Request + AttrHint uint64 + Handle uint32 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestGetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.AttrHint, &r.Handle, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestGetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.AttrHint, &r.Handle, &r.FileName) +} + +// ReplyGetattrV2 as defined in hgfsProto.h:HgfsReplyGetattrV2 +type ReplyGetattrV2 struct { + Reply + Attr AttrV2 + SymlinkTarget FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyGetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Reply, &r.Attr, &r.SymlinkTarget) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyGetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Reply, &r.Attr, &r.SymlinkTarget) +} + +// RequestSetattrV2 as defined in hgfsProto.h:HgfsRequestSetattrV2 +type RequestSetattrV2 struct { + Request + Hints uint64 + Attr AttrV2 + Handle uint32 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestSetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.Hints, &r.Attr, &r.Handle, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestSetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.Hints, &r.Attr, &r.Handle, &r.FileName) +} + +// ReplySetattrV2 as defined in hgfsProto.h:HgfsReplySetattrV2 +type ReplySetattrV2 struct { + Header Reply +} + +// OpenMode +const ( + OpenModeReadOnly = iota + OpenModeWriteOnly + OpenModeReadWrite + OpenModeAccmodes +) + +// OpenFlags +const ( + Open = iota + OpenEmpty + OpenCreate + OpenCreateSafe + OpenCreateEmpty +) + +// Permissions +const ( + PermRead = 4 + PermWrite = 2 + PermExec = 1 +) + +// RequestOpen as defined in hgfsProto.h:HgfsRequestOpen +type RequestOpen struct { + Request + OpenMode int32 + OpenFlags int32 + Permissions uint8 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestOpen) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.OpenMode, &r.OpenFlags, r.Permissions, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestOpen) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.OpenMode, &r.OpenFlags, &r.Permissions, &r.FileName) +} + +// ReplyOpen as defined in hgfsProto.h:HgfsReplyOpen +type ReplyOpen struct { + Reply + Handle uint32 +} + +// RequestClose as defined in hgfsProto.h:HgfsRequestClose +type RequestClose struct { + Request + Handle uint32 +} + +// ReplyClose as defined in hgfsProto.h:HgfsReplyClose +type ReplyClose struct { + Reply +} + +// Lock type +const ( + LockNone = iota + LockOpportunistic + LockExclusive + LockShared + LockBatch + LockLease +) + +// RequestOpenV3 as defined in hgfsProto.h:HgfsRequestOpenV3 +type RequestOpenV3 struct { + Mask uint64 + OpenMode int32 + OpenFlags int32 + SpecialPerms uint8 + OwnerPerms uint8 + GroupPerms uint8 + OtherPerms uint8 + AttrFlags uint64 + AllocationSize uint64 + DesiredAccess uint32 + ShareAccess uint32 + DesiredLock int32 + Reserved1 uint64 + Reserved2 uint64 + FileName FileNameV3 +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestOpenV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Mask, &r.OpenMode, &r.OpenFlags, + &r.SpecialPerms, &r.OwnerPerms, &r.GroupPerms, &r.OtherPerms, + &r.AttrFlags, &r.AllocationSize, &r.DesiredAccess, &r.ShareAccess, + &r.DesiredLock, &r.Reserved1, &r.Reserved2, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestOpenV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Mask, &r.OpenMode, &r.OpenFlags, + &r.SpecialPerms, &r.OwnerPerms, &r.GroupPerms, &r.OtherPerms, + &r.AttrFlags, &r.AllocationSize, &r.DesiredAccess, &r.ShareAccess, + &r.DesiredLock, &r.Reserved1, &r.Reserved2, &r.FileName) +} + +// ReplyOpenV3 as defined in hgfsProto.h:HgfsReplyOpenV3 +type ReplyOpenV3 struct { + Handle uint32 + AcquiredLock int32 + Flags int32 + Reserved uint32 +} + +// RequestReadV3 as defined in hgfsProto.h:HgfsRequestReadV3 +type RequestReadV3 struct { + Handle uint32 + Offset uint64 + RequiredSize uint32 + Reserved uint64 +} + +// ReplyReadV3 as defined in hgfsProto.h:HgfsReplyReadV3 +type ReplyReadV3 struct { + ActualSize uint32 + Reserved uint64 + Payload []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyReadV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.ActualSize, &r.Reserved, r.Payload) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyReadV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.ActualSize, &r.Reserved, &r.Payload) +} + +// Write flags +const ( + WriteAppend = 1 +) + +// RequestWriteV3 as defined in hgfsProto.h:HgfsRequestWriteV3 +type RequestWriteV3 struct { + Handle uint32 + WriteFlags uint8 + Offset uint64 + RequiredSize uint32 + Reserved uint64 + Payload []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestWriteV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Handle, &r.WriteFlags, &r.Offset, &r.RequiredSize, &r.Reserved, r.Payload) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestWriteV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Handle, &r.WriteFlags, &r.Offset, &r.RequiredSize, &r.Reserved, &r.Payload) +} + +// ReplyWriteV3 as defined in hgfsProto.h:HgfsReplyWriteV3 +type ReplyWriteV3 struct { + ActualSize uint32 + Reserved uint64 +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go new file mode 100644 index 000000000..80510d87f --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go @@ -0,0 +1,573 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package hgfs + +import ( + "errors" + "flag" + "fmt" + "io" + "log" + "math/rand" + "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "sync" + "sync/atomic" +) + +// See: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/hgfsServer/hgfsServer.c + +var ( + // Trace enables hgfs packet tracing + Trace = false +) + +// Server provides an HGFS protocol implementation to support guest tools VmxiHgfsSendPacketCommand +type Server struct { + Capabilities []Capability + + handlers map[int32]func(*Packet) (any, error) + schemes map[string]FileHandler + sessions map[uint64]*session + mu sync.Mutex + handle uint32 + + chmod func(string, os.FileMode) error + chown func(string, int, int) error +} + +// NewServer creates a new Server instance with the default handlers +func NewServer() *Server { + if f := flag.Lookup("toolbox.trace"); f != nil { + Trace, _ = strconv.ParseBool(f.Value.String()) + } + + s := &Server{ + sessions: make(map[uint64]*session), + schemes: make(map[string]FileHandler), + chmod: os.Chmod, + chown: os.Chown, + } + + s.handlers = map[int32]func(*Packet) (any, error){ + OpCreateSessionV4: s.CreateSessionV4, + OpDestroySessionV4: s.DestroySessionV4, + OpGetattrV2: s.GetattrV2, + OpSetattrV2: s.SetattrV2, + OpOpen: s.Open, + OpClose: s.Close, + OpOpenV3: s.OpenV3, + OpReadV3: s.ReadV3, + OpWriteV3: s.WriteV3, + } + + for op := range s.handlers { + s.Capabilities = append(s.Capabilities, Capability{Op: op, Flags: 0x1}) + } + + return s +} + +// RegisterFileHandler enables dispatch to handler for the given scheme. +func (s *Server) RegisterFileHandler(scheme string, handler FileHandler) { + if handler == nil { + delete(s.schemes, scheme) + return + } + s.schemes[scheme] = handler +} + +// Dispatch unpacks the given request packet and dispatches to the appropriate handler +func (s *Server) Dispatch(packet []byte) ([]byte, error) { + req := &Packet{} + + err := req.UnmarshalBinary(packet) + if err != nil { + return nil, err + } + + if Trace { + fmt.Fprintf(os.Stderr, "[hgfs] request %#v\n", req.Header) + } + + var res any + + handler, ok := s.handlers[req.Op] + if ok { + res, err = handler(req) + } else { + err = &Status{ + Code: StatusOperationNotSupported, + Err: fmt.Errorf("unsupported Op(%d)", req.Op), + } + } + + return req.Reply(res, err) +} + +// File interface abstracts standard i/o methods to support transfer +// of regular files and archives of directories. +type File interface { + io.Reader + io.Writer + io.Closer + + Name() string +} + +// FileHandler is the plugin interface for hgfs file transport. +type FileHandler interface { + Stat(*url.URL) (os.FileInfo, error) + Open(*url.URL, int32) (File, error) +} + +// urlParse attempts to convert the given name to a URL with scheme for use as FileHandler dispatch. +func urlParse(name string) *url.URL { + var info os.FileInfo + + u, err := url.Parse(name) + if err == nil && u.Scheme == "" { + info, err = os.Stat(u.Path) + if err == nil && info.IsDir() { + u.Scheme = ArchiveScheme // special case for IsDir() + return u + } + } + + u, err = url.Parse(strings.TrimPrefix(name, "/")) // must appear to be an absolute path or hgfs errors + if err != nil { + u = &url.URL{Path: name} + } + + if u.Scheme == "" { + ix := strings.Index(u.Path, "/") + if ix > 0 { + u.Scheme = u.Path[:ix] + u.Path = u.Path[ix:] + } + } + + return u +} + +// OpenFile selects the File implementation based on file type and mode. +func (s *Server) OpenFile(name string, mode int32) (File, error) { + u := urlParse(name) + + if h, ok := s.schemes[u.Scheme]; ok { + f, serr := h.Open(u, mode) + if serr != os.ErrNotExist { + return f, serr + } + } + + switch mode { + case OpenModeReadOnly: + return os.Open(filepath.Clean(name)) + case OpenModeWriteOnly: + flag := os.O_WRONLY | os.O_CREATE | os.O_TRUNC + return os.OpenFile(name, flag, 0600) + default: + return nil, &Status{ + Err: fmt.Errorf("open mode(%d) not supported for file %q", mode, name), + Code: StatusAccessDenied, + } + } +} + +// Stat wraps os.Stat such that we can report directory types as regular files to support archive streaming. +// In the case of standard vmware-tools, attempts to transfer directories result +// with a VIX_E_NOT_A_FILE (see InitiateFileTransfer{To,From}Guest). +// Note that callers on the VMX side that reach this path are only concerned with: +// - does the file exist? +// - size: +// + used for UI progress with desktop Drag-N-Drop operations, which toolbox does not support. +// + sent to as Content-Length header in response to GET of FileTransferInformation.Url, +// if the first ReadV3 size is > HGFS_LARGE_PACKET_MAX +func (s *Server) Stat(name string) (os.FileInfo, error) { + u := urlParse(name) + + if h, ok := s.schemes[u.Scheme]; ok { + sinfo, serr := h.Stat(u) + if serr != os.ErrNotExist { + return sinfo, serr + } + } + + return os.Stat(name) +} + +type session struct { + files map[uint32]File + mu sync.Mutex +} + +// TODO: we currently depend on the VMX to close files and remove sessions, +// which it does provided it can communicate with the toolbox. Let's look at +// adding session expiration when implementing OpenModeWriteOnly support. +func newSession() *session { + return &session{ + files: make(map[uint32]File), + } +} + +func (s *Server) getSession(p *Packet) (*session, error) { + s.mu.Lock() + session, ok := s.sessions[p.SessionID] + s.mu.Unlock() + + if !ok { + return nil, &Status{ + Code: StatusStaleSession, + Err: errors.New("session not found"), + } + } + + return session, nil +} + +func (s *Server) removeSession(id uint64) bool { + s.mu.Lock() + session, ok := s.sessions[id] + delete(s.sessions, id) + s.mu.Unlock() + + if !ok { + return false + } + + session.mu.Lock() + defer session.mu.Unlock() + + for _, f := range session.files { + log.Printf("[hgfs] session %X removed with open file: %s", id, f.Name()) + _ = f.Close() + } + + return true +} + +// open-vm-tools' session max is 1024, there shouldn't be more than a handful at a given time in our use cases +const maxSessions = 24 + +// CreateSessionV4 handls OpCreateSessionV4 requests +func (s *Server) CreateSessionV4(p *Packet) (any, error) { + const SessionMaxPacketSizeValid = 0x1 + + req := new(RequestCreateSessionV4) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + res := &ReplyCreateSessionV4{ + SessionID: uint64(rand.Int63()), + NumCapabilities: uint32(len(s.Capabilities)), + MaxPacketSize: LargePacketMax, + Flags: SessionMaxPacketSizeValid, + Capabilities: s.Capabilities, + } + + s.mu.Lock() + defer s.mu.Unlock() + if len(s.sessions) > maxSessions { + return nil, &Status{Code: StatusTooManySessions} + } + + s.sessions[res.SessionID] = newSession() + + return res, nil +} + +// DestroySessionV4 handls OpDestroySessionV4 requests +func (s *Server) DestroySessionV4(p *Packet) (any, error) { + if s.removeSession(p.SessionID) { + return &ReplyDestroySessionV4{}, nil + } + + return nil, &Status{Code: StatusStaleSession} +} + +// Stat maps os.FileInfo to AttrV2 +func (a *AttrV2) Stat(info os.FileInfo) { + switch { + case info.IsDir(): + a.Type = FileTypeDirectory + case info.Mode()&os.ModeSymlink == os.ModeSymlink: + a.Type = FileTypeSymlink + default: + a.Type = FileTypeRegular + } + + a.Size = uint64(info.Size()) + + a.Mask = AttrValidType | AttrValidSize + + a.sysStat(info) +} + +// GetattrV2 handles OpGetattrV2 requests +func (s *Server) GetattrV2(p *Packet) (any, error) { + res := &ReplyGetattrV2{} + + req := new(RequestGetattrV2) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + info, err := s.Stat(name) + if err != nil { + return nil, err + } + + res.Attr.Stat(info) + + return res, nil +} + +// SetattrV2 handles OpSetattrV2 requests +func (s *Server) SetattrV2(p *Packet) (any, error) { + res := &ReplySetattrV2{} + + req := new(RequestSetattrV2) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + + _, err = os.Stat(name) + if err != nil && os.IsNotExist(err) { + // assuming this is a virtual file + return res, nil + } + + uid := -1 + if req.Attr.Mask&AttrValidUserID == AttrValidUserID { + uid = int(req.Attr.UserID) + } + + gid := -1 + if req.Attr.Mask&AttrValidGroupID == AttrValidGroupID { + gid = int(req.Attr.GroupID) + } + + err = s.chown(name, uid, gid) + if err != nil { + return nil, err + } + + var perm os.FileMode + + if req.Attr.Mask&AttrValidOwnerPerms == AttrValidOwnerPerms { + perm |= os.FileMode(req.Attr.OwnerPerms) << 6 + } + + if req.Attr.Mask&AttrValidGroupPerms == AttrValidGroupPerms { + perm |= os.FileMode(req.Attr.GroupPerms) << 3 + } + + if req.Attr.Mask&AttrValidOtherPerms == AttrValidOtherPerms { + perm |= os.FileMode(req.Attr.OtherPerms) + } + + if perm != 0 { + err = s.chmod(name, perm) + if err != nil { + return nil, err + } + } + + return res, nil +} + +func (s *Server) newHandle() uint32 { + return atomic.AddUint32(&s.handle, 1) +} + +// Open handles OpOpen requests +func (s *Server) Open(p *Packet) (any, error) { + req := new(RequestOpen) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + mode := req.OpenMode + + if mode != OpenModeReadOnly { + return nil, &Status{ + Err: fmt.Errorf("open mode(%d) not supported for file %q", mode, name), + Code: StatusAccessDenied, + } + } + + file, err := s.OpenFile(name, mode) + if err != nil { + return nil, err + } + + res := &ReplyOpen{ + Handle: s.newHandle(), + } + + session.mu.Lock() + session.files[res.Handle] = file + session.mu.Unlock() + + return res, nil +} + +// Close handles OpClose requests +func (s *Server) Close(p *Packet) (any, error) { + req := new(RequestClose) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + if ok { + delete(session.files, req.Handle) + } + session.mu.Unlock() + + if ok { + err = file.Close() + } else { + return nil, &Status{Code: StatusInvalidHandle} + } + + return &ReplyClose{}, err +} + +// OpenV3 handles OpOpenV3 requests +func (s *Server) OpenV3(p *Packet) (any, error) { + req := new(RequestOpenV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + + if req.DesiredLock != LockNone { + return nil, &Status{ + Err: fmt.Errorf("open lock type=%d not supported for file %q", req.DesiredLock, name), + Code: StatusOperationNotSupported, + } + } + + file, err := s.OpenFile(name, req.OpenMode) + if err != nil { + return nil, err + } + + res := &ReplyOpenV3{ + Handle: s.newHandle(), + } + + session.mu.Lock() + session.files[res.Handle] = file + session.mu.Unlock() + + return res, nil +} + +// ReadV3 handles OpReadV3 requests +func (s *Server) ReadV3(p *Packet) (any, error) { + req := new(RequestReadV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + session.mu.Unlock() + + if !ok { + return nil, &Status{Code: StatusInvalidHandle} + } + + buf := make([]byte, req.RequiredSize) + + // Use ReadFull as Read() of an archive io.Pipe may return much smaller chunks, + // such as when we've read a tar header. + n, err := io.ReadFull(file, buf) + if err != nil && n == 0 { + if err != io.EOF { + return nil, err + } + } + + res := &ReplyReadV3{ + ActualSize: uint32(n), + Payload: buf[:n], + } + + return res, nil +} + +// WriteV3 handles OpWriteV3 requests +func (s *Server) WriteV3(p *Packet) (any, error) { + req := new(RequestWriteV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + session.mu.Unlock() + + if !ok { + return nil, &Status{Code: StatusInvalidHandle} + } + + n, err := file.Write(req.Payload) + if err != nil { + return nil, err + } + + res := &ReplyWriteV3{ + ActualSize: uint32(n), + } + + return res, nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/process/process.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/process/process.go new file mode 100644 index 000000000..f1ae3f317 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/process/process.go @@ -0,0 +1,628 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package process + +import ( + "bytes" + "context" + "fmt" + "io" + "net" + "net/url" + "os" + "os/exec" + "path" + "path/filepath" + "strconv" + "strings" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/vmware/govmomi/toolbox/hgfs" + "github.com/vmware/govmomi/toolbox/vix" +) + +var ( + EscapeXML *strings.Replacer + + shell = "/bin/sh" + + defaultOwner = os.Getenv("USER") +) + +func init() { + // See: VixToolsEscapeXMLString + chars := []string{ + `"`, + "%", + "&", + "'", + "<", + ">", + } + + replace := make([]string, 0, len(chars)*2) + + for _, c := range chars { + replace = append(replace, c) + replace = append(replace, url.QueryEscape(c)) + } + + EscapeXML = strings.NewReplacer(replace...) + + // See procMgrPosix.c:ProcMgrStartProcess: + // Prefer bash -c as is uses exec() to replace itself, + // whereas bourne shell does a fork & exec, so two processes are started. + if sh, err := exec.LookPath("bash"); err != nil { + shell = sh + } + + if defaultOwner == "" { + defaultOwner = "toolbox" + } +} + +// IO encapsulates IO for Go functions and OS commands such that they can interact via the OperationsManager +// without file system disk IO. +type IO struct { + In struct { + io.Writer + io.Reader + io.Closer // Closer for the write side of the pipe, can be closed via hgfs ops (FileTranfserToGuest) + } + + Out *bytes.Buffer + Err *bytes.Buffer +} + +// State is the toolbox representation of the GuestProcessInfo type +type State struct { + StartTime int64 // (keep first to ensure 64-bit alignment) + EndTime int64 // (keep first to ensure 64-bit alignment) + + Name string + Args string + Owner string + Pid int64 + ExitCode int32 + + IO *IO +} + +// WithIO enables toolbox Process IO without file system disk IO. +func (p *Process) WithIO() *Process { + p.IO = &IO{ + Out: new(bytes.Buffer), + Err: new(bytes.Buffer), + } + + return p +} + +// File implements the os.FileInfo interface to enable toolbox interaction with virtual files. +type File struct { + io.Reader + io.Writer + io.Closer + + name string + size int +} + +// Name implementation of the os.FileInfo interface method. +func (a *File) Name() string { + return a.name +} + +// Size implementation of the os.FileInfo interface method. +func (a *File) Size() int64 { + return int64(a.size) +} + +// Mode implementation of the os.FileInfo interface method. +func (a *File) Mode() os.FileMode { + if strings.HasSuffix(a.name, "stdin") { + return 0200 + } + return 0400 +} + +// ModTime implementation of the os.FileInfo interface method. +func (a *File) ModTime() time.Time { + return time.Now() +} + +// IsDir implementation of the os.FileInfo interface method. +func (a *File) IsDir() bool { + return false +} + +// Sys implementation of the os.FileInfo interface method. +func (a *File) Sys() any { + return nil +} + +func (s *State) toXML() string { + const format = "" + + "%s" + + "%s" + + "%d" + + "%s" + + "%d" + + "%d" + + "%d" + + "" + + name := filepath.Base(s.Name) + + argv := []string{s.Name} + + if len(s.Args) != 0 { + argv = append(argv, EscapeXML.Replace(s.Args)) + } + + args := strings.Join(argv, " ") + + return fmt.Sprintf(format, name, args, s.Pid, s.Owner, s.StartTime, s.ExitCode, s.EndTime) +} + +// Process managed by the process Manager. +type Process struct { + State + + Start func(*Process, *vix.StartProgramRequest) (int64, error) + Wait func() error + Kill context.CancelFunc + + ctx context.Context +} + +// Error can be returned by the Process.Wait function to propagate ExitCode to process State. +type Error struct { + Err error + ExitCode int32 +} + +func (e *Error) Error() string { + return e.Err.Error() +} + +// Manager manages processes within the guest. +// See: https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/vim.vm.guest.Manager.html +type Manager struct { + wg sync.WaitGroup + mu sync.Mutex + expire time.Duration + entries map[int64]*Process + pids sync.Pool +} + +// NewManager creates a new process Manager instance. +func NewManager() *Manager { + // We use pseudo PIDs that don't conflict with OS PIDs, so they can live in the same table. + // For the pseudo PIDs, we use a sync.Pool rather than a plain old counter to avoid the unlikely, + // but possible wrapping should such a counter exceed MaxInt64. + pid := int64(32768) // TODO: /proc/sys/kernel/pid_max + + return &Manager{ + expire: time.Minute * 5, + entries: make(map[int64]*Process), + pids: sync.Pool{ + New: func() any { + return atomic.AddInt64(&pid, 1) + }, + }, + } +} + +// Start calls the Process.Start function, returning the pid on success or an error. +// A goroutine is started that calls the Process.Wait function. After Process.Wait has +// returned, the process State EndTime and ExitCode fields are set. The process state can be +// queried via ListProcessesInGuest until it is removed, 5 minutes after Wait returns. +func (m *Manager) Start(r *vix.StartProgramRequest, p *Process) (int64, error) { + p.Name = r.ProgramPath + p.Args = r.Arguments + + // Owner is cosmetic, but useful for example with: govc guest.ps -U $uid + if p.Owner == "" { + p.Owner = defaultOwner + } + + p.StartTime = time.Now().Unix() + + p.ctx, p.Kill = context.WithCancel(context.Background()) + + pid, err := p.Start(p, r) + if err != nil { + return -1, err + } + + if pid == 0 { + p.Pid = m.pids.Get().(int64) // pseudo pid for funcs + } else { + p.Pid = pid + } + + m.mu.Lock() + m.entries[p.Pid] = p + m.mu.Unlock() + + m.wg.Add(1) + go func() { + werr := p.Wait() + + m.mu.Lock() + p.EndTime = time.Now().Unix() + + if werr != nil { + rc := int32(1) + if xerr, ok := werr.(*Error); ok { + rc = xerr.ExitCode + } + + p.ExitCode = rc + } + + m.mu.Unlock() + m.wg.Done() + p.Kill() // cancel context for those waiting on p.ctx.Done() + + // See: https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/vim.vm.guest.ProcessManager.ProcessInfo.html + // "If the process was started using StartProgramInGuest then the process completion time + // will be available if queried within 5 minutes after it completes." + <-time.After(m.expire) + + m.mu.Lock() + delete(m.entries, p.Pid) + m.mu.Unlock() + + if pid == 0 { + m.pids.Put(p.Pid) // pseudo pid can be reused now + } + }() + + return p.Pid, nil +} + +// Kill cancels the Process Context. +// Returns true if pid exists in the process table, false otherwise. +func (m *Manager) Kill(pid int64) bool { + m.mu.Lock() + entry, ok := m.entries[pid] + m.mu.Unlock() + + if ok { + entry.Kill() + return true + } + + return false +} + +// ListProcesses marshals the process State for the given pids. +// If no pids are specified, all current processes are included. +// The return value can be used for responding to a VixMsgListProcessesExRequest. +func (m *Manager) ListProcesses(pids []int64) []byte { + w := new(bytes.Buffer) + + for _, p := range m.List(pids) { + _, _ = w.WriteString(p.toXML()) + } + + return w.Bytes() +} + +// List the process State for the given pids. +func (m *Manager) List(pids []int64) []State { + var list []State + + m.mu.Lock() + + if len(pids) == 0 { + for _, p := range m.entries { + list = append(list, p.State) + } + } else { + for _, id := range pids { + p, ok := m.entries[id] + if !ok { + continue + } + + list = append(list, p.State) + } + } + + m.mu.Unlock() + + return list +} + +type procFileInfo struct { + os.FileInfo +} + +// Size returns hgfs.LargePacketMax such that InitiateFileTransferFromGuest can download a /proc/ file from the guest. +// If we were to return the size '0' here, then a 'Content-Length: 0' header is returned by VC/ESX. +func (p procFileInfo) Size() int64 { + return hgfs.LargePacketMax // Remember, Sully, when I promised to kill you last? I lied. +} + +// Stat implements hgfs.FileHandler.Stat +func (m *Manager) Stat(u *url.URL) (os.FileInfo, error) { + name := path.Join("/proc", u.Path) + + info, err := os.Stat(name) + if err == nil && info.Size() == 0 { + // This is a real /proc file + return &procFileInfo{info}, nil + } + + dir, file := path.Split(u.Path) + + pid, err := strconv.ParseInt(path.Base(dir), 10, 64) + if err != nil { + return nil, os.ErrNotExist + } + + m.mu.Lock() + p := m.entries[pid] + m.mu.Unlock() + + if p == nil || p.IO == nil { + return nil, os.ErrNotExist + } + + pf := &File{ + name: name, + Closer: io.NopCloser(nil), // via hgfs, nop for stdout and stderr + } + + var r *bytes.Buffer + + switch file { + case "stdin": + pf.Writer = p.IO.In.Writer + pf.Closer = p.IO.In.Closer + return pf, nil + case "stdout": + r = p.IO.Out + case "stderr": + r = p.IO.Err + default: + return nil, os.ErrNotExist + } + + select { + case <-p.ctx.Done(): + case <-time.After(time.Second): + // The vmx guest RPC calls are queue based, serialized on the vmx side. + // There are 5 seconds between "ping" RPC calls and after a few misses, + // the vmx considers tools as not running. In this case, the vmx would timeout + // a file transfer after 60 seconds. + // + // vix.FileAccessError is converted to a CannotAccessFile fault, + // so the client can choose to retry the transfer in this case. + // Would have preferred vix.ObjectIsBusy (EBUSY), but VC/ESX converts that + // to a general SystemErrorFault with nothing but a localized string message + // to check against: "vix error codes = (5, 0)." + // Is standard vmware-tools, EACCES is converted to a CannotAccessFile fault. + return nil, vix.Error(vix.FileAccessError) + } + + pf.Reader = r + pf.size = r.Len() + + return pf, nil +} + +// Open implements hgfs.FileHandler.Open +func (m *Manager) Open(u *url.URL, mode int32) (hgfs.File, error) { + info, err := m.Stat(u) + if err != nil { + return nil, err + } + + pinfo, ok := info.(*File) + + if !ok { + return nil, os.ErrNotExist // fall through to default os.Open + } + + switch path.Base(u.Path) { + case "stdin": + if mode != hgfs.OpenModeWriteOnly { + return nil, vix.Error(vix.InvalidArg) + } + case "stdout", "stderr": + if mode != hgfs.OpenModeReadOnly { + return nil, vix.Error(vix.InvalidArg) + } + } + + return pinfo, nil +} + +type processFunc struct { + wg sync.WaitGroup + + run func(context.Context, string) error + + err error +} + +// NewFunc creates a new Process, where the Start function calls the given run function within a goroutine. +// The Wait function waits for the goroutine to finish and returns the error returned by run. +// The run ctx param may be used to return early via the process Manager.Kill method. +// The run args command is that of the VixMsgStartProgramRequest.Arguments field. +func NewFunc(run func(ctx context.Context, args string) error) *Process { + f := &processFunc{run: run} + + return &Process{ + Start: f.start, + Wait: f.wait, + } +} + +// FuncIO is the Context key to access optional ProcessIO +var FuncIO = struct { + key int64 +}{vix.CommandMagicWord} + +func (f *processFunc) start(p *Process, r *vix.StartProgramRequest) (int64, error) { + f.wg.Add(1) + + var c io.Closer + + if p.IO != nil { + pr, pw := io.Pipe() + + p.IO.In.Reader, p.IO.In.Writer = pr, pw + c, p.IO.In.Closer = pr, pw + + p.ctx = context.WithValue(p.ctx, FuncIO, p.IO) + } + + go func() { + f.err = f.run(p.ctx, r.Arguments) + + if p.IO != nil { + _ = c.Close() + + if f.err != nil && p.IO.Err.Len() == 0 { + p.IO.Err.WriteString(f.err.Error()) + } + } + + f.wg.Done() + }() + + return 0, nil +} + +func (f *processFunc) wait() error { + f.wg.Wait() + return f.err +} + +type processCmd struct { + cmd *exec.Cmd +} + +// New creates a new Process, where the Start function use exec.CommandContext to create and start the process. +// The Wait function waits for the process to finish and returns the error returned by exec.Cmd.Wait(). +// Prior to Wait returning, the exec.Cmd.Wait() error is used to set the Process.ExitCode, if error is of type exec.ExitError. +// The ctx param may be used to kill the process via the process Manager.Kill method. +// The VixMsgStartProgramRequest param fields are mapped to the exec.Cmd counterpart fields. +// Processes are started within a sub-shell, allowing for i/o redirection, just as with the C version of vmware-tools. +func New() *Process { + c := new(processCmd) + + return &Process{ + Start: c.start, + Wait: c.wait, + } +} + +func (c *processCmd) start(p *Process, r *vix.StartProgramRequest) (int64, error) { + name, err := exec.LookPath(r.ProgramPath) + if err != nil { + return -1, err + } + // #nosec: Subprocess launching with variable + // Note that processCmd is currently used only for testing. + c.cmd = exec.CommandContext(p.ctx, shell, "-c", fmt.Sprintf("%s %s", name, r.Arguments)) + c.cmd.Dir = r.WorkingDir + c.cmd.Env = r.EnvVars + + if p.IO != nil { + in, perr := c.cmd.StdinPipe() + if perr != nil { + return -1, perr + } + + p.IO.In.Writer = in + p.IO.In.Closer = in + + // Note we currently use a Buffer in addition to the os.Pipe so that: + // - Stat() can provide a size + // - FileTransferFromGuest won't block + // - Can't use the exec.Cmd.Std{out,err}Pipe methods since Wait() closes the pipes. + // We could use os.Pipe directly, but toolbox needs to take care of closing both ends, + // but also need to prevent FileTransferFromGuest from blocking. + c.cmd.Stdout = p.IO.Out + c.cmd.Stderr = p.IO.Err + } + + err = c.cmd.Start() + if err != nil { + return -1, err + } + + return int64(c.cmd.Process.Pid), nil +} + +func (c *processCmd) wait() error { + err := c.cmd.Wait() + if err != nil { + xerr := &Error{ + Err: err, + ExitCode: 1, + } + + if x, ok := err.(*exec.ExitError); ok { + if status, ok := x.Sys().(syscall.WaitStatus); ok { + xerr.ExitCode = int32(status.ExitStatus()) + } + } + + return xerr + } + + return nil +} + +// NewRoundTrip starts a Go function to implement a toolbox backed http.RoundTripper +func NewRoundTrip() *Process { + return NewFunc(func(ctx context.Context, host string) error { + p, _ := ctx.Value(FuncIO).(*IO) + + closers := []io.Closer{p.In.Closer} + + defer func() { + for _, c := range closers { + _ = c.Close() + } + }() + + c, err := new(net.Dialer).DialContext(ctx, "tcp", host) + if err != nil { + return err + } + + closers = append(closers, c) + + go func() { + <-ctx.Done() + if ctx.Err() == context.DeadlineExceeded { + _ = c.Close() + } + }() + + _, err = io.Copy(c, p.In.Reader) + if err != nil { + return err + } + + _, err = io.Copy(p.Out, c) + if err != nil { + return err + } + + return nil + }).WithIO() +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/property.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/property.go new file mode 100644 index 000000000..542a9f5fc --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/property.go @@ -0,0 +1,224 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vix + +import ( + "bytes" + "encoding/binary" + "errors" +) + +// Property type enum as defined in open-vm-tools/lib/include/vix.h +const ( + _ = iota // ANY type not supported + vixPropertyTypeInt32 + vixPropertyTypeString + vixPropertyTypeBool + _ // HANDLE type not supported + vixPropertyTypeInt64 + vixPropertyTypeBlob +) + +// Property ID enum as defined in open-vm-tools/lib/include/vixOpenSource.h +const ( + PropertyGuestToolsAPIOptions = 4501 + PropertyGuestOsFamily = 4502 + PropertyGuestOsVersion = 4503 + PropertyGuestToolsProductNam = 4511 + PropertyGuestToolsVersion = 4500 + PropertyGuestName = 4505 + PropertyGuestOsVersionShort = 4520 + + PropertyGuestStartProgramEnabled = 4540 + PropertyGuestListProcessesEnabled = 4541 + PropertyGuestTerminateProcessEnabled = 4542 + PropertyGuestReadEnvironmentVariableEnabled = 4543 + + PropertyGuestMakeDirectoryEnabled = 4547 + PropertyGuestDeleteFileEnabled = 4548 + PropertyGuestDeleteDirectoryEnabled = 4549 + PropertyGuestMoveDirectoryEnabled = 4550 + PropertyGuestMoveFileEnabled = 4551 + PropertyGuestCreateTempFileEnabled = 4552 + PropertyGuestCreateTempDirectoryEnabled = 4553 + PropertyGuestListFilesEnabled = 4554 + PropertyGuestChangeFileAttributesEnabled = 4555 + PropertyGuestInitiateFileTransferFromGuestEnabled = 4556 + PropertyGuestInitiateFileTransferToGuestEnabled = 4557 +) + +type Property struct { + header struct { + ID int32 + Kind int32 + Length int32 + } + + data struct { + Int32 int32 + String string + Bool uint8 + Int64 int64 + Blob []byte + } +} + +var int32Size int32 + +func init() { + var i int32 + int32Size = int32(binary.Size(&i)) +} + +type PropertyList []*Property + +func NewInt32Property(id int32, val int32) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeInt32 + p.header.Length = int32Size + p.data.Int32 = val + return p +} + +func NewStringProperty(id int32, val string) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeString + p.header.Length = int32(len(val) + 1) + p.data.String = val + return p +} + +func NewBoolProperty(id int32, val bool) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeBool + p.header.Length = 1 + if val { + p.data.Bool = 1 + } + return p +} + +func NewInt64Property(id int32, val int64) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeInt64 + p.header.Length = int32Size * 2 + p.data.Int64 = val + return p +} + +func NewBlobProperty(id int32, val []byte) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeBlob + p.header.Length = int32(len(val)) + p.data.Blob = val + return p +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (p *Property) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, &p.header) + + switch p.header.Kind { + case vixPropertyTypeBool: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Bool) + case vixPropertyTypeInt32: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Int32) + case vixPropertyTypeInt64: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Int64) + case vixPropertyTypeString: + // #nosec: Errors unhandled + _, _ = buf.WriteString(p.data.String) + // #nosec: Errors unhandled + _ = buf.WriteByte(0) + case vixPropertyTypeBlob: + // #nosec: Errors unhandled + _, _ = buf.Write(p.data.Blob) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (p *Property) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &p.header) + if err != nil { + return err + } + + switch p.header.Kind { + case vixPropertyTypeBool: + return binary.Read(buf, binary.LittleEndian, &p.data.Bool) + case vixPropertyTypeInt32: + return binary.Read(buf, binary.LittleEndian, &p.data.Int32) + case vixPropertyTypeInt64: + return binary.Read(buf, binary.LittleEndian, &p.data.Int64) + case vixPropertyTypeString: + s := make([]byte, p.header.Length) + if _, err := buf.Read(s); err != nil { + return err + } + + p.data.String = string(bytes.TrimRight(s, "\x00")) + case vixPropertyTypeBlob: + p.data.Blob = make([]byte, p.header.Length) + if _, err := buf.Read(p.data.Blob); err != nil { + return err + } + default: + return errors.New("VIX_E_UNRECOGNIZED_PROPERTY") + } + + return nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (l *PropertyList) UnmarshalBinary(data []byte) error { + headerSize := int32Size * 3 + + for { + p := new(Property) + + err := p.UnmarshalBinary(data) + if err != nil { + return err + } + + *l = append(*l, p) + + offset := headerSize + p.header.Length + data = data[offset:] + + if len(data) == 0 { + return nil + } + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (l *PropertyList) MarshalBinary() ([]byte, error) { + var buf bytes.Buffer + + for _, p := range *l { + // #nosec: Errors unhandled + b, _ := p.MarshalBinary() + // #nosec: Errors unhandled + _, _ = buf.Write(b) + } + + return buf.Bytes(), nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go b/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go new file mode 100644 index 000000000..d974a50d1 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go @@ -0,0 +1,835 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vix + +import ( + "bytes" + "encoding/base64" + "encoding/binary" + "fmt" + "os" + "os/exec" + "syscall" +) + +const ( + CommandMagicWord = 0xd00d0001 + + CommandGetToolsState = 62 + + CommandStartProgram = 185 + CommandListProcessesEx = 186 + CommandReadEnvVariables = 187 + CommandTerminateProcess = 193 + + CommandCreateDirectoryEx = 178 + CommandMoveGuestFileEx = 179 + CommandMoveGuestDirectory = 180 + CommandCreateTemporaryFileEx = 181 + CommandCreateTemporaryDirectory = 182 + CommandSetGuestFileAttributes = 183 + CommandDeleteGuestFileEx = 194 + CommandDeleteGuestDirectoryEx = 195 + + CommandListFiles = 177 + HgfsSendPacketCommand = 84 + CommandInitiateFileTransferFromGuest = 188 + CommandInitiateFileTransferToGuest = 189 + + // VIX_USER_CREDENTIAL_NAME_PASSWORD + UserCredentialTypeNamePassword = 1 + + // VIX_E_* constants from vix.h + OK = 0 + Fail = 1 + InvalidArg = 3 + FileNotFound = 4 + FileAlreadyExists = 12 + FileAccessError = 13 + AuthenticationFail = 35 + + UnrecognizedCommandInGuest = 3025 + InvalidMessageHeader = 10000 + InvalidMessageBody = 10001 + NotAFile = 20001 + NotADirectory = 20002 + NoSuchProcess = 20003 + DirectoryNotEmpty = 20006 + + // VIX_COMMAND_* constants from Commands.h + CommandGuestReturnsBinary = 0x80 + + // VIX_FILE_ATTRIBUTES_ constants from vix.h + FileAttributesDirectory = 0x0001 + FileAttributesSymlink = 0x0002 +) + +// SetGuestFileAttributes flags as defined in vixOpenSource.h +const ( + FileAttributeSetAccessDate = 0x0001 + FileAttributeSetModifyDate = 0x0002 + FileAttributeSetReadonly = 0x0004 + FileAttributeSetHidden = 0x0008 + FileAttributeSetUnixOwnerid = 0x0010 + FileAttributeSetUnixGroupid = 0x0020 + FileAttributeSetUnixPermissions = 0x0040 +) + +type Error int + +func (err Error) Error() string { + return fmt.Sprintf("vix error=%d", err) +} + +// ErrorCode does its best to map the given error to a VIX error code. +// See also: Vix_TranslateErrno +func ErrorCode(err error) int { + switch t := err.(type) { + case Error: + return int(t) + case *os.PathError: + if errno, ok := t.Err.(syscall.Errno); ok { + switch errno { + case syscall.ENOTEMPTY: + return DirectoryNotEmpty + } + } + case *exec.Error: + if t.Err == exec.ErrNotFound { + return FileNotFound + } + } + + switch { + case os.IsNotExist(err): + return FileNotFound + case os.IsExist(err): + return FileAlreadyExists + case os.IsPermission(err): + return FileAccessError + default: + return Fail + } +} + +type Header struct { + Magic uint32 + MessageVersion uint16 + + TotalMessageLength uint32 + HeaderLength uint32 + BodyLength uint32 + CredentialLength uint32 + + CommonFlags uint8 +} + +type CommandRequestHeader struct { + Header + + OpCode uint32 + RequestFlags uint32 + + TimeOut uint32 + + Cookie uint64 + ClientHandleID uint32 + + UserCredentialType uint32 +} + +type StartProgramRequest struct { + CommandRequestHeader + + Body struct { + StartMinimized uint8 + ProgramPathLength uint32 + ArgumentsLength uint32 + WorkingDirLength uint32 + NumEnvVars uint32 + EnvVarLength uint32 + } + + ProgramPath string + Arguments string + WorkingDir string + EnvVars []string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *StartProgramRequest) MarshalBinary() ([]byte, error) { + var env bytes.Buffer + + if n := len(r.EnvVars); n != 0 { + for _, e := range r.EnvVars { + _, _ = env.Write([]byte(e)) + _ = env.WriteByte(0) + } + r.Body.NumEnvVars = uint32(n) + r.Body.EnvVarLength = uint32(env.Len()) + } + + var fields []string + + add := func(s string, l *uint32) { + if n := len(s); n != 0 { + *l = uint32(n) + 1 + fields = append(fields, s) + } + } + + add(r.ProgramPath, &r.Body.ProgramPathLength) + add(r.Arguments, &r.Body.ArgumentsLength) + add(r.WorkingDir, &r.Body.WorkingDirLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + if r.Body.EnvVarLength != 0 { + _, _ = buf.Write(env.Bytes()) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *StartProgramRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.ProgramPathLength, &r.ProgramPath}, + {r.Body.ArgumentsLength, &r.Arguments}, + {r.Body.WorkingDirLength, &r.WorkingDir}, + } + + for _, field := range fields { + if field.len == 0 { + continue + } + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + for i := 0; i < int(r.Body.NumEnvVars); i++ { + env, rerr := buf.ReadString(0) + if rerr != nil { + return rerr + } + + env = env[:len(env)-1] // discard NULL terminator + r.EnvVars = append(r.EnvVars, env) + } + + return nil +} + +type KillProcessRequest struct { + CommandRequestHeader + + Body struct { + Pid int64 + Options uint32 + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *KillProcessRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *KillProcessRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + return binary.Read(buf, binary.LittleEndian, &r.Body) +} + +type ListProcessesRequest struct { + CommandRequestHeader + + Body struct { + Key uint32 + Offset uint32 + NumPids uint32 + } + + Pids []int64 +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ListProcessesRequest) MarshalBinary() ([]byte, error) { + r.Body.NumPids = uint32(len(r.Pids)) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, pid := range r.Pids { + _ = binary.Write(buf, binary.LittleEndian, &pid) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ListProcessesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + r.Pids = make([]int64, r.Body.NumPids) + + for i := uint32(0); i < r.Body.NumPids; i++ { + err := binary.Read(buf, binary.LittleEndian, &r.Pids[i]) + if err != nil { + return err + } + } + + return nil +} + +type ReadEnvironmentVariablesRequest struct { + CommandRequestHeader + + Body struct { + NumNames uint32 + NamesLength uint32 + } + + Names []string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReadEnvironmentVariablesRequest) MarshalBinary() ([]byte, error) { + var env bytes.Buffer + + if n := len(r.Names); n != 0 { + for _, e := range r.Names { + _, _ = env.Write([]byte(e)) + _ = env.WriteByte(0) + } + r.Body.NumNames = uint32(n) + r.Body.NamesLength = uint32(env.Len()) + } + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + if r.Body.NamesLength != 0 { + _, _ = buf.Write(env.Bytes()) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReadEnvironmentVariablesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + for i := 0; i < int(r.Body.NumNames); i++ { + env, rerr := buf.ReadString(0) + if rerr != nil { + return rerr + } + + env = env[:len(env)-1] // discard NULL terminator + r.Names = append(r.Names, env) + } + + return nil +} + +type CreateTempFileRequest struct { + CommandRequestHeader + + Body struct { + Options int32 + FilePrefixLength uint32 + FileSuffixLength uint32 + DirectoryPathLength uint32 + PropertyListLength uint32 + } + + FilePrefix string + FileSuffix string + DirectoryPath string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *CreateTempFileRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + *l = uint32(len(s)) // NOTE: NULL byte is not included in the length fields on the wire + fields = append(fields, s) + } + + add(r.FilePrefix, &r.Body.FilePrefixLength) + add(r.FileSuffix, &r.Body.FileSuffixLength) + add(r.DirectoryPath, &r.Body.DirectoryPathLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *CreateTempFileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.FilePrefixLength, &r.FilePrefix}, + {r.Body.FileSuffixLength, &r.FileSuffix}, + {r.Body.DirectoryPathLength, &r.DirectoryPath}, + } + + for _, field := range fields { + field.len++ // NOTE: NULL byte is not included in the length fields on the wire + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type FileRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *FileRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *FileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type DirRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + FilePropertiesLength uint32 + Recursive bool + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *DirRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *DirRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type RenameFileRequest struct { + CommandRequestHeader + + Body struct { + CopyFileOptions int32 + OldPathNameLength uint32 + NewPathNameLength uint32 + FilePropertiesLength uint32 + Overwrite bool + } + + OldPathName string + NewPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RenameFileRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + *l = uint32(len(s)) // NOTE: NULL byte is not included in the length fields on the wire + fields = append(fields, s) + } + + add(r.OldPathName, &r.Body.OldPathNameLength) + add(r.NewPathName, &r.Body.NewPathNameLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RenameFileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.OldPathNameLength, &r.OldPathName}, + {r.Body.NewPathNameLength, &r.NewPathName}, + } + + for _, field := range fields { + field.len++ // NOTE: NULL byte is not included in the length fields on the wire + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type ListFilesRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + PatternLength uint32 + Index int32 + MaxResults int32 + Offset uint64 + } + + GuestPathName string + Pattern string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ListFilesRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + if n := len(s); n != 0 { + *l = uint32(n) + 1 + fields = append(fields, s) + } + } + + add(r.GuestPathName, &r.Body.GuestPathNameLength) + add(r.Pattern, &r.Body.PatternLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ListFilesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.GuestPathNameLength, &r.GuestPathName}, + {r.Body.PatternLength, &r.Pattern}, + } + + for _, field := range fields { + if field.len == 0 { + continue + } + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type SetGuestFileAttributesRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + AccessTime int64 + ModificationTime int64 + OwnerID int32 + GroupID int32 + Permissions int32 + Hidden bool + ReadOnly bool + GuestPathNameLength uint32 + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *SetGuestFileAttributesRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *SetGuestFileAttributesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +func (r *SetGuestFileAttributesRequest) IsSet(opt int32) bool { + return r.Body.FileOptions&opt == opt +} + +type CommandHgfsSendPacket struct { + CommandRequestHeader + + Body struct { + PacketSize uint32 + Timeout int32 + } + + Packet []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *CommandHgfsSendPacket) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.Write(r.Packet) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *CommandHgfsSendPacket) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + r.Packet = buf.Next(int(r.Body.PacketSize)) + + return nil +} + +type InitiateFileTransferToGuestRequest struct { + CommandRequestHeader + + Body struct { + Options int32 + GuestPathNameLength uint32 + Overwrite bool + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *InitiateFileTransferToGuestRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *InitiateFileTransferToGuestRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type UserCredentialNamePassword struct { + Body struct { + NameLength uint32 + PasswordLength uint32 + } + + Name string + Password string +} + +func (c *UserCredentialNamePassword) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(bytes.TrimRight(data, "\x00")) + + err := binary.Read(buf, binary.LittleEndian, &c.Body) + if err != nil { + return err + } + + str, err := base64.StdEncoding.DecodeString(buf.String()) + if err != nil { + return err + } + + c.Name = string(str[0:c.Body.NameLength]) + c.Password = string(str[c.Body.NameLength+1 : len(str)-1]) + + return nil +} + +func (c *UserCredentialNamePassword) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + c.Body.NameLength = uint32(len(c.Name)) + c.Body.PasswordLength = uint32(len(c.Password)) + + _ = binary.Write(buf, binary.LittleEndian, &c.Body) + + src := append([]byte(c.Name+"\x00"), []byte(c.Password+"\x00")...) + + enc := base64.StdEncoding + pwd := make([]byte, enc.EncodedLen(len(src))) + enc.Encode(pwd, src) + _, _ = buf.Write(pwd) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/dataset/dataset.go b/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/dataset/dataset.go new file mode 100644 index 000000000..f2fac2a65 --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/dataset/dataset.go @@ -0,0 +1,188 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package dataset + +import ( + "context" + "net/http" + "net/url" + "path" + "strconv" + + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vapi/vm/internal" +) + +// Manager extends rest.Client, adding data set related methods. +// +// Data sets functionality was introduced in vSphere 8.0, +// and requires the VM to have virtual hardware version 20 or newer. +// +// See the VMware Guest SDK Programming Guide for details on using data sets +// from within the guest OS of a VM. +// +// See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/vm/data_sets/ +type Manager struct { + *rest.Client +} + +// NewManager creates a new Manager instance with the given client. +func NewManager(client *rest.Client) *Manager { + return &Manager{ + Client: client, + } +} + +// Access permission to the entries of a data set. +type Access string + +const ( + AccessNone = Access("NONE") + AccessReadOnly = Access("READ_ONLY") + AccessReadWrite = Access("READ_WRITE") +) + +// Describes a data set to be created. +type CreateSpec struct { + // Name should take the form "com.company.project" to avoid conflict with other uses. + // Must not be empty. + Name string `json:"name"` + + // Description of the data set. + Description string `json:"description"` + + // Host controls access to the data set entries by the ESXi host and the vCenter. + // For example, if the host access is set to NONE, the entries of this data set + // will not be accessible through the vCenter API. + // Must not be empty. + Host Access `json:"host"` + + // Guest controls access to the data set entries by the guest OS of the VM (i.e. in-guest APIs). + // For example, if the guest access is set to READ_ONLY, it will be forbidden + // to create, delete, and update entries in this data set via the VMware Guest SDK. + // Must not be empty. + Guest Access `json:"guest"` + + // OmitFromSnapshotAndClone controls whether the data set is included in snapshots and clones of the VM. + // When a VM is reverted to a snapshot, any data set with OmitFromSnapshotAndClone=true will be destroyed. + // Default is false. + OmitFromSnapshotAndClone *bool `json:"omit_from_snapshot_and_clone,omitempty"` +} + +// Describes modifications to a data set. +type UpdateSpec struct { + Description *string `json:"description,omitempty"` + Host *Access `json:"host,omitempty"` + Guest *Access `json:"guest,omitempty"` + OmitFromSnapshotAndClone *bool `json:"omit_from_snapshot_and_clone,omitempty"` +} + +// Data set information. +type Info struct { + Name string `json:"name"` + Description string `json:"description"` + Host Access `json:"host"` + Guest Access `json:"guest"` + Used int `json:"used"` + OmitFromSnapshotAndClone bool `json:"omit_from_snapshot_and_clone"` +} + +// Brief data set information. +type Summary struct { + DataSet string `json:"data_set"` + Name string `json:"name"` + Description string `json:"description"` +} + +const dataSetsPathField = "data-sets" + +func dataSetPath(vm string, dataSet string) string { + return path.Join(internal.VCenterVMPath, url.PathEscape(vm), dataSetsPathField, url.PathEscape(dataSet)) +} + +func dataSetsPath(vm string) string { + return path.Join(internal.VCenterVMPath, url.PathEscape(vm), dataSetsPathField) +} + +const entriesPathField = "entries" + +func entryPath(vm string, dataSet string, key string) string { + return path.Join(internal.VCenterVMPath, url.PathEscape(vm), dataSetsPathField, url.PathEscape(dataSet), entriesPathField, url.PathEscape(key)) +} + +func entriesPath(vm string, dataSet string) string { + return path.Join(internal.VCenterVMPath, url.PathEscape(vm), dataSetsPathField, url.PathEscape(dataSet), entriesPathField) +} + +// CreateDataSet creates a data set associated with the given virtual machine. +func (c *Manager) CreateDataSet(ctx context.Context, vm string, spec *CreateSpec) (string, error) { + url := c.Resource(dataSetsPath(vm)) + var res string + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + return res, err +} + +// DeleteDataSet deletes an existing data set from the given virtual machine. +// The operation will fail if the data set is not empty. +// Set the force flag to delete a non-empty data set. +func (c *Manager) DeleteDataSet(ctx context.Context, vm string, dataSet string, force bool) error { + url := c.Resource(dataSetPath(vm, dataSet)) + if force { + url.WithParam("force", strconv.FormatBool(force)) + } + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// GetDataSet retrieves information about the given data set. +func (c *Manager) GetDataSet(ctx context.Context, vm string, dataSet string) (*Info, error) { + url := c.Resource(dataSetPath(vm, dataSet)) + var res Info + err := c.Do(ctx, url.Request(http.MethodGet), &res) + return &res, err +} + +// UpdateDataSet modifies the given data set. +func (c *Manager) UpdateDataSet(ctx context.Context, vm string, dataSet string, spec *UpdateSpec) error { + url := c.Resource(dataSetPath(vm, dataSet)) + return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) +} + +// ListDataSets returns a list of brief descriptions of the data sets on with the given virtual machine. +func (c *Manager) ListDataSets(ctx context.Context, vm string) ([]Summary, error) { + url := c.Resource(dataSetsPath(vm)) + var res []Summary + err := c.Do(ctx, url.Request(http.MethodGet), &res) + return res, err +} + +// SetEntry creates or updates an entry in the given data set. +// If an entry with the given key already exists, it will be overwritten. +// The key can be at most 4096 bytes. The value can be at most 1MB. +func (c *Manager) SetEntry(ctx context.Context, vm string, dataSet string, key string, value string) error { + url := c.Resource(entryPath(vm, dataSet, key)) + return c.Do(ctx, url.Request(http.MethodPut, value), nil) +} + +// GetEntry returns the value of the data set entry with the given key. +func (c *Manager) GetEntry(ctx context.Context, vm string, dataSet string, key string) (string, error) { + url := c.Resource(entryPath(vm, dataSet, key)) + var res string + err := c.Do(ctx, url.Request(http.MethodGet), &res) + return res, err +} + +// DeleteEntry removes an existing entry from the given data set. +func (c *Manager) DeleteEntry(ctx context.Context, vm string, dataSet string, key string) error { + url := c.Resource(entryPath(vm, dataSet, key)) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// ListEntries returns a list of all entry keys in the given data set. +func (c *Manager) ListEntries(ctx context.Context, vm string, dataSet string) ([]string, error) { + url := c.Resource(entriesPath(vm, dataSet)) + var res []string + err := c.Do(ctx, url.Request(http.MethodGet), &res) + return res, err +} diff --git a/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/internal/internal.go b/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/internal/internal.go new file mode 100644 index 000000000..e24300a8b --- /dev/null +++ b/stembuild/vendor/github.com/vmware/govmomi/vapi/vm/internal/internal.go @@ -0,0 +1,12 @@ +// © Broadcom. All Rights Reserved. +// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package internal + +const ( + // VCenterVMPath is the REST endpoint for the virtual machine API + VCenterVMPath = "/api/vcenter/vm" + // LegacyVCenterVMPath is the legacy REST endpoint for the virtual machine API, relative to the "/rest" base path + LegacyVCenterVMPath = "/vcenter/vm" +) diff --git a/stembuild/vendor/modules.txt b/stembuild/vendor/modules.txt index c400d41cb..c6fe825f2 100644 --- a/stembuild/vendor/modules.txt +++ b/stembuild/vendor/modules.txt @@ -210,6 +210,7 @@ github.com/vmware/govmomi/cli/vm/snapshot github.com/vmware/govmomi/cns github.com/vmware/govmomi/cns/methods github.com/vmware/govmomi/cns/types +github.com/vmware/govmomi/crypto github.com/vmware/govmomi/fault github.com/vmware/govmomi/find github.com/vmware/govmomi/guest @@ -229,12 +230,21 @@ github.com/vmware/govmomi/property github.com/vmware/govmomi/session github.com/vmware/govmomi/session/cache github.com/vmware/govmomi/session/keepalive +github.com/vmware/govmomi/simulator +github.com/vmware/govmomi/simulator/esx +github.com/vmware/govmomi/simulator/internal +github.com/vmware/govmomi/simulator/vpx github.com/vmware/govmomi/task +github.com/vmware/govmomi/toolbox/hgfs +github.com/vmware/govmomi/toolbox/process +github.com/vmware/govmomi/toolbox/vix github.com/vmware/govmomi/units github.com/vmware/govmomi/vapi/internal github.com/vmware/govmomi/vapi/library github.com/vmware/govmomi/vapi/library/finder github.com/vmware/govmomi/vapi/rest +github.com/vmware/govmomi/vapi/vm/dataset +github.com/vmware/govmomi/vapi/vm/internal github.com/vmware/govmomi/view github.com/vmware/govmomi/vim25 github.com/vmware/govmomi/vim25/debug From 13dcaa2e86cc0d540c4170f0063f8b5ad0ce0544 Mon Sep 17 00:00:00 2001 From: Rajath Agasthya Date: Fri, 15 Aug 2025 17:54:45 -0500 Subject: [PATCH 21/21] Remove static IPs for Windows 2019 on vSphere Pipeline uses DHCP for vSphere VMs created during stembuild. --- ci/pipelines/stemcells-windows.yml | 81 ++++++++++++------- ci/tasks/fetch-vm-ip/run.sh | 30 +++++++ ci/tasks/fetch-vm-ip/task.yml | 18 +++++ ci/tasks/run-construct-stembuild-linux/run.sh | 23 ++++-- .../run-construct-stembuild-linux/task.yml | 2 +- ci/tasks/setup-integration-test-vm/run.sh | 47 +++++++---- ci/tasks/setup-integration-test-vm/task.yml | 1 - .../test-integration-stembuild-linux/run.sh | 1 - .../test-integration-stembuild-linux/task.yml | 2 +- .../run.ps1 | 1 - .../task.yml | 2 +- .../integration/iaas_cli/govc_cli_test.go | 2 +- 12 files changed, 152 insertions(+), 58 deletions(-) create mode 100755 ci/tasks/fetch-vm-ip/run.sh create mode 100644 ci/tasks/fetch-vm-ip/task.yml diff --git a/ci/pipelines/stemcells-windows.yml b/ci/pipelines/stemcells-windows.yml index 3cc16d6a0..fcee4392c 100644 --- a/ci/pipelines/stemcells-windows.yml +++ b/ci/pipelines/stemcells-windows.yml @@ -298,16 +298,6 @@ resources: file: main initial_version: "((BASE_OS_VERSION)).1.0" -# type: pool -- name: nimbus-ips - type: pool - tags: [*internal_worker_tag] - source: - branch: master - pool: nimbus-ips - private_key: ((github_deploy_key_Bosh-Windows-Locks.private_key)) - uri: git@github.gwd.broadcom.net:TNZ/Bosh-Windows-Locks.git - # type: s3 - name: blobstore-s3-cli type: s3 @@ -810,10 +800,6 @@ jobs: - get: bosh-agent-release passed: [build] - get: ovftool - - put: nimbus-ips - inputs: detect - params: { acquire: true } - tags: [*internal_worker_tag] - get: blobstore-dav-cli - get: blobstore-s3-cli - get: blobstore-gcs-cli @@ -856,6 +842,23 @@ jobs: - task: zip-files file: bosh-windows-stemcell-builder-ci/ci/tasks/zip-files/task.yml image: bosh-windows-stemcell-builder-ci-image + - load_var: integration-vm-name + file: integration-vm-name/name + format: trim + reveal: true + - task: fetch-integration-vm-ip + file: bosh-windows-stemcell-builder-ci/ci/tasks/fetch-vm-ip/task.yml + image: bosh-windows-stemcell-builder-ci-image + tags: [ windows-nimbus ] + params: + GOVC_URL: ((nimbus_windows-demo_auth_url)) + VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) + VCENTER_VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates + VM_NAME: ((.:integration-vm-name)) + - load_var: integration-vm-ip + file: vm-ip/ip + format: trim + reveal: true - task: integration tags: [windows-nimbus] file: bosh-windows-stemcell-builder-ci/ci/tasks/test-integration-stembuild-windows/task.yml @@ -879,6 +882,7 @@ jobs: VM_PASSWORD: ((stembuild_vm_user.password)) PACKAGE_TEST_VM_NAME: stembuild-package-integration-tests-base-vm OS_LINE: *windows_os_line + TARGET_VM_IP: ((.:integration-vm-ip)) - task: build tags: [windows-nimbus] file: bosh-windows-stemcell-builder-ci/ci/tasks/build-stembuild-windows/task.yml @@ -896,11 +900,6 @@ jobs: params: CLONE_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates VCENTER_ADMIN_CREDENTIAL_URL: ((nimbus_windows-demo_auth_url)) - ensure: - put: nimbus-ips - inputs: detect - params: { release: nimbus-ips } - tags: [*internal_worker_tag] - name: stembuild-linux serial: true @@ -929,10 +928,6 @@ jobs: - get: bosh-agent-release passed: [build] - get: ovftool - - put: nimbus-ips - inputs: detect - params: { acquire: true } - tags: [*internal_worker_tag] - get: blobstore-dav-cli - get: blobstore-s3-cli - get: blobstore-gcs-cli @@ -975,6 +970,23 @@ jobs: - task: zip-files file: bosh-windows-stemcell-builder-ci/ci/tasks/zip-files/task.yml image: bosh-windows-stemcell-builder-ci-image + - load_var: integration-vm-name + file: integration-vm-name/name + format: trim + reveal: true + - task: fetch-integration-vm-ip + file: bosh-windows-stemcell-builder-ci/ci/tasks/fetch-vm-ip/task.yml + image: bosh-windows-stemcell-builder-ci-image + tags: [ windows-nimbus ] + params: + GOVC_URL: ((nimbus_windows-demo_auth_url)) + VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) + VCENTER_VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates + VM_NAME: ((.:integration-vm-name)) + - load_var: integration-vm-ip + file: vm-ip/ip + format: trim + reveal: true - task: integration file: bosh-windows-stemcell-builder-ci/ci/tasks/test-integration-stembuild-linux/task.yml image: bosh-windows-stemcell-builder-ci-image @@ -999,6 +1011,7 @@ jobs: VM_PASSWORD: ((stembuild_vm_user.password)) PACKAGE_TEST_VM_NAME: stembuild-package-integration-tests-base-vm OS_LINE: *windows_os_line + TARGET_VM_IP: ((.:integration-vm-ip)) - task: build file: bosh-windows-stemcell-builder-ci/ci/tasks/build-stembuild-linux/task.yml image: bosh-windows-stemcell-builder-ci-image @@ -1016,11 +1029,6 @@ jobs: params: CLONE_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates VCENTER_ADMIN_CREDENTIAL_URL: ((nimbus_windows-demo_auth_url)) - ensure: - put: nimbus-ips - inputs: detect - params: { release: nimbus-ips } - tags: [*internal_worker_tag] - name: create-stembuild-linux-stemcell serial: true @@ -1074,12 +1082,12 @@ jobs: image: bosh-windows-stemcell-builder-ci-image tags: [windows-nimbus] params: + GOVC_URL: ((nimbus_windows-demo_auth_url)) VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) VCENTER_USERNAME: ((nimbus_windows-demo_user.username)) VCENTER_PASSWORD: ((nimbus_windows-demo_user.password)) VCENTER_VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates STEMBUILD_BASE_VM_NAME: windows-server-2019-base-vm-linux - STEMBUILD_BASE_VM_IP: 192.168.111.31 STEMBUILD_BASE_VM_USERNAME: ((stembuild_vm_user.username)) STEMBUILD_BASE_VM_PASSWORD: ((stembuild_vm_user.password)) - task: run-stembuild-package @@ -1232,6 +1240,19 @@ jobs: DATACENTER: dc0 VM_TO_SNAPSHOT: /dc0/vm/bosh-windows-ci-vms-and-templates/windows-server-2019-base-vm-windows SNAPSHOT_NAME: "stembuild-ready-power-on" + - task: fetch-vm-ip + file: bosh-windows-stemcell-builder-ci/ci/tasks/fetch-vm-ip/task.yml + image: bosh-windows-stemcell-builder-ci-image + tags: [ windows-nimbus ] + params: + GOVC_URL: ((nimbus_windows-demo_auth_url)) + VCENTER_BASE_URL: ((nimbus_windows-demo_base_url)) + VCENTER_VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates + VM_NAME: windows-server-2019-base-vm-windows + - load_var: ip + file: vm-ip/ip + format: trim + reveal: true - task: run-stembuild-construct file: bosh-windows-stemcell-builder-ci/ci/tasks/run-construct-stembuild-windows/task.yml tags: [windows-nimbus] @@ -1241,7 +1262,7 @@ jobs: VCENTER_PASSWORD: ((nimbus_windows-demo_user.password)) VCENTER_VM_FOLDER: /dc0/vm/bosh-windows-ci-vms-and-templates STEMBUILD_BASE_VM_NAME: windows-server-2019-base-vm-windows - STEMBUILD_BASE_VM_IP: 192.168.111.32 + STEMBUILD_BASE_VM_IP: ((.:ip)) STEMBUILD_BASE_VM_USERNAME: ((stembuild_vm_user.username)) STEMBUILD_BASE_VM_PASSWORD: ((stembuild_vm_user.password)) - task: run-stembuild-package diff --git a/ci/tasks/fetch-vm-ip/run.sh b/ci/tasks/fetch-vm-ip/run.sh new file mode 100755 index 000000000..09fa152cb --- /dev/null +++ b/ci/tasks/fetch-vm-ip/run.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euxo pipefail + +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" + +source ${SCRIPT_DIR}/../../common-scripts/update_nimbus_urls_and_cert.sh + +cat > ca.crt < vm-ip/ip diff --git a/ci/tasks/fetch-vm-ip/task.yml b/ci/tasks/fetch-vm-ip/task.yml new file mode 100644 index 000000000..13c12c25d --- /dev/null +++ b/ci/tasks/fetch-vm-ip/task.yml @@ -0,0 +1,18 @@ +--- +platform: linux + +inputs: + - name: bosh-windows-stemcell-builder-ci + +outputs: + - name: vm-ip + +run: + path: bosh-windows-stemcell-builder-ci/ci/tasks/fetch-vm-ip/run.sh + +params: + GOVC_URL: + VCENTER_BASE_URL: + VM_NAME: + VCENTER_VM_FOLDER: + TIMEOUT: 300 diff --git a/ci/tasks/run-construct-stembuild-linux/run.sh b/ci/tasks/run-construct-stembuild-linux/run.sh index b4965aa26..2adb9f714 100755 --- a/ci/tasks/run-construct-stembuild-linux/run.sh +++ b/ci/tasks/run-construct-stembuild-linux/run.sh @@ -12,16 +12,27 @@ cp lgpo-binary/LGPO*.zip "${ROOT_DIR}/LGPO.zip" ca_cert_file="${ROOT_DIR}/vcenter_ca.crt" echo "${VCENTER_CA_CERT}" > "${ca_cert_file}" +VM_NAME="${VCENTER_VM_FOLDER}/${STEMBUILD_BASE_VM_NAME}" + +echo "Fetching IP for VM: $VM_NAME..." + +VM_IP=$(govc vm.info -json "$VM_NAME" | jq -r '.virtualMachines[0].guest.ipAddress') + +if [ -z "$VM_IP" ]; then + echo "Error: could not retrieve IP address for VM '$VM_NAME'." + exit 1 +fi + cp stembuild-untested-linux/stembuild* "${ROOT_DIR}/stembuild" chmod 500 "${ROOT_DIR}/stembuild" ./stembuild -debug construct \ -vcenter-url "${VCENTER_BASE_URL}" \ - -vcenter-username "${VCENTER_USERNAME}" \ - -vcenter-password "${VCENTER_PASSWORD}" \ + -vcenter-username "${VCENTER_USERNAME}" \ + -vcenter-password "${VCENTER_PASSWORD}" \ -vcenter-ca-certs "${ca_cert_file}" \ - -vm-inventory-path "${VCENTER_VM_FOLDER}/${STEMBUILD_BASE_VM_NAME}" \ - -vm-ip "${STEMBUILD_BASE_VM_IP}" \ - -vm-username "${STEMBUILD_BASE_VM_USERNAME}" \ - -vm-password "${STEMBUILD_BASE_VM_PASSWORD}" \ + -vm-inventory-path "${VM_NAME}" \ + -vm-ip "${VM_IP}" \ + -vm-username "${STEMBUILD_BASE_VM_USERNAME}" \ + -vm-password "${STEMBUILD_BASE_VM_PASSWORD}" \ -setup-arg FailOnInstallWUCerts diff --git a/ci/tasks/run-construct-stembuild-linux/task.yml b/ci/tasks/run-construct-stembuild-linux/task.yml index 21d810d96..7cc21d3e2 100644 --- a/ci/tasks/run-construct-stembuild-linux/task.yml +++ b/ci/tasks/run-construct-stembuild-linux/task.yml @@ -10,11 +10,11 @@ run: path: bosh-windows-stemcell-builder-ci/ci/tasks/run-construct-stembuild-linux/run.sh params: + GOVC_URL: VCENTER_BASE_URL: VCENTER_USERNAME: VCENTER_PASSWORD: VCENTER_VM_FOLDER: STEMBUILD_BASE_VM_NAME: - STEMBUILD_BASE_VM_IP: STEMBUILD_BASE_VM_USERNAME: STEMBUILD_BASE_VM_PASSWORD: diff --git a/ci/tasks/setup-integration-test-vm/run.sh b/ci/tasks/setup-integration-test-vm/run.sh index 6bb8d9e92..50da59323 100755 --- a/ci/tasks/setup-integration-test-vm/run.sh +++ b/ci/tasks/setup-integration-test-vm/run.sh @@ -6,12 +6,17 @@ export GOVC_URL="${VCENTER_ADMIN_CREDENTIAL_URL}" ROOT_DIR=$(pwd) export OUTPUT_DIR=${ROOT_DIR}/output -VM_IP=$(cat nimbus-ips/name) +CLONE_NAME_PREFIX="construct-${JOB_OS_NAME}-integration-ci-${OS_LINE}" +CLONE_NAME_SUFFIX=$(mktemp -u XXXXXX) +CLONE_NAME="${CLONE_NAME_PREFIX}-${CLONE_NAME_SUFFIX}" + +export CLONE_NAME_PREFIX +export CLONE_NAME_SUFFIX +export CLONE_NAME -CLONE_NAME="stembuild-${JOB_OS_NAME}-${OS_LINE}-${VM_IP}" echo "${CLONE_NAME}" > integration-vm-name/name +echo "Creating VM ${CLONE_NAME}" -echo "Cloning ${BASE_VM_IPATH} to ${CLONE_NAME}" govc vm.clone \ -vm "${BASE_VM_IPATH}" \ -ds "${CLONE_DATASTORE}" \ @@ -22,7 +27,6 @@ govc vm.clone \ echo "Customizing ${CLONE_NAME}" govc vm.customize \ -vm.ipath "${CLONE_FOLDER}"/"${CLONE_NAME}" \ - -ip "${VM_IP}" \ -org "${VM_ORG_NAME}" \ -username "${VM_USERNAME}" \ "${VM_CUSTOMIZATION_NAME}" @@ -30,21 +34,34 @@ govc vm.customize \ govc vm.power -on \ -vm.ipath "${CLONE_FOLDER}"/"${CLONE_NAME}" -echo "Waiting 10 min for ${CLONE_NAME} to be configured with ${VM_IP}" +echo "Waiting for VM to be configured with IP address..." SECONDS=0 FOUND_IP_ADDRESS= -while [ "${VM_IP}" != "${FOUND_IP_ADDRESS}" ]; do - sleep 10 - VM_INFO=$(govc vm.info -json "${CLONE_FOLDER}"/"${CLONE_NAME}") - - FOUND_IP_ADDRESS=$(echo "${VM_INFO}" | - jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]? |select(. == \"${VM_IP}\")") +while [ -z "$FOUND_IP_ADDRESS" ] || [ "$FOUND_IP_ADDRESS" == "null" ]; do + VM_INFO=$(govc vm.info -json "${CLONE_FOLDER}"/"${CLONE_NAME}") + FOUND_IP_ADDRESS=$(echo "${VM_INFO}" | jq -r '.virtualMachines[0].guest.ipAddress') echo "Current IP Addresses:" - echo "${VM_INFO}" | jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]?" + echo "${VM_INFO}" | jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]?" + + if [ ${SECONDS} -gt 600 ] ; then + exit 1 + fi + sleep 10 +done - if [ ${SECONDS} -gt 600 ] ; then - exit 1 - fi +echo "Waiting for VM guest customization to complete..." +SECONDS=0 +GUEST_CUSTOMIZATION_STATUS= + +while [ "$GUEST_CUSTOMIZATION_STATUS" != "TOOLSDEPLOYPKG_SUCCEEDED" ]; do + GUEST_CUSTOMIZATION_STATUS=$(govc vm.info -json "${CLONE_FOLDER}"/"${CLONE_NAME}" | jq -r '.virtualMachines[0].guest.customizationInfo.customizationStatus') + + if [ ${SECONDS} -gt 600 ] ; then + exit 1 + fi + sleep 30 done + +echo "Integration VM setup complete" \ No newline at end of file diff --git a/ci/tasks/setup-integration-test-vm/task.yml b/ci/tasks/setup-integration-test-vm/task.yml index 439e338de..c4aa90090 100644 --- a/ci/tasks/setup-integration-test-vm/task.yml +++ b/ci/tasks/setup-integration-test-vm/task.yml @@ -3,7 +3,6 @@ platform: linux inputs: - name: bosh-windows-stemcell-builder-ci -- name: nimbus-ips outputs: - name: integration-vm-name diff --git a/ci/tasks/test-integration-stembuild-linux/run.sh b/ci/tasks/test-integration-stembuild-linux/run.sh index ea62454be..8349aae4f 100755 --- a/ci/tasks/test-integration-stembuild-linux/run.sh +++ b/ci/tasks/test-integration-stembuild-linux/run.sh @@ -16,7 +16,6 @@ chmod +x "${ROOT_DIR}/ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle" "${ROOT_DIR}/ovftool/VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle" --eulas-agreed --required export TARGET_VM_IP -TARGET_VM_IP=$(cat nimbus-ips/name) export VM_NAME VM_NAME=$(cat integration-vm-name/name) echo "Using VM @ IPAddr: ${VM_NAME}@${TARGET_VM_IP}" diff --git a/ci/tasks/test-integration-stembuild-linux/task.yml b/ci/tasks/test-integration-stembuild-linux/task.yml index bb3e5c7d0..30f5840fd 100644 --- a/ci/tasks/test-integration-stembuild-linux/task.yml +++ b/ci/tasks/test-integration-stembuild-linux/task.yml @@ -6,7 +6,6 @@ inputs: - name: stemcell-builder - name: version - name: ovftool -- name: nimbus-ips - name: integration-vm-name run: @@ -26,3 +25,4 @@ params: PACKAGE_TEST_BASE_VM_NAME: OS_LINE: SKIP_CLEANUP: false + TARGET_VM_IP: diff --git a/ci/tasks/test-integration-stembuild-windows/run.ps1 b/ci/tasks/test-integration-stembuild-windows/run.ps1 index 082bbb7fc..d8c2188bd 100644 --- a/ci/tasks/test-integration-stembuild-windows/run.ps1 +++ b/ci/tasks/test-integration-stembuild-windows/run.ps1 @@ -22,7 +22,6 @@ $env:TEMP=$TMP_DIR $env:SystemTemp=$TMP_DIR $env:VM_NAME= cat $ROOT_DIR/integration-vm-name/name -$env:TARGET_VM_IP = cat $ROOT_DIR/nimbus-ips/name $env:STEMBUILD_VERSION = cat $ROOT_DIR/version/version $vcenterCertPath="$TMP_DIR\vcenter_ca.crt" diff --git a/ci/tasks/test-integration-stembuild-windows/task.yml b/ci/tasks/test-integration-stembuild-windows/task.yml index 7717b4c83..6ee3fdac2 100644 --- a/ci/tasks/test-integration-stembuild-windows/task.yml +++ b/ci/tasks/test-integration-stembuild-windows/task.yml @@ -5,7 +5,6 @@ inputs: - name: bosh-windows-stemcell-builder-ci - name: stemcell-builder - name: version -- name: nimbus-ips - name: integration-vm-name outputs: @@ -31,3 +30,4 @@ params: PACKAGE_TEST_BASE_VM_NAME: OS_LINE: SKIP_CLEANUP: false + TARGET_VM_IP: diff --git a/stembuild/integration/iaas_cli/govc_cli_test.go b/stembuild/integration/iaas_cli/govc_cli_test.go index f608a0ca2..fd245ef23 100644 --- a/stembuild/integration/iaas_cli/govc_cli_test.go +++ b/stembuild/integration/iaas_cli/govc_cli_test.go @@ -31,7 +31,7 @@ lsilogic-sas-1000 VirtualLsiLogicSASController LSI Logic SAS ethernet-0 VirtualE1000e internal-network vmci-12000 VirtualMachineVMCIDevice Device on the virtual machine PCI bus that provides support for the virtual machine communication interface ahci-15000 VirtualAHCIController AHCI -cdrom-16000 VirtualCdrom Remote device +cdrom-16000 VirtualCdrom Remote ATAPI ` out, _, err := runner.RunWithOutput([]string{"device.ls", "-vm", targetVMPath, "-u", vCenterCredentialUrl}) Expect(err).NotTo(HaveOccurred())