From 38fe79948ba7190e8c3032cc5fe0d4056b1e66c3 Mon Sep 17 00:00:00 2001 From: sylviamoss Date: Fri, 9 Apr 2021 14:41:11 +0200 Subject: [PATCH 1/7] remove vsphere components and docs --- builder/vsphere/clone/builder.go | 175 --- builder/vsphere/clone/builder_acc_test.go | 734 ----------- builder/vsphere/clone/builder_test.go | 15 - builder/vsphere/clone/config.go | 104 -- builder/vsphere/clone/config.hcl2spec.go | 282 ----- builder/vsphere/clone/config_test.go | 74 -- builder/vsphere/clone/step_clone.go | 136 -- builder/vsphere/clone/step_clone.hcl2spec.go | 71 -- builder/vsphere/clone/step_clone_test.go | 251 ---- builder/vsphere/clone/step_customize.go | 276 ----- .../vsphere/clone/step_customize.hcl2spec.go | 155 --- builder/vsphere/common/artifact.go | 50 - builder/vsphere/common/cleanup_vm.go | 30 - builder/vsphere/common/cleanup_vm_test.go | 62 - builder/vsphere/common/common_test.go | 19 - builder/vsphere/common/config_location.go | 53 - .../common/config_location.hcl2spec.go | 43 - builder/vsphere/common/config_ssh.go | 15 - builder/vsphere/common/output_config.go | 59 - .../vsphere/common/output_config.hcl2spec.go | 35 - builder/vsphere/common/step_add_cdrom.go | 81 -- .../vsphere/common/step_add_cdrom.hcl2spec.go | 33 - builder/vsphere/common/step_add_cdrom_test.go | 235 ---- builder/vsphere/common/step_add_floppy.go | 111 -- .../common/step_add_floppy.hcl2spec.go | 37 - .../vsphere/common/step_add_floppy_test.go | 453 ------- builder/vsphere/common/step_boot_command.go | 152 --- builder/vsphere/common/step_config_params.go | 65 - .../common/step_config_params.hcl2spec.go | 35 - builder/vsphere/common/step_connect.go | 64 - .../vsphere/common/step_connect.hcl2spec.go | 39 - builder/vsphere/common/step_download.go | 68 - builder/vsphere/common/step_download_test.go | 85 -- builder/vsphere/common/step_export.go | 338 ----- .../vsphere/common/step_export.hcl2spec.go | 45 - builder/vsphere/common/step_hardware.go | 98 -- .../vsphere/common/step_hardware.hcl2spec.go | 57 - builder/vsphere/common/step_hardware_test.go | 181 --- .../vsphere/common/step_http_ip_discover.go | 68 - .../common/step_http_ip_discover_test.go | 83 -- .../common/step_import_to_content_library.go | 180 --- ...step_import_to_content_library.hcl2spec.go | 49 - builder/vsphere/common/step_remote_upload.go | 117 -- .../vsphere/common/step_remote_upload_test.go | 71 -- builder/vsphere/common/step_remove_cdrom.go | 46 - .../common/step_remove_cdrom.hcl2spec.go | 31 - .../vsphere/common/step_remove_cdrom_test.go | 111 -- builder/vsphere/common/step_remove_floppy.go | 49 - .../vsphere/common/step_remove_floppy_test.go | 213 ---- builder/vsphere/common/step_run.go | 80 -- builder/vsphere/common/step_run.hcl2spec.go | 31 - builder/vsphere/common/step_shutdown.go | 109 -- .../vsphere/common/step_shutdown.hcl2spec.go | 35 - builder/vsphere/common/step_snapshot.go | 32 - builder/vsphere/common/step_ssh_key_pair.go | 115 -- builder/vsphere/common/step_template.go | 31 - builder/vsphere/common/step_wait_for_ip.go | 182 --- .../common/step_wait_for_ip.hcl2spec.go | 35 - builder/vsphere/common/storage_config.go | 118 -- .../vsphere/common/storage_config.hcl2spec.go | 62 - builder/vsphere/common/testing/utility.go | 69 -- builder/vsphere/driver/cluster.go | 19 - builder/vsphere/driver/datastore.go | 235 ---- builder/vsphere/driver/datastore_acc_test.go | 96 -- builder/vsphere/driver/datastore_mock.go | 81 -- builder/vsphere/driver/datastore_test.go | 174 --- builder/vsphere/driver/disk.go | 85 -- builder/vsphere/driver/disk_test.go | 46 - builder/vsphere/driver/driver.go | 129 -- builder/vsphere/driver/driver_mock.go | 119 -- builder/vsphere/driver/driver_test.go | 171 --- builder/vsphere/driver/folder.go | 93 -- builder/vsphere/driver/folder_acc_test.go | 19 - builder/vsphere/driver/host.go | 45 - builder/vsphere/driver/host_acc_test.go | 22 - builder/vsphere/driver/library.go | 113 -- builder/vsphere/driver/library_test.go | 62 - builder/vsphere/driver/network.go | 77 -- builder/vsphere/driver/resource_pool.go | 91 -- .../vsphere/driver/resource_pool_acc_test.go | 20 - builder/vsphere/driver/resource_pool_test.go | 71 -- builder/vsphere/driver/vm.go | 1102 ----------------- builder/vsphere/driver/vm_cdrom.go | 89 -- builder/vsphere/driver/vm_cdrom_test.go | 167 --- builder/vsphere/driver/vm_clone_acc_test.go | 312 ----- builder/vsphere/driver/vm_create_acc_test.go | 92 -- builder/vsphere/driver/vm_keyboard.go | 39 - builder/vsphere/driver/vm_mock.go | 235 ---- builder/vsphere/driver/vm_test.go | 187 --- .../vsphere/examples/alpine/alpine-3.8.json | 64 - .../examples/alpine/alpine-3.8.pkr.hcl | 44 - builder/vsphere/examples/alpine/answerfile | 15 - builder/vsphere/examples/alpine/setup.sh | 19 - builder/vsphere/examples/clone/alpine.json | 18 - builder/vsphere/examples/clone/alpine.pkr.hcl | 25 - builder/vsphere/examples/driver/main.go | 26 - .../vsphere/examples/macos/macos-10.13.json | 49 - .../examples/macos/macos-10.13.pkr.hcl | 43 - .../vsphere/examples/macos/setup/.gitignore | 1 - .../vsphere/examples/macos/setup/iso-macos.sh | 15 - .../vsphere/examples/macos/setup/iso-setup.sh | 27 - .../vsphere/examples/macos/setup/postinstall | 25 - builder/vsphere/examples/macos/setup/setup.sh | 13 - builder/vsphere/examples/ubuntu/preseed.cfg | 16 - .../vsphere/examples/ubuntu/ubuntu-16.04.json | 63 - .../examples/ubuntu/ubuntu-16.04.pkr.hcl | 52 - .../vsphere/examples/windows/.gitattributes | 2 - .../examples/windows/setup/Autounattend.xml | 122 -- .../vsphere/examples/windows/setup/setup.ps1 | 15 - .../examples/windows/setup/vmtools.cmd | 2 - .../vsphere/examples/windows/windows-10.json | 48 - .../examples/windows/windows-10.pkr.hcl | 41 - builder/vsphere/iso/builder.go | 179 --- builder/vsphere/iso/builder_acc_test.go | 568 --------- builder/vsphere/iso/common_test.go | 17 - builder/vsphere/iso/config.go | 107 -- builder/vsphere/iso/config.hcl2spec.go | 286 ----- builder/vsphere/iso/step_create.go | 188 --- builder/vsphere/iso/step_create.hcl2spec.go | 73 -- builder/vsphere/iso/step_create_test.go | 417 ------- builder/vsphere/test/lab.ovpn | 38 - builder/vsphere/test/lab.p12 | Bin 4141 -> 0 bytes builder/vsphere/test/test-key.pem | 27 - builder/vsphere/test/test-key.pub | 1 - builder/vsphere/version/version.go | 13 - command/plugin.go | 8 - .../vsphere-template/post-processor.go | 153 --- .../post-processor.hcl2spec.go | 65 - .../vsphere-template/post-processor_test.go | 39 - .../step_choose_datacenter.go | 35 - .../vsphere-template/step_create_folder.go | 86 -- .../vsphere-template/step_create_snapshot.go | 76 -- .../vsphere-template/step_mark_as_template.go | 186 --- .../vsphere-template/version/version.go | 13 - post-processor/vsphere/artifact.go | 47 - post-processor/vsphere/artifact_test.go | 22 - post-processor/vsphere/post-processor.go | 280 ----- .../vsphere/post-processor.hcl2spec.go | 75 -- post-processor/vsphere/post-processor_test.go | 130 -- post-processor/vsphere/version/version.go | 13 - .../content/docs/builders/vmware/index.mdx | 11 - .../docs/builders/vmware/vsphere-clone.mdx | 416 ------- .../docs/builders/vmware/vsphere-iso.mdx | 410 ------ .../docs/post-processors/vsphere-template.mdx | 168 --- .../content/docs/post-processors/vsphere.mdx | 180 --- .../clone/CloneConfig-not-required.mdx | 20 - .../vsphere/clone/Config-not-required.mdx | 15 - .../clone/CustomizeConfig-not-required.mdx | 9 - .../builder/vsphere/clone/CustomizeConfig.mdx | 12 - .../clone/GlobalDnsSettings-not-required.mdx | 5 - .../vsphere/clone/GlobalDnsSettings.mdx | 4 - .../GlobalRoutingSettings-not-required.mdx | 5 - .../vsphere/clone/GlobalRoutingSettings.mdx | 3 - .../clone/LinuxOptions-not-required.mdx | 9 - .../clone/NetworkInterface-not-required.mdx | 15 - .../vsphere/clone/vAppConfig-not-required.mdx | 9 - .../common/BootConfig-not-required.mdx | 4 - .../common/CDRomConfig-not-required.mdx | 12 - .../ConfigParamsConfig-not-required.mdx | 9 - .../common/ConnectConfig-not-required.mdx | 11 - ...tLibraryDestinationConfig-not-required.mdx | 46 - .../ContentLibraryDestinationConfig.mdx | 5 - .../common/DiskConfig-not-required.mdx | 7 - .../vsphere/common/DiskConfig-required.mdx | 3 - .../builder/vsphere/common/DiskConfig.mdx | 74 -- .../common/ExportConfig-not-required.mdx | 32 - .../builder/vsphere/common/ExportConfig.mdx | 33 - .../common/FloppyConfig-not-required.mdx | 14 - .../common/HardwareConfig-not-required.mdx | 31 - .../common/LocationConfig-not-required.mdx | 24 - .../common/OutputConfig-not-required.mdx | 16 - .../common/RemoveCDRomConfig-not-required.mdx | 3 - .../vsphere/common/RunConfig-not-required.mdx | 3 - .../common/ShutdownConfig-not-required.mdx | 16 - .../common/StorageConfig-not-required.mdx | 8 - .../common/WaitIpConfig-not-required.mdx | 20 - .../vsphere/iso/Config-not-required.mdx | 13 - .../vsphere/iso/CreateConfig-not-required.mdx | 16 - .../builder/vsphere/iso/NIC-not-required.mdx | 10 - .../builder/vsphere/iso/NIC-required.mdx | 3 - .../partials/builder/vsphere/iso/NIC.mdx | 30 - website/data/docs-nav-data.json | 16 - 182 files changed, 16361 deletions(-) delete mode 100644 builder/vsphere/clone/builder.go delete mode 100644 builder/vsphere/clone/builder_acc_test.go delete mode 100644 builder/vsphere/clone/builder_test.go delete mode 100644 builder/vsphere/clone/config.go delete mode 100644 builder/vsphere/clone/config.hcl2spec.go delete mode 100644 builder/vsphere/clone/config_test.go delete mode 100644 builder/vsphere/clone/step_clone.go delete mode 100644 builder/vsphere/clone/step_clone.hcl2spec.go delete mode 100644 builder/vsphere/clone/step_clone_test.go delete mode 100644 builder/vsphere/clone/step_customize.go delete mode 100644 builder/vsphere/clone/step_customize.hcl2spec.go delete mode 100644 builder/vsphere/common/artifact.go delete mode 100644 builder/vsphere/common/cleanup_vm.go delete mode 100644 builder/vsphere/common/cleanup_vm_test.go delete mode 100644 builder/vsphere/common/common_test.go delete mode 100644 builder/vsphere/common/config_location.go delete mode 100644 builder/vsphere/common/config_location.hcl2spec.go delete mode 100644 builder/vsphere/common/config_ssh.go delete mode 100644 builder/vsphere/common/output_config.go delete mode 100644 builder/vsphere/common/output_config.hcl2spec.go delete mode 100644 builder/vsphere/common/step_add_cdrom.go delete mode 100644 builder/vsphere/common/step_add_cdrom.hcl2spec.go delete mode 100644 builder/vsphere/common/step_add_cdrom_test.go delete mode 100644 builder/vsphere/common/step_add_floppy.go delete mode 100644 builder/vsphere/common/step_add_floppy.hcl2spec.go delete mode 100644 builder/vsphere/common/step_add_floppy_test.go delete mode 100644 builder/vsphere/common/step_boot_command.go delete mode 100644 builder/vsphere/common/step_config_params.go delete mode 100644 builder/vsphere/common/step_config_params.hcl2spec.go delete mode 100644 builder/vsphere/common/step_connect.go delete mode 100644 builder/vsphere/common/step_connect.hcl2spec.go delete mode 100644 builder/vsphere/common/step_download.go delete mode 100644 builder/vsphere/common/step_download_test.go delete mode 100644 builder/vsphere/common/step_export.go delete mode 100644 builder/vsphere/common/step_export.hcl2spec.go delete mode 100644 builder/vsphere/common/step_hardware.go delete mode 100644 builder/vsphere/common/step_hardware.hcl2spec.go delete mode 100644 builder/vsphere/common/step_hardware_test.go delete mode 100644 builder/vsphere/common/step_http_ip_discover.go delete mode 100644 builder/vsphere/common/step_http_ip_discover_test.go delete mode 100644 builder/vsphere/common/step_import_to_content_library.go delete mode 100644 builder/vsphere/common/step_import_to_content_library.hcl2spec.go delete mode 100644 builder/vsphere/common/step_remote_upload.go delete mode 100644 builder/vsphere/common/step_remote_upload_test.go delete mode 100644 builder/vsphere/common/step_remove_cdrom.go delete mode 100644 builder/vsphere/common/step_remove_cdrom.hcl2spec.go delete mode 100644 builder/vsphere/common/step_remove_cdrom_test.go delete mode 100644 builder/vsphere/common/step_remove_floppy.go delete mode 100644 builder/vsphere/common/step_remove_floppy_test.go delete mode 100644 builder/vsphere/common/step_run.go delete mode 100644 builder/vsphere/common/step_run.hcl2spec.go delete mode 100644 builder/vsphere/common/step_shutdown.go delete mode 100644 builder/vsphere/common/step_shutdown.hcl2spec.go delete mode 100644 builder/vsphere/common/step_snapshot.go delete mode 100644 builder/vsphere/common/step_ssh_key_pair.go delete mode 100644 builder/vsphere/common/step_template.go delete mode 100644 builder/vsphere/common/step_wait_for_ip.go delete mode 100644 builder/vsphere/common/step_wait_for_ip.hcl2spec.go delete mode 100644 builder/vsphere/common/storage_config.go delete mode 100644 builder/vsphere/common/storage_config.hcl2spec.go delete mode 100644 builder/vsphere/common/testing/utility.go delete mode 100644 builder/vsphere/driver/cluster.go delete mode 100644 builder/vsphere/driver/datastore.go delete mode 100644 builder/vsphere/driver/datastore_acc_test.go delete mode 100644 builder/vsphere/driver/datastore_mock.go delete mode 100644 builder/vsphere/driver/datastore_test.go delete mode 100644 builder/vsphere/driver/disk.go delete mode 100644 builder/vsphere/driver/disk_test.go delete mode 100644 builder/vsphere/driver/driver.go delete mode 100644 builder/vsphere/driver/driver_mock.go delete mode 100644 builder/vsphere/driver/driver_test.go delete mode 100644 builder/vsphere/driver/folder.go delete mode 100644 builder/vsphere/driver/folder_acc_test.go delete mode 100644 builder/vsphere/driver/host.go delete mode 100644 builder/vsphere/driver/host_acc_test.go delete mode 100644 builder/vsphere/driver/library.go delete mode 100644 builder/vsphere/driver/library_test.go delete mode 100644 builder/vsphere/driver/network.go delete mode 100644 builder/vsphere/driver/resource_pool.go delete mode 100644 builder/vsphere/driver/resource_pool_acc_test.go delete mode 100644 builder/vsphere/driver/resource_pool_test.go delete mode 100644 builder/vsphere/driver/vm.go delete mode 100644 builder/vsphere/driver/vm_cdrom.go delete mode 100644 builder/vsphere/driver/vm_cdrom_test.go delete mode 100644 builder/vsphere/driver/vm_clone_acc_test.go delete mode 100644 builder/vsphere/driver/vm_create_acc_test.go delete mode 100644 builder/vsphere/driver/vm_keyboard.go delete mode 100644 builder/vsphere/driver/vm_mock.go delete mode 100644 builder/vsphere/driver/vm_test.go delete mode 100644 builder/vsphere/examples/alpine/alpine-3.8.json delete mode 100644 builder/vsphere/examples/alpine/alpine-3.8.pkr.hcl delete mode 100644 builder/vsphere/examples/alpine/answerfile delete mode 100644 builder/vsphere/examples/alpine/setup.sh delete mode 100644 builder/vsphere/examples/clone/alpine.json delete mode 100644 builder/vsphere/examples/clone/alpine.pkr.hcl delete mode 100644 builder/vsphere/examples/driver/main.go delete mode 100644 builder/vsphere/examples/macos/macos-10.13.json delete mode 100644 builder/vsphere/examples/macos/macos-10.13.pkr.hcl delete mode 100644 builder/vsphere/examples/macos/setup/.gitignore delete mode 100644 builder/vsphere/examples/macos/setup/iso-macos.sh delete mode 100644 builder/vsphere/examples/macos/setup/iso-setup.sh delete mode 100644 builder/vsphere/examples/macos/setup/postinstall delete mode 100644 builder/vsphere/examples/macos/setup/setup.sh delete mode 100644 builder/vsphere/examples/ubuntu/preseed.cfg delete mode 100644 builder/vsphere/examples/ubuntu/ubuntu-16.04.json delete mode 100644 builder/vsphere/examples/ubuntu/ubuntu-16.04.pkr.hcl delete mode 100644 builder/vsphere/examples/windows/.gitattributes delete mode 100644 builder/vsphere/examples/windows/setup/Autounattend.xml delete mode 100644 builder/vsphere/examples/windows/setup/setup.ps1 delete mode 100644 builder/vsphere/examples/windows/setup/vmtools.cmd delete mode 100644 builder/vsphere/examples/windows/windows-10.json delete mode 100644 builder/vsphere/examples/windows/windows-10.pkr.hcl delete mode 100644 builder/vsphere/iso/builder.go delete mode 100644 builder/vsphere/iso/builder_acc_test.go delete mode 100644 builder/vsphere/iso/common_test.go delete mode 100644 builder/vsphere/iso/config.go delete mode 100644 builder/vsphere/iso/config.hcl2spec.go delete mode 100644 builder/vsphere/iso/step_create.go delete mode 100644 builder/vsphere/iso/step_create.hcl2spec.go delete mode 100644 builder/vsphere/iso/step_create_test.go delete mode 100644 builder/vsphere/test/lab.ovpn delete mode 100644 builder/vsphere/test/lab.p12 delete mode 100644 builder/vsphere/test/test-key.pem delete mode 100644 builder/vsphere/test/test-key.pub delete mode 100644 builder/vsphere/version/version.go delete mode 100644 post-processor/vsphere-template/post-processor.go delete mode 100644 post-processor/vsphere-template/post-processor.hcl2spec.go delete mode 100644 post-processor/vsphere-template/post-processor_test.go delete mode 100644 post-processor/vsphere-template/step_choose_datacenter.go delete mode 100644 post-processor/vsphere-template/step_create_folder.go delete mode 100644 post-processor/vsphere-template/step_create_snapshot.go delete mode 100644 post-processor/vsphere-template/step_mark_as_template.go delete mode 100644 post-processor/vsphere-template/version/version.go delete mode 100644 post-processor/vsphere/artifact.go delete mode 100644 post-processor/vsphere/artifact_test.go delete mode 100644 post-processor/vsphere/post-processor.go delete mode 100644 post-processor/vsphere/post-processor.hcl2spec.go delete mode 100644 post-processor/vsphere/post-processor_test.go delete mode 100644 post-processor/vsphere/version/version.go delete mode 100644 website/content/docs/builders/vmware/vsphere-clone.mdx delete mode 100644 website/content/docs/builders/vmware/vsphere-iso.mdx delete mode 100644 website/content/docs/post-processors/vsphere-template.mdx delete mode 100644 website/content/docs/post-processors/vsphere.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/CloneConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/Config-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/CustomizeConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/CustomizeConfig.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/GlobalDnsSettings-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/GlobalDnsSettings.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/GlobalRoutingSettings-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/GlobalRoutingSettings.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/LinuxOptions-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/NetworkInterface-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/clone/vAppConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/BootConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/CDRomConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ConfigParamsConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ConnectConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig.mdx delete mode 100644 website/content/partials/builder/vsphere/common/DiskConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/DiskConfig-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/DiskConfig.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ExportConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ExportConfig.mdx delete mode 100644 website/content/partials/builder/vsphere/common/FloppyConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/HardwareConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/LocationConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/OutputConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/RemoveCDRomConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/RunConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/ShutdownConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/StorageConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/common/WaitIpConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/iso/Config-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/iso/CreateConfig-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/iso/NIC-not-required.mdx delete mode 100644 website/content/partials/builder/vsphere/iso/NIC-required.mdx delete mode 100644 website/content/partials/builder/vsphere/iso/NIC.mdx diff --git a/builder/vsphere/clone/builder.go b/builder/vsphere/clone/builder.go deleted file mode 100644 index d9c34bab9..000000000 --- a/builder/vsphere/clone/builder.go +++ /dev/null @@ -1,175 +0,0 @@ -package clone - -import ( - "context" - "fmt" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type Builder struct { - config Config - runner multistep.Runner -} - -func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } - -func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { - warnings, errs := b.config.Prepare(raws...) - if errs != nil { - return nil, warnings, errs - } - - return nil, warnings, nil -} - -func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { - state := new(multistep.BasicStateBag) - state.Put("debug", b.config.PackerDebug) - state.Put("hook", hook) - state.Put("ui", ui) - - var steps []multistep.Step - - steps = append(steps, - &common.StepConnect{ - Config: &b.config.ConnectConfig, - }, - &commonsteps.StepCreateCD{ - Files: b.config.CDConfig.CDFiles, - Label: b.config.CDConfig.CDLabel, - }, - &common.StepRemoteUpload{ - Datastore: b.config.Datastore, - Host: b.config.Host, - SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, - }, - &StepCloneVM{ - Config: &b.config.CloneConfig, - Location: &b.config.LocationConfig, - Force: b.config.PackerConfig.PackerForce, - }, - &common.StepConfigureHardware{ - Config: &b.config.HardwareConfig, - }, - &common.StepAddCDRom{ - Config: &b.config.CDRomConfig, - }, - &common.StepConfigParams{ - Config: &b.config.ConfigParamsConfig, - }, - ) - - if b.config.CustomizeConfig != nil { - steps = append(steps, &StepCustomize{ - Config: b.config.CustomizeConfig, - }) - } - - if b.config.Comm.Type != "none" { - steps = append(steps, - &commonsteps.StepCreateFloppy{ - Files: b.config.FloppyFiles, - Directories: b.config.FloppyDirectories, - Label: b.config.FloppyLabel, - }, - &common.StepAddFloppy{ - Config: &b.config.FloppyConfig, - Datastore: b.config.Datastore, - Host: b.config.Host, - SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, - }, - &common.StepHTTPIPDiscover{ - HTTPIP: b.config.BootConfig.HTTPIP, - Network: b.config.WaitIpConfig.GetIPNet(), - }, - commonsteps.HTTPServerFromHTTPConfig(&b.config.HTTPConfig), - &common.StepSshKeyPair{ - Debug: b.config.PackerDebug, - DebugKeyPath: fmt.Sprintf("%s.pem", b.config.PackerBuildName), - Comm: &b.config.Comm, - }, - &common.StepRun{ - Config: &b.config.RunConfig, - SetOrder: false, - }, - &common.StepBootCommand{ - Config: &b.config.BootConfig, - Ctx: b.config.ctx, - VMName: b.config.VMName, - }, - &common.StepWaitForIp{ - Config: &b.config.WaitIpConfig, - }, - &communicator.StepConnect{ - Config: &b.config.Comm, - Host: common.CommHost(b.config.Comm.Host()), - SSHConfig: b.config.Comm.SSHConfigFunc(), - }, - &commonsteps.StepProvision{}, - &common.StepShutdown{ - Config: &b.config.ShutdownConfig, - }, - &common.StepRemoveFloppy{ - Datastore: b.config.Datastore, - Host: b.config.Host, - }, - ) - } - - steps = append(steps, - &common.StepRemoveCDRom{ - Config: &b.config.RemoveCDRomConfig, - }, - &common.StepCreateSnapshot{ - CreateSnapshot: b.config.CreateSnapshot, - }, - &common.StepConvertToTemplate{ - ConvertToTemplate: b.config.ConvertToTemplate, - }, - ) - - if b.config.ContentLibraryDestinationConfig != nil { - steps = append(steps, &common.StepImportToContentLibrary{ - ContentLibConfig: b.config.ContentLibraryDestinationConfig, - }) - } - - if b.config.Export != nil { - steps = append(steps, &common.StepExport{ - Name: b.config.Export.Name, - Force: b.config.Export.Force, - Images: b.config.Export.Images, - Manifest: b.config.Export.Manifest, - OutputDir: b.config.Export.OutputDir.OutputDir, - Options: b.config.Export.Options, - }) - } - - b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) - b.runner.Run(ctx, state) - - if rawErr, ok := state.GetOk("error"); ok { - return nil, rawErr.(error) - } - - if _, ok := state.GetOk("vm"); !ok { - return nil, nil - } - artifact := &common.Artifact{ - Name: b.config.VMName, - VM: state.Get("vm").(*driver.VirtualMachineDriver), - StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, - } - if b.config.Export != nil { - artifact.Outconfig = &b.config.Export.OutputDir - } - - return artifact, nil -} diff --git a/builder/vsphere/clone/builder_acc_test.go b/builder/vsphere/clone/builder_acc_test.go deleted file mode 100644 index f39610644..000000000 --- a/builder/vsphere/clone/builder_acc_test.go +++ /dev/null @@ -1,734 +0,0 @@ -package clone - -import ( - "os" - "testing" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - builderT "github.com/hashicorp/packer/acctest" - "github.com/hashicorp/packer/builder/vsphere/common" - commonT "github.com/hashicorp/packer/builder/vsphere/common/testing" - "github.com/vmware/govmomi/vim25/types" -) - -func TestCloneBuilderAcc_default(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - config := defaultConfig() - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - Check: checkDefault(t, config["vm_name"].(string), config["host"].(string), "datastore1"), - }) -} - -func defaultConfig() map[string]interface{} { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - config := map[string]interface{}{ - "vcenter_server": "vcenter.vsphere65.test", - "username": username, - "password": password, - "insecure_connection": true, - - "template": "alpine", - "host": "esxi-1.vsphere65.test", - - "linked_clone": true, // speed up - "communicator": "none", - } - config["vm_name"] = commonT.NewVMName() - return config -} - -func checkDefault(t *testing.T, name string, host string, datastore string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if vmInfo.Name != name { - t.Errorf("Invalid VM name: expected '%v', got '%v'", name, vmInfo.Name) - } - - f := d.NewFolder(vmInfo.Parent) - folderPath, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if folderPath != "" { - t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) - } - - h := d.NewHost(vmInfo.Runtime.Host) - hostInfo, err := h.Info("name") - if err != nil { - t.Fatal("Cannot read host properties: ", err) - } - if hostInfo.Name != host { - t.Errorf("Invalid host name: expected '%v', got '%v'", host, hostInfo.Name) - } - - p := d.NewResourcePool(vmInfo.ResourcePool) - poolPath, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if poolPath != "" { - t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) - } - - dsr := vmInfo.Datastore[0].Reference() - ds := d.NewDatastore(&dsr) - dsInfo, err := ds.Info("name") - if err != nil { - t.Fatal("Cannot read datastore properties: ", err) - } - if dsInfo.Name != datastore { - t.Errorf("Invalid datastore name: expected '%v', got '%v'", datastore, dsInfo.Name) - } - - return nil - } -} - -func TestCloneBuilderAcc_artifact(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - config := defaultConfig() - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - Check: checkArtifact(t), - }) -} - -func checkArtifact(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - if len(artifacts) > 1 { - t.Fatal("more than 1 artifact") - } - - artifactRaw := artifacts[0] - _, ok := artifactRaw.(*common.Artifact) - if !ok { - t.Fatalf("unknown artifact: %#v", artifactRaw) - } - - return nil - } -} - -func TestCloneBuilderAcc_folder(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: folderConfig(), - Check: checkFolder(t, "folder1/folder2"), - }) -} - -func folderConfig() string { - config := defaultConfig() - config["folder"] = "folder1/folder2" - return commonT.RenderConfig(config) -} - -func checkFolder(t *testing.T, folder string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("parent") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - f := d.NewFolder(vmInfo.Parent) - path, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if path != folder { - t.Errorf("Wrong folder. expected: %v, got: %v", folder, path) - } - - return nil - } -} - -func TestCloneBuilderAcc_resourcePool(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: resourcePoolConfig(), - Check: checkResourcePool(t, "pool1/pool2"), - }) -} - -func resourcePoolConfig() string { - config := defaultConfig() - config["resource_pool"] = "pool1/pool2" - return commonT.RenderConfig(config) -} - -func checkResourcePool(t *testing.T, pool string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("resourcePool") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - p := d.NewResourcePool(vmInfo.ResourcePool) - path, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if path != pool { - t.Errorf("Wrong folder. expected: %v, got: %v", pool, path) - } - - return nil - } -} - -func TestCloneBuilderAcc_datastore(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: datastoreConfig(), - Check: checkDatastore(t, "datastore1"), // on esxi-1.vsphere65.test - }) -} - -func datastoreConfig() string { - config := defaultConfig() - config["template"] = "alpine-host4" // on esxi-4.vsphere65.test - config["linked_clone"] = false - return commonT.RenderConfig(config) -} - -func checkDatastore(t *testing.T, name string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("datastore") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - n := len(vmInfo.Datastore) - if n != 1 { - t.Fatalf("VM should have 1 datastore, got %v", n) - } - - ds := d.NewDatastore(&vmInfo.Datastore[0]) - info, err := ds.Info("name") - if err != nil { - t.Fatalf("Cannot read datastore properties: %v", err) - } - if info.Name != name { - t.Errorf("Wrong datastore. expected: %v, got: %v", name, info.Name) - } - - return nil - } -} - -func TestCloneBuilderAcc_multipleDatastores(t *testing.T) { - t.Skip("test must fail") - - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: multipleDatastoresConfig(), - }) -} - -func multipleDatastoresConfig() string { - config := defaultConfig() - config["host"] = "esxi-4.vsphere65.test" // host with 2 datastores - config["linked_clone"] = false - return commonT.RenderConfig(config) -} - -func TestCloneBuilderAcc_fullClone(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: fullCloneConfig(), - Check: checkFullClone(t), - }) -} - -func fullCloneConfig() string { - config := defaultConfig() - config["linked_clone"] = false - return commonT.RenderConfig(config) -} - -func checkFullClone(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if len(vmInfo.LayoutEx.Disk[0].Chain) != 1 { - t.Error("Not a full clone") - } - - return nil - } -} - -func TestCloneBuilderAcc_linkedClone(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: linkedCloneConfig(), - Check: checkLinkedClone(t), - }) -} - -func linkedCloneConfig() string { - config := defaultConfig() - config["linked_clone"] = true - return commonT.RenderConfig(config) -} - -func checkLinkedClone(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if len(vmInfo.LayoutEx.Disk[0].Chain) != 2 { - t.Error("Not a linked clone") - } - - return nil - } -} - -func TestCloneBuilderAcc_network(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: networkConfig(), - Check: checkNetwork(t, "VM Network 2"), - }) -} - -func networkConfig() string { - config := defaultConfig() - config["template"] = "alpine-host4" - config["host"] = "esxi-4.vsphere65.test" - config["datastore"] = "datastore4" - config["network"] = "VM Network 2" - return commonT.RenderConfig(config) -} - -func checkNetwork(t *testing.T, name string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("network") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - n := len(vmInfo.Network) - if n != 1 { - t.Fatalf("VM should have 1 network, got %v", n) - } - - ds := d.NewNetwork(&vmInfo.Network[0]) - info, err := ds.Info("name") - if err != nil { - t.Fatalf("Cannot read network properties: %v", err) - } - if info.Name != name { - t.Errorf("Wrong network. expected: %v, got: %v", name, info.Name) - } - - return nil - } -} - -func TestCloneBuilderAcc_hardware(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: hardwareConfig(), - Check: checkHardware(t), - }) -} - -func hardwareConfig() string { - config := defaultConfig() - config["CPUs"] = 2 - config["cpu_cores"] = 2 - config["CPU_reservation"] = 1000 - config["CPU_limit"] = 1500 - config["RAM"] = 2048 - config["RAM_reservation"] = 1024 - config["CPU_hot_plug"] = true - config["RAM_hot_plug"] = true - config["video_ram"] = 8192 - - return commonT.RenderConfig(config) -} - -func checkHardware(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("config") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - cpuSockets := vmInfo.Config.Hardware.NumCPU - if cpuSockets != 2 { - t.Errorf("VM should have 2 CPU sockets, got %v", cpuSockets) - } - - cpuCores := vmInfo.Config.Hardware.NumCoresPerSocket - if cpuCores != 2 { - t.Errorf("VM should have 2 CPU cores per socket, got %v", cpuCores) - } - - cpuReservation := *vmInfo.Config.CpuAllocation.Reservation - if cpuReservation != 1000 { - t.Errorf("VM should have CPU reservation for 1000 Mhz, got %v", cpuReservation) - } - - cpuLimit := *vmInfo.Config.CpuAllocation.Limit - if cpuLimit != 1500 { - t.Errorf("VM should have CPU reservation for 1500 Mhz, got %v", cpuLimit) - } - - ram := vmInfo.Config.Hardware.MemoryMB - if ram != 2048 { - t.Errorf("VM should have 2048 MB of RAM, got %v", ram) - } - - ramReservation := *vmInfo.Config.MemoryAllocation.Reservation - if ramReservation != 1024 { - t.Errorf("VM should have RAM reservation for 1024 MB, got %v", ramReservation) - } - - cpuHotAdd := vmInfo.Config.CpuHotAddEnabled - if !*cpuHotAdd { - t.Errorf("VM should have CPU hot add enabled, got %v", cpuHotAdd) - } - - memoryHotAdd := vmInfo.Config.MemoryHotAddEnabled - if !*memoryHotAdd { - t.Errorf("VM should have Memory hot add enabled, got %v", memoryHotAdd) - } - - l, err := vm.Devices() - if err != nil { - t.Fatalf("Cannot read VM devices: %v", err) - } - v := l.SelectByType((*types.VirtualMachineVideoCard)(nil)) - if len(v) != 1 { - t.Errorf("VM should have one video card") - } - if v[0].(*types.VirtualMachineVideoCard).VideoRamSizeInKB != 8192 { - t.Errorf("Video RAM should be equal 8192") - } - - return nil - } -} - -func TestCloneBuilderAcc_RAMReservation(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: RAMReservationConfig(), - Check: checkRAMReservation(t), - }) -} - -func RAMReservationConfig() string { - config := defaultConfig() - config["RAM_reserve_all"] = true - - return commonT.RenderConfig(config) -} - -func checkRAMReservation(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("config") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if *vmInfo.Config.MemoryReservationLockedToMax != true { - t.Errorf("VM should have all RAM reserved") - } - - return nil - } -} - -func TestCloneBuilderAcc_sshPassword(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: sshPasswordConfig(), - Check: checkDefaultBootOrder(t), - }) -} - -func sshPasswordConfig() string { - config := defaultConfig() - config["communicator"] = "ssh" - config["ssh_username"] = "root" - config["ssh_password"] = "jetbrains" - return commonT.RenderConfig(config) -} - -func checkDefaultBootOrder(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.bootOptions") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - order := vmInfo.Config.BootOptions.BootOrder - if order != nil { - t.Errorf("Boot order must be empty") - } - - return nil - } -} - -func TestCloneBuilderAcc_sshKey(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: sshKeyConfig(), - }) -} - -func sshKeyConfig() string { - config := defaultConfig() - config["communicator"] = "ssh" - config["ssh_username"] = "root" - config["ssh_private_key_file"] = "../test/test-key.pem" - return commonT.RenderConfig(config) -} - -func TestCloneBuilderAcc_snapshot(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: snapshotConfig(), - Check: checkSnapshot(t), - }) -} - -func snapshotConfig() string { - config := defaultConfig() - config["linked_clone"] = false - config["create_snapshot"] = true - return commonT.RenderConfig(config) -} - -func checkSnapshot(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - layers := len(vmInfo.LayoutEx.Disk[0].Chain) - if layers != 2 { - t.Errorf("VM should have a single snapshot. expected 2 disk layers, got %v", layers) - } - - return nil - } -} - -func TestCloneBuilderAcc_template(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: templateConfig(), - Check: checkTemplate(t), - }) -} - -func templateConfig() string { - config := defaultConfig() - config["convert_to_template"] = true - return commonT.RenderConfig(config) -} - -func checkTemplate(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("config.template") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if vmInfo.Config.Template != true { - t.Error("Not a template") - } - - return nil - } -} - -func TestCloneBuilderAcc_bootOrder(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: bootOrderConfig(), - Check: checkBootOrder(t), - }) -} - -func bootOrderConfig() string { - config := defaultConfig() - config["communicator"] = "ssh" - config["ssh_username"] = "root" - config["ssh_password"] = "jetbrains" - - config["boot_order"] = "disk,cdrom,floppy" - - return commonT.RenderConfig(config) -} - -func checkBootOrder(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.bootOptions") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - order := vmInfo.Config.BootOptions.BootOrder - if order == nil { - t.Errorf("Boot order must not be empty") - } - - return nil - } -} - -func TestCloneBuilderAcc_notes(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: notesConfig(), - Check: checkNotes(t), - }) -} - -func notesConfig() string { - config := defaultConfig() - config["notes"] = "test" - - return commonT.RenderConfig(config) -} - -func checkNotes(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.annotation") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - notes := vmInfo.Config.Annotation - if notes != "test" { - t.Errorf("notest should be 'test'") - } - - return nil - } -} - -func TestCloneBuilderAcc_windows(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - t.Skip("test is too slow") - config := windowsConfig() - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - }) -} - -func windowsConfig() map[string]interface{} { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - config := map[string]interface{}{ - "vcenter_server": "vcenter.vsphere65.test", - "username": username, - "password": password, - "insecure_connection": true, - - "vm_name": commonT.NewVMName(), - "template": "windows", - "host": "esxi-1.vsphere65.test", - "linked_clone": true, // speed up - - "communicator": "winrm", - "winrm_username": "jetbrains", - "winrm_password": "jetbrains", - } - - return config -} diff --git a/builder/vsphere/clone/builder_test.go b/builder/vsphere/clone/builder_test.go deleted file mode 100644 index a3150f52b..000000000 --- a/builder/vsphere/clone/builder_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package clone - -import ( - "testing" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" -) - -func TestCloneBuilder_ImplementsBuilder(t *testing.T) { - var raw interface{} - raw = &Builder{} - if _, ok := raw.(packersdk.Builder); !ok { - t.Fatalf("Builder should be a builder") - } -} diff --git a/builder/vsphere/clone/config.go b/builder/vsphere/clone/config.go deleted file mode 100644 index 8d2160577..000000000 --- a/builder/vsphere/clone/config.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type Config - -package clone - -import ( - packerCommon "github.com/hashicorp/packer-plugin-sdk/common" - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - "github.com/hashicorp/packer/builder/vsphere/common" -) - -type Config struct { - packerCommon.PackerConfig `mapstructure:",squash"` - commonsteps.HTTPConfig `mapstructure:",squash"` - commonsteps.CDConfig `mapstructure:",squash"` - - common.ConnectConfig `mapstructure:",squash"` - CloneConfig `mapstructure:",squash"` - common.LocationConfig `mapstructure:",squash"` - common.HardwareConfig `mapstructure:",squash"` - common.ConfigParamsConfig `mapstructure:",squash"` - - common.CDRomConfig `mapstructure:",squash"` - common.RemoveCDRomConfig `mapstructure:",squash"` - common.FloppyConfig `mapstructure:",squash"` - common.RunConfig `mapstructure:",squash"` - common.BootConfig `mapstructure:",squash"` - common.WaitIpConfig `mapstructure:",squash"` - Comm communicator.Config `mapstructure:",squash"` - common.ShutdownConfig `mapstructure:",squash"` - - // Create a snapshot when set to `true`, so the VM can be used as a base - // for linked clones. Defaults to `false`. - CreateSnapshot bool `mapstructure:"create_snapshot"` - // Convert VM to a template. Defaults to `false`. - ConvertToTemplate bool `mapstructure:"convert_to_template"` - // Configuration for exporting VM to an ovf file. - // The VM will not be exported if no [Export Configuration](#export-configuration) is specified. - Export *common.ExportConfig `mapstructure:"export"` - // Configuration for importing a VM template or OVF template to a Content Library. - // The template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. - // The import doesn't work if [convert_to_template](#convert_to_template) is set to true. - ContentLibraryDestinationConfig *common.ContentLibraryDestinationConfig `mapstructure:"content_library_destination"` - // Customize the cloned VM to configure host, network, or licensing settings. See the [customization options](#customization). - CustomizeConfig *CustomizeConfig `mapstructure:"customize"` - - ctx interpolate.Context -} - -func (c *Config) Prepare(raws ...interface{}) ([]string, error) { - err := config.Decode(c, &config.DecodeOpts{ - PluginType: common.BuilderId, - Interpolate: true, - InterpolateContext: &c.ctx, - InterpolateFilter: &interpolate.RenderFilter{ - Exclude: []string{ - "boot_command", - }, - }, - }, raws...) - if err != nil { - return nil, err - } - - // warnings := make([]string, 0) - errs := new(packersdk.MultiError) - - errs = packersdk.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.CloneConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.LocationConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.HTTPConfig.Prepare(&c.ctx)...) - - errs = packersdk.MultiErrorAppend(errs, c.CDRomConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.CDConfig.Prepare(&c.ctx)...) - errs = packersdk.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) - errs = packersdk.MultiErrorAppend(errs, c.WaitIpConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) - - _, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) - // shutdownWarnings, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) - // warnings = append(warnings, shutdownWarnings...) - errs = packersdk.MultiErrorAppend(errs, shutdownErrs...) - - if c.Export != nil { - errs = packersdk.MultiErrorAppend(errs, c.Export.Prepare(&c.ctx, &c.LocationConfig, &c.PackerConfig)...) - } - if c.ContentLibraryDestinationConfig != nil { - errs = packersdk.MultiErrorAppend(errs, c.ContentLibraryDestinationConfig.Prepare(&c.LocationConfig)...) - } - if c.CustomizeConfig != nil { - errs = packersdk.MultiErrorAppend(errs, c.CustomizeConfig.Prepare()...) - } - - if len(errs.Errors) > 0 { - return nil, errs - } - - return nil, nil -} diff --git a/builder/vsphere/clone/config.hcl2spec.go b/builder/vsphere/clone/config.hcl2spec.go deleted file mode 100644 index ad7787e7e..000000000 --- a/builder/vsphere/clone/config.hcl2spec.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. - -package clone - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/zclconf/go-cty/cty" -) - -// FlatConfig is an auto-generated flat version of Config. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConfig struct { - PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` - PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` - PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` - PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` - PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` - PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` - PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` - PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` - HTTPDir *string `mapstructure:"http_directory" cty:"http_directory" hcl:"http_directory"` - HTTPContent map[string]string `mapstructure:"http_content" cty:"http_content" hcl:"http_content"` - HTTPPortMin *int `mapstructure:"http_port_min" cty:"http_port_min" hcl:"http_port_min"` - HTTPPortMax *int `mapstructure:"http_port_max" cty:"http_port_max" hcl:"http_port_max"` - HTTPAddress *string `mapstructure:"http_bind_address" cty:"http_bind_address" hcl:"http_bind_address"` - HTTPInterface *string `mapstructure:"http_interface" undocumented:"true" cty:"http_interface" hcl:"http_interface"` - CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"` - CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"` - VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` - Username *string `mapstructure:"username" cty:"username" hcl:"username"` - Password *string `mapstructure:"password" cty:"password" hcl:"password"` - InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` - Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` - Template *string `mapstructure:"template" cty:"template" hcl:"template"` - DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` - LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` - Network *string `mapstructure:"network" cty:"network" hcl:"network"` - MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` - Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` - VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` - DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` - Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` - VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` - Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` - Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` - Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` - SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` - CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` - CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` - CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` - CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` - CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` - RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` - RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` - RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` - MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` - VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` - VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` - NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` - Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` - ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` - ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` - ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` - ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` - CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` - ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` - RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` - FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` - FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` - FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` - FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` - BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` - BootGroupInterval *string `mapstructure:"boot_keygroup_interval" cty:"boot_keygroup_interval" hcl:"boot_keygroup_interval"` - BootWait *string `mapstructure:"boot_wait" cty:"boot_wait" hcl:"boot_wait"` - BootCommand []string `mapstructure:"boot_command" cty:"boot_command" hcl:"boot_command"` - HTTPIP *string `mapstructure:"http_ip" cty:"http_ip" hcl:"http_ip"` - WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` - SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` - WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` - Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` - PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` - SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` - SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` - SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` - SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` - SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` - SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` - SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` - SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` - SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` - SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` - SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` - SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` - SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` - SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` - SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` - SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` - SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` - SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` - SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` - SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` - SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` - SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` - SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` - SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` - SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` - SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` - SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` - SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` - SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` - SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` - SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` - WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` - WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` - WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` - WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` - WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` - WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` - WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` - WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` - WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` - Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` - Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` - DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` - CreateSnapshot *bool `mapstructure:"create_snapshot" cty:"create_snapshot" hcl:"create_snapshot"` - ConvertToTemplate *bool `mapstructure:"convert_to_template" cty:"convert_to_template" hcl:"convert_to_template"` - Export *common.FlatExportConfig `mapstructure:"export" cty:"export" hcl:"export"` - ContentLibraryDestinationConfig *common.FlatContentLibraryDestinationConfig `mapstructure:"content_library_destination" cty:"content_library_destination" hcl:"content_library_destination"` - CustomizeConfig *FlatCustomizeConfig `mapstructure:"customize" cty:"customize" hcl:"customize"` -} - -// FlatMapstructure returns a new FlatConfig. -// FlatConfig is an auto-generated flat version of Config. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConfig) -} - -// HCL2Spec returns the hcl spec of a Config. -// This spec is used by HCL to read the fields of Config. -// The decoded values from this spec will then be applied to a FlatConfig. -func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, - "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, - "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, - "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, - "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, - "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, - "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, - "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, - "http_directory": &hcldec.AttrSpec{Name: "http_directory", Type: cty.String, Required: false}, - "http_content": &hcldec.AttrSpec{Name: "http_content", Type: cty.Map(cty.String), Required: false}, - "http_port_min": &hcldec.AttrSpec{Name: "http_port_min", Type: cty.Number, Required: false}, - "http_port_max": &hcldec.AttrSpec{Name: "http_port_max", Type: cty.Number, Required: false}, - "http_bind_address": &hcldec.AttrSpec{Name: "http_bind_address", Type: cty.String, Required: false}, - "http_interface": &hcldec.AttrSpec{Name: "http_interface", Type: cty.String, Required: false}, - "cd_files": &hcldec.AttrSpec{Name: "cd_files", Type: cty.List(cty.String), Required: false}, - "cd_label": &hcldec.AttrSpec{Name: "cd_label", Type: cty.String, Required: false}, - "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, - "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, - "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, - "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, - "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, - "template": &hcldec.AttrSpec{Name: "template", Type: cty.String, Required: false}, - "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, - "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, - "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, - "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, - "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, - "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, - "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, - "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, - "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, - "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, - "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, - "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, - "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, - "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, - "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, - "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, - "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, - "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, - "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, - "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, - "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, - "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, - "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, - "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, - "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, - "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, - "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, - "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, - "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, - "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, - "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, - "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, - "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, - "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, - "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, - "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, - "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, - "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, - "boot_keygroup_interval": &hcldec.AttrSpec{Name: "boot_keygroup_interval", Type: cty.String, Required: false}, - "boot_wait": &hcldec.AttrSpec{Name: "boot_wait", Type: cty.String, Required: false}, - "boot_command": &hcldec.AttrSpec{Name: "boot_command", Type: cty.List(cty.String), Required: false}, - "http_ip": &hcldec.AttrSpec{Name: "http_ip", Type: cty.String, Required: false}, - "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, - "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, - "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, - "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, - "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, - "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, - "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, - "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, - "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, - "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, - "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, - "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, - "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, - "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, - "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, - "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, - "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, - "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, - "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, - "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, - "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, - "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, - "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, - "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, - "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, - "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, - "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, - "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, - "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, - "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, - "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, - "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, - "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, - "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, - "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, - "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, - "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, - "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, - "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, - "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, - "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, - "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, - "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, - "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, - "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, - "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, - "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, - "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, - "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, - "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, - "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, - "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, - "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, - "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, - "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, - "create_snapshot": &hcldec.AttrSpec{Name: "create_snapshot", Type: cty.Bool, Required: false}, - "convert_to_template": &hcldec.AttrSpec{Name: "convert_to_template", Type: cty.Bool, Required: false}, - "export": &hcldec.BlockSpec{TypeName: "export", Nested: hcldec.ObjectSpec((*common.FlatExportConfig)(nil).HCL2Spec())}, - "content_library_destination": &hcldec.BlockSpec{TypeName: "content_library_destination", Nested: hcldec.ObjectSpec((*common.FlatContentLibraryDestinationConfig)(nil).HCL2Spec())}, - "customize": &hcldec.BlockSpec{TypeName: "customize", Nested: hcldec.ObjectSpec((*FlatCustomizeConfig)(nil).HCL2Spec())}, - } - return s -} diff --git a/builder/vsphere/clone/config_test.go b/builder/vsphere/clone/config_test.go deleted file mode 100644 index a1da7013d..000000000 --- a/builder/vsphere/clone/config_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package clone - -import ( - "testing" - "time" -) - -func TestCloneConfig_MinimalConfig(t *testing.T) { - c := new(Config) - warns, errs := c.Prepare(minimalConfig()) - testConfigOk(t, warns, errs) -} - -func TestCloneConfig_MandatoryParameters(t *testing.T) { - params := []string{"vcenter_server", "username", "password", "template", "vm_name", "host"} - for _, param := range params { - raw := minimalConfig() - raw[param] = "" - c := new(Config) - warns, err := c.Prepare(raw) - testConfigErr(t, param, warns, err) - } -} - -func TestCloneConfig_Timeout(t *testing.T) { - raw := minimalConfig() - raw["shutdown_timeout"] = "3m" - conf := new(Config) - warns, err := conf.Prepare(raw) - testConfigOk(t, warns, err) - if conf.ShutdownConfig.Timeout != 3*time.Minute { - t.Fatalf("shutdown_timeout sould be equal 3 minutes, got %v", conf.ShutdownConfig.Timeout) - } -} - -func TestCloneConfig_RAMReservation(t *testing.T) { - raw := minimalConfig() - raw["RAM_reservation"] = 1000 - raw["RAM_reserve_all"] = true - c := new(Config) - warns, err := c.Prepare(raw) - testConfigErr(t, "RAM_reservation", warns, err) -} - -func minimalConfig() map[string]interface{} { - return map[string]interface{}{ - "vcenter_server": "vcenter.domain.local", - "username": "root", - "password": "vmware", - "template": "ubuntu", - "vm_name": "vm1", - "host": "esxi1.domain.local", - "ssh_username": "root", - "ssh_password": "secret", - } -} - -func testConfigOk(t *testing.T, warns []string, err error) { - if len(warns) > 0 { - t.Errorf("Should be no warnings: %#v", warns) - } - if err != nil { - t.Errorf("Unexpected error: %s", err) - } -} - -func testConfigErr(t *testing.T, context string, warns []string, err error) { - if len(warns) > 0 { - t.Errorf("Should be no warnings: %#v", warns) - } - if err == nil { - t.Error("An error is not raised for", context) - } -} diff --git a/builder/vsphere/clone/step_clone.go b/builder/vsphere/clone/step_clone.go deleted file mode 100644 index c0def3269..000000000 --- a/builder/vsphere/clone/step_clone.go +++ /dev/null @@ -1,136 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type CloneConfig,vAppConfig - -package clone - -import ( - "context" - "fmt" - "path" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type vAppConfig struct { - // Set values for the available vApp Properties to supply configuration parameters to a virtual machine cloned from - // a template that came from an imported OVF or OVA file. - // - // -> **Note:** The only supported usage path for vApp properties is for existing user-configurable keys. - // These generally come from an existing template that was created from an imported OVF or OVA file. - // You cannot set values for vApp properties on virtual machines created from scratch, - // virtual machines lacking a vApp configuration, or on property keys that do not exist. - Properties map[string]string `mapstructure:"properties"` -} - -type CloneConfig struct { - // Name of source VM. Path is optional. - Template string `mapstructure:"template"` - // The size of the disk in MB. - DiskSize int64 `mapstructure:"disk_size"` - // Create VM as a linked clone from latest snapshot. Defaults to `false`. - LinkedClone bool `mapstructure:"linked_clone"` - // Set the network in which the VM will be connected to. If no network is - // specified, `host` must be specified to allow Packer to look for the - // available network. If the network is inside a network folder in vCenter, - // you need to provide the full path to the network. - Network string `mapstructure:"network"` - // Sets a custom Mac Address to the network adapter. If set, the [network](#network) must be also specified. - MacAddress string `mapstructure:"mac_address"` - // VM notes. - Notes string `mapstructure:"notes"` - // Set the vApp Options to a virtual machine. - // See the [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) - // to know the available options and how to use it. - VAppConfig vAppConfig `mapstructure:"vapp"` - StorageConfig common.StorageConfig `mapstructure:",squash"` -} - -func (c *CloneConfig) Prepare() []error { - var errs []error - errs = append(errs, c.StorageConfig.Prepare()...) - - if c.Template == "" { - errs = append(errs, fmt.Errorf("'template' is required")) - } - - if c.LinkedClone == true && c.DiskSize != 0 { - errs = append(errs, fmt.Errorf("'linked_clone' and 'disk_size' cannot be used together")) - } - - if c.MacAddress != "" && c.Network == "" { - errs = append(errs, fmt.Errorf("'network' is required when 'mac_address' is specified")) - } - - return errs -} - -type StepCloneVM struct { - Config *CloneConfig - Location *common.LocationConfig - Force bool -} - -func (s *StepCloneVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - d := state.Get("driver").(driver.Driver) - vmPath := path.Join(s.Location.Folder, s.Location.VMName) - - err := d.PreCleanVM(ui, vmPath, s.Force) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - ui.Say("Cloning VM...") - template, err := d.FindVM(s.Config.Template) - if err != nil { - state.Put("error", fmt.Errorf("Error finding vm to clone: %s", err)) - return multistep.ActionHalt - } - - var disks []driver.Disk - for _, disk := range s.Config.StorageConfig.Storage { - disks = append(disks, driver.Disk{ - DiskSize: disk.DiskSize, - DiskEagerlyScrub: disk.DiskEagerlyScrub, - DiskThinProvisioned: disk.DiskThinProvisioned, - ControllerIndex: disk.DiskControllerIndex, - }) - } - - vm, err := template.Clone(ctx, &driver.CloneConfig{ - Name: s.Location.VMName, - Folder: s.Location.Folder, - Cluster: s.Location.Cluster, - Host: s.Location.Host, - ResourcePool: s.Location.ResourcePool, - Datastore: s.Location.Datastore, - LinkedClone: s.Config.LinkedClone, - Network: s.Config.Network, - MacAddress: s.Config.MacAddress, - Annotation: s.Config.Notes, - VAppProperties: s.Config.VAppConfig.Properties, - PrimaryDiskSize: s.Config.DiskSize, - StorageConfig: driver.StorageConfig{ - DiskControllerType: s.Config.StorageConfig.DiskControllerType, - Storage: disks, - }, - }) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - if vm == nil { - return multistep.ActionHalt - } - state.Put("vm", vm) - - return multistep.ActionContinue -} - -func (s *StepCloneVM) Cleanup(state multistep.StateBag) { - common.CleanupVM(state) -} diff --git a/builder/vsphere/clone/step_clone.hcl2spec.go b/builder/vsphere/clone/step_clone.hcl2spec.go deleted file mode 100644 index 41897a0fb..000000000 --- a/builder/vsphere/clone/step_clone.hcl2spec.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type CloneConfig,vAppConfig"; DO NOT EDIT. - -package clone - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/zclconf/go-cty/cty" -) - -// FlatCloneConfig is an auto-generated flat version of CloneConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatCloneConfig struct { - Template *string `mapstructure:"template" cty:"template" hcl:"template"` - DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` - LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` - Network *string `mapstructure:"network" cty:"network" hcl:"network"` - MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` - Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` - VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` - DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` - Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` -} - -// FlatMapstructure returns a new FlatCloneConfig. -// FlatCloneConfig is an auto-generated flat version of CloneConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*CloneConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatCloneConfig) -} - -// HCL2Spec returns the hcl spec of a CloneConfig. -// This spec is used by HCL to read the fields of CloneConfig. -// The decoded values from this spec will then be applied to a FlatCloneConfig. -func (*FlatCloneConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "template": &hcldec.AttrSpec{Name: "template", Type: cty.String, Required: false}, - "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, - "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, - "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, - "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, - "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, - "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, - "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, - "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, - } - return s -} - -// FlatvAppConfig is an auto-generated flat version of vAppConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatvAppConfig struct { - Properties map[string]string `mapstructure:"properties" cty:"properties" hcl:"properties"` -} - -// FlatMapstructure returns a new FlatvAppConfig. -// FlatvAppConfig is an auto-generated flat version of vAppConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*vAppConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatvAppConfig) -} - -// HCL2Spec returns the hcl spec of a vAppConfig. -// This spec is used by HCL to read the fields of vAppConfig. -// The decoded values from this spec will then be applied to a FlatvAppConfig. -func (*FlatvAppConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "properties": &hcldec.AttrSpec{Name: "properties", Type: cty.Map(cty.String), Required: false}, - } - return s -} diff --git a/builder/vsphere/clone/step_clone_test.go b/builder/vsphere/clone/step_clone_test.go deleted file mode 100644 index 9b23ea443..000000000 --- a/builder/vsphere/clone/step_clone_test.go +++ /dev/null @@ -1,251 +0,0 @@ -package clone - -import ( - "bytes" - "context" - "path" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestCreateConfig_Prepare(t *testing.T) { - tc := []struct { - name string - config *CloneConfig - fail bool - expectedErrMsg string - }{ - { - name: "Valid config", - config: &CloneConfig{ - Template: "template name", - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"test"}, - Storage: []common.DiskConfig{ - { - DiskSize: 0, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "storage[0].'disk_size' is required", - }, - { - name: "Storage validate disk_size", - config: &CloneConfig{ - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 0, - DiskThinProvisioned: true, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "storage[0].'disk_size' is required", - }, - { - name: "Storage validate disk_controller_index", - config: &CloneConfig{ - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - DiskControllerIndex: 3, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "storage[0].'disk_controller_index' references an unknown disk controller", - }, - { - name: "Validate template is set", - config: &CloneConfig{ - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"test"}, - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "'template' is required", - }, - { - name: "Validate LinkedClone and DiskSize set at the same time", - config: &CloneConfig{ - Template: "template name", - LinkedClone: true, - DiskSize: 32768, - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"test"}, - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "'linked_clone' and 'disk_size' cannot be used together", - }, - { - name: "Validate MacAddress and Network not set at the same time", - config: &CloneConfig{ - Template: "template name", - MacAddress: "some mac address", - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"test"}, - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "'network' is required when 'mac_address' is specified", - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - errs := c.config.Prepare() - if c.fail { - if len(errs) == 0 { - t.Fatalf("Config preprare should fail") - } - if errs[0].Error() != c.expectedErrMsg { - t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error()) - } - } else { - if len(errs) != 0 { - t.Fatalf("Config preprare should not fail: %s", errs[0]) - } - } - }) - } -} - -func TestStepCreateVM_Run(t *testing.T) { - state := new(multistep.BasicStateBag) - state.Put("ui", &packersdk.BasicUi{ - Reader: new(bytes.Buffer), - Writer: new(bytes.Buffer), - }) - driverMock := driver.NewDriverMock() - state.Put("driver", driverMock) - step := basicStepCloneVM() - step.Force = true - vmPath := path.Join(step.Location.Folder, step.Location.VMName) - vmMock := new(driver.VirtualMachineMock) - driverMock.VM = vmMock - - if action := step.Run(context.TODO(), state); action == multistep.ActionHalt { - t.Fatalf("Should not halt.") - } - - // Pre clean VM - if !driverMock.PreCleanVMCalled { - t.Fatalf("driver.PreCleanVM should be called.") - } - if driverMock.PreCleanForce != step.Force { - t.Fatalf("Force PreCleanVM should be %t but was %t.", step.Force, driverMock.PreCleanForce) - } - if driverMock.PreCleanVMPath != vmPath { - t.Fatalf("VM path expected to be %s but was %s", vmPath, driverMock.PreCleanVMPath) - } - - if !driverMock.FindVMCalled { - t.Fatalf("driver.FindVM should be called.") - } - if !vmMock.CloneCalled { - t.Fatalf("vm.Clone should be called.") - } - - if diff := cmp.Diff(vmMock.CloneConfig, driverCreateConfig(step.Config, step.Location)); diff != "" { - t.Fatalf("wrong driver.CreateConfig: %s", diff) - } - vm, ok := state.GetOk("vm") - if !ok { - t.Fatal("state must contain the VM") - } - if vm != driverMock.VM { - t.Fatalf("state doesn't contain the created VM.") - } -} - -func basicStepCloneVM() *StepCloneVM { - step := &StepCloneVM{ - Config: createConfig(), - Location: basicLocationConfig(), - } - return step -} - -func basicLocationConfig() *common.LocationConfig { - return &common.LocationConfig{ - VMName: "test-vm", - Folder: "test-folder", - Cluster: "test-cluster", - Host: "test-host", - ResourcePool: "test-resource-pool", - Datastore: "test-datastore", - } -} - -func createConfig() *CloneConfig { - return &CloneConfig{ - Template: "template name", - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"pvscsi"}, - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - DiskThinProvisioned: true, - }, - }, - }, - } -} - -func driverCreateConfig(config *CloneConfig, location *common.LocationConfig) *driver.CloneConfig { - var disks []driver.Disk - for _, disk := range config.StorageConfig.Storage { - disks = append(disks, driver.Disk{ - DiskSize: disk.DiskSize, - DiskEagerlyScrub: disk.DiskEagerlyScrub, - DiskThinProvisioned: disk.DiskThinProvisioned, - ControllerIndex: disk.DiskControllerIndex, - }) - } - - return &driver.CloneConfig{ - StorageConfig: driver.StorageConfig{ - DiskControllerType: config.StorageConfig.DiskControllerType, - Storage: disks, - }, - Annotation: config.Notes, - Name: location.VMName, - Folder: location.Folder, - Cluster: location.Cluster, - Host: location.Host, - ResourcePool: location.ResourcePool, - Datastore: location.Datastore, - LinkedClone: config.LinkedClone, - Network: config.Network, - MacAddress: config.MacAddress, - VAppProperties: config.VAppConfig.Properties, - PrimaryDiskSize: config.DiskSize, - } -} diff --git a/builder/vsphere/clone/step_customize.go b/builder/vsphere/clone/step_customize.go deleted file mode 100644 index 0a48d0c24..000000000 --- a/builder/vsphere/clone/step_customize.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type CustomizeConfig,LinuxOptions,NetworkInterfaces,NetworkInterface,GlobalDnsSettings,GlobalRoutingSettings -package clone - -import ( - "context" - "fmt" - "io/ioutil" - "net" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer/builder/vsphere/driver" - "github.com/vmware/govmomi/vim25/types" -) - -// A cloned virtual machine can be [customized](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-58E346FF-83AE-42B8-BE58-253641D257BC.html) -// to configure host, network, or licensing settings. -// -// To perform virtual machine customization as a part of the clone process, specify the customize block with the -// respective customization options. Windows guests are customized using Sysprep, which will result in the machine SID being reset. -// Before using customization, check that your source VM meets the [requirements](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-E63B6FAA-8D35-428D-B40C-744769845906.html) -// for guest OS customization on vSphere. -// See the [customization example](#customization-example) for a usage synopsis. -// -// The settings for customize are as follows: -type CustomizeConfig struct { - // Settings to Linux guest OS customization. See [Linux customization settings](#linux-customization-settings). - LinuxOptions *LinuxOptions `mapstructure:"linux_options"` - // Supply your own sysprep.xml file to allow full control of the customization process out-of-band of vSphere. - WindowsSysPrepFile string `mapstructure:"windows_sysprep_file"` - // Configure network interfaces on a per-interface basis that should matched up to the network adapters present in the VM. - // To use DHCP, declare an empty network_interface for each adapter being configured. This field is required. - // See [Network interface settings](#network-interface-settings). - NetworkInterfaces NetworkInterfaces `mapstructure:"network_interface"` - GlobalRoutingSettings `mapstructure:",squash"` - GlobalDnsSettings `mapstructure:",squash"` -} - -type LinuxOptions struct { - // The domain name for this machine. This, along with [host_name](#host_name), make up the FQDN of this virtual machine. - Domain string `mapstructure:"domain"` - // The host name for this machine. This, along with [domain](#domain), make up the FQDN of this virtual machine. - Hostname string `mapstructure:"host_name"` - // Tells the operating system that the hardware clock is set to UTC. Default: true. - HWClockUTC config.Trilean `mapstructure:"hw_clock_utc"` - // Sets the time zone. The default is UTC. - Timezone string `mapstructure:"time_zone"` -} - -type NetworkInterface struct { - // Network interface-specific DNS server settings for Windows operating systems. - // Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. - DnsServerList []string `mapstructure:"dns_server_list"` - // Network interface-specific DNS search domain for Windows operating systems. - // Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. - DnsDomain string `mapstructure:"dns_domain"` - // The IPv4 address assigned to this network adapter. If left blank or not included, DHCP is used. - Ipv4Address string `mapstructure:"ipv4_address"` - // The IPv4 subnet mask, in bits (example: 24 for 255.255.255.0). - Ipv4NetMask int `mapstructure:"ipv4_netmask"` - // The IPv6 address assigned to this network adapter. If left blank or not included, auto-configuration is used. - Ipv6Address string `mapstructure:"ipv6_address"` - // The IPv6 subnet mask, in bits (example: 32). - Ipv6NetMask int `mapstructure:"ipv6_netmask"` -} - -type NetworkInterfaces []NetworkInterface - -// The settings here must match the IP/mask of at least one network_interface supplied to customization. -type GlobalRoutingSettings struct { - // The IPv4 default gateway when using network_interface customization on the virtual machine. - Ipv4Gateway string `mapstructure:"ipv4_gateway"` - // The IPv6 default gateway when using network_interface customization on the virtual machine. - Ipv6Gateway string `mapstructure:"ipv6_gateway"` -} - -// The following settings configure DNS globally, generally for Linux systems. For Windows systems, -// this is done per-interface, see [network interface](#network_interface) settings. -type GlobalDnsSettings struct { - // The list of DNS servers to configure on a virtual machine. - DnsServerList []string `mapstructure:"dns_server_list"` - // A list of DNS search domains to add to the DNS configuration on the virtual machine. - DnsSuffixList []string `mapstructure:"dns_suffix_list"` -} - -type StepCustomize struct { - Config *CustomizeConfig -} - -func (c *CustomizeConfig) Prepare() []error { - var errs []error - - if c.LinuxOptions == nil && c.WindowsSysPrepFile == "" { - errs = append(errs, fmt.Errorf("customize is empty")) - } - if c.LinuxOptions != nil && c.WindowsSysPrepFile != "" { - errs = append(errs, fmt.Errorf("`linux_options` and `windows_sysprep_text` both set - one must not be included if the other is specified")) - } - - if c.LinuxOptions != nil { - if c.LinuxOptions.Hostname == "" { - errs = append(errs, fmt.Errorf("linux options `host_name` is empty")) - } - if c.LinuxOptions.Domain == "" { - errs = append(errs, fmt.Errorf("linux options `domain` is empty")) - } - - if c.LinuxOptions.HWClockUTC == config.TriUnset { - c.LinuxOptions.HWClockUTC = config.TriTrue - } - if c.LinuxOptions.Timezone == "" { - c.LinuxOptions.Timezone = "UTC" - } - } - - if len(c.NetworkInterfaces) == 0 { - errs = append(errs, fmt.Errorf("one or more `network_interface` must be provided")) - } - - return errs -} - -func (s *StepCustomize) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - vm := state.Get("vm").(*driver.VirtualMachineDriver) - ui := state.Get("ui").(packersdk.Ui) - - identity, err := s.identitySettings() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - nicSettingsMap := s.nicSettingsMap() - globalIpSettings := s.globalIpSettings() - - spec := types.CustomizationSpec{ - Identity: identity, - NicSettingMap: nicSettingsMap, - GlobalIPSettings: globalIpSettings, - } - ui.Say("Customizing VM...") - err = vm.Customize(spec) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *StepCustomize) identitySettings() (types.BaseCustomizationIdentitySettings, error) { - if s.Config.LinuxOptions != nil { - return &types.CustomizationLinuxPrep{ - HostName: &types.CustomizationFixedName{ - Name: s.Config.LinuxOptions.Hostname, - }, - Domain: s.Config.LinuxOptions.Domain, - TimeZone: s.Config.LinuxOptions.Timezone, - HwClockUTC: s.Config.LinuxOptions.HWClockUTC.ToBoolPointer(), - }, nil - } - - if s.Config.WindowsSysPrepFile != "" { - sysPrep, err := ioutil.ReadFile(s.Config.WindowsSysPrepFile) - if err != nil { - return nil, fmt.Errorf("error on reading %s: %s", s.Config.WindowsSysPrepFile, err) - } - return &types.CustomizationSysprepText{ - Value: string(sysPrep), - }, nil - } - - return nil, fmt.Errorf("no customization identity found") -} - -func (s *StepCustomize) nicSettingsMap() []types.CustomizationAdapterMapping { - result := make([]types.CustomizationAdapterMapping, len(s.Config.NetworkInterfaces)) - var ipv4gwFound, ipv6gwFound bool - for i := range s.Config.NetworkInterfaces { - var adapter types.CustomizationIPSettings - adapter, ipv4gwFound, ipv6gwFound = s.ipSettings(i, !ipv4gwFound, !ipv6gwFound) - obj := types.CustomizationAdapterMapping{ - Adapter: adapter, - } - result[i] = obj - } - return result -} - -func (s *StepCustomize) ipSettings(n int, ipv4gwAdd bool, ipv6gwAdd bool) (types.CustomizationIPSettings, bool, bool) { - var v4gwFound, v6gwFound bool - var obj types.CustomizationIPSettings - - ipv4Address := s.Config.NetworkInterfaces[n].Ipv4Address - if ipv4Address != "" { - ipv4mask := s.Config.NetworkInterfaces[n].Ipv4NetMask - ipv4Gateway := s.Config.Ipv4Gateway - obj.Ip = &types.CustomizationFixedIp{ - IpAddress: ipv4Address, - } - obj.SubnetMask = v4CIDRMaskToDotted(ipv4mask) - // Check for the gateway - if ipv4gwAdd && ipv4Gateway != "" && matchGateway(ipv4Address, ipv4mask, ipv4Gateway) { - obj.Gateway = []string{ipv4Gateway} - v4gwFound = true - } - } else { - obj.Ip = &types.CustomizationDhcpIpGenerator{} - } - - obj.DnsServerList = s.Config.NetworkInterfaces[n].DnsServerList - obj.DnsDomain = s.Config.NetworkInterfaces[n].DnsDomain - obj.IpV6Spec, v6gwFound = s.IPSettingsIPV6Address(n, ipv6gwAdd) - - return obj, v4gwFound, v6gwFound -} - -func v4CIDRMaskToDotted(mask int) string { - m := net.CIDRMask(mask, 32) - a := int(m[0]) - b := int(m[1]) - c := int(m[2]) - d := int(m[3]) - return fmt.Sprintf("%d.%d.%d.%d", a, b, c, d) -} - -func (s *StepCustomize) IPSettingsIPV6Address(n int, gwAdd bool) (*types.CustomizationIPSettingsIpV6AddressSpec, bool) { - addr := s.Config.NetworkInterfaces[n].Ipv6Address - var gwFound bool - if addr == "" { - return nil, gwFound - } - mask := s.Config.NetworkInterfaces[n].Ipv6NetMask - gw := s.Config.Ipv6Gateway - obj := &types.CustomizationIPSettingsIpV6AddressSpec{ - Ip: []types.BaseCustomizationIpV6Generator{ - &types.CustomizationFixedIpV6{ - IpAddress: addr, - SubnetMask: int32(mask), - }, - }, - } - if gwAdd && gw != "" && matchGateway(addr, mask, gw) { - obj.Gateway = []string{gw} - gwFound = true - } - return obj, gwFound -} - -// matchGateway take an IP, mask, and gateway, and checks to see if the gateway -// is reachable from the IP address. -func matchGateway(a string, m int, g string) bool { - ip := net.ParseIP(a) - gw := net.ParseIP(g) - var mask net.IPMask - if ip.To4() != nil { - mask = net.CIDRMask(m, 32) - } else { - mask = net.CIDRMask(m, 128) - } - if ip.Mask(mask).Equal(gw.Mask(mask)) { - return true - } - return false -} - -func (s *StepCustomize) globalIpSettings() types.CustomizationGlobalIPSettings { - return types.CustomizationGlobalIPSettings{ - DnsServerList: s.Config.DnsServerList, - DnsSuffixList: s.Config.DnsSuffixList, - } -} - -func (s *StepCustomize) Cleanup(_ multistep.StateBag) {} diff --git a/builder/vsphere/clone/step_customize.hcl2spec.go b/builder/vsphere/clone/step_customize.hcl2spec.go deleted file mode 100644 index 0634474a3..000000000 --- a/builder/vsphere/clone/step_customize.hcl2spec.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type CustomizeConfig,LinuxOptions,NetworkInterfaces,NetworkInterface,GlobalDnsSettings,GlobalRoutingSettings"; DO NOT EDIT. - -package clone - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatCustomizeConfig is an auto-generated flat version of CustomizeConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatCustomizeConfig struct { - LinuxOptions *FlatLinuxOptions `mapstructure:"linux_options" cty:"linux_options" hcl:"linux_options"` - WindowsSysPrepFile *string `mapstructure:"windows_sysprep_file" cty:"windows_sysprep_file" hcl:"windows_sysprep_file"` - NetworkInterfaces []FlatNetworkInterface `mapstructure:"network_interface" cty:"network_interface" hcl:"network_interface"` - Ipv4Gateway *string `mapstructure:"ipv4_gateway" cty:"ipv4_gateway" hcl:"ipv4_gateway"` - Ipv6Gateway *string `mapstructure:"ipv6_gateway" cty:"ipv6_gateway" hcl:"ipv6_gateway"` - DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` - DnsSuffixList []string `mapstructure:"dns_suffix_list" cty:"dns_suffix_list" hcl:"dns_suffix_list"` -} - -// FlatMapstructure returns a new FlatCustomizeConfig. -// FlatCustomizeConfig is an auto-generated flat version of CustomizeConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*CustomizeConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatCustomizeConfig) -} - -// HCL2Spec returns the hcl spec of a CustomizeConfig. -// This spec is used by HCL to read the fields of CustomizeConfig. -// The decoded values from this spec will then be applied to a FlatCustomizeConfig. -func (*FlatCustomizeConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "linux_options": &hcldec.BlockSpec{TypeName: "linux_options", Nested: hcldec.ObjectSpec((*FlatLinuxOptions)(nil).HCL2Spec())}, - "windows_sysprep_file": &hcldec.AttrSpec{Name: "windows_sysprep_file", Type: cty.String, Required: false}, - "network_interface": &hcldec.BlockListSpec{TypeName: "network_interface", Nested: hcldec.ObjectSpec((*FlatNetworkInterface)(nil).HCL2Spec())}, - "ipv4_gateway": &hcldec.AttrSpec{Name: "ipv4_gateway", Type: cty.String, Required: false}, - "ipv6_gateway": &hcldec.AttrSpec{Name: "ipv6_gateway", Type: cty.String, Required: false}, - "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, - "dns_suffix_list": &hcldec.AttrSpec{Name: "dns_suffix_list", Type: cty.List(cty.String), Required: false}, - } - return s -} - -// FlatGlobalDnsSettings is an auto-generated flat version of GlobalDnsSettings. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatGlobalDnsSettings struct { - DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` - DnsSuffixList []string `mapstructure:"dns_suffix_list" cty:"dns_suffix_list" hcl:"dns_suffix_list"` -} - -// FlatMapstructure returns a new FlatGlobalDnsSettings. -// FlatGlobalDnsSettings is an auto-generated flat version of GlobalDnsSettings. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*GlobalDnsSettings) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatGlobalDnsSettings) -} - -// HCL2Spec returns the hcl spec of a GlobalDnsSettings. -// This spec is used by HCL to read the fields of GlobalDnsSettings. -// The decoded values from this spec will then be applied to a FlatGlobalDnsSettings. -func (*FlatGlobalDnsSettings) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, - "dns_suffix_list": &hcldec.AttrSpec{Name: "dns_suffix_list", Type: cty.List(cty.String), Required: false}, - } - return s -} - -// FlatGlobalRoutingSettings is an auto-generated flat version of GlobalRoutingSettings. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatGlobalRoutingSettings struct { - Ipv4Gateway *string `mapstructure:"ipv4_gateway" cty:"ipv4_gateway" hcl:"ipv4_gateway"` - Ipv6Gateway *string `mapstructure:"ipv6_gateway" cty:"ipv6_gateway" hcl:"ipv6_gateway"` -} - -// FlatMapstructure returns a new FlatGlobalRoutingSettings. -// FlatGlobalRoutingSettings is an auto-generated flat version of GlobalRoutingSettings. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*GlobalRoutingSettings) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatGlobalRoutingSettings) -} - -// HCL2Spec returns the hcl spec of a GlobalRoutingSettings. -// This spec is used by HCL to read the fields of GlobalRoutingSettings. -// The decoded values from this spec will then be applied to a FlatGlobalRoutingSettings. -func (*FlatGlobalRoutingSettings) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "ipv4_gateway": &hcldec.AttrSpec{Name: "ipv4_gateway", Type: cty.String, Required: false}, - "ipv6_gateway": &hcldec.AttrSpec{Name: "ipv6_gateway", Type: cty.String, Required: false}, - } - return s -} - -// FlatLinuxOptions is an auto-generated flat version of LinuxOptions. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatLinuxOptions struct { - Domain *string `mapstructure:"domain" cty:"domain" hcl:"domain"` - Hostname *string `mapstructure:"host_name" cty:"host_name" hcl:"host_name"` - HWClockUTC *bool `mapstructure:"hw_clock_utc" cty:"hw_clock_utc" hcl:"hw_clock_utc"` - Timezone *string `mapstructure:"time_zone" cty:"time_zone" hcl:"time_zone"` -} - -// FlatMapstructure returns a new FlatLinuxOptions. -// FlatLinuxOptions is an auto-generated flat version of LinuxOptions. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*LinuxOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatLinuxOptions) -} - -// HCL2Spec returns the hcl spec of a LinuxOptions. -// This spec is used by HCL to read the fields of LinuxOptions. -// The decoded values from this spec will then be applied to a FlatLinuxOptions. -func (*FlatLinuxOptions) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "domain": &hcldec.AttrSpec{Name: "domain", Type: cty.String, Required: false}, - "host_name": &hcldec.AttrSpec{Name: "host_name", Type: cty.String, Required: false}, - "hw_clock_utc": &hcldec.AttrSpec{Name: "hw_clock_utc", Type: cty.Bool, Required: false}, - "time_zone": &hcldec.AttrSpec{Name: "time_zone", Type: cty.String, Required: false}, - } - return s -} - -// FlatNetworkInterface is an auto-generated flat version of NetworkInterface. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatNetworkInterface struct { - DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` - DnsDomain *string `mapstructure:"dns_domain" cty:"dns_domain" hcl:"dns_domain"` - Ipv4Address *string `mapstructure:"ipv4_address" cty:"ipv4_address" hcl:"ipv4_address"` - Ipv4NetMask *int `mapstructure:"ipv4_netmask" cty:"ipv4_netmask" hcl:"ipv4_netmask"` - Ipv6Address *string `mapstructure:"ipv6_address" cty:"ipv6_address" hcl:"ipv6_address"` - Ipv6NetMask *int `mapstructure:"ipv6_netmask" cty:"ipv6_netmask" hcl:"ipv6_netmask"` -} - -// FlatMapstructure returns a new FlatNetworkInterface. -// FlatNetworkInterface is an auto-generated flat version of NetworkInterface. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*NetworkInterface) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatNetworkInterface) -} - -// HCL2Spec returns the hcl spec of a NetworkInterface. -// This spec is used by HCL to read the fields of NetworkInterface. -// The decoded values from this spec will then be applied to a FlatNetworkInterface. -func (*FlatNetworkInterface) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, - "dns_domain": &hcldec.AttrSpec{Name: "dns_domain", Type: cty.String, Required: false}, - "ipv4_address": &hcldec.AttrSpec{Name: "ipv4_address", Type: cty.String, Required: false}, - "ipv4_netmask": &hcldec.AttrSpec{Name: "ipv4_netmask", Type: cty.Number, Required: false}, - "ipv6_address": &hcldec.AttrSpec{Name: "ipv6_address", Type: cty.String, Required: false}, - "ipv6_netmask": &hcldec.AttrSpec{Name: "ipv6_netmask", Type: cty.Number, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/artifact.go b/builder/vsphere/common/artifact.go deleted file mode 100644 index 267b03d8b..000000000 --- a/builder/vsphere/common/artifact.go +++ /dev/null @@ -1,50 +0,0 @@ -package common - -import ( - "os" - - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -const BuilderId = "jetbrains.vsphere" - -type Artifact struct { - Outconfig *OutputConfig - Name string - VM *driver.VirtualMachineDriver - - // StateData should store data such as GeneratedData - // to be shared with post-processors - StateData map[string]interface{} -} - -func (a *Artifact) BuilderId() string { - return BuilderId -} - -func (a *Artifact) Files() []string { - if a.Outconfig != nil { - files, _ := a.Outconfig.ListFiles() - return files - } - return []string{} -} - -func (a *Artifact) Id() string { - return a.Name -} - -func (a *Artifact) String() string { - return a.Name -} - -func (a *Artifact) State(name string) interface{} { - return a.StateData[name] -} - -func (a *Artifact) Destroy() error { - if a.Outconfig != nil { - os.RemoveAll(a.Outconfig.OutputDir) - } - return a.VM.Destroy() -} diff --git a/builder/vsphere/common/cleanup_vm.go b/builder/vsphere/common/cleanup_vm.go deleted file mode 100644 index 3e847a9ea..000000000 --- a/builder/vsphere/common/cleanup_vm.go +++ /dev/null @@ -1,30 +0,0 @@ -package common - -import ( - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func CleanupVM(state multistep.StateBag) { - _, cancelled := state.GetOk(multistep.StateCancelled) - _, halted := state.GetOk(multistep.StateHalted) - _, destroy := state.GetOk("destroy_vm") - if !cancelled && !halted && !destroy { - return - } - - ui := state.Get("ui").(packersdk.Ui) - - st := state.Get("vm") - if st == nil { - return - } - vm := st.(driver.VirtualMachine) - - ui.Say("Destroying VM...") - err := vm.Destroy() - if err != nil { - ui.Error(err.Error()) - } -} diff --git a/builder/vsphere/common/cleanup_vm_test.go b/builder/vsphere/common/cleanup_vm_test.go deleted file mode 100644 index d27f30a28..000000000 --- a/builder/vsphere/common/cleanup_vm_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package common - -import ( - "bytes" - "testing" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func cleanupTestState(mockVM driver.VirtualMachine) multistep.StateBag { - state := new(multistep.BasicStateBag) - state.Put("vm", mockVM) - state.Put("ui", &packersdk.BasicUi{ - Reader: new(bytes.Buffer), - Writer: new(bytes.Buffer), - }) - return state -} - -func Test_CleanupVM(t *testing.T) { - type testCase struct { - Reason string - ExtraState map[string]interface{} - ExpectDestroy bool - } - testCases := []testCase{ - { - "if cancelled, we should destroy the VM", - map[string]interface{}{multistep.StateCancelled: true}, - true, - }, - { - "if halted, we should destroy the VM", - map[string]interface{}{multistep.StateHalted: true}, - true, - }, - { - "if destroy flag is set, we should destroy the VM", - map[string]interface{}{"destroy_vm": true}, - true, - }, - { - "if none of the above flags are set, we should not destroy the VM", - map[string]interface{}{}, - false, - }, - } - for _, tc := range testCases { - mockVM := &driver.VirtualMachineMock{} - state := cleanupTestState(mockVM) - for k, v := range tc.ExtraState { - state.Put(k, v) - } - CleanupVM(state) - if mockVM.DestroyCalled != tc.ExpectDestroy { - t.Fatalf("Problem with cleanup: %s", tc.Reason) - } - } - -} diff --git a/builder/vsphere/common/common_test.go b/builder/vsphere/common/common_test.go deleted file mode 100644 index 74fdfa3f9..000000000 --- a/builder/vsphere/common/common_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package common - -import ( - "bytes" - "strings" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" -) - -func basicStateBag(errorBuffer *strings.Builder) *multistep.BasicStateBag { - state := new(multistep.BasicStateBag) - state.Put("ui", &packersdk.BasicUi{ - Reader: new(bytes.Buffer), - Writer: new(bytes.Buffer), - ErrorWriter: errorBuffer, - }) - return state -} diff --git a/builder/vsphere/common/config_location.go b/builder/vsphere/common/config_location.go deleted file mode 100644 index 06c651a10..000000000 --- a/builder/vsphere/common/config_location.go +++ /dev/null @@ -1,53 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type LocationConfig - -package common - -import ( - "fmt" - "path" - "strings" -) - -type LocationConfig struct { - // Name of the new VM to create. - VMName string `mapstructure:"vm_name"` - // VM folder to create the VM in. - Folder string `mapstructure:"folder"` - // ESXi cluster where target VM is created. See the - // [Working With Clusters And Hosts](#working-with-clusters-and-hosts) - // section above for more details. - Cluster string `mapstructure:"cluster"` - // ESXi host where target VM is created. A full path must be specified if - // the host is in a folder. For example `folder/host`. See the - // [Working With Clusters And Hosts](#working-with-clusters-and-hosts) - // section above for more details. - Host string `mapstructure:"host"` - // VMWare resource pool. If not set, it will look for the root resource - // pool of the `host` or `cluster`. If a root resource is not found, it - // will then look for a default resource pool. - ResourcePool string `mapstructure:"resource_pool"` - // VMWare datastore. Required if `host` is a cluster, or if `host` has - // multiple datastores. - Datastore string `mapstructure:"datastore"` - // Set this to true if packer should use the host for uploading files - // to the datastore. Defaults to false. - SetHostForDatastoreUploads bool `mapstructure:"set_host_for_datastore_uploads"` -} - -func (c *LocationConfig) Prepare() []error { - var errs []error - - if c.VMName == "" { - errs = append(errs, fmt.Errorf("'vm_name' is required")) - } - if c.Cluster == "" && c.Host == "" { - errs = append(errs, fmt.Errorf("'host' or 'cluster' is required")) - } - - // clean Folder path and remove leading slash as folders are relative within vsphere - c.Folder = path.Clean(c.Folder) - c.Folder = strings.TrimLeft(c.Folder, "/") - - return errs -} diff --git a/builder/vsphere/common/config_location.hcl2spec.go b/builder/vsphere/common/config_location.hcl2spec.go deleted file mode 100644 index c55712475..000000000 --- a/builder/vsphere/common/config_location.hcl2spec.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type LocationConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatLocationConfig is an auto-generated flat version of LocationConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatLocationConfig struct { - VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` - Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` - Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` - Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` - SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` -} - -// FlatMapstructure returns a new FlatLocationConfig. -// FlatLocationConfig is an auto-generated flat version of LocationConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*LocationConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatLocationConfig) -} - -// HCL2Spec returns the hcl spec of a LocationConfig. -// This spec is used by HCL to read the fields of LocationConfig. -// The decoded values from this spec will then be applied to a FlatLocationConfig. -func (*FlatLocationConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, - "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, - "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, - "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, - "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/config_ssh.go b/builder/vsphere/common/config_ssh.go deleted file mode 100644 index bb967a45f..000000000 --- a/builder/vsphere/common/config_ssh.go +++ /dev/null @@ -1,15 +0,0 @@ -package common - -import ( - "github.com/hashicorp/packer-plugin-sdk/multistep" -) - -func CommHost(host string) func(multistep.StateBag) (string, error) { - return func(state multistep.StateBag) (string, error) { - if host != "" { - return host, nil - } else { - return state.Get("ip").(string), nil - } - } -} diff --git a/builder/vsphere/common/output_config.go b/builder/vsphere/common/output_config.go deleted file mode 100644 index 1aef6cc30..000000000 --- a/builder/vsphere/common/output_config.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type OutputConfig - -package common - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/hashicorp/packer-plugin-sdk/common" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" -) - -type OutputConfig struct { - // This setting specifies the directory that - // artifacts from the build, such as the virtual machine files and disks, - // will be output to. The path to the directory may be relative or - // absolute. If relative, the path is relative to the working directory - // packer is executed from. This directory must not exist or, if - // created, must be empty prior to running the builder. By default this is - // "output-BUILDNAME" where "BUILDNAME" is the name of the build. - OutputDir string `mapstructure:"output_directory" required:"false"` - // The permissions to apply to the "output_directory", and to any parent - // directories that get created for output_directory. By default this is - // "0750". You should express the permission as quoted string with a - // leading zero such as "0755" in JSON file, because JSON does not support - // octal value. In Unix-like OS, the actual permission may differ from - // this value because of umask. - DirPerm os.FileMode `mapstructure:"directory_permission" required:"false"` -} - -func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error { - if c.OutputDir == "" { - c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName) - } - if c.DirPerm == 0 { - c.DirPerm = 0750 - } - - return nil -} - -// Stolen from output_dir_local.go in vmware builder. -func (c *OutputConfig) ListFiles() ([]string, error) { - files := make([]string, 0, 10) - - visit := func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !info.IsDir() { - files = append(files, path) - } - return nil - } - - return files, filepath.Walk(c.OutputDir, visit) -} diff --git a/builder/vsphere/common/output_config.hcl2spec.go b/builder/vsphere/common/output_config.hcl2spec.go deleted file mode 100644 index 0cec88325..000000000 --- a/builder/vsphere/common/output_config.hcl2spec.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type OutputConfig"; DO NOT EDIT. - -package common - -import ( - "io/fs" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatOutputConfig is an auto-generated flat version of OutputConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatOutputConfig struct { - OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` - DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` -} - -// FlatMapstructure returns a new FlatOutputConfig. -// FlatOutputConfig is an auto-generated flat version of OutputConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*OutputConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatOutputConfig) -} - -// HCL2Spec returns the hcl spec of a OutputConfig. -// This spec is used by HCL to read the fields of OutputConfig. -// The decoded values from this spec will then be applied to a FlatOutputConfig. -func (*FlatOutputConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "output_directory": &hcldec.AttrSpec{Name: "output_directory", Type: cty.String, Required: false}, - "directory_permission": &hcldec.AttrSpec{Name: "directory_permission", Type: cty.Number, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_add_cdrom.go b/builder/vsphere/common/step_add_cdrom.go deleted file mode 100644 index 887bbc5f9..000000000 --- a/builder/vsphere/common/step_add_cdrom.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type CDRomConfig - -package common - -import ( - "context" - "fmt" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type CDRomConfig struct { - // Which controller to use. Example: `sata`. Defaults to `ide`. - CdromType string `mapstructure:"cdrom_type"` - // List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - // Here's an HCL2 example: - // ```hcl - // iso_paths = [ - // "[datastore1] ISO/ubuntu.iso", - // "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" - // ] - // ``` - ISOPaths []string `mapstructure:"iso_paths"` -} - -type StepAddCDRom struct { - Config *CDRomConfig -} - -func (c *CDRomConfig) Prepare() []error { - var errs []error - - if c.CdromType != "" && c.CdromType != "ide" && c.CdromType != "sata" { - errs = append(errs, fmt.Errorf("'cdrom_type' must be 'ide' or 'sata'")) - } - - return errs -} - -func (s *StepAddCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(driver.VirtualMachine) - - if s.Config.CdromType == "sata" { - if _, err := vm.FindSATAController(); err == driver.ErrNoSataController { - ui.Say("Adding SATA controller...") - if err := vm.AddSATAController(); err != nil { - state.Put("error", fmt.Errorf("error adding SATA controller: %v", err)) - return multistep.ActionHalt - } - } - } - - ui.Say("Mounting ISO images...") - if path, ok := state.GetOk("iso_remote_path"); ok { - if err := vm.AddCdrom(s.Config.CdromType, path.(string)); err != nil { - state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err)) - return multistep.ActionHalt - } - } - - // Add our custom CD, if it exists - if cd_path, _ := state.Get("cd_path").(string); cd_path != "" { - s.Config.ISOPaths = append(s.Config.ISOPaths, cd_path) - } - - if len(s.Config.ISOPaths) > 0 { - for _, path := range s.Config.ISOPaths { - if err := vm.AddCdrom(s.Config.CdromType, path); err != nil { - state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err)) - return multistep.ActionHalt - } - } - } - return multistep.ActionContinue -} - -func (s *StepAddCDRom) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_add_cdrom.hcl2spec.go b/builder/vsphere/common/step_add_cdrom.hcl2spec.go deleted file mode 100644 index 205232829..000000000 --- a/builder/vsphere/common/step_add_cdrom.hcl2spec.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type CDRomConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatCDRomConfig is an auto-generated flat version of CDRomConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatCDRomConfig struct { - CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` - ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` -} - -// FlatMapstructure returns a new FlatCDRomConfig. -// FlatCDRomConfig is an auto-generated flat version of CDRomConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*CDRomConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatCDRomConfig) -} - -// HCL2Spec returns the hcl spec of a CDRomConfig. -// This spec is used by HCL to read the fields of CDRomConfig. -// The decoded values from this spec will then be applied to a FlatCDRomConfig. -func (*FlatCDRomConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, - "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_add_cdrom_test.go b/builder/vsphere/common/step_add_cdrom_test.go deleted file mode 100644 index bc50a9e3c..000000000 --- a/builder/vsphere/common/step_add_cdrom_test.go +++ /dev/null @@ -1,235 +0,0 @@ -package common - -import ( - "context" - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestCDRomConfig_Prepare(t *testing.T) { - // Data validation - tc := []struct { - name string - config *CDRomConfig - fail bool - expectedErrMsg string - }{ - { - name: "Should not fail for empty config", - config: new(CDRomConfig), - fail: false, - expectedErrMsg: "", - }, - { - name: "Valid cdroom type ide", - config: &CDRomConfig{CdromType: "ide"}, - fail: false, - expectedErrMsg: "", - }, - { - name: "Valid cdroom type sata", - config: &CDRomConfig{CdromType: "ide"}, - fail: false, - expectedErrMsg: "", - }, - { - name: "Invalid cdroom type", - config: &CDRomConfig{CdromType: "invalid"}, - fail: true, - expectedErrMsg: "'cdrom_type' must be 'ide' or 'sata'", - }, - } - - for _, c := range tc { - errs := c.config.Prepare() - if c.fail { - if len(errs) == 0 { - t.Fatalf("Config preprare should fail") - } - if errs[0].Error() != c.expectedErrMsg { - t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error()) - } - } else { - if len(errs) != 0 { - t.Fatalf("Config preprare should not fail") - } - } - } -} - -func TestStepAddCDRom_Run(t *testing.T) { - tc := []struct { - name string - state *multistep.BasicStateBag - step *StepAddCDRom - vmMock *driver.VirtualMachineMock - expectedAction multistep.StepAction - expectedVmMock *driver.VirtualMachineMock - fail bool - errMessage string - }{ - { - name: "CDRom SATA type with all iso paths set", - state: cdAndIsoRemotePathStateBag(), - step: &StepAddCDRom{ - Config: &CDRomConfig{ - CdromType: "sata", - ISOPaths: []string{"iso/path"}, - }, - }, - vmMock: new(driver.VirtualMachineMock), - expectedAction: multistep.ActionContinue, - expectedVmMock: &driver.VirtualMachineMock{ - FindSATAControllerCalled: true, - AddCdromCalled: true, - AddCdromCalledTimes: 3, - AddCdromTypes: []string{"sata", "sata", "sata"}, - AddCdromPaths: []string{"remote/path", "iso/path", "cd/path"}, - }, - fail: false, - errMessage: "", - }, - { - name: "Add SATA Controller", - state: basicStateBag(nil), - step: &StepAddCDRom{ - Config: &CDRomConfig{ - CdromType: "sata", - }, - }, - vmMock: &driver.VirtualMachineMock{ - FindSATAControllerErr: driver.ErrNoSataController, - }, - expectedAction: multistep.ActionContinue, - expectedVmMock: &driver.VirtualMachineMock{ - FindSATAControllerCalled: true, - FindSATAControllerErr: driver.ErrNoSataController, - AddSATAControllerCalled: true, - }, - fail: false, - errMessage: "", - }, - { - name: "Fail to add SATA Controller", - state: basicStateBag(nil), - step: &StepAddCDRom{ - Config: &CDRomConfig{ - CdromType: "sata", - }, - }, - vmMock: &driver.VirtualMachineMock{ - FindSATAControllerErr: driver.ErrNoSataController, - AddSATAControllerErr: fmt.Errorf("AddSATAController error"), - }, - expectedAction: multistep.ActionHalt, - expectedVmMock: &driver.VirtualMachineMock{ - FindSATAControllerCalled: true, - AddSATAControllerCalled: true, - }, - fail: true, - errMessage: fmt.Sprintf("error adding SATA controller: %v", fmt.Errorf("AddSATAController error")), - }, - { - name: "IDE CDRom Type and Iso Path set", - state: basicStateBag(nil), - step: &StepAddCDRom{ - Config: &CDRomConfig{ - CdromType: "ide", - ISOPaths: []string{"iso/path"}, - }, - }, - vmMock: new(driver.VirtualMachineMock), - expectedAction: multistep.ActionContinue, - expectedVmMock: &driver.VirtualMachineMock{ - AddCdromCalled: true, - AddCdromCalledTimes: 1, - AddCdromTypes: []string{"ide"}, - AddCdromPaths: []string{"iso/path"}, - }, - fail: false, - errMessage: "", - }, - { - name: "Fail to add cdrom from ISOPaths", - state: basicStateBag(nil), - step: &StepAddCDRom{ - Config: &CDRomConfig{ - ISOPaths: []string{"iso/path"}, - }, - }, - vmMock: &driver.VirtualMachineMock{ - AddCdromErr: fmt.Errorf("AddCdrom error"), - }, - expectedAction: multistep.ActionHalt, - expectedVmMock: &driver.VirtualMachineMock{ - AddCdromCalled: true, - AddCdromCalledTimes: 1, - AddCdromTypes: []string{""}, - AddCdromPaths: []string{"iso/path"}, - }, - fail: true, - errMessage: fmt.Sprintf("error mounting an image 'iso/path': %v", fmt.Errorf("AddCdrom error")), - }, - { - name: "Fail to add cdrom from state iso_remote_path", - state: isoRemotePathStateBag(), - step: &StepAddCDRom{ - Config: new(CDRomConfig), - }, - vmMock: &driver.VirtualMachineMock{ - AddCdromErr: fmt.Errorf("AddCdrom error"), - }, - expectedAction: multistep.ActionHalt, - expectedVmMock: &driver.VirtualMachineMock{ - AddCdromCalled: true, - AddCdromCalledTimes: 1, - AddCdromTypes: []string{""}, - AddCdromPaths: []string{"remote/path"}, - }, - fail: true, - errMessage: fmt.Sprintf("error mounting an image 'remote/path': %v", fmt.Errorf("AddCdrom error")), - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - c.state.Put("vm", c.vmMock) - if action := c.step.Run(context.TODO(), c.state); action != c.expectedAction { - t.Fatalf("unexpected action %v", action) - } - err, ok := c.state.Get("error").(error) - if ok { - if err.Error() != c.errMessage { - t.Fatalf("unexpected error %s", err.Error()) - } - } else { - if c.fail { - t.Fatalf("expected to fail but it didn't") - } - } - - if diff := cmp.Diff(c.vmMock, c.expectedVmMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected VirtualMachine calls: %s", diff) - } - }) - } -} - -func cdAndIsoRemotePathStateBag() *multistep.BasicStateBag { - state := basicStateBag(nil) - state.Put("iso_remote_path", "remote/path") - state.Put("cd_path", "cd/path") - return state -} - -func isoRemotePathStateBag() *multistep.BasicStateBag { - state := basicStateBag(nil) - state.Put("iso_remote_path", "remote/path") - return state -} diff --git a/builder/vsphere/common/step_add_floppy.go b/builder/vsphere/common/step_add_floppy.go deleted file mode 100644 index a56671348..000000000 --- a/builder/vsphere/common/step_add_floppy.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type FloppyConfig - -package common - -import ( - "context" - "fmt" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type FloppyConfig struct { - // Datastore path to a floppy image that will be mounted to the VM. - // Example: `[datastore1] ISO/pvscsi-Windows8.flp`. - FloppyIMGPath string `mapstructure:"floppy_img_path"` - // List of local files to be mounted to the VM floppy drive. Can be used to - // make Debian preseed or RHEL kickstart files available to the VM. - FloppyFiles []string `mapstructure:"floppy_files"` - // List of directories to copy files from. - FloppyDirectories []string `mapstructure:"floppy_dirs"` - // The label to use for the floppy disk that - // is attached when the VM is booted. This is most useful for cloud-init, - // Kickstart or other early initialization tools, which can benefit from labelled floppy disks. - // By default, the floppy label will be 'packer'. - FloppyLabel string `mapstructure:"floppy_label"` -} - -type StepAddFloppy struct { - Config *FloppyConfig - Datastore string - Host string - SetHostForDatastoreUploads bool -} - -func (s *StepAddFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(driver.VirtualMachine) - d := state.Get("driver").(driver.Driver) - - if floppyPath, ok := state.GetOk("floppy_path"); ok { - ui.Say("Uploading created floppy image") - - ds, err := d.FindDatastore(s.Datastore, s.Host) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - vmDir, err := vm.GetDir() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - uploadPath := fmt.Sprintf("%v/packer-tmp-created-floppy.flp", vmDir) - if err := ds.UploadFile(floppyPath.(string), uploadPath, s.Host, s.SetHostForDatastoreUploads); err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Put("uploaded_floppy_path", uploadPath) - - ui.Say("Adding generated Floppy...") - floppyIMGPath := ds.ResolvePath(uploadPath) - err = vm.AddFloppy(floppyIMGPath) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - if s.Config.FloppyIMGPath != "" { - ui.Say("Adding Floppy image...") - err := vm.AddFloppy(s.Config.FloppyIMGPath) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepAddFloppy) Cleanup(state multistep.StateBag) { - _, cancelled := state.GetOk(multistep.StateCancelled) - _, halted := state.GetOk(multistep.StateHalted) - if !cancelled && !halted { - return - } - - ui := state.Get("ui").(packersdk.Ui) - d := state.Get("driver").(driver.Driver) - - if UploadedFloppyPath, ok := state.GetOk("uploaded_floppy_path"); ok { - ui.Say("Deleting Floppy image ...") - - ds, err := d.FindDatastore(s.Datastore, s.Host) - if err != nil { - state.Put("error", err) - return - } - - err = ds.Delete(UploadedFloppyPath.(string)) - if err != nil { - state.Put("error", err) - return - } - - } -} diff --git a/builder/vsphere/common/step_add_floppy.hcl2spec.go b/builder/vsphere/common/step_add_floppy.hcl2spec.go deleted file mode 100644 index a42511314..000000000 --- a/builder/vsphere/common/step_add_floppy.hcl2spec.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type FloppyConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatFloppyConfig is an auto-generated flat version of FloppyConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatFloppyConfig struct { - FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` - FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` - FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` - FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` -} - -// FlatMapstructure returns a new FlatFloppyConfig. -// FlatFloppyConfig is an auto-generated flat version of FloppyConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*FloppyConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatFloppyConfig) -} - -// HCL2Spec returns the hcl spec of a FloppyConfig. -// This spec is used by HCL to read the fields of FloppyConfig. -// The decoded values from this spec will then be applied to a FlatFloppyConfig. -func (*FlatFloppyConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, - "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, - "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, - "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_add_floppy_test.go b/builder/vsphere/common/step_add_floppy_test.go deleted file mode 100644 index d6533580a..000000000 --- a/builder/vsphere/common/step_add_floppy_test.go +++ /dev/null @@ -1,453 +0,0 @@ -package common - -import ( - "context" - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestStepAddFloppy_Run(t *testing.T) { - tc := []struct { - name string - floppyPath string - uploadedPath string - step *StepAddFloppy - expectedAction multistep.StepAction - vmMock *driver.VirtualMachineMock - expectedVmMock *driver.VirtualMachineMock - driverMock *driver.DriverMock - expectedDriverMock *driver.DriverMock - dsMock *driver.DatastoreMock - expectedDsMock *driver.DatastoreMock - fail bool - errMessage string - }{ - { - name: "Add floppy from state floppy path", - floppyPath: "floppy/path", - uploadedPath: "vm/dir/packer-tmp-created-floppy.flp", - step: &StepAddFloppy{ - Config: new(FloppyConfig), - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: true, - }, - expectedAction: multistep.ActionContinue, - vmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - }, - expectedVmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - GetDirCalled: true, - AddFloppyCalled: true, - AddFloppyImagePath: "resolved/path", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - ResolvePathReturn: "resolved/path", - }, - expectedDsMock: &driver.DatastoreMock{ - UploadFileCalled: true, - UploadFileSrc: "floppy/path", - UploadFileDst: "vm/dir/packer-tmp-created-floppy.flp", - UploadFileHost: "host", - UploadFileSetHost: true, - ResolvePathCalled: true, - ResolvePathReturn: "resolved/path", - }, - fail: false, - }, - { - name: "State floppy path - find datastore fail", - floppyPath: "floppy/path", - step: &StepAddFloppy{ - Config: new(FloppyConfig), - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: true, - }, - expectedAction: multistep.ActionHalt, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: new(driver.VirtualMachineMock), - driverMock: &driver.DriverMock{ - FindDatastoreErr: fmt.Errorf("error finding datastore"), - }, - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "error finding datastore", - }, - { - name: "State floppy path - vm get dir fail", - floppyPath: "floppy/path", - step: &StepAddFloppy{ - Config: new(FloppyConfig), - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: true, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - GetDirErr: fmt.Errorf("fail to get vm dir"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - GetDirCalled: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "fail to get vm dir", - }, - { - name: "State floppy path - datastore upload file fail", - floppyPath: "floppy/path", - step: &StepAddFloppy{ - Config: new(FloppyConfig), - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: true, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - }, - expectedVmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - GetDirCalled: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - UploadFileErr: fmt.Errorf("failed to upload file"), - }, - expectedDsMock: &driver.DatastoreMock{ - UploadFileCalled: true, - UploadFileSrc: "floppy/path", - UploadFileDst: "vm/dir/packer-tmp-created-floppy.flp", - UploadFileHost: "host", - UploadFileSetHost: true, - }, - fail: true, - errMessage: "failed to upload file", - }, - { - name: "State floppy path - vm fail to add floppy", - floppyPath: "floppy/path", - uploadedPath: "vm/dir/packer-tmp-created-floppy.flp", - step: &StepAddFloppy{ - Config: new(FloppyConfig), - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: true, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - AddFloppyErr: fmt.Errorf("failed to add floppy"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - GetDirResponse: "vm/dir", - GetDirCalled: true, - AddFloppyCalled: true, - AddFloppyImagePath: "resolved/path", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - ResolvePathReturn: "resolved/path", - }, - expectedDsMock: &driver.DatastoreMock{ - UploadFileCalled: true, - UploadFileSrc: "floppy/path", - UploadFileDst: "vm/dir/packer-tmp-created-floppy.flp", - UploadFileHost: "host", - UploadFileSetHost: true, - ResolvePathCalled: true, - ResolvePathReturn: "resolved/path", - }, - fail: true, - errMessage: "failed to add floppy", - }, - { - name: "Add floppy from FloppyIMGPath config", - step: &StepAddFloppy{ - Config: &FloppyConfig{ - FloppyIMGPath: "floppy/image/path", - }, - }, - expectedAction: multistep.ActionContinue, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - AddFloppyCalled: true, - AddFloppyImagePath: "floppy/image/path", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: false, - }, - { - name: "Fail to add floppy from FloppyIMGPath config", - step: &StepAddFloppy{ - Config: &FloppyConfig{ - FloppyIMGPath: "floppy/image/path", - }, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - AddFloppyErr: fmt.Errorf("fail to add floppy"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - AddFloppyCalled: true, - AddFloppyImagePath: "floppy/image/path", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "fail to add floppy", - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - state := basicStateBag(nil) - state.Put("vm", c.vmMock) - c.driverMock.DatastoreMock = c.dsMock - state.Put("driver", c.driverMock) - - if c.floppyPath != "" { - state.Put("floppy_path", c.floppyPath) - } - - if action := c.step.Run(context.TODO(), state); action != c.expectedAction { - t.Fatalf("unexpected action %v", action) - } - err, ok := state.Get("error").(error) - if ok { - if err.Error() != c.errMessage { - t.Fatalf("unexpected error %s", err.Error()) - } - } else { - if c.fail { - t.Fatalf("expected to fail but it didn't") - } - } - - uploadedPath, _ := state.Get("uploaded_floppy_path").(string) - if uploadedPath != c.uploadedPath { - t.Fatalf("Unexpected uploaded path state %s", uploadedPath) - } - - if diff := cmp.Diff(c.vmMock, c.expectedVmMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected VirtualMachine calls: %s", diff) - } - c.expectedDriverMock.DatastoreMock = c.expectedDsMock - if diff := cmp.Diff(c.driverMock, c.expectedDriverMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Driver calls: %s", diff) - } - if diff := cmp.Diff(c.dsMock, c.expectedDsMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Datastore calls: %s", diff) - } - }) - } -} - -func TestStepAddFloppy_Cleanup(t *testing.T) { - tc := []struct { - name string - uploadedPath string - multistepState string - step *StepAddFloppy - driverMock *driver.DriverMock - expectedDriverMock *driver.DriverMock - dsMock *driver.DatastoreMock - expectedDsMock *driver.DatastoreMock - fail bool - errMessage string - }{ - { - name: "State cancelled clean up", - uploadedPath: "uploaded/path", - multistepState: multistep.StateCancelled, - step: &StepAddFloppy{ - Datastore: "datastore", - Host: "host", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - DeleteCalled: true, - }, - expectedDsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeletePath: "uploaded/path", - }, - fail: false, - }, - { - name: "State halted clean up", - uploadedPath: "uploaded/path", - multistepState: multistep.StateHalted, - step: &StepAddFloppy{ - Datastore: "datastore", - Host: "host", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - DeleteCalled: true, - }, - expectedDsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeletePath: "uploaded/path", - }, - fail: false, - }, - { - name: "Don't clean up without uploaded path", - multistepState: multistep.StateHalted, - step: new(StepAddFloppy), - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: false, - }, - { - name: "Don't clean up if state is not halted or canceled", - multistepState: "", - step: new(StepAddFloppy), - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: false, - }, - { - name: "Fail because datastore is not found", - uploadedPath: "uploaded/path", - multistepState: multistep.StateHalted, - step: &StepAddFloppy{ - Datastore: "datastore", - Host: "host", - }, - driverMock: &driver.DriverMock{ - FindDatastoreErr: fmt.Errorf("fail to find datastore"), - }, - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "fail to find datastore", - }, - { - name: "Fail to delete floppy", - uploadedPath: "uploaded/path", - multistepState: multistep.StateHalted, - step: &StepAddFloppy{ - Datastore: "datastore", - Host: "host", - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeleteErr: fmt.Errorf("failed to delete floppy"), - }, - expectedDsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeletePath: "uploaded/path", - }, - fail: true, - errMessage: "failed to delete floppy", - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - state := basicStateBag(nil) - c.driverMock.DatastoreMock = c.dsMock - state.Put("driver", c.driverMock) - if c.uploadedPath != "" { - state.Put("uploaded_floppy_path", c.uploadedPath) - } - - if c.multistepState != "" { - state.Put(c.multistepState, true) - } - - c.step.Cleanup(state) - err, ok := state.Get("error").(error) - if ok { - if err.Error() != c.errMessage { - t.Fatalf("unexpected error %s", err.Error()) - } - } else { - if c.fail { - t.Fatalf("expected to fail but it didn't") - } - } - - c.expectedDriverMock.DatastoreMock = c.expectedDsMock - if diff := cmp.Diff(c.driverMock, c.expectedDriverMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Driver calls: %s", diff) - } - if diff := cmp.Diff(c.dsMock, c.expectedDsMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Datastore calls: %s", diff) - } - }) - } -} diff --git a/builder/vsphere/common/step_boot_command.go b/builder/vsphere/common/step_boot_command.go deleted file mode 100644 index 5847d1f08..000000000 --- a/builder/vsphere/common/step_boot_command.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:generate struct-markdown -package common - -import ( - "context" - "fmt" - "time" - - "github.com/hashicorp/packer-plugin-sdk/bootcommand" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - "github.com/hashicorp/packer/builder/vsphere/driver" - "golang.org/x/mobile/event/key" -) - -type BootConfig struct { - bootcommand.BootConfig `mapstructure:",squash"` - // The IP address to use for the HTTP server started to serve the `http_directory`. - // If unset, Packer will automatically discover and assign an IP. - HTTPIP string `mapstructure:"http_ip"` -} - -type bootCommandTemplateData struct { - HTTPIP string - HTTPPort int - Name string -} - -func (c *BootConfig) Prepare(ctx *interpolate.Context) []error { - if c.BootWait == 0 { - c.BootWait = 10 * time.Second - } - return c.BootConfig.Prepare(ctx) -} - -type StepBootCommand struct { - Config *BootConfig - VMName string - Ctx interpolate.Context -} - -func (s *StepBootCommand) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - debug := state.Get("debug").(bool) - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if s.Config.BootCommand == nil { - return multistep.ActionContinue - } - - // Wait the for the vm to boot. - if int64(s.Config.BootWait) > 0 { - ui.Say(fmt.Sprintf("Waiting %s for boot...", s.Config.BootWait.String())) - select { - case <-time.After(s.Config.BootWait): - break - case <-ctx.Done(): - return multistep.ActionHalt - } - } - - var pauseFn multistep.DebugPauseFn - if debug { - pauseFn = state.Get("pauseFn").(multistep.DebugPauseFn) - } - - port := state.Get("http_port").(int) - if port > 0 { - ip := state.Get("http_ip").(string) - s.Ctx.Data = &bootCommandTemplateData{ - ip, - port, - s.VMName, - } - ui.Say(fmt.Sprintf("HTTP server is working at http://%v:%v/", ip, port)) - } - - var keyAlt, keyCtrl, keyShift bool - sendCodes := func(code key.Code, down bool) error { - switch code { - case key.CodeLeftAlt: - keyAlt = down - case key.CodeLeftControl: - keyCtrl = down - case key.CodeLeftShift: - keyShift = down - } - - shift := down - if keyShift { - shift = keyShift - } - - _, err := vm.TypeOnKeyboard(driver.KeyInput{ - Scancode: code, - Ctrl: keyCtrl, - Alt: keyAlt, - Shift: shift, - }) - if err != nil { - // retry once if error - ui.Error(fmt.Errorf("error typing a boot command (code, down) `%d, %t`: %w", code, down, err).Error()) - ui.Say("trying key input again") - time.Sleep(s.Config.BootGroupInterval) - _, err = vm.TypeOnKeyboard(driver.KeyInput{ - Scancode: code, - Ctrl: keyCtrl, - Alt: keyAlt, - Shift: shift, - }) - if err != nil { - return fmt.Errorf("error typing a boot command (code, down) `%d, %t`: %w", code, down, err) - } - } - return nil - } - d := bootcommand.NewUSBDriver(sendCodes, s.Config.BootGroupInterval) - - ui.Say("Typing boot command...") - flatBootCommand := s.Config.FlatBootCommand() - command, err := interpolate.Render(flatBootCommand, &s.Ctx) - if err != nil { - err := fmt.Errorf("Error preparing boot command: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - seq, err := bootcommand.GenerateExpressionSequence(command) - if err != nil { - err := fmt.Errorf("Error generating boot command: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - if err := seq.Do(ctx, d); err != nil { - err := fmt.Errorf("Error running boot command: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - if pauseFn != nil { - pauseFn(multistep.DebugLocationAfterRun, fmt.Sprintf("boot_command: %s", command), state) - } - - return multistep.ActionContinue -} - -func (s *StepBootCommand) Cleanup(_ multistep.StateBag) {} diff --git a/builder/vsphere/common/step_config_params.go b/builder/vsphere/common/step_config_params.go deleted file mode 100644 index e9e52f0ec..000000000 --- a/builder/vsphere/common/step_config_params.go +++ /dev/null @@ -1,65 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type ConfigParamsConfig - -package common - -import ( - "context" - "fmt" - - "github.com/vmware/govmomi/vim25/types" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type ConfigParamsConfig struct { - // configuration_parameters is a direct passthrough to the VSphere API's - // ConfigSpec: https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html - ConfigParams map[string]string `mapstructure:"configuration_parameters"` - - // Enables time synchronization with the host. Defaults to false. - ToolsSyncTime bool `mapstructure:"tools_sync_time"` - - // If sets to true, vSphere will automatically check and upgrade VMware Tools upon a system power cycle. - // If not set, defaults to manual upgrade. - ToolsUpgradePolicy bool `mapstructure:"tools_upgrade_policy"` -} - -type StepConfigParams struct { - Config *ConfigParamsConfig -} - -func (s *StepConfigParams) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - configParams := make(map[string]string) - - if s.Config.ConfigParams != nil { - configParams = s.Config.ConfigParams - } - - var info *types.ToolsConfigInfo - if s.Config.ToolsSyncTime || s.Config.ToolsUpgradePolicy { - info = &types.ToolsConfigInfo{} - - if s.Config.ToolsSyncTime { - info.SyncTimeWithHost = &s.Config.ToolsSyncTime - } - - if s.Config.ToolsUpgradePolicy { - info.ToolsUpgradePolicy = "UpgradeAtPowerCycle" - } - } - - ui.Say("Adding configuration parameters...") - if err := vm.AddConfigParams(configParams, info); err != nil { - state.Put("error", fmt.Errorf("error adding configuration parameters: %v", err)) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *StepConfigParams) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_config_params.hcl2spec.go b/builder/vsphere/common/step_config_params.hcl2spec.go deleted file mode 100644 index a68cb3ad2..000000000 --- a/builder/vsphere/common/step_config_params.hcl2spec.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type ConfigParamsConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConfigParamsConfig struct { - ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` - ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` - ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` -} - -// FlatMapstructure returns a new FlatConfigParamsConfig. -// FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*ConfigParamsConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConfigParamsConfig) -} - -// HCL2Spec returns the hcl spec of a ConfigParamsConfig. -// This spec is used by HCL to read the fields of ConfigParamsConfig. -// The decoded values from this spec will then be applied to a FlatConfigParamsConfig. -func (*FlatConfigParamsConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, - "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, - "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_connect.go b/builder/vsphere/common/step_connect.go deleted file mode 100644 index 6afec36d8..000000000 --- a/builder/vsphere/common/step_connect.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type ConnectConfig - -package common - -import ( - "context" - "fmt" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type ConnectConfig struct { - // vCenter server hostname. - VCenterServer string `mapstructure:"vcenter_server"` - // vSphere username. - Username string `mapstructure:"username"` - // vSphere password. - Password string `mapstructure:"password"` - // Do not validate vCenter server's TLS certificate. Defaults to `false`. - InsecureConnection bool `mapstructure:"insecure_connection"` - // VMware datacenter name. Required if there is more than one datacenter in vCenter. - Datacenter string `mapstructure:"datacenter"` -} - -func (c *ConnectConfig) Prepare() []error { - var errs []error - - if c.VCenterServer == "" { - errs = append(errs, fmt.Errorf("'vcenter_server' is required")) - } - if c.Username == "" { - errs = append(errs, fmt.Errorf("'username' is required")) - } - if c.Password == "" { - errs = append(errs, fmt.Errorf("'password' is required")) - } - - return errs -} - -type StepConnect struct { - Config *ConnectConfig -} - -func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - d, err := driver.NewDriver(&driver.ConnectConfig{ - VCenterServer: s.Config.VCenterServer, - Username: s.Config.Username, - Password: s.Config.Password, - InsecureConnection: s.Config.InsecureConnection, - Datacenter: s.Config.Datacenter, - }) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Put("driver", d) - - return multistep.ActionContinue -} - -func (s *StepConnect) Cleanup(multistep.StateBag) {} diff --git a/builder/vsphere/common/step_connect.hcl2spec.go b/builder/vsphere/common/step_connect.hcl2spec.go deleted file mode 100644 index fa5782e33..000000000 --- a/builder/vsphere/common/step_connect.hcl2spec.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type ConnectConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatConnectConfig is an auto-generated flat version of ConnectConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConnectConfig struct { - VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` - Username *string `mapstructure:"username" cty:"username" hcl:"username"` - Password *string `mapstructure:"password" cty:"password" hcl:"password"` - InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` - Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` -} - -// FlatMapstructure returns a new FlatConnectConfig. -// FlatConnectConfig is an auto-generated flat version of ConnectConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*ConnectConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConnectConfig) -} - -// HCL2Spec returns the hcl spec of a ConnectConfig. -// This spec is used by HCL to read the fields of ConnectConfig. -// The decoded values from this spec will then be applied to a FlatConnectConfig. -func (*FlatConnectConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, - "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, - "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, - "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, - "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_download.go b/builder/vsphere/common/step_download.go deleted file mode 100644 index 93aafc726..000000000 --- a/builder/vsphere/common/step_download.go +++ /dev/null @@ -1,68 +0,0 @@ -package common - -import ( - "context" - "fmt" - "net/url" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -// Defining this interface ensures that we use the common step download, or the -// mock created to test this wrapper -type DownloadStep interface { - Run(context.Context, multistep.StateBag) multistep.StepAction - Cleanup(multistep.StateBag) - UseSourceToFindCacheTarget(source string) (*url.URL, string, error) -} - -// VSphere has a specialized need -- before we waste time downloading an iso, -// we need to check whether that iso already exists on the remote datastore. -// if it does, we skip the download. This wrapping-step still uses the common -// StepDownload but only if the image isn't already present on the datastore. -type StepDownload struct { - DownloadStep DownloadStep - // These keys are VSphere-specific and used to check the remote datastore. - Url []string - ResultKey string - Datastore string - Host string -} - -func (s *StepDownload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - driver := state.Get("driver").(driver.Driver) - ui := state.Get("ui").(packersdk.Ui) - - // Check whether iso is present on remote datastore. - ds, err := driver.FindDatastore(s.Datastore, s.Host) - if err != nil { - state.Put("error", fmt.Errorf("datastore doesn't exist: %v", err)) - return multistep.ActionHalt - } - - // loop over URLs to see if any are already present. If they are, store that - // one instate and continue - for _, source := range s.Url { - _, targetPath, err := s.DownloadStep.UseSourceToFindCacheTarget(source) - if err != nil { - state.Put("error", fmt.Errorf("Error getting target path: %s", err)) - return multistep.ActionHalt - } - _, remotePath, _, _ := GetRemoteDirectoryAndPath(targetPath, ds) - - if exists := ds.FileExists(remotePath); exists { - ui.Say(fmt.Sprintf("File %s already uploaded; continuing", targetPath)) - state.Put(s.ResultKey, targetPath) - return multistep.ActionContinue - } - } - - // ISO is not present on datastore, so we need to download, then upload it. - // Pass through to the common download step. - return s.DownloadStep.Run(ctx, state) -} - -func (s *StepDownload) Cleanup(state multistep.StateBag) { -} diff --git a/builder/vsphere/common/step_download_test.go b/builder/vsphere/common/step_download_test.go deleted file mode 100644 index 887868d99..000000000 --- a/builder/vsphere/common/step_download_test.go +++ /dev/null @@ -1,85 +0,0 @@ -package common - -import ( - "context" - "net/url" - "testing" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -/// create mock step -type MockDownloadStep struct { - RunCalled bool -} - -func (s *MockDownloadStep) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - s.RunCalled = true - return multistep.ActionContinue -} - -func (s *MockDownloadStep) Cleanup(state multistep.StateBag) {} - -func (s *MockDownloadStep) UseSourceToFindCacheTarget(source string) (*url.URL, string, error) { - return nil, "sometarget", nil -} - -/// start tests -func downloadStepState(exists bool) *multistep.BasicStateBag { - state := basicStateBag(nil) - dsMock := &driver.DatastoreMock{ - FileExistsReturn: exists, - } - driverMock := &driver.DriverMock{ - DatastoreMock: dsMock, - } - state.Put("driver", driverMock) - return state -} - -func TestStepDownload_Run(t *testing.T) { - testcases := []struct { - name string - filePresent bool - expectedAction multistep.StepAction - expectInternalStepCalled bool - errMessage string - }{ - { - name: "Remote iso present; download shouldn't be called", - filePresent: true, - expectedAction: multistep.ActionContinue, - expectInternalStepCalled: false, - errMessage: "", - }, - { - name: "Remote iso not present; download should be called", - filePresent: false, - expectedAction: multistep.ActionContinue, - expectInternalStepCalled: true, - errMessage: "", - }, - } - for _, tc := range testcases { - internalStep := &MockDownloadStep{} - state := downloadStepState(tc.filePresent) - step := &StepDownload{ - DownloadStep: internalStep, - Url: []string{"https://path/to/fake-url.iso"}, - Datastore: "datastore-mock", - Host: "fake-host", - } - stepAction := step.Run(context.TODO(), state) - if stepAction != tc.expectedAction { - t.Fatalf("%s: Recieved wrong step action; step exists, should return early.", tc.name) - } - if tc.expectInternalStepCalled != internalStep.RunCalled { - if tc.expectInternalStepCalled { - t.Fatalf("%s: Expected internal download step to be called", tc.name) - } else { - t.Fatalf("%s: Expected internal download step not to be called", tc.name) - } - } - } -} diff --git a/builder/vsphere/common/step_export.go b/builder/vsphere/common/step_export.go deleted file mode 100644 index d5dae8401..000000000 --- a/builder/vsphere/common/step_export.go +++ /dev/null @@ -1,338 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type ExportConfig - -package common - -import ( - "bytes" - "context" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "fmt" - "hash" - "io" - "os" - "path/filepath" - "strings" - - "github.com/hashicorp/packer-plugin-sdk/common" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - "github.com/hashicorp/packer/builder/vsphere/driver" - "github.com/pkg/errors" - "github.com/vmware/govmomi/nfc" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -// You may optionally export an ovf from VSphere to the instance running Packer. -// -// Example usage: -// -// In JSON: -// ```json -// ... -// "vm_name": "example-ubuntu", -// ... -// "export": { -// "force": true, -// "output_directory": "./output_vsphere" -// }, -// ``` -// In HCL2: -// ```hcl -// # ... -// vm_name = "example-ubuntu" -// # ... -// export { -// force = true -// output_directory = "./output_vsphere" -// } -// ``` -// The above configuration would create the following files: -// -// ```text -// ./output_vsphere/example-ubuntu-disk-0.vmdk -// ./output_vsphere/example-ubuntu.mf -// ./output_vsphere/example-ubuntu.ovf -// ``` -type ExportConfig struct { - // name of the ovf. defaults to the name of the VM - Name string `mapstructure:"name"` - // overwrite ovf if it exists - Force bool `mapstructure:"force"` - // include iso and img image files that are attached to the VM - Images bool `mapstructure:"images"` - // generate manifest using sha1, sha256, sha512. Defaults to 'sha256'. Use 'none' for no manifest. - Manifest string `mapstructure:"manifest"` - // Directory on the computer running Packer to export files to - OutputDir OutputConfig `mapstructure:",squash"` - // Advanced ovf export options. Options can include: - // * mac - MAC address is exported for all ethernet devices - // * uuid - UUID is exported for all virtual machines - // * extraconfig - all extra configuration options are exported for a virtual machine - // * nodevicesubtypes - resource subtypes for CD/DVD drives, floppy drives, and serial and parallel ports are not exported - // - // For example, adding the following export config option would output the mac addresses for all Ethernet devices in the ovf file: - // - // In JSON: - // ```json - // ... - // "export": { - // "options": ["mac"] - // }, - // ``` - // In HCL2: - // ```hcl - // ... - // export { - // options = ["mac"] - // } - // ``` - Options []string `mapstructure:"options"` -} - -var sha = map[string]func() hash.Hash{ - "none": nil, - "sha1": sha1.New, - "sha256": sha256.New, - "sha512": sha512.New, -} - -func (c *ExportConfig) Prepare(ctx *interpolate.Context, lc *LocationConfig, pc *common.PackerConfig) []error { - var errs *packersdk.MultiError - - errs = packersdk.MultiErrorAppend(errs, c.OutputDir.Prepare(ctx, pc)...) - - // manifest should default to sha256 - if c.Manifest == "" { - c.Manifest = "sha256" - } - if _, ok := sha[c.Manifest]; !ok { - errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("unknown hash: %s. available options include available options being 'none', 'sha1', 'sha256', 'sha512'", c.Manifest)) - } - - if c.Name == "" { - c.Name = lc.VMName - } - target := getTarget(c.OutputDir.OutputDir, c.Name) - if !c.Force { - if _, err := os.Stat(target); err == nil { - errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("file already exists: %s", target)) - } - } - - if err := os.MkdirAll(c.OutputDir.OutputDir, c.OutputDir.DirPerm); err != nil { - errs = packersdk.MultiErrorAppend(errs, errors.Wrap(err, "unable to make directory for export")) - } - - if errs != nil && len(errs.Errors) > 0 { - return errs.Errors - } - - return nil -} - -func getTarget(dir string, name string) string { - return filepath.Join(dir, name+".ovf") -} - -type StepExport struct { - Name string - Force bool - Images bool - Manifest string - OutputDir string - Options []string - mf bytes.Buffer -} - -func (s *StepExport) Cleanup(multistep.StateBag) { -} - -func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - ui.Message("Starting export...") - lease, err := vm.Export() - if err != nil { - state.Put("error", errors.Wrap(err, "error exporting vm")) - return multistep.ActionHalt - } - - info, err := lease.Wait(ctx, nil) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - u := lease.StartUpdater(ctx, info) - defer u.Done() - - cdp := types.OvfCreateDescriptorParams{ - Name: s.Name, - } - - m := vm.NewOvfManager() - if len(s.Options) > 0 { - exportOptions, err := vm.GetOvfExportOptions(m) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - var unknown []string - for _, option := range s.Options { - found := false - for _, exportOpt := range exportOptions { - if exportOpt.Option == option { - found = true - break - } - } - if !found { - unknown = append(unknown, option) - } - cdp.ExportOption = append(cdp.ExportOption, option) - } - - // only printing error message because the unknown options are just ignored by vcenter - if len(unknown) > 0 { - ui.Error(fmt.Sprintf("unknown export options %s", strings.Join(unknown, ","))) - } - } - - for _, i := range info.Items { - if !s.include(&i) { - continue - } - - if !strings.HasPrefix(i.Path, s.Name) { - i.Path = s.Name + "-" + i.Path - } - - file := i.File() - - ui.Message("Downloading: " + file.Path) - size, err := s.Download(ctx, lease, i) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - // Fix file size descriptor - file.Size = size - - ui.Message("Exporting file: " + file.Path) - cdp.OvfFiles = append(cdp.OvfFiles, file) - } - - if err = lease.Complete(ctx); err != nil { - state.Put("error", errors.Wrap(err, "unable to complete lease")) - return multistep.ActionHalt - } - - desc, err := vm.CreateDescriptor(m, cdp) - if err != nil { - state.Put("error", errors.Wrap(err, "unable to create descriptor")) - return multistep.ActionHalt - } - - target := getTarget(s.OutputDir, s.Name) - file, err := os.Create(target) - if err != nil { - state.Put("error", errors.Wrap(err, "unable to create file: "+target)) - return multistep.ActionHalt - } - - var w io.Writer = file - h, ok := s.newHash() - if ok { - w = io.MultiWriter(file, h) - } - - ui.Message("Writing ovf...") - _, err = io.WriteString(w, desc.OvfDescriptor) - if err != nil { - state.Put("error", errors.Wrap(err, "unable to write descriptor")) - return multistep.ActionHalt - } - - if err = file.Close(); err != nil { - state.Put("error", errors.Wrap(err, "unable to close descriptor")) - return multistep.ActionHalt - } - - if s.Manifest == "none" { - // manifest does not need to be created, return - return multistep.ActionContinue - } - - ui.Message("Creating manifest...") - s.addHash(filepath.Base(target), h) - - file, err = os.Create(filepath.Join(s.OutputDir, s.Name+".mf")) - if err != nil { - state.Put("error", errors.Wrap(err, "unable to create manifest")) - return multistep.ActionHalt - } - - _, err = io.Copy(file, &s.mf) - if err != nil { - state.Put("error", errors.Wrap(err, "unable to write manifest")) - return multistep.ActionHalt - } - - err = file.Close() - if err != nil { - state.Put("error", errors.Wrap(err, "unable to close file")) - return multistep.ActionHalt - } - - ui.Message("Finished exporting...") - return multistep.ActionContinue -} - -func (s *StepExport) include(item *nfc.FileItem) bool { - if s.Images { - return true - } - - return filepath.Ext(item.Path) == ".vmdk" -} - -func (s *StepExport) newHash() (hash.Hash, bool) { - // check if function is nil to handle the 'none' case - if h, ok := sha[s.Manifest]; ok && h != nil { - return h(), true - } - - return nil, false -} - -func (s *StepExport) addHash(p string, h hash.Hash) { - _, _ = fmt.Fprintf(&s.mf, "%s(%s)= %x\n", strings.ToUpper(s.Manifest), p, h.Sum(nil)) -} - -func (s *StepExport) Download(ctx context.Context, lease *nfc.Lease, item nfc.FileItem) (int64, error) { - path := filepath.Join(s.OutputDir, item.Path) - opts := soap.Download{} - - if h, ok := s.newHash(); ok { - opts.Writer = h - defer s.addHash(item.Path, h) - } - - err := lease.DownloadFile(ctx, path, item, opts) - if err != nil { - return 0, err - } - - f, err := os.Stat(path) - if err != nil { - return 0, err - } - return f.Size(), err -} diff --git a/builder/vsphere/common/step_export.hcl2spec.go b/builder/vsphere/common/step_export.hcl2spec.go deleted file mode 100644 index 21824d5d5..000000000 --- a/builder/vsphere/common/step_export.hcl2spec.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type ExportConfig"; DO NOT EDIT. - -package common - -import ( - "io/fs" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatExportConfig is an auto-generated flat version of ExportConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatExportConfig struct { - Name *string `mapstructure:"name" cty:"name" hcl:"name"` - Force *bool `mapstructure:"force" cty:"force" hcl:"force"` - Images *bool `mapstructure:"images" cty:"images" hcl:"images"` - Manifest *string `mapstructure:"manifest" cty:"manifest" hcl:"manifest"` - OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` - DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` - Options []string `mapstructure:"options" cty:"options" hcl:"options"` -} - -// FlatMapstructure returns a new FlatExportConfig. -// FlatExportConfig is an auto-generated flat version of ExportConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*ExportConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatExportConfig) -} - -// HCL2Spec returns the hcl spec of a ExportConfig. -// This spec is used by HCL to read the fields of ExportConfig. -// The decoded values from this spec will then be applied to a FlatExportConfig. -func (*FlatExportConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, - "force": &hcldec.AttrSpec{Name: "force", Type: cty.Bool, Required: false}, - "images": &hcldec.AttrSpec{Name: "images", Type: cty.Bool, Required: false}, - "manifest": &hcldec.AttrSpec{Name: "manifest", Type: cty.String, Required: false}, - "output_directory": &hcldec.AttrSpec{Name: "output_directory", Type: cty.String, Required: false}, - "directory_permission": &hcldec.AttrSpec{Name: "directory_permission", Type: cty.Number, Required: false}, - "options": &hcldec.AttrSpec{Name: "options", Type: cty.List(cty.String), Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_hardware.go b/builder/vsphere/common/step_hardware.go deleted file mode 100644 index 853f363eb..000000000 --- a/builder/vsphere/common/step_hardware.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type HardwareConfig - -package common - -import ( - "context" - "fmt" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type HardwareConfig struct { - // Number of CPU cores. - CPUs int32 `mapstructure:"CPUs"` - // Number of CPU cores per socket. - CpuCores int32 `mapstructure:"cpu_cores"` - // Amount of reserved CPU resources in MHz. - CPUReservation int64 `mapstructure:"CPU_reservation"` - // Upper limit of available CPU resources in MHz. - CPULimit int64 `mapstructure:"CPU_limit"` - // Enable CPU hot plug setting for virtual machine. Defaults to `false`. - CpuHotAddEnabled bool `mapstructure:"CPU_hot_plug"` - // Amount of RAM in MB. - RAM int64 `mapstructure:"RAM"` - // Amount of reserved RAM in MB. - RAMReservation int64 `mapstructure:"RAM_reservation"` - // Reserve all available RAM. Defaults to `false`. Cannot be used together - // with `RAM_reservation`. - RAMReserveAll bool `mapstructure:"RAM_reserve_all"` - // Enable RAM hot plug setting for virtual machine. Defaults to `false`. - MemoryHotAddEnabled bool `mapstructure:"RAM_hot_plug"` - // Amount of video memory in KB. - VideoRAM int64 `mapstructure:"video_ram"` - // vGPU profile for accelerated graphics. See [NVIDIA GRID vGPU documentation](https://docs.nvidia.com/grid/latest/grid-vgpu-user-guide/index.html#configure-vmware-vsphere-vm-with-vgpu) - // for examples of profile names. Defaults to none. - VGPUProfile string `mapstructure:"vgpu_profile"` - // Enable nested hardware virtualization for VM. Defaults to `false`. - NestedHV bool `mapstructure:"NestedHV"` - // Set the Firmware for virtual machine. Supported values: `bios`, `efi` or `efi-secure`. Defaults to `bios`. - Firmware string `mapstructure:"firmware"` - // During the boot, force entry into the BIOS setup screen. Defaults to `false`. - ForceBIOSSetup bool `mapstructure:"force_bios_setup"` -} - -func (c *HardwareConfig) Prepare() []error { - var errs []error - - if c.RAMReservation > 0 && c.RAMReserveAll != false { - errs = append(errs, fmt.Errorf("'RAM_reservation' and 'RAM_reserve_all' cannot be used together")) - } - - if c.Firmware != "" && c.Firmware != "bios" && c.Firmware != "efi" && c.Firmware != "efi-secure" { - errs = append(errs, fmt.Errorf("'firmware' must be '', 'bios', 'efi' or 'efi-secure'")) - } - - return errs -} - -type StepConfigureHardware struct { - Config *HardwareConfig -} - -func (s *StepConfigureHardware) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(driver.VirtualMachine) - - if *s.Config != (HardwareConfig{}) { - ui.Say("Customizing hardware...") - - err := vm.Configure(&driver.HardwareConfig{ - CPUs: s.Config.CPUs, - CpuCores: s.Config.CpuCores, - CPUReservation: s.Config.CPUReservation, - CPULimit: s.Config.CPULimit, - RAM: s.Config.RAM, - RAMReservation: s.Config.RAMReservation, - RAMReserveAll: s.Config.RAMReserveAll, - NestedHV: s.Config.NestedHV, - CpuHotAddEnabled: s.Config.CpuHotAddEnabled, - MemoryHotAddEnabled: s.Config.MemoryHotAddEnabled, - VideoRAM: s.Config.VideoRAM, - VGPUProfile: s.Config.VGPUProfile, - Firmware: s.Config.Firmware, - ForceBIOSSetup: s.Config.ForceBIOSSetup, - }) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepConfigureHardware) Cleanup(multistep.StateBag) {} diff --git a/builder/vsphere/common/step_hardware.hcl2spec.go b/builder/vsphere/common/step_hardware.hcl2spec.go deleted file mode 100644 index 334e6a644..000000000 --- a/builder/vsphere/common/step_hardware.hcl2spec.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type HardwareConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatHardwareConfig is an auto-generated flat version of HardwareConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatHardwareConfig struct { - CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` - CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` - CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` - CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` - CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` - RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` - RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` - RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` - MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` - VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` - VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` - NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` - Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` - ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` -} - -// FlatMapstructure returns a new FlatHardwareConfig. -// FlatHardwareConfig is an auto-generated flat version of HardwareConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*HardwareConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatHardwareConfig) -} - -// HCL2Spec returns the hcl spec of a HardwareConfig. -// This spec is used by HCL to read the fields of HardwareConfig. -// The decoded values from this spec will then be applied to a FlatHardwareConfig. -func (*FlatHardwareConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, - "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, - "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, - "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, - "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, - "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, - "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, - "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, - "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, - "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, - "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, - "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, - "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, - "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_hardware_test.go b/builder/vsphere/common/step_hardware_test.go deleted file mode 100644 index 58b0e930a..000000000 --- a/builder/vsphere/common/step_hardware_test.go +++ /dev/null @@ -1,181 +0,0 @@ -package common - -import ( - "context" - "errors" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestHardwareConfig_Prepare(t *testing.T) { - tc := []struct { - name string - config *HardwareConfig - fail bool - expectedErrMsg string - }{ - { - name: "Validate empty config", - config: &HardwareConfig{}, - fail: false, - }, - { - name: "Validate RAMReservation RAMReserveAll cannot be used together", - config: &HardwareConfig{ - RAMReservation: 2, - RAMReserveAll: true, - }, - fail: true, - expectedErrMsg: "'RAM_reservation' and 'RAM_reserve_all' cannot be used together", - }, - { - name: "Invalid firmware", - config: &HardwareConfig{ - Firmware: "invalid", - }, - fail: true, - expectedErrMsg: "'firmware' must be '', 'bios', 'efi' or 'efi-secure'", - }, - { - name: "Validate 'bios' firmware", - config: &HardwareConfig{ - Firmware: "bios", - }, - fail: false, - }, - { - name: "Validate 'efi' firmware", - config: &HardwareConfig{ - Firmware: "efi", - }, - fail: false, - }, - { - name: "Validate 'efi-secure' firmware", - config: &HardwareConfig{ - Firmware: "efi-secure", - }, - fail: false, - }, - } - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - errs := c.config.Prepare() - if c.fail { - if len(errs) == 0 { - t.Fatalf("Config preprare should fail") - } - if errs[0].Error() != c.expectedErrMsg { - t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error()) - } - } else { - if len(errs) != 0 { - t.Fatalf("Config preprare should not fail") - } - } - }) - } -} - -func TestStepConfigureHardware_Run(t *testing.T) { - tc := []struct { - name string - step *StepConfigureHardware - action multistep.StepAction - configureError error - configureCalled bool - hardwareConfig *driver.HardwareConfig - }{ - { - name: "Configure hardware", - step: basicStepConfigureHardware(), - action: multistep.ActionContinue, - configureError: nil, - configureCalled: true, - hardwareConfig: driverHardwareConfigFromConfig(basicStepConfigureHardware().Config), - }, - { - name: "Don't configure hardware when config is empty", - step: &StepConfigureHardware{Config: &HardwareConfig{}}, - action: multistep.ActionContinue, - configureError: nil, - configureCalled: false, - }, - { - name: "Halt when configure return error", - step: basicStepConfigureHardware(), - action: multistep.ActionHalt, - configureError: errors.New("failed to configure"), - configureCalled: true, - hardwareConfig: driverHardwareConfigFromConfig(basicStepConfigureHardware().Config), - }, - } - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - state := basicStateBag(nil) - vmMock := new(driver.VirtualMachineMock) - vmMock.ConfigureError = c.configureError - state.Put("vm", vmMock) - - action := c.step.Run(context.TODO(), state) - if action != c.action { - t.Fatalf("expected action '%v' but actual action was '%v'", c.action, action) - } - if vmMock.ConfigureCalled != c.configureCalled { - t.Fatalf("expecting vm.Configure called to %t but was %t", c.configureCalled, vmMock.ConfigureCalled) - } - if diff := cmp.Diff(vmMock.ConfigureHardwareConfig, c.hardwareConfig); diff != "" { - t.Fatalf("wrong driver.HardwareConfig: %s", diff) - } - - err, ok := state.GetOk("error") - containsError := c.configureError != nil - if containsError != ok { - t.Fatalf("Contain error - expecting %t but was %t", containsError, ok) - } - if containsError { - if !strings.Contains(err.(error).Error(), c.configureError.Error()) { - t.Fatalf("Destroy should fail with error message '%s' but failed with '%s'", c.configureError.Error(), err.(error).Error()) - } - } - }) - } -} - -func basicStepConfigureHardware() *StepConfigureHardware { - return &StepConfigureHardware{ - Config: &HardwareConfig{ - CPUs: 1, - CpuCores: 1, - CPUReservation: 1, - CPULimit: 4000, - RAM: 1024, - RAMReserveAll: true, - Firmware: "efi-secure", - ForceBIOSSetup: true, - }, - } -} - -func driverHardwareConfigFromConfig(config *HardwareConfig) *driver.HardwareConfig { - return &driver.HardwareConfig{ - CPUs: config.CPUs, - CpuCores: config.CpuCores, - CPUReservation: config.CPUReservation, - CPULimit: config.CPULimit, - RAM: config.RAM, - RAMReservation: config.RAMReservation, - RAMReserveAll: config.RAMReserveAll, - NestedHV: config.NestedHV, - CpuHotAddEnabled: config.CpuHotAddEnabled, - MemoryHotAddEnabled: config.MemoryHotAddEnabled, - VideoRAM: config.VideoRAM, - VGPUProfile: config.VGPUProfile, - Firmware: config.Firmware, - ForceBIOSSetup: config.ForceBIOSSetup, - } -} diff --git a/builder/vsphere/common/step_http_ip_discover.go b/builder/vsphere/common/step_http_ip_discover.go deleted file mode 100644 index 933cdbfe7..000000000 --- a/builder/vsphere/common/step_http_ip_discover.go +++ /dev/null @@ -1,68 +0,0 @@ -package common - -import ( - "context" - "fmt" - "net" - - "github.com/hashicorp/packer-plugin-sdk/multistep" -) - -// Step to discover the http ip -// which guests use to reach the vm host -// To make sure the IP is set before boot command and http server steps -type StepHTTPIPDiscover struct { - HTTPIP string - Network *net.IPNet -} - -func (s *StepHTTPIPDiscover) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ip, err := getHostIP(s.HTTPIP, s.Network) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Put("http_ip", ip) - - return multistep.ActionContinue -} - -func (s *StepHTTPIPDiscover) Cleanup(state multistep.StateBag) {} - -func getHostIP(s string, network *net.IPNet) (string, error) { - if s != "" { - if net.ParseIP(s) != nil { - return s, nil - } else { - return "", fmt.Errorf("invalid IP address") - } - } - - addrs, err := net.InterfaceAddrs() - if err != nil { - return "", err - } - - // look for an IP that is contained in the ip_wait_address range - if network != nil { - for _, a := range addrs { - ipnet, ok := a.(*net.IPNet) - if ok && !ipnet.IP.IsLoopback() { - if network.Contains(ipnet.IP) { - return ipnet.IP.String(), nil - } - } - } - } - - // fallback to an ipv4 address if an IP is not found in the range - for _, a := range addrs { - ipnet, ok := a.(*net.IPNet) - if ok && !ipnet.IP.IsLoopback() { - if ipnet.IP.To4() != nil { - return ipnet.IP.String(), nil - } - } - } - return "", fmt.Errorf("IP not found") -} diff --git a/builder/vsphere/common/step_http_ip_discover_test.go b/builder/vsphere/common/step_http_ip_discover_test.go deleted file mode 100644 index f1ca79d3a..000000000 --- a/builder/vsphere/common/step_http_ip_discover_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package common - -import ( - "context" - "net" - "testing" - - "github.com/hashicorp/packer-plugin-sdk/multistep" -) - -func TestStepHTTPIPDiscover_Run(t *testing.T) { - state := new(multistep.BasicStateBag) - step := new(StepHTTPIPDiscover) - - // without setting HTTPIP - if action := step.Run(context.Background(), state); action != multistep.ActionContinue { - t.Fatalf("bad action: %#v", action) - } - if _, ok := state.GetOk("error"); ok { - t.Fatal("should NOT have error") - } - _, ok := state.GetOk("http_ip") - if !ok { - t.Fatal("should have http_ip") - } - - // setting HTTPIP - ip := "10.0.2.2" - step = &StepHTTPIPDiscover{ - HTTPIP: ip, - } - if action := step.Run(context.Background(), state); action != multistep.ActionContinue { - t.Fatalf("bad action: %#v", action) - } - if _, ok := state.GetOk("error"); ok { - t.Fatal("should NOT have error") - } - httpIp, ok := state.GetOk("http_ip") - if !ok { - t.Fatal("should have http_ip") - } - if httpIp != ip { - t.Fatalf("bad: Http ip is %s but was supposed to be %s", httpIp, ip) - } - - _, ipNet, err := net.ParseCIDR("0.0.0.0/0") - if err != nil { - t.Fatal("error getting ipNet", err) - } - step = new(StepHTTPIPDiscover) - step.Network = ipNet - - // without setting HTTPIP with Network - if action := step.Run(context.Background(), state); action != multistep.ActionContinue { - t.Fatalf("bad action: %#v", action) - } - if _, ok := state.GetOk("error"); ok { - t.Fatal("should NOT have error") - } - _, ok = state.GetOk("http_ip") - if !ok { - t.Fatal("should have http_ip") - } - - // setting HTTPIP with Network - step = &StepHTTPIPDiscover{ - HTTPIP: ip, - Network: ipNet, - } - if action := step.Run(context.Background(), state); action != multistep.ActionContinue { - t.Fatalf("bad action: %#v", action) - } - if _, ok := state.GetOk("error"); ok { - t.Fatal("should NOT have error") - } - httpIp, ok = state.GetOk("http_ip") - if !ok { - t.Fatal("should have http_ip") - } - if httpIp != ip { - t.Fatalf("bad: Http ip is %s but was supposed to be %s", httpIp, ip) - } -} diff --git a/builder/vsphere/common/step_import_to_content_library.go b/builder/vsphere/common/step_import_to_content_library.go deleted file mode 100644 index 935fa750c..000000000 --- a/builder/vsphere/common/step_import_to_content_library.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type ContentLibraryDestinationConfig -package common - -import ( - "context" - "fmt" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - "github.com/hashicorp/packer/builder/vsphere/driver" - "github.com/vmware/govmomi/vapi/vcenter" -) - -// With this configuration Packer creates a library item in a content library whose content is a VM template -// or an OVF template created from the just built VM. -// The template is stored in a existing or newly created library item. -type ContentLibraryDestinationConfig struct { - // Name of the library in which the new library item containing the template should be created/updated. - // The Content Library should be of type Local to allow deploying virtual machines. - Library string `mapstructure:"library"` - // Name of the library item that will be created or updated. - // For VM templates, the name of the item should be different from [vm_name](#vm_name) and - // the default is [vm_name](#vm_name) + timestamp when not set. VM templates will be always imported to a new library item. - // For OVF templates, the name defaults to [vm_name](#vm_name) when not set, and if an item with the same name already - // exists it will be then updated with the new OVF template, otherwise a new item will be created. - // - // ~> **Note**: It's not possible to update existing library items with a new VM template. If updating an existing library - // item is necessary, use an OVF template instead by setting the [ovf](#ovf) option as `true`. - // - Name string `mapstructure:"name"` - // Description of the library item that will be created. - // This option is not used when importing OVF templates. - // Defaults to "Packer imported [vm_name](#vm_name) VM template". - Description string `mapstructure:"description"` - // Cluster onto which the virtual machine template should be placed. - // If cluster and resource_pool are both specified, resource_pool must belong to cluster. - // If cluster and host are both specified, host must be a member of cluster. - // This option is not used when importing OVF templates. - // Defaults to [cluster](#cluster). - Cluster string `mapstructure:"cluster"` - // Virtual machine folder into which the virtual machine template should be placed. - // This option is not used when importing OVF templates. - // Defaults to the same folder as the source virtual machine. - Folder string `mapstructure:"folder"` - // Host onto which the virtual machine template should be placed. - // If host and resource_pool are both specified, resource_pool must belong to host. - // If host and cluster are both specified, host must be a member of cluster. - // This option is not used when importing OVF templates. - // Defaults to [host](#host). - Host string `mapstructure:"host"` - // Resource pool into which the virtual machine template should be placed. - // Defaults to [resource_pool](#resource_pool). if [resource_pool](#resource_pool) is also unset, - // the system will attempt to choose a suitable resource pool for the virtual machine template. - ResourcePool string `mapstructure:"resource_pool"` - // The datastore for the virtual machine template's configuration and log files. - // This option is not used when importing OVF templates. - // Defaults to the storage backing associated with the library specified by library. - Datastore string `mapstructure:"datastore"` - // If set to true, the VM will be destroyed after deploying the template to the Content Library. - // Defaults to `false`. - Destroy bool `mapstructure:"destroy"` - // When set to true, Packer will import and OVF template to the content library item. Defaults to `false`. - Ovf bool `mapstructure:"ovf"` -} - -func (c *ContentLibraryDestinationConfig) Prepare(lc *LocationConfig) []error { - var errs *packersdk.MultiError - - if c.Library == "" { - errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("a library name must be provided")) - } - - if c.Ovf { - if c.Name == "" { - c.Name = lc.VMName - } - } else { - if c.Name == lc.VMName { - errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("the content library destination name must be different from the VM name")) - } - - if c.Name == "" { - // Add timestamp to the name to differentiate from the original VM - // otherwise vSphere won't be able to create the template which will be imported - name, err := interpolate.Render(lc.VMName+"{{timestamp}}", nil) - if err != nil { - errs = packersdk.MultiErrorAppend(errs, - fmt.Errorf("unable to parse content library VM template name: %s", err)) - } - c.Name = name - } - if c.Cluster == "" { - c.Cluster = lc.Cluster - } - if c.Host == "" { - c.Host = lc.Host - } - if c.ResourcePool == "" { - c.ResourcePool = lc.ResourcePool - } - if c.Description == "" { - c.Description = fmt.Sprintf("Packer imported %s VM template", lc.VMName) - } - } - - if errs != nil && len(errs.Errors) > 0 { - return errs.Errors - } - - return nil -} - -type StepImportToContentLibrary struct { - ContentLibConfig *ContentLibraryDestinationConfig -} - -func (s *StepImportToContentLibrary) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - var err error - - if s.ContentLibConfig.Ovf { - ui.Say(fmt.Sprintf("Importing VM OVF template %s to Content Library...", s.ContentLibConfig.Name)) - err = s.importOvfTemplate(vm) - } else { - ui.Say(fmt.Sprintf("Importing VM template %s to Content Library...", s.ContentLibConfig.Name)) - err = s.importVmTemplate(vm) - } - - if err != nil { - ui.Error(fmt.Sprintf("Failed to import template %s: %s", s.ContentLibConfig.Name, err.Error())) - state.Put("error", err) - return multistep.ActionHalt - } - - if s.ContentLibConfig.Destroy { - state.Put("destroy_vm", s.ContentLibConfig.Destroy) - } - - return multistep.ActionContinue -} - -func (s *StepImportToContentLibrary) importOvfTemplate(vm *driver.VirtualMachineDriver) error { - ovf := vcenter.OVF{ - Spec: vcenter.CreateSpec{ - Name: s.ContentLibConfig.Name, - }, - Target: vcenter.LibraryTarget{ - LibraryID: s.ContentLibConfig.Library, - }, - } - return vm.ImportOvfToContentLibrary(ovf) -} - -func (s *StepImportToContentLibrary) importVmTemplate(vm *driver.VirtualMachineDriver) error { - template := vcenter.Template{ - Name: s.ContentLibConfig.Name, - Description: s.ContentLibConfig.Description, - Library: s.ContentLibConfig.Library, - Placement: &vcenter.Placement{ - Cluster: s.ContentLibConfig.Cluster, - Folder: s.ContentLibConfig.Folder, - Host: s.ContentLibConfig.Host, - ResourcePool: s.ContentLibConfig.ResourcePool, - }, - } - - if s.ContentLibConfig.Datastore != "" { - template.VMHomeStorage = &vcenter.DiskStorage{ - Datastore: s.ContentLibConfig.Datastore, - } - } - - return vm.ImportToContentLibrary(template) -} - -func (s *StepImportToContentLibrary) Cleanup(multistep.StateBag) { -} diff --git a/builder/vsphere/common/step_import_to_content_library.hcl2spec.go b/builder/vsphere/common/step_import_to_content_library.hcl2spec.go deleted file mode 100644 index 2c42538fb..000000000 --- a/builder/vsphere/common/step_import_to_content_library.hcl2spec.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type ContentLibraryDestinationConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatContentLibraryDestinationConfig is an auto-generated flat version of ContentLibraryDestinationConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatContentLibraryDestinationConfig struct { - Library *string `mapstructure:"library" cty:"library" hcl:"library"` - Name *string `mapstructure:"name" cty:"name" hcl:"name"` - Description *string `mapstructure:"description" cty:"description" hcl:"description"` - Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` - Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` - Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` - Destroy *bool `mapstructure:"destroy" cty:"destroy" hcl:"destroy"` - Ovf *bool `mapstructure:"ovf" cty:"ovf" hcl:"ovf"` -} - -// FlatMapstructure returns a new FlatContentLibraryDestinationConfig. -// FlatContentLibraryDestinationConfig is an auto-generated flat version of ContentLibraryDestinationConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*ContentLibraryDestinationConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatContentLibraryDestinationConfig) -} - -// HCL2Spec returns the hcl spec of a ContentLibraryDestinationConfig. -// This spec is used by HCL to read the fields of ContentLibraryDestinationConfig. -// The decoded values from this spec will then be applied to a FlatContentLibraryDestinationConfig. -func (*FlatContentLibraryDestinationConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "library": &hcldec.AttrSpec{Name: "library", Type: cty.String, Required: false}, - "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, - "description": &hcldec.AttrSpec{Name: "description", Type: cty.String, Required: false}, - "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, - "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, - "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, - "destroy": &hcldec.AttrSpec{Name: "destroy", Type: cty.Bool, Required: false}, - "ovf": &hcldec.AttrSpec{Name: "ovf", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_remote_upload.go b/builder/vsphere/common/step_remote_upload.go deleted file mode 100644 index 92728f5c8..000000000 --- a/builder/vsphere/common/step_remote_upload.go +++ /dev/null @@ -1,117 +0,0 @@ -package common - -import ( - "context" - "fmt" - "log" - "path/filepath" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type StepRemoteUpload struct { - Datastore string - Host string - SetHostForDatastoreUploads bool - UploadedCustomCD bool -} - -func (s *StepRemoteUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - d := state.Get("driver").(driver.Driver) - - if path, ok := state.GetOk("iso_path"); ok { - // user-supplied boot iso - fullRemotePath, err := s.uploadFile(path.(string), d, ui) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Put("iso_remote_path", fullRemotePath) - } - if cdPath, ok := state.GetOk("cd_path"); ok { - // Packer-created cd_files disk - fullRemotePath, err := s.uploadFile(cdPath.(string), d, ui) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - s.UploadedCustomCD = true - state.Put("cd_path", fullRemotePath) - } - - return multistep.ActionContinue -} - -func GetRemoteDirectoryAndPath(path string, ds driver.Datastore) (string, string, string, string) { - filename := filepath.Base(path) - remotePath := fmt.Sprintf("packer_cache/%s", filename) - remoteDirectory := fmt.Sprintf("[%s] packer_cache/", ds.Name()) - fullRemotePath := fmt.Sprintf("%s/%s", remoteDirectory, filename) - - return filename, remotePath, remoteDirectory, fullRemotePath - -} -func (s *StepRemoteUpload) uploadFile(path string, d driver.Driver, ui packersdk.Ui) (string, error) { - ds, err := d.FindDatastore(s.Datastore, s.Host) - if err != nil { - return "", fmt.Errorf("datastore doesn't exist: %v", err) - } - - filename, remotePath, remoteDirectory, fullRemotePath := GetRemoteDirectoryAndPath(path, ds) - - if exists := ds.FileExists(remotePath); exists == true { - ui.Say(fmt.Sprintf("File %s already exists; skipping upload.", fullRemotePath)) - return fullRemotePath, nil - } - - ui.Say(fmt.Sprintf("Uploading %s to %s", filename, remotePath)) - - if exists := ds.DirExists(remotePath); exists == false { - log.Printf("Remote directory doesn't exist; creating...") - if err := ds.MakeDirectory(remoteDirectory); err != nil { - return "", err - } - } - - if err := ds.UploadFile(path, remotePath, s.Host, s.SetHostForDatastoreUploads); err != nil { - return "", err - } - return fullRemotePath, nil -} - -func (s *StepRemoteUpload) Cleanup(state multistep.StateBag) { - _, cancelled := state.GetOk(multistep.StateCancelled) - _, halted := state.GetOk(multistep.StateHalted) - if !cancelled && !halted { - return - } - - if !s.UploadedCustomCD { - return - } - - UploadedCDPath, ok := state.GetOk("cd_path") - if !ok { - return - } - - ui := state.Get("ui").(packersdk.Ui) - d := state.Get("driver").(*driver.VCenterDriver) - ui.Say("Deleting cd_files image from remote datastore ...") - - ds, err := d.FindDatastore(s.Datastore, s.Host) - if err != nil { - log.Printf("Error finding datastore to delete custom CD; please delete manually: %s", err) - return - } - - err = ds.Delete(UploadedCDPath.(string)) - if err != nil { - log.Printf("Error deleting custom CD from remote datastore; please delete manually: %s", err) - return - - } -} diff --git a/builder/vsphere/common/step_remote_upload_test.go b/builder/vsphere/common/step_remote_upload_test.go deleted file mode 100644 index dd9d8796f..000000000 --- a/builder/vsphere/common/step_remote_upload_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package common - -import ( - "context" - "fmt" - "testing" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestStepRemoteUpload_Run(t *testing.T) { - state := basicStateBag(nil) - dsMock := driver.DatastoreMock{ - DirExistsReturn: false, - } - driverMock := driver.NewDriverMock() - driverMock.DatastoreMock = &dsMock - state.Put("driver", driverMock) - state.Put("iso_path", "[datastore] iso/path") - - step := &StepRemoteUpload{ - Datastore: "datastore", - Host: "host", - SetHostForDatastoreUploads: false, - } - - if action := step.Run(context.TODO(), state); action == multistep.ActionHalt { - t.Fatalf("Should not halt.") - } - - if !driverMock.FindDatastoreCalled { - t.Fatalf("driver.FindDatastore should be called.") - } - if !driverMock.DatastoreMock.FileExistsCalled { - t.Fatalf("datastore.FindDatastore should be called.") - } - if !driverMock.DatastoreMock.MakeDirectoryCalled { - t.Fatalf("datastore.MakeDirectory should be called.") - } - if !driverMock.DatastoreMock.UploadFileCalled { - t.Fatalf("datastore.UploadFile should be called.") - } - remotePath, ok := state.GetOk("iso_remote_path") - if !ok { - t.Fatalf("state should contain iso_remote_path") - } - expectedRemovePath := fmt.Sprintf("[%s] packer_cache//path", driverMock.DatastoreMock.Name()) - if remotePath != expectedRemovePath { - t.Fatalf("iso_remote_path expected to be %s but was %s", expectedRemovePath, remotePath) - } -} - -func TestStepRemoteUpload_SkipRun(t *testing.T) { - state := basicStateBag(nil) - driverMock := driver.NewDriverMock() - state.Put("driver", driverMock) - - step := &StepRemoteUpload{} - - if action := step.Run(context.TODO(), state); action == multistep.ActionHalt { - t.Fatalf("Should not halt.") - } - - if driverMock.FindDatastoreCalled { - t.Fatalf("driver.FindDatastore should not be called.") - } - if _, ok := state.GetOk("iso_remote_path"); ok { - t.Fatalf("state should not contain iso_remote_path") - } -} diff --git a/builder/vsphere/common/step_remove_cdrom.go b/builder/vsphere/common/step_remove_cdrom.go deleted file mode 100644 index 71d88c004..000000000 --- a/builder/vsphere/common/step_remove_cdrom.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type RemoveCDRomConfig - -package common - -import ( - "context" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type RemoveCDRomConfig struct { - // Remove CD-ROM devices from template. Defaults to `false`. - RemoveCdrom bool `mapstructure:"remove_cdrom"` -} - -type StepRemoveCDRom struct { - Config *RemoveCDRomConfig -} - -func (s *StepRemoveCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(driver.VirtualMachine) - - ui.Say("Eject CD-ROM drives...") - err := vm.EjectCdroms() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - if s.Config.RemoveCdrom == true { - ui.Say("Deleting CD-ROM drives...") - err := vm.RemoveCdroms() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepRemoveCDRom) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_remove_cdrom.hcl2spec.go b/builder/vsphere/common/step_remove_cdrom.hcl2spec.go deleted file mode 100644 index 826cacdf4..000000000 --- a/builder/vsphere/common/step_remove_cdrom.hcl2spec.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type RemoveCDRomConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatRemoveCDRomConfig struct { - RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` -} - -// FlatMapstructure returns a new FlatRemoveCDRomConfig. -// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*RemoveCDRomConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatRemoveCDRomConfig) -} - -// HCL2Spec returns the hcl spec of a RemoveCDRomConfig. -// This spec is used by HCL to read the fields of RemoveCDRomConfig. -// The decoded values from this spec will then be applied to a FlatRemoveCDRomConfig. -func (*FlatRemoveCDRomConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_remove_cdrom_test.go b/builder/vsphere/common/step_remove_cdrom_test.go deleted file mode 100644 index 0461256b2..000000000 --- a/builder/vsphere/common/step_remove_cdrom_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package common - -import ( - "context" - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestStepRemoveCDRom_Run(t *testing.T) { - tc := []struct { - name string - step *StepRemoveCDRom - expectedAction multistep.StepAction - vmMock *driver.VirtualMachineMock - expectedVmMock *driver.VirtualMachineMock - fail bool - errMessage string - }{ - { - name: "Eject CD-ROM drives", - step: &StepRemoveCDRom{ - Config: &RemoveCDRomConfig{}, - }, - expectedAction: multistep.ActionContinue, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - EjectCdromsCalled: true, - }, - fail: false, - }, - { - name: "Failed to eject CD-ROM drives", - step: &StepRemoveCDRom{ - Config: &RemoveCDRomConfig{}, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - EjectCdromsErr: fmt.Errorf("failed to eject cd-rom drives"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - EjectCdromsCalled: true, - }, - fail: true, - errMessage: "failed to eject cd-rom drives", - }, - { - name: "Eject and delete CD-ROM drives", - step: &StepRemoveCDRom{ - Config: &RemoveCDRomConfig{ - RemoveCdrom: true, - }, - }, - expectedAction: multistep.ActionContinue, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - EjectCdromsCalled: true, - RemoveCdromsCalled: true, - }, - fail: false, - }, - { - name: "Fail to delete CD-ROM drives", - step: &StepRemoveCDRom{ - Config: &RemoveCDRomConfig{ - RemoveCdrom: true, - }, - }, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - RemoveCdromsErr: fmt.Errorf("failed to delete cd-rom devices"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - EjectCdromsCalled: true, - RemoveCdromsCalled: true, - }, - fail: true, - errMessage: "failed to delete cd-rom devices", - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - state := basicStateBag(nil) - state.Put("vm", c.vmMock) - - if action := c.step.Run(context.TODO(), state); action != c.expectedAction { - t.Fatalf("unexpected action %v", action) - } - err, ok := state.Get("error").(error) - if ok { - if err.Error() != c.errMessage { - t.Fatalf("unexpected error %s", err.Error()) - } - } else { - if c.fail { - t.Fatalf("expected to fail but it didn't") - } - } - - if diff := cmp.Diff(c.vmMock, c.expectedVmMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected VirtualMachine calls: %s", diff) - } - }) - } -} diff --git a/builder/vsphere/common/step_remove_floppy.go b/builder/vsphere/common/step_remove_floppy.go deleted file mode 100644 index b48376bd0..000000000 --- a/builder/vsphere/common/step_remove_floppy.go +++ /dev/null @@ -1,49 +0,0 @@ -package common - -import ( - "context" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type StepRemoveFloppy struct { - Datastore string - Host string -} - -func (s *StepRemoveFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(driver.VirtualMachine) - d := state.Get("driver").(driver.Driver) - - ui.Say("Deleting Floppy drives...") - floppies, err := vm.FloppyDevices() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - if err = vm.RemoveDevice(true, floppies...); err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - if UploadedFloppyPath, ok := state.GetOk("uploaded_floppy_path"); ok { - ui.Say("Deleting Floppy image...") - ds, err := d.FindDatastore(s.Datastore, s.Host) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - if err := ds.Delete(UploadedFloppyPath.(string)); err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Remove("uploaded_floppy_path") - } - - return multistep.ActionContinue -} - -func (s *StepRemoveFloppy) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_remove_floppy_test.go b/builder/vsphere/common/step_remove_floppy_test.go deleted file mode 100644 index bf1a578d1..000000000 --- a/builder/vsphere/common/step_remove_floppy_test.go +++ /dev/null @@ -1,213 +0,0 @@ -package common - -import ( - "context" - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestStepRemoveFloppy_Run(t *testing.T) { - tc := []struct { - name string - uploadedPath string - step *StepRemoveFloppy - expectedAction multistep.StepAction - vmMock *driver.VirtualMachineMock - expectedVmMock *driver.VirtualMachineMock - driverMock *driver.DriverMock - expectedDriverMock *driver.DriverMock - dsMock *driver.DatastoreMock - expectedDsMock *driver.DatastoreMock - fail bool - errMessage string - }{ - { - name: "Remove floppy drives and images", - uploadedPath: "vm/dir/packer-tmp-created-floppy.flp", - step: &StepRemoveFloppy{ - Datastore: "datastore", - Host: "host", - }, - expectedAction: multistep.ActionContinue, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - RemoveDeviceCalled: true, - RemoveDeviceKeepFiles: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: new(driver.DatastoreMock), - expectedDsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeletePath: "vm/dir/packer-tmp-created-floppy.flp", - }, - fail: false, - }, - { - name: "No floppy image to remove", - step: &StepRemoveFloppy{}, - expectedAction: multistep.ActionContinue, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - RemoveDeviceCalled: true, - RemoveDeviceKeepFiles: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: false, - }, - { - name: "Fail to find floppy devices", - step: &StepRemoveFloppy{}, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - FloppyDevicesErr: fmt.Errorf("failed to find floppy devices"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "failed to find floppy devices", - }, - { - name: "Fail to remove floppy devices", - step: &StepRemoveFloppy{}, - expectedAction: multistep.ActionHalt, - vmMock: &driver.VirtualMachineMock{ - RemoveDeviceErr: fmt.Errorf("failed to remove device"), - }, - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - RemoveDeviceCalled: true, - RemoveDeviceKeepFiles: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: new(driver.DriverMock), - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "failed to remove device", - }, - { - name: "Fail to find datastore", - uploadedPath: "vm/dir/packer-tmp-created-floppy.flp", - step: &StepRemoveFloppy{ - Datastore: "datastore", - Host: "host", - }, - expectedAction: multistep.ActionHalt, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - RemoveDeviceCalled: true, - RemoveDeviceKeepFiles: true, - }, - driverMock: &driver.DriverMock{ - FindDatastoreErr: fmt.Errorf("failed to find datastore"), - }, - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: new(driver.DatastoreMock), - expectedDsMock: new(driver.DatastoreMock), - fail: true, - errMessage: "failed to find datastore", - }, - { - name: "Fail to delete floppy image", - uploadedPath: "vm/dir/packer-tmp-created-floppy.flp", - step: &StepRemoveFloppy{ - Datastore: "datastore", - Host: "host", - }, - expectedAction: multistep.ActionHalt, - vmMock: new(driver.VirtualMachineMock), - expectedVmMock: &driver.VirtualMachineMock{ - FloppyDevicesCalled: true, - RemoveDeviceCalled: true, - RemoveDeviceKeepFiles: true, - }, - driverMock: new(driver.DriverMock), - expectedDriverMock: &driver.DriverMock{ - FindDatastoreCalled: true, - FindDatastoreName: "datastore", - FindDatastoreHost: "host", - }, - dsMock: &driver.DatastoreMock{ - DeleteErr: fmt.Errorf("failed to delete floppy"), - }, - expectedDsMock: &driver.DatastoreMock{ - DeleteCalled: true, - DeletePath: "vm/dir/packer-tmp-created-floppy.flp", - }, - fail: true, - errMessage: "failed to delete floppy", - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - state := basicStateBag(nil) - state.Put("vm", c.vmMock) - c.driverMock.DatastoreMock = c.dsMock - state.Put("driver", c.driverMock) - - if c.uploadedPath != "" { - state.Put("uploaded_floppy_path", c.uploadedPath) - } - - if action := c.step.Run(context.TODO(), state); action != c.expectedAction { - t.Fatalf("unexpected action %v", action) - } - err, ok := state.Get("error").(error) - if ok { - if err.Error() != c.errMessage { - t.Fatalf("unexpected error %s", err.Error()) - } - } else { - if c.fail { - t.Fatalf("expected to fail but it didn't") - } - } - - if !c.fail { - if _, ok := state.GetOk("uploaded_floppy_path"); ok { - t.Fatalf("uploaded_floppy_path should not be in state") - } - } - - if diff := cmp.Diff(c.vmMock, c.expectedVmMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected VirtualMachine calls: %s", diff) - } - c.expectedDriverMock.DatastoreMock = c.expectedDsMock - if diff := cmp.Diff(c.driverMock, c.expectedDriverMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Driver calls: %s", diff) - } - if diff := cmp.Diff(c.dsMock, c.expectedDsMock, - cmpopts.IgnoreInterfaces(struct{ error }{})); diff != "" { - t.Fatalf("unexpected Datastore calls: %s", diff) - } - }) - } -} diff --git a/builder/vsphere/common/step_run.go b/builder/vsphere/common/step_run.go deleted file mode 100644 index 0f6bc0b56..000000000 --- a/builder/vsphere/common/step_run.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type RunConfig - -package common - -import ( - "context" - "strings" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type RunConfig struct { - // Priority of boot devices. Defaults to `disk,cdrom` - BootOrder string `mapstructure:"boot_order"` // example: "floppy,cdrom,ethernet,disk" -} - -type StepRun struct { - Config *RunConfig - SetOrder bool -} - -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if s.Config.BootOrder != "" { - ui.Say("Set boot order...") - order := strings.Split(s.Config.BootOrder, ",") - if err := vm.SetBootOrder(order); err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } else { - if s.SetOrder { - ui.Say("Set boot order temporary...") - if err := vm.SetBootOrder([]string{"disk", "cdrom"}); err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - } - - ui.Say("Power on VM...") - err := vm.PowerOn() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *StepRun) Cleanup(state multistep.StateBag) { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if s.Config.BootOrder == "" && s.SetOrder { - ui.Say("Clear boot order...") - if err := vm.SetBootOrder([]string{"-"}); err != nil { - state.Put("error", err) - return - } - } - - _, cancelled := state.GetOk(multistep.StateCancelled) - _, halted := state.GetOk(multistep.StateHalted) - if !cancelled && !halted { - return - } - - ui.Say("Power off VM...") - - err := vm.PowerOff() - if err != nil { - ui.Error(err.Error()) - } -} diff --git a/builder/vsphere/common/step_run.hcl2spec.go b/builder/vsphere/common/step_run.hcl2spec.go deleted file mode 100644 index 5ecc99cae..000000000 --- a/builder/vsphere/common/step_run.hcl2spec.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type RunConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatRunConfig is an auto-generated flat version of RunConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatRunConfig struct { - BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` -} - -// FlatMapstructure returns a new FlatRunConfig. -// FlatRunConfig is an auto-generated flat version of RunConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*RunConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatRunConfig) -} - -// HCL2Spec returns the hcl spec of a RunConfig. -// This spec is used by HCL to read the fields of RunConfig. -// The decoded values from this spec will then be applied to a FlatRunConfig. -func (*FlatRunConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_shutdown.go b/builder/vsphere/common/step_shutdown.go deleted file mode 100644 index 685bf04c1..000000000 --- a/builder/vsphere/common/step_shutdown.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type ShutdownConfig - -package common - -import ( - "bytes" - "context" - "fmt" - "log" - "time" - - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type ShutdownConfig struct { - // Specify a VM guest shutdown command. This command will be executed using - // the `communicator`. Otherwise the VMware guest tools are used to gracefully - // shutdown the VM guest. - Command string `mapstructure:"shutdown_command"` - // Amount of time to wait for graceful VM shutdown. - // Defaults to 5m or five minutes. - // This will likely need to be modified if the `communicator` is 'none'. - Timeout time.Duration `mapstructure:"shutdown_timeout"` - // Packer normally halts the virtual machine after all provisioners have - // run when no `shutdown_command` is defined. If this is set to `true`, Packer - // *will not* halt the virtual machine but will assume that you will send the stop - // signal yourself through a preseed.cfg, a script or the final provisioner. - // Packer will wait for a default of five minutes until the virtual machine is shutdown. - // The timeout can be changed using `shutdown_timeout` option. - DisableShutdown bool `mapstructure:"disable_shutdown"` -} - -func (c *ShutdownConfig) Prepare(comm communicator.Config) (warnings []string, errs []error) { - - if c.Timeout == 0 { - c.Timeout = 5 * time.Minute - } - - if comm.Type == "none" && c.Command != "" { - warnings = append(warnings, "The parameter `shutdown_command` is ignored as it requires a `communicator`.") - } - - return -} - -type StepShutdown struct { - Config *ShutdownConfig -} - -func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if off, _ := vm.IsPoweredOff(); off { - // Probably power off initiated by last provisioner, though disable_shutdown is not set - ui.Say("VM is already powered off") - return multistep.ActionContinue - } - - comm, _ := state.Get("communicator").(packersdk.Communicator) - if comm == nil { - - msg := fmt.Sprintf("Please shutdown virtual machine within %s.", s.Config.Timeout) - ui.Message(msg) - - } else if s.Config.DisableShutdown { - ui.Say("Automatic shutdown disabled. Please shutdown virtual machine.") - } else if s.Config.Command != "" { - // Communicator is not needed unless shutdown_command is populated - - ui.Say("Executing shutdown command...") - log.Printf("Shutdown command: %s", s.Config.Command) - - var stdout, stderr bytes.Buffer - cmd := &packersdk.RemoteCmd{ - Command: s.Config.Command, - Stdout: &stdout, - Stderr: &stderr, - } - err := comm.Start(ctx, cmd) - if err != nil { - state.Put("error", fmt.Errorf("Failed to send shutdown command: %s", err)) - return multistep.ActionHalt - } - } else { - ui.Say("Shutting down VM...") - - err := vm.StartShutdown() - if err != nil { - state.Put("error", fmt.Errorf("Cannot shut down VM: %v", err)) - return multistep.ActionHalt - } - } - - log.Printf("Waiting max %s for shutdown to complete", s.Config.Timeout) - err := vm.WaitForShutdown(ctx, s.Config.Timeout) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *StepShutdown) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_shutdown.hcl2spec.go b/builder/vsphere/common/step_shutdown.hcl2spec.go deleted file mode 100644 index 323e771c8..000000000 --- a/builder/vsphere/common/step_shutdown.hcl2spec.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type ShutdownConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatShutdownConfig struct { - Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` - Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` - DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` -} - -// FlatMapstructure returns a new FlatShutdownConfig. -// FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*ShutdownConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatShutdownConfig) -} - -// HCL2Spec returns the hcl spec of a ShutdownConfig. -// This spec is used by HCL to read the fields of ShutdownConfig. -// The decoded values from this spec will then be applied to a FlatShutdownConfig. -func (*FlatShutdownConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, - "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, - "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/step_snapshot.go b/builder/vsphere/common/step_snapshot.go deleted file mode 100644 index a83efe521..000000000 --- a/builder/vsphere/common/step_snapshot.go +++ /dev/null @@ -1,32 +0,0 @@ -package common - -import ( - "context" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type StepCreateSnapshot struct { - CreateSnapshot bool -} - -func (s *StepCreateSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if s.CreateSnapshot { - ui.Say("Creating snapshot...") - - err := vm.CreateSnapshot("Created by Packer") - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepCreateSnapshot) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_ssh_key_pair.go b/builder/vsphere/common/step_ssh_key_pair.go deleted file mode 100644 index d339175cb..000000000 --- a/builder/vsphere/common/step_ssh_key_pair.go +++ /dev/null @@ -1,115 +0,0 @@ -package common - -import ( - "context" - "fmt" - "io/ioutil" - "os" - - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/communicator/ssh" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/uuid" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -// StepSshKeyPair executes the business logic for setting the SSH key pair in -// the specified communicator.Config. -type StepSshKeyPair struct { - Debug bool - DebugKeyPath string - Comm *communicator.Config -} - -func (s *StepSshKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - if s.Comm.Type != "ssh" || s.Comm.SSHPassword != "" { - return multistep.ActionContinue - } - - ui := state.Get("ui").(packersdk.Ui) - - comment := fmt.Sprintf("packer_%s", uuid.TimeOrderedUUID()) - if s.Comm.SSHPrivateKeyFile != "" { - ui.Say("Using existing SSH private key for the communicator...") - privateKeyBytes, err := s.Comm.ReadSSHPrivateKeyFile() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - kp, err := ssh.KeyPairFromPrivateKey(ssh.FromPrivateKeyConfig{ - RawPrivateKeyPemBlock: privateKeyBytes, - Comment: comment, - }) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - s.Comm.SSHPrivateKey = privateKeyBytes - s.Comm.SSHKeyPairName = kp.Comment - s.Comm.SSHTemporaryKeyPairName = kp.Comment - s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine - - return multistep.ActionContinue - } - - if s.Comm.SSHAgentAuth { - ui.Say("Using local SSH Agent to authenticate connections for the communicator...") - return multistep.ActionContinue - } - - ui.Say("Creating ephemeral key pair for SSH communicator...") - - if s.Comm.SSHTemporaryKeyPairName != "" { - comment = s.Comm.SSHTemporaryKeyPairName - } - - kp, err := ssh.NewKeyPair(ssh.CreateKeyPairConfig{ - Comment: comment, - Type: ssh.Rsa, - }) - if err != nil { - state.Put("error", fmt.Errorf("Error creating temporary keypair: %s", err)) - return multistep.ActionHalt - } - - s.Comm.SSHKeyPairName = kp.Comment - s.Comm.SSHTemporaryKeyPairName = kp.Comment - s.Comm.SSHPrivateKey = kp.PrivateKeyPemBlock - s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine - s.Comm.SSHClearAuthorizedKeys = true - - vm := state.Get("vm").(*driver.VirtualMachineDriver) - err = vm.AddPublicKeys(ctx, string(s.Comm.SSHPublicKey)) - if err != nil { - state.Put("error", fmt.Errorf("error saving temporary keypair in the vm: %s", err)) - return multistep.ActionHalt - } - - ui.Say("Created ephemeral SSH key pair for communicator") - - // If we're in debug mode, output the private key to the working - // directory. - if s.Debug { - ui.Message(fmt.Sprintf("Saving communicator private key for debug purposes: %s", s.DebugKeyPath)) - // Write the key out - if err := ioutil.WriteFile(s.DebugKeyPath, kp.PrivateKeyPemBlock, 0600); err != nil { - state.Put("error", fmt.Errorf("Error saving debug key: %s", err)) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepSshKeyPair) Cleanup(state multistep.StateBag) { - if s.Debug { - if err := os.Remove(s.DebugKeyPath); err != nil { - ui := state.Get("ui").(packersdk.Ui) - ui.Error(fmt.Sprintf( - "Error removing debug key '%s': %s", s.DebugKeyPath, err)) - } - } -} diff --git a/builder/vsphere/common/step_template.go b/builder/vsphere/common/step_template.go deleted file mode 100644 index 535729909..000000000 --- a/builder/vsphere/common/step_template.go +++ /dev/null @@ -1,31 +0,0 @@ -package common - -import ( - "context" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type StepConvertToTemplate struct { - ConvertToTemplate bool -} - -func (s *StepConvertToTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - if s.ConvertToTemplate { - ui.Say("Convert VM into template...") - err := vm.ConvertToTemplate() - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - } - - return multistep.ActionContinue -} - -func (s *StepConvertToTemplate) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_wait_for_ip.go b/builder/vsphere/common/step_wait_for_ip.go deleted file mode 100644 index 72a68e7a8..000000000 --- a/builder/vsphere/common/step_wait_for_ip.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type WaitIpConfig - -package common - -import ( - "context" - "fmt" - "log" - "net" - "time" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type WaitIpConfig struct { - // Amount of time to wait for VM's IP, similar to 'ssh_timeout'. - // Defaults to 30m (30 minutes). See the Golang - // [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation - // for full details. - WaitTimeout time.Duration `mapstructure:"ip_wait_timeout"` - // Amount of time to wait for VM's IP to settle down, sometimes VM may - // report incorrect IP initially, then its recommended to set that - // parameter to apx. 2 minutes. Examples 45s and 10m. Defaults to - // 5s(5 seconds). See the Golang - // [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation - // for full details. - SettleTimeout time.Duration `mapstructure:"ip_settle_timeout"` - // Set this to a CIDR address to cause the service to wait for an address that is contained in - // this network range. Defaults to "0.0.0.0/0" for any ipv4 address. Examples include: - // - // * empty string ("") - remove all filters - // * `0:0:0:0:0:0:0:0/0` - allow only ipv6 addresses - // * `192.168.1.0/24` - only allow ipv4 addresses from 192.168.1.1 to 192.168.1.254 - WaitAddress *string `mapstructure:"ip_wait_address"` - ipnet *net.IPNet - - // WaitTimeout is a total timeout, so even if VM changes IP frequently and it doesn't settle down we will end waiting. -} - -type StepWaitForIp struct { - Config *WaitIpConfig -} - -func (c *WaitIpConfig) Prepare() []error { - var errs []error - - if c.SettleTimeout == 0 { - c.SettleTimeout = 5 * time.Second - } - if c.WaitTimeout == 0 { - c.WaitTimeout = 30 * time.Minute - } - if c.WaitAddress == nil { - addr := "0.0.0.0/0" - c.WaitAddress = &addr - } - - if *c.WaitAddress != "" { - var err error - _, c.ipnet, err = net.ParseCIDR(*c.WaitAddress) - if err != nil { - errs = append(errs, fmt.Errorf("unable to parse \"ip_wait_address\": %w", err)) - } - } - - return errs -} - -func (c *WaitIpConfig) GetIPNet() *net.IPNet { - return c.ipnet -} - -func (s *StepWaitForIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - vm := state.Get("vm").(*driver.VirtualMachineDriver) - - var ip string - var err error - - sub, cancel := context.WithCancel(ctx) - waitDone := make(chan bool, 1) - defer func() { - cancel() - }() - - go func() { - ui.Say("Waiting for IP...") - ip, err = doGetIp(vm, sub, s.Config) - waitDone <- true - }() - - log.Printf("[INFO] Waiting for IP, up to total timeout: %s, settle timeout: %s", s.Config.WaitTimeout, s.Config.SettleTimeout) - timeout := time.After(s.Config.WaitTimeout) - for { - select { - case <-timeout: - cancel() - <-waitDone - if ip != "" { - state.Put("ip", ip) - log.Printf("[WARN] API timeout waiting for IP but one IP was found. Using IP: %s", ip) - return multistep.ActionContinue - } - err := fmt.Errorf("Timeout waiting for IP.") - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - case <-ctx.Done(): - cancel() - log.Println("[WARN] Interrupt detected, quitting waiting for IP.") - return multistep.ActionHalt - case <-waitDone: - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - state.Put("ip", ip) - ui.Say(fmt.Sprintf("IP address: %v", ip)) - return multistep.ActionContinue - case <-time.After(1 * time.Second): - if _, ok := state.GetOk(multistep.StateCancelled); ok { - return multistep.ActionHalt - } - } - } -} - -func doGetIp(vm *driver.VirtualMachineDriver, ctx context.Context, c *WaitIpConfig) (string, error) { - var prevIp = "" - var stopTime time.Time - var interval time.Duration - if c.SettleTimeout.Seconds() >= 120 { - interval = 30 * time.Second - } else if c.SettleTimeout.Seconds() >= 60 { - interval = 15 * time.Second - } else if c.SettleTimeout.Seconds() >= 10 { - interval = 5 * time.Second - } else { - interval = 1 * time.Second - } -loop: - ip, err := vm.WaitForIP(ctx, c.ipnet) - if err != nil { - return "", err - } - - // Check for ctx cancellation to avoid printing any IP logs at the timeout - select { - case <-ctx.Done(): - return ip, fmt.Errorf("IP wait cancelled.") - default: - } - - if prevIp == "" || prevIp != ip { - if prevIp == "" { - log.Printf("VM IP aquired: %s", ip) - } else { - log.Printf("VM IP changed from %s to %s", prevIp, ip) - } - prevIp = ip - stopTime = time.Now().Add(c.SettleTimeout) - goto loop - } else { - log.Printf("VM IP is still the same: %s", prevIp) - if time.Now().After(stopTime) { - log.Printf("VM IP seems stable enough: %s", ip) - return ip, nil - } - select { - case <-ctx.Done(): - return "", fmt.Errorf("IP wait cancelled") - case <-time.After(interval): - goto loop - } - } - -} - -func (s *StepWaitForIp) Cleanup(state multistep.StateBag) {} diff --git a/builder/vsphere/common/step_wait_for_ip.hcl2spec.go b/builder/vsphere/common/step_wait_for_ip.hcl2spec.go deleted file mode 100644 index c65302f31..000000000 --- a/builder/vsphere/common/step_wait_for_ip.hcl2spec.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type WaitIpConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatWaitIpConfig struct { - WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` - SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` - WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` -} - -// FlatMapstructure returns a new FlatWaitIpConfig. -// FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*WaitIpConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatWaitIpConfig) -} - -// HCL2Spec returns the hcl spec of a WaitIpConfig. -// This spec is used by HCL to read the fields of WaitIpConfig. -// The decoded values from this spec will then be applied to a FlatWaitIpConfig. -func (*FlatWaitIpConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, - "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, - "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, - } - return s -} diff --git a/builder/vsphere/common/storage_config.go b/builder/vsphere/common/storage_config.go deleted file mode 100644 index 6650616d5..000000000 --- a/builder/vsphere/common/storage_config.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type StorageConfig,DiskConfig - -package common - -import ( - "fmt" -) - -// Defines the disk storage for a VM. -// -// Example that will create a 15GB and a 20GB disk on the VM. The second disk will be thin provisioned: -// -// In JSON: -// ```json -// "storage": [ -// { -// "disk_size": 15000 -// }, -// { -// "disk_size": 20000, -// "disk_thin_provisioned": true -// } -// ], -// ``` -// In HCL2: -// ```hcl -// storage { -// disk_size = 15000 -// } -// storage { -// disk_size = 20000 -// disk_thin_provisioned = true -// } -// ``` -// -// Example that creates 2 pvscsi controllers and adds 2 disks to each one: -// -// In JSON: -// ```json -// "disk_controller_type": ["pvscsi", "pvscsi"], -// "storage": [ -// { -// "disk_size": 15000, -// "disk_controller_index": 0 -// }, -// { -// "disk_size": 15000, -// "disk_controller_index": 0 -// }, -// { -// "disk_size": 15000, -// "disk_controller_index": 1 -// }, -// { -// "disk_size": 15000, -// "disk_controller_index": 1 -// } -// ], -// ``` -// -// In HCL2: -// ```hcl -// disk_controller_type = ["pvscsi", "pvscsi"] -// storage { -// disk_size = 15000, -// disk_controller_index = 0 -// } -// storage { -// disk_size = 15000 -// disk_controller_index = 0 -// } -// storage { -// disk_size = 15000 -// disk_controller_index = 1 -// } -// storage { -// disk_size = 15000 -// disk_controller_index = 1 -// } -// ``` -type DiskConfig struct { - // The size of the disk in MB. - DiskSize int64 `mapstructure:"disk_size" required:"true"` - // Enable VMDK thin provisioning for VM. Defaults to `false`. - DiskThinProvisioned bool `mapstructure:"disk_thin_provisioned"` - // Enable VMDK eager scrubbing for VM. Defaults to `false`. - DiskEagerlyScrub bool `mapstructure:"disk_eagerly_scrub"` - // The assigned disk controller. Defaults to the first one (0) - DiskControllerIndex int `mapstructure:"disk_controller_index"` -} - -type StorageConfig struct { - // Set VM disk controller type. Example `lsilogic`, `pvscsi`, `nvme`, or `scsi`. Use a list to define additional controllers. - // Defaults to `lsilogic`. See - // [SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html#GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362) - // for additional details. - DiskControllerType []string `mapstructure:"disk_controller_type"` - // Configures a collection of one or more disks to be provisioned along with the VM. See the [Storage Configuration](#storage-configuration). - Storage []DiskConfig `mapstructure:"storage"` -} - -func (c *StorageConfig) Prepare() []error { - var errs []error - - if len(c.Storage) > 0 { - for i, storage := range c.Storage { - if storage.DiskSize == 0 { - errs = append(errs, fmt.Errorf("storage[%d].'disk_size' is required", i)) - } - if storage.DiskControllerIndex >= len(c.DiskControllerType) { - errs = append(errs, fmt.Errorf("storage[%d].'disk_controller_index' references an unknown disk controller", i)) - } - } - } - - return errs -} diff --git a/builder/vsphere/common/storage_config.hcl2spec.go b/builder/vsphere/common/storage_config.hcl2spec.go deleted file mode 100644 index 1d8fbd8c5..000000000 --- a/builder/vsphere/common/storage_config.hcl2spec.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type StorageConfig,DiskConfig"; DO NOT EDIT. - -package common - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatDiskConfig is an auto-generated flat version of DiskConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatDiskConfig struct { - DiskSize *int64 `mapstructure:"disk_size" required:"true" cty:"disk_size" hcl:"disk_size"` - DiskThinProvisioned *bool `mapstructure:"disk_thin_provisioned" cty:"disk_thin_provisioned" hcl:"disk_thin_provisioned"` - DiskEagerlyScrub *bool `mapstructure:"disk_eagerly_scrub" cty:"disk_eagerly_scrub" hcl:"disk_eagerly_scrub"` - DiskControllerIndex *int `mapstructure:"disk_controller_index" cty:"disk_controller_index" hcl:"disk_controller_index"` -} - -// FlatMapstructure returns a new FlatDiskConfig. -// FlatDiskConfig is an auto-generated flat version of DiskConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*DiskConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatDiskConfig) -} - -// HCL2Spec returns the hcl spec of a DiskConfig. -// This spec is used by HCL to read the fields of DiskConfig. -// The decoded values from this spec will then be applied to a FlatDiskConfig. -func (*FlatDiskConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, - "disk_thin_provisioned": &hcldec.AttrSpec{Name: "disk_thin_provisioned", Type: cty.Bool, Required: false}, - "disk_eagerly_scrub": &hcldec.AttrSpec{Name: "disk_eagerly_scrub", Type: cty.Bool, Required: false}, - "disk_controller_index": &hcldec.AttrSpec{Name: "disk_controller_index", Type: cty.Number, Required: false}, - } - return s -} - -// FlatStorageConfig is an auto-generated flat version of StorageConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatStorageConfig struct { - DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` - Storage []FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` -} - -// FlatMapstructure returns a new FlatStorageConfig. -// FlatStorageConfig is an auto-generated flat version of StorageConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*StorageConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatStorageConfig) -} - -// HCL2Spec returns the hcl spec of a StorageConfig. -// This spec is used by HCL to read the fields of StorageConfig. -// The decoded values from this spec will then be applied to a FlatStorageConfig. -func (*FlatStorageConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, - "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*FlatDiskConfig)(nil).HCL2Spec())}, - } - return s -} diff --git a/builder/vsphere/common/testing/utility.go b/builder/vsphere/common/testing/utility.go deleted file mode 100644 index 72bc8c3f5..000000000 --- a/builder/vsphere/common/testing/utility.go +++ /dev/null @@ -1,69 +0,0 @@ -package testing - -import ( - "encoding/json" - "fmt" - "math/rand" - "os" - "testing" - "time" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func NewVMName() string { - rand.Seed(time.Now().UnixNano()) - return fmt.Sprintf("test-%v", rand.Intn(1000)) -} - -func RenderConfig(config map[string]interface{}) string { - t := map[string][]map[string]interface{}{ - "builders": { - map[string]interface{}{ - "type": "test", - }, - }, - } - for k, v := range config { - t["builders"][0][k] = v - } - - j, _ := json.Marshal(t) - return string(j) -} - -func TestConn(t *testing.T) driver.Driver { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - d, err := driver.NewDriver(&driver.ConnectConfig{ - VCenterServer: "vcenter.vsphere65.test", - Username: username, - Password: password, - InsecureConnection: true, - }) - if err != nil { - t.Fatal("Cannot connect: ", err) - } - return d -} - -func GetVM(t *testing.T, d driver.Driver, artifacts []packersdk.Artifact) driver.VirtualMachine { - artifactRaw := artifacts[0] - artifact, _ := artifactRaw.(*common.Artifact) - - vm, err := d.FindVM(artifact.Name) - if err != nil { - t.Fatalf("Cannot find VM: %v", err) - } - - return vm -} diff --git a/builder/vsphere/driver/cluster.go b/builder/vsphere/driver/cluster.go deleted file mode 100644 index d17031b82..000000000 --- a/builder/vsphere/driver/cluster.go +++ /dev/null @@ -1,19 +0,0 @@ -package driver - -import "github.com/vmware/govmomi/object" - -type Cluster struct { - driver *VCenterDriver - cluster *object.ClusterComputeResource -} - -func (d *VCenterDriver) FindCluster(name string) (*Cluster, error) { - c, err := d.finder.ClusterComputeResource(d.ctx, name) - if err != nil { - return nil, err - } - return &Cluster{ - cluster: c, - driver: d, - }, nil -} diff --git a/builder/vsphere/driver/datastore.go b/builder/vsphere/driver/datastore.go deleted file mode 100644 index ae371b79f..000000000 --- a/builder/vsphere/driver/datastore.go +++ /dev/null @@ -1,235 +0,0 @@ -package driver - -import ( - "fmt" - "path" - "regexp" - "strings" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -type Datastore interface { - Info(params ...string) (*mo.Datastore, error) - FileExists(path string) bool - DirExists(path string) bool - Name() string - ResolvePath(path string) string - UploadFile(src, dst, host string, setHost bool) error - Delete(path string) error - MakeDirectory(path string) error - Reference() types.ManagedObjectReference -} - -type DatastoreDriver struct { - ds *object.Datastore - driver *VCenterDriver -} - -func (d *VCenterDriver) NewDatastore(ref *types.ManagedObjectReference) Datastore { - return &DatastoreDriver{ - ds: object.NewDatastore(d.client.Client, *ref), - driver: d, - } -} - -// If name is an empty string, then resolve host's one -func (d *VCenterDriver) FindDatastore(name string, host string) (Datastore, error) { - if name == "" { - h, err := d.FindHost(host) - if err != nil { - return nil, fmt.Errorf("Error finding host for to get datastore: %s", err) - } - - i, err := h.Info("datastore") - if err != nil { - return nil, fmt.Errorf("Error getting datastore info from host: %s", err) - } - - if len(i.Datastore) > 1 { - return nil, fmt.Errorf("Host has multiple datastores. Specify it explicitly") - } - - ds := d.NewDatastore(&i.Datastore[0]) - inf, err := ds.Info("name") - if err != nil { - return nil, fmt.Errorf("Error getting datastore name: %s", err) - } - name = inf.Name - } - - ds, err := d.finder.Datastore(d.ctx, name) - if err != nil { - return nil, fmt.Errorf("Error finding datastore with name %s: %s", name, err) - } - - return &DatastoreDriver{ - ds: ds, - driver: d, - }, nil -} - -func (d *VCenterDriver) GetDatastoreName(id string) (string, error) { - obj := types.ManagedObjectReference{ - Type: "Datastore", - Value: id, - } - pc := property.DefaultCollector(d.vimClient) - var me mo.ManagedEntity - - err := pc.RetrieveOne(d.ctx, obj, []string{"name"}, &me) - if err != nil { - return id, err - } - return me.Name, nil -} - -func (ds *DatastoreDriver) Info(params ...string) (*mo.Datastore, error) { - var p []string - if len(params) == 0 { - p = []string{"*"} - } else { - p = params - } - var info mo.Datastore - err := ds.ds.Properties(ds.driver.ctx, ds.ds.Reference(), p, &info) - if err != nil { - return nil, err - } - return &info, nil -} - -func (ds *DatastoreDriver) DirExists(filepath string) bool { - _, err := ds.ds.Stat(ds.driver.ctx, filepath) - if _, ok := err.(object.DatastoreNoSuchDirectoryError); ok { - return false - } - return true -} - -func (ds *DatastoreDriver) FileExists(path string) bool { - _, err := ds.ds.Stat(ds.driver.ctx, path) - return err == nil -} - -func (ds *DatastoreDriver) Name() string { - return ds.ds.Name() -} - -func (ds *DatastoreDriver) Reference() types.ManagedObjectReference { - return ds.ds.Reference() -} - -func (ds *DatastoreDriver) ResolvePath(path string) string { - return ds.ds.Path(path) -} - -// The file ID isn't available via the API, so we use DatastoreBrowser to search -func (d *VCenterDriver) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) { - ref := types.ManagedObjectReference{Type: "Datastore", Value: datastoreID} - ds := object.NewDatastore(d.vimClient, ref) - - b, err := ds.Browser(d.ctx) - if err != nil { - return filename, err - } - ext := path.Ext(filename) - pat := strings.Replace(filename, ext, "*"+ext, 1) - spec := types.HostDatastoreBrowserSearchSpec{ - MatchPattern: []string{pat}, - } - - task, err := b.SearchDatastore(d.ctx, dir, &spec) - if err != nil { - return filename, err - } - - info, err := task.WaitForResult(d.ctx, nil) - if err != nil { - return filename, err - } - - res, ok := info.Result.(types.HostDatastoreBrowserSearchResults) - if !ok { - return filename, fmt.Errorf("search(%s) result type=%T", pat, info.Result) - } - - if len(res.File) != 1 { - return filename, fmt.Errorf("search(%s) result files=%d", pat, len(res.File)) - } - return res.File[0].GetFileInfo().Path, nil -} - -func (ds *DatastoreDriver) UploadFile(src, dst, host string, setHost bool) error { - p := soap.DefaultUpload - ctx := ds.driver.ctx - - if setHost && host != "" { - h, err := ds.driver.FindHost(host) - if err != nil { - return err - } - ctx = ds.ds.HostContext(ctx, h.host) - } - - return ds.ds.UploadFile(ctx, src, dst, &p) -} - -func (ds *DatastoreDriver) Delete(path string) error { - dc, err := ds.driver.finder.Datacenter(ds.driver.ctx, ds.ds.DatacenterPath) - if err != nil { - return err - } - fm := ds.ds.NewFileManager(dc, false) - return fm.Delete(ds.driver.ctx, path) -} - -func (ds *DatastoreDriver) MakeDirectory(path string) error { - dc, err := ds.driver.finder.Datacenter(ds.driver.ctx, ds.ds.DatacenterPath) - if err != nil { - return err - } - fm := ds.ds.NewFileManager(dc, false) - return fm.FileManager.MakeDirectory(ds.driver.ctx, path, dc, true) -} - -// Cuts out the datastore prefix -// Example: "[datastore1] file.ext" --> "file.ext" -func RemoveDatastorePrefix(path string) string { - res := object.DatastorePath{} - if hadPrefix := res.FromString(path); hadPrefix { - return res.Path - } else { - return path - } -} - -type DatastoreIsoPath struct { - path string -} - -func (d *DatastoreIsoPath) Validate() bool { - // Matches: - // [datastore] /dir/subdir/file - // [datastore] dir/subdir/file - // [] /dir/subdir/file - // [data-store] /dir/subdir/file - // dir/subdir/file or dir/subdir/file - matched, _ := regexp.MatchString(`^\s*(\[[^\[\]\/]*\])?\s*[^\[\]]+\s*$`, d.path) - return matched -} - -func (d *DatastoreIsoPath) GetFilePath() string { - filePath := d.path - parts := strings.Split(d.path, "]") - if len(parts) > 1 { - // removes datastore name from path - filePath = parts[1] - filePath = strings.TrimSpace(filePath) - } - return filePath -} diff --git a/builder/vsphere/driver/datastore_acc_test.go b/builder/vsphere/driver/datastore_acc_test.go deleted file mode 100644 index 45cc4e76e..000000000 --- a/builder/vsphere/driver/datastore_acc_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package driver - -import ( - "fmt" - "io/ioutil" - "testing" - "time" -) - -func TestDatastoreAcc(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - d := newTestDriver(t) - ds, err := d.FindDatastore("datastore1", "") - if err != nil { - t.Fatalf("Cannot find the default datastore '%v': %v", "datastore1", err) - } - info, err := ds.Info("name") - if err != nil { - t.Fatalf("Cannot read datastore properties: %v", err) - } - if info.Name != "datastore1" { - t.Errorf("Wrong datastore. expected: 'datastore1', got: '%v'", info.Name) - } -} - -func TestFileUpload(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - dsName := "datastore1" - hostName := "esxi-1.vsphere65.test" - - fileName := fmt.Sprintf("test-%v", time.Now().Unix()) - tmpFile, err := ioutil.TempFile("", fileName) - if err != nil { - t.Fatalf("Error creating temp file") - } - err = tmpFile.Close() - if err != nil { - t.Fatalf("Error creating temp file") - } - - d := newTestDriver(t) - ds, err := d.FindDatastore(dsName, hostName) - if err != nil { - t.Fatalf("Cannot find datastore '%v': %v", dsName, err) - } - - err = ds.UploadFile(tmpFile.Name(), fileName, hostName, true) - if err != nil { - t.Fatalf("Cannot upload file: %v", err) - } - - if ds.FileExists(fileName) != true { - t.Fatalf("Cannot find file") - } - - err = ds.Delete(fileName) - if err != nil { - t.Fatalf("Cannot delete file: %v", err) - } -} - -func TestFileUploadDRS(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - dsName := "datastore3" - hostName := "" - - fileName := fmt.Sprintf("test-%v", time.Now().Unix()) - tmpFile, err := ioutil.TempFile("", fileName) - if err != nil { - t.Fatalf("Error creating temp file") - } - err = tmpFile.Close() - if err != nil { - t.Fatalf("Error creating temp file") - } - - d := newTestDriver(t) - ds, err := d.FindDatastore(dsName, hostName) - if err != nil { - t.Fatalf("Cannot find datastore '%v': %v", dsName, err) - } - - err = ds.UploadFile(tmpFile.Name(), fileName, hostName, false) - if err != nil { - t.Fatalf("Cannot upload file: %v", err) - } - - if ds.FileExists(fileName) != true { - t.Fatalf("Cannot find file") - } - - err = ds.Delete(fileName) - if err != nil { - t.Fatalf("Cannot delete file: %v", err) - } -} diff --git a/builder/vsphere/driver/datastore_mock.go b/builder/vsphere/driver/datastore_mock.go deleted file mode 100644 index 9330d9227..000000000 --- a/builder/vsphere/driver/datastore_mock.go +++ /dev/null @@ -1,81 +0,0 @@ -package driver - -import ( - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type DatastoreMock struct { - FileExistsCalled bool - FileExistsReturn bool - - DirExistsCalled bool - DirExistsReturn bool - - NameReturn string - - MakeDirectoryCalled bool - - ResolvePathCalled bool - ResolvePathReturn string - - DeleteCalled bool - DeletePath string - DeleteErr error - - UploadFileCalled bool - UploadFileSrc string - UploadFileDst string - UploadFileHost string - UploadFileSetHost bool - UploadFileErr error -} - -func (ds *DatastoreMock) Info(params ...string) (*mo.Datastore, error) { - return nil, nil -} - -func (ds *DatastoreMock) FileExists(path string) bool { - ds.FileExistsCalled = true - return ds.FileExistsReturn -} - -func (ds *DatastoreMock) DirExists(path string) bool { - ds.DirExistsCalled = true - return ds.DirExistsReturn -} -func (ds *DatastoreMock) Name() string { - if ds.NameReturn == "" { - return "datastore-mock" - } - return ds.NameReturn -} - -func (ds *DatastoreMock) Reference() types.ManagedObjectReference { - return types.ManagedObjectReference{} -} - -func (ds *DatastoreMock) ResolvePath(path string) string { - ds.ResolvePathCalled = true - return ds.ResolvePathReturn -} - -func (ds *DatastoreMock) UploadFile(src, dst, host string, setHost bool) error { - ds.UploadFileCalled = true - ds.UploadFileSrc = src - ds.UploadFileDst = dst - ds.UploadFileHost = host - ds.UploadFileSetHost = setHost - return ds.UploadFileErr -} - -func (ds *DatastoreMock) Delete(path string) error { - ds.DeleteCalled = true - ds.DeletePath = path - return ds.DeleteErr -} - -func (ds *DatastoreMock) MakeDirectory(path string) error { - ds.MakeDirectoryCalled = true - return nil -} diff --git a/builder/vsphere/driver/datastore_test.go b/builder/vsphere/driver/datastore_test.go deleted file mode 100644 index d2b296d92..000000000 --- a/builder/vsphere/driver/datastore_test.go +++ /dev/null @@ -1,174 +0,0 @@ -package driver - -import ( - "testing" - - "github.com/vmware/govmomi/simulator" -) - -func TestDatastoreIsoPath(t *testing.T) { - tc := []struct { - isoPath string - filePath string - valid bool - }{ - { - isoPath: "[datastore] dir/subdir/file", - filePath: "dir/subdir/file", - valid: true, - }, - { - isoPath: "[] dir/subdir/file", - filePath: "dir/subdir/file", - valid: true, - }, - { - isoPath: "dir/subdir/file", - filePath: "dir/subdir/file", - valid: true, - }, - { - isoPath: "[datastore] /dir/subdir/file", - filePath: "/dir/subdir/file", - valid: true, - }, - { - isoPath: "/dir/subdir/file [datastore] ", - valid: false, - }, - { - isoPath: "[datastore][] /dir/subdir/file", - valid: false, - }, - { - isoPath: "[data/store] /dir/subdir/file", - valid: false, - }, - { - isoPath: "[data store] /dir/sub dir/file", - filePath: "/dir/sub dir/file", - valid: true, - }, - { - isoPath: " [datastore] /dir/subdir/file", - filePath: "/dir/subdir/file", - valid: true, - }, - { - isoPath: "[datastore] /dir/subdir/file", - filePath: "/dir/subdir/file", - valid: true, - }, - { - isoPath: "[datastore] /dir/subdir/file ", - filePath: "/dir/subdir/file", - valid: true, - }, - { - isoPath: "[привѣ́тъ] /привѣ́тъ/привѣ́тъ/привѣ́тъ", - filePath: "/привѣ́тъ/привѣ́тъ/привѣ́тъ", - valid: true, - }, - // Test case for #9846 - { - isoPath: "[ISO-StorageLun9] Linux/rhel-8.0-x86_64-dvd.iso", - filePath: "Linux/rhel-8.0-x86_64-dvd.iso", - valid: true, - }, - } - - for i, c := range tc { - dsIsoPath := &DatastoreIsoPath{path: c.isoPath} - if dsIsoPath.Validate() != c.valid { - t.Fatalf("%d Expecting %s to be %t but was %t", i, c.isoPath, c.valid, !c.valid) - } - if !c.valid { - continue - } - filePath := dsIsoPath.GetFilePath() - if filePath != c.filePath { - t.Fatalf("%d Expecting %s but got %s", i, c.filePath, filePath) - } - } -} - -func TestVCenterDriver_FindDatastore(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - _, datastore := sim.ChooseSimulatorPreCreatedDatastore() - _, host := sim.ChooseSimulatorPreCreatedHost() - - tc := []struct { - name string - datastore string - host string - fail bool - errMessage string - }{ - { - name: "should find datastore when name is provided", - datastore: datastore.Name, - fail: false, - }, - { - name: "should find datastore when only host is provided", - host: host.Name, - fail: false, - }, - { - name: "should not find invalid datastore", - datastore: "invalid", - fail: true, - }, - { - name: "should not find invalid host", - host: "invalid", - fail: true, - }, - } - - for _, c := range tc { - t.Run(c.name, func(t *testing.T) { - ds, err := sim.driver.FindDatastore(c.datastore, c.host) - if c.fail { - if err == nil { - t.Fatalf("expected to fail") - } - if c.errMessage != "" && err.Error() != c.errMessage { - t.Fatalf("unexpected error message %s", err.Error()) - } - } else { - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if ds == nil { - t.Fatalf("expected to find datastore") - } - } - }) - } -} - -func TestVCenterDriver_MultipleDatastoreError(t *testing.T) { - model := simulator.ESX() - model.Datastore = 2 - sim, err := NewCustomVCenterSimulator(model) - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - _, host := sim.ChooseSimulatorPreCreatedHost() - - _, err = sim.driver.FindDatastore("", host.Name) - if err == nil { - t.Fatalf("expected to fail") - } - if err.Error() != "Host has multiple datastores. Specify it explicitly" { - t.Fatalf("unexpected error message %s", err.Error()) - } -} diff --git a/builder/vsphere/driver/disk.go b/builder/vsphere/driver/disk.go deleted file mode 100644 index a51201992..000000000 --- a/builder/vsphere/driver/disk.go +++ /dev/null @@ -1,85 +0,0 @@ -package driver - -import ( - "errors" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type Disk struct { - DiskSize int64 - DiskEagerlyScrub bool - DiskThinProvisioned bool - ControllerIndex int -} - -type StorageConfig struct { - DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic" - Storage []Disk -} - -func (c *StorageConfig) AddStorageDevices(existingDevices object.VirtualDeviceList) ([]types.BaseVirtualDeviceConfigSpec, error) { - newDevices := object.VirtualDeviceList{} - - // Create new controller based on existing devices list and add it to the new devices list - // to confirm creation - var controllers []types.BaseVirtualController - for _, controllerType := range c.DiskControllerType { - var device types.BaseVirtualDevice - var err error - if controllerType == "nvme" { - device, err = existingDevices.CreateNVMEController() - } else { - device, err = existingDevices.CreateSCSIController(controllerType) - } - if err != nil { - return nil, err - } - existingDevices = append(existingDevices, device) - newDevices = append(newDevices, device) - controller, err := existingDevices.FindDiskController(existingDevices.Name(device)) - if err != nil { - return nil, err - } - controllers = append(controllers, controller) - } - - for _, dc := range c.Storage { - disk := &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - Key: existingDevices.NewKey(), - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - DiskMode: string(types.VirtualDiskModePersistent), - ThinProvisioned: types.NewBool(dc.DiskThinProvisioned), - EagerlyScrub: types.NewBool(dc.DiskEagerlyScrub), - }, - }, - CapacityInKB: dc.DiskSize * 1024, - } - - existingDevices.AssignController(disk, controllers[dc.ControllerIndex]) - existingDevices = append(existingDevices, disk) - newDevices = append(newDevices, disk) - } - - return newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) -} - -func findDisk(devices object.VirtualDeviceList) (*types.VirtualDisk, error) { - var disks []*types.VirtualDisk - for _, device := range devices { - switch d := device.(type) { - case *types.VirtualDisk: - disks = append(disks, d) - } - } - - switch len(disks) { - case 0: - return nil, errors.New("VM has no disks") - case 1: - return disks[0], nil - } - return nil, errors.New("VM has multiple disks") -} diff --git a/builder/vsphere/driver/disk_test.go b/builder/vsphere/driver/disk_test.go deleted file mode 100644 index 174e008ba..000000000 --- a/builder/vsphere/driver/disk_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package driver - -import ( - "testing" - - "github.com/vmware/govmomi/object" -) - -func TestAddStorageDevices(t *testing.T) { - config := &StorageConfig{ - DiskControllerType: []string{"pvscsi"}, - Storage: []Disk{ - { - DiskSize: 3072, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - { - DiskSize: 20480, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - }, - } - - noExistingDevices := object.VirtualDeviceList{} - storageConfigSpec, err := config.AddStorageDevices(noExistingDevices) - if err != nil { - t.Fatalf("unexpected erro: %q", err.Error()) - } - if len(storageConfigSpec) != 3 { - t.Fatalf("Expecting VirtualDeviceList to have 3 storage devices but had %d", len(storageConfigSpec)) - } - - existingDevices := object.VirtualDeviceList{} - device, err := existingDevices.CreateNVMEController() - existingDevices = append(existingDevices, device) - - storageConfigSpec, err = config.AddStorageDevices(existingDevices) - if err != nil { - t.Fatalf("unexpected erro: %q", err.Error()) - } - if len(storageConfigSpec) != 3 { - t.Fatalf("Expecting VirtualDeviceList to have 3 storage devices but had %d", len(storageConfigSpec)) - } -} diff --git a/builder/vsphere/driver/driver.go b/builder/vsphere/driver/driver.go deleted file mode 100644 index 8fbab96e5..000000000 --- a/builder/vsphere/driver/driver.go +++ /dev/null @@ -1,129 +0,0 @@ -package driver - -import ( - "context" - "fmt" - "net/url" - "time" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/session" - "github.com/vmware/govmomi/vapi/library" - "github.com/vmware/govmomi/vapi/rest" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -type Driver interface { - NewVM(ref *types.ManagedObjectReference) VirtualMachine - FindVM(name string) (VirtualMachine, error) - FindCluster(name string) (*Cluster, error) - PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error - CreateVM(config *CreateConfig) (VirtualMachine, error) - - NewDatastore(ref *types.ManagedObjectReference) Datastore - FindDatastore(name string, host string) (Datastore, error) - GetDatastoreName(id string) (string, error) - GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) - - NewFolder(ref *types.ManagedObjectReference) *Folder - FindFolder(name string) (*Folder, error) - NewHost(ref *types.ManagedObjectReference) *Host - FindHost(name string) (*Host, error) - NewNetwork(ref *types.ManagedObjectReference) *Network - FindNetwork(name string) (*Network, error) - FindNetworks(name string) ([]*Network, error) - NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool - FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) - - FindContentLibraryByName(name string) (*Library, error) - FindContentLibraryItem(libraryId string, name string) (*library.Item, error) - FindContentLibraryFileDatastorePath(isoPath string) (string, error) -} - -type VCenterDriver struct { - // context that controls the authenticated sessions used to run the VM commands - ctx context.Context - client *govmomi.Client - vimClient *vim25.Client - restClient *RestClient - finder *find.Finder - datacenter *object.Datacenter -} - -type ConnectConfig struct { - VCenterServer string - Username string - Password string - InsecureConnection bool - Datacenter string -} - -func NewDriver(config *ConnectConfig) (Driver, error) { - ctx := context.TODO() - - vcenterUrl, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer)) - if err != nil { - return nil, err - } - credentials := url.UserPassword(config.Username, config.Password) - vcenterUrl.User = credentials - - soapClient := soap.NewClient(vcenterUrl, config.InsecureConnection) - vimClient, err := vim25.NewClient(ctx, soapClient) - if err != nil { - return nil, err - } - - vimClient.RoundTripper = session.KeepAlive(vimClient.RoundTripper, 10*time.Minute) - client := &govmomi.Client{ - Client: vimClient, - SessionManager: session.NewManager(vimClient), - } - - err = client.SessionManager.Login(ctx, credentials) - if err != nil { - return nil, err - } - - finder := find.NewFinder(client.Client, false) - datacenter, err := finder.DatacenterOrDefault(ctx, config.Datacenter) - if err != nil { - return nil, err - } - finder.SetDatacenter(datacenter) - - d := &VCenterDriver{ - ctx: ctx, - client: client, - vimClient: vimClient, - restClient: &RestClient{ - client: rest.NewClient(vimClient), - credentials: credentials, - }, - datacenter: datacenter, - finder: finder, - } - return d, nil -} - -// The rest.Client requires vCenter. -// RestClient is to modularize the rest.Client session and use it only when is necessary. -// This will allow users without vCenter to use the other features that doesn't use the rest.Client. -// To use the client login/logout must be done to create an authenticated session. -type RestClient struct { - client *rest.Client - credentials *url.Userinfo -} - -func (r *RestClient) Login(ctx context.Context) error { - return r.client.Login(ctx, r.credentials) -} - -func (r *RestClient) Logout(ctx context.Context) error { - return r.client.Logout(ctx) -} diff --git a/builder/vsphere/driver/driver_mock.go b/builder/vsphere/driver/driver_mock.go deleted file mode 100644 index 03fa736fb..000000000 --- a/builder/vsphere/driver/driver_mock.go +++ /dev/null @@ -1,119 +0,0 @@ -package driver - -import ( - "fmt" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/vmware/govmomi/vapi/library" - "github.com/vmware/govmomi/vim25/types" -) - -type DriverMock struct { - FindDatastoreCalled bool - DatastoreMock *DatastoreMock - FindDatastoreName string - FindDatastoreHost string - FindDatastoreErr error - - PreCleanShouldFail bool - PreCleanVMCalled bool - PreCleanForce bool - PreCleanVMPath string - - CreateVMShouldFail bool - CreateVMCalled bool - CreateConfig *CreateConfig - VM VirtualMachine - - FindVMCalled bool - FindVMName string -} - -func NewDriverMock() *DriverMock { - return new(DriverMock) -} - -func (d *DriverMock) FindDatastore(name string, host string) (Datastore, error) { - d.FindDatastoreCalled = true - if d.DatastoreMock == nil { - d.DatastoreMock = new(DatastoreMock) - } - d.FindDatastoreName = name - d.FindDatastoreHost = host - return d.DatastoreMock, d.FindDatastoreErr -} - -func (d *DriverMock) NewVM(ref *types.ManagedObjectReference) VirtualMachine { - return nil -} - -func (d *DriverMock) FindVM(name string) (VirtualMachine, error) { - d.FindVMCalled = true - if d.VM == nil { - d.VM = new(VirtualMachineMock) - } - d.FindVMName = name - return d.VM, d.FindDatastoreErr -} - -func (d *DriverMock) FindCluster(name string) (*Cluster, error) { - return nil, nil -} - -func (d *DriverMock) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { - d.PreCleanVMCalled = true - if d.PreCleanShouldFail { - return fmt.Errorf("pre clean failed") - } - d.PreCleanForce = true - d.PreCleanVMPath = vmPath - return nil -} - -func (d *DriverMock) CreateVM(config *CreateConfig) (VirtualMachine, error) { - d.CreateVMCalled = true - if d.CreateVMShouldFail { - return nil, fmt.Errorf("create vm failed") - } - d.CreateConfig = config - d.VM = new(VirtualMachineDriver) - return d.VM, nil -} - -func (d *DriverMock) NewDatastore(ref *types.ManagedObjectReference) Datastore { return nil } - -func (d *DriverMock) GetDatastoreName(id string) (string, error) { return "", nil } - -func (d *DriverMock) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) { - return "", nil -} - -func (d *DriverMock) NewFolder(ref *types.ManagedObjectReference) *Folder { return nil } - -func (d *DriverMock) FindFolder(name string) (*Folder, error) { return nil, nil } - -func (d *DriverMock) NewHost(ref *types.ManagedObjectReference) *Host { return nil } - -func (d *DriverMock) FindHost(name string) (*Host, error) { return nil, nil } - -func (d *DriverMock) NewNetwork(ref *types.ManagedObjectReference) *Network { return nil } - -func (d *DriverMock) FindNetwork(name string) (*Network, error) { return nil, nil } - -func (d *DriverMock) FindNetworks(name string) ([]*Network, error) { return nil, nil } - -func (d *DriverMock) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { return nil } - -func (d *DriverMock) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { - return nil, nil -} - -func (d *DriverMock) FindContentLibraryByName(name string) (*Library, error) { return nil, nil } - -func (d *DriverMock) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { - return nil, nil -} - -func (d *DriverMock) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { - return "", nil -} diff --git a/builder/vsphere/driver/driver_test.go b/builder/vsphere/driver/driver_test.go deleted file mode 100644 index 534755858..000000000 --- a/builder/vsphere/driver/driver_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package driver - -import ( - "context" - "crypto/tls" - "fmt" - "math/rand" - "net/http" - "net/url" - "os" - "testing" - "time" - - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/session" - "github.com/vmware/govmomi/simulator" - "github.com/vmware/govmomi/vapi/rest" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/soap" -) - -// Defines whether acceptance tests should be run -const TestHostName = "esxi-1.vsphere65.test" - -func newTestDriver(t *testing.T) Driver { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - d, err := NewDriver(&ConnectConfig{ - VCenterServer: "vcenter.vsphere65.test", - Username: username, - Password: password, - InsecureConnection: true, - }) - if err != nil { - t.Fatalf("Cannot connect: %v", err) - } - return d -} - -func newVMName() string { - rand.Seed(time.Now().UTC().UnixNano()) - return fmt.Sprintf("test-%v", rand.Intn(1000)) -} - -type VCenterSimulator struct { - model *simulator.Model - server *simulator.Server - driver *VCenterDriver -} - -func NewCustomVCenterSimulator(model *simulator.Model) (*VCenterSimulator, error) { - sim := new(VCenterSimulator) - sim.model = model - - server, err := sim.NewSimulatorServer() - if err != nil { - sim.Close() - return nil, err - } - sim.server = server - - driver, err := sim.NewSimulatorDriver() - if err != nil { - sim.Close() - return nil, err - } - sim.driver = driver - return sim, nil -} - -func NewVCenterSimulator() (*VCenterSimulator, error) { - model := simulator.VPX() - model.Machine = 1 - return NewCustomVCenterSimulator(model) -} - -func (s *VCenterSimulator) Close() { - if s.model != nil { - s.model.Remove() - } - if s.server != nil { - s.server.Close() - } -} - -//Simulator shortcut to choose any pre created VM. -func (s *VCenterSimulator) ChooseSimulatorPreCreatedVM() (VirtualMachine, *simulator.VirtualMachine) { - machine := simulator.Map.Any("VirtualMachine").(*simulator.VirtualMachine) - ref := machine.Reference() - vm := s.driver.NewVM(&ref) - return vm, machine -} - -//Simulator shortcut to choose any pre created Datastore. -func (s *VCenterSimulator) ChooseSimulatorPreCreatedDatastore() (Datastore, *simulator.Datastore) { - ds := simulator.Map.Any("Datastore").(*simulator.Datastore) - ref := ds.Reference() - datastore := s.driver.NewDatastore(&ref) - return datastore, ds -} - -//Simulator shortcut to choose any pre created Host. -func (s *VCenterSimulator) ChooseSimulatorPreCreatedHost() (*Host, *simulator.HostSystem) { - h := simulator.Map.Any("HostSystem").(*simulator.HostSystem) - ref := h.Reference() - host := s.driver.NewHost(&ref) - return host, h -} - -func (s *VCenterSimulator) NewSimulatorServer() (*simulator.Server, error) { - err := s.model.Create() - if err != nil { - return nil, err - } - - s.model.Service.RegisterEndpoints = true - s.model.Service.TLS = new(tls.Config) - s.model.Service.ServeMux = http.NewServeMux() - return s.model.Service.NewServer(), nil -} - -func (s *VCenterSimulator) NewSimulatorDriver() (*VCenterDriver, error) { - ctx := context.TODO() - user := &url.Userinfo{} - s.server.URL.User = user - - soapClient := soap.NewClient(s.server.URL, true) - vimClient, err := vim25.NewClient(ctx, soapClient) - if err != nil { - return nil, err - } - - vimClient.RoundTripper = session.KeepAlive(vimClient.RoundTripper, 10*time.Minute) - client := &govmomi.Client{ - Client: vimClient, - SessionManager: session.NewManager(vimClient), - } - - err = client.SessionManager.Login(ctx, user) - if err != nil { - return nil, err - } - - finder := find.NewFinder(client.Client, false) - datacenter, err := finder.DatacenterOrDefault(ctx, "") - if err != nil { - return nil, err - } - finder.SetDatacenter(datacenter) - - d := &VCenterDriver{ - ctx: ctx, - client: client, - vimClient: vimClient, - restClient: &RestClient{ - client: rest.NewClient(vimClient), - credentials: user, - }, - datacenter: datacenter, - finder: finder, - } - return d, nil -} diff --git a/builder/vsphere/driver/folder.go b/builder/vsphere/driver/folder.go deleted file mode 100644 index 75e07e594..000000000 --- a/builder/vsphere/driver/folder.go +++ /dev/null @@ -1,93 +0,0 @@ -package driver - -import ( - "fmt" - "path" - "strings" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type Folder struct { - driver *VCenterDriver - folder *object.Folder -} - -func (d *VCenterDriver) NewFolder(ref *types.ManagedObjectReference) *Folder { - return &Folder{ - folder: object.NewFolder(d.client.Client, *ref), - driver: d, - } -} - -func (d *VCenterDriver) FindFolder(name string) (*Folder, error) { - if name != "" { - // create folders if they don't exist - parent := "" - parentFolder, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm")) - if err != nil { - return nil, err - } - folders := strings.Split(name, "/") - for _, folder := range folders { - parent = path.Join(parent, folder) - f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", parent)) - if _, ok := err.(*find.NotFoundError); ok { - f, err = parentFolder.CreateFolder(d.ctx, folder) - } - if err != nil { - return nil, err - } - parentFolder = f - } - } - - f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", name)) - if err != nil { - return nil, err - } - - return &Folder{ - folder: f, - driver: d, - }, nil -} - -func (f *Folder) Info(params ...string) (*mo.Folder, error) { - var p []string - if len(params) == 0 { - p = []string{"*"} - } else { - p = params - } - var info mo.Folder - err := f.folder.Properties(f.driver.ctx, f.folder.Reference(), p, &info) - if err != nil { - return nil, err - } - return &info, nil -} - -func (f *Folder) Path() (string, error) { - info, err := f.Info("name", "parent") - if err != nil { - return "", err - } - if info.Parent.Type == "Datacenter" { - return "", nil - } else { - parent := f.driver.NewFolder(info.Parent) - path, err := parent.Path() - if err != nil { - return "", err - } - if path == "" { - return info.Name, nil - } else { - return fmt.Sprintf("%v/%v", path, info.Name), nil - } - } -} diff --git a/builder/vsphere/driver/folder_acc_test.go b/builder/vsphere/driver/folder_acc_test.go deleted file mode 100644 index 7f3b527b6..000000000 --- a/builder/vsphere/driver/folder_acc_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package driver - -import "testing" - -func TestFolderAcc(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - d := newTestDriver(t) - f, err := d.FindFolder("folder1/folder2") - if err != nil { - t.Fatalf("Cannot find the default folder '%v': %v", "folder1/folder2", err) - } - path, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if path != "folder1/folder2" { - t.Errorf("Wrong folder. expected: 'folder1/folder2', got: '%v'", path) - } -} diff --git a/builder/vsphere/driver/host.go b/builder/vsphere/driver/host.go deleted file mode 100644 index 31c193589..000000000 --- a/builder/vsphere/driver/host.go +++ /dev/null @@ -1,45 +0,0 @@ -package driver - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type Host struct { - driver *VCenterDriver - host *object.HostSystem -} - -func (d *VCenterDriver) NewHost(ref *types.ManagedObjectReference) *Host { - return &Host{ - host: object.NewHostSystem(d.client.Client, *ref), - driver: d, - } -} - -func (d *VCenterDriver) FindHost(name string) (*Host, error) { - h, err := d.finder.HostSystem(d.ctx, name) - if err != nil { - return nil, err - } - return &Host{ - host: h, - driver: d, - }, nil -} - -func (h *Host) Info(params ...string) (*mo.HostSystem, error) { - var p []string - if len(params) == 0 { - p = []string{"*"} - } else { - p = params - } - var info mo.HostSystem - err := h.host.Properties(h.driver.ctx, h.host.Reference(), p, &info) - if err != nil { - return nil, err - } - return &info, nil -} diff --git a/builder/vsphere/driver/host_acc_test.go b/builder/vsphere/driver/host_acc_test.go deleted file mode 100644 index faee0fdaa..000000000 --- a/builder/vsphere/driver/host_acc_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package driver - -import ( - "testing" -) - -func TestHostAcc(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - d := newTestDriver(t) - host, err := d.FindHost(TestHostName) - if err != nil { - t.Fatalf("Cannot find the default host '%v': %v", "datastore1", err) - } - - info, err := host.Info("name") - if err != nil { - t.Fatalf("Cannot read host properties: %v", err) - } - if info.Name != TestHostName { - t.Errorf("Wrong host name: expected '%v', got: '%v'", TestHostName, info.Name) - } -} diff --git a/builder/vsphere/driver/library.go b/builder/vsphere/driver/library.go deleted file mode 100644 index 25d7d6880..000000000 --- a/builder/vsphere/driver/library.go +++ /dev/null @@ -1,113 +0,0 @@ -package driver - -import ( - "fmt" - "log" - "path" - "strings" - - "github.com/vmware/govmomi/vapi/library" -) - -type Library struct { - driver *VCenterDriver - library *library.Library -} - -func (d *VCenterDriver) FindContentLibraryByName(name string) (*Library, error) { - lm := library.NewManager(d.restClient.client) - l, err := lm.GetLibraryByName(d.ctx, name) - if err != nil { - return nil, err - } - return &Library{ - library: l, - driver: d, - }, nil -} - -func (d *VCenterDriver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { - lm := library.NewManager(d.restClient.client) - items, err := lm.GetLibraryItems(d.ctx, libraryId) - if err != nil { - return nil, err - } - for _, item := range items { - if item.Name == name { - return &item, nil - } - } - return nil, fmt.Errorf("Item %s not found", name) -} - -func (d *VCenterDriver) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { - log.Printf("Check if ISO path is a Content Library path") - err := d.restClient.Login(d.ctx) - if err != nil { - log.Printf("vCenter client not available. ISO path not identified as a Content Library path") - return isoPath, err - } - - libraryFilePath := &LibraryFilePath{path: isoPath} - err = libraryFilePath.Validate() - if err != nil { - log.Printf("ISO path not identified as a Content Library path") - return isoPath, err - } - libraryName := libraryFilePath.GetLibraryName() - itemName := libraryFilePath.GetLibraryItemName() - isoFile := libraryFilePath.GetFileName() - - lib, err := d.FindContentLibraryByName(libraryName) - if err != nil { - log.Printf("ISO path not identified as a Content Library path") - return isoPath, err - } - log.Printf("ISO path identified as a Content Library path") - log.Printf("Finding the equivalent datastore path for the Content Library ISO file path") - libItem, err := d.FindContentLibraryItem(lib.library.ID, itemName) - if err != nil { - log.Printf("[WARN] Couldn't find item %s: %s", itemName, err.Error()) - return isoPath, err - } - datastoreName, err := d.GetDatastoreName(lib.library.Storage[0].DatastoreID) - if err != nil { - log.Printf("[WARN] Couldn't find datastore name for library %s", libraryName) - return isoPath, err - } - libItemDir := fmt.Sprintf("[%s] contentlib-%s/%s", datastoreName, lib.library.ID, libItem.ID) - - isoFilePath, err := d.GetDatastoreFilePath(lib.library.Storage[0].DatastoreID, libItemDir, isoFile) - if err != nil { - log.Printf("[WARN] Couldn't find datastore ID path for %s", isoFile) - return isoPath, err - } - - _ = d.restClient.Logout(d.ctx) - return path.Join(libItemDir, isoFilePath), nil -} - -type LibraryFilePath struct { - path string -} - -func (l *LibraryFilePath) Validate() error { - l.path = strings.TrimLeft(l.path, "/") - parts := strings.Split(l.path, "/") - if len(parts) != 3 { - return fmt.Errorf("Not a valid Content Library File path. The path must contain the nanmes for the library, item and file.") - } - return nil -} - -func (l *LibraryFilePath) GetLibraryName() string { - return strings.Split(l.path, "/")[0] -} - -func (l *LibraryFilePath) GetLibraryItemName() string { - return strings.Split(l.path, "/")[1] -} - -func (l *LibraryFilePath) GetFileName() string { - return strings.Split(l.path, "/")[2] -} diff --git a/builder/vsphere/driver/library_test.go b/builder/vsphere/driver/library_test.go deleted file mode 100644 index e0161eb8c..000000000 --- a/builder/vsphere/driver/library_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package driver - -import "testing" - -func TestLibraryFilePath(t *testing.T) { - tc := []struct { - filePath string - libraryName string - libraryItemName string - fileName string - valid bool - }{ - { - filePath: "lib/item/file", - libraryName: "lib", - libraryItemName: "item", - fileName: "file", - valid: true, - }, - { - filePath: "/lib/item/file", - libraryName: "lib", - libraryItemName: "item", - fileName: "file", - valid: true, - }, - { - filePath: "/lib/item/filedir/file", - valid: false, - }, - { - filePath: "/lib/item", - valid: false, - }, - { - filePath: "/lib", - valid: false, - }, - } - - for _, c := range tc { - libraryFilePath := &LibraryFilePath{path: c.filePath} - if err := libraryFilePath.Validate(); err != nil { - if c.valid { - t.Fatalf("Expecting %s to be valid", c.filePath) - } - continue - } - libraryName := libraryFilePath.GetLibraryName() - if libraryName != c.libraryName { - t.Fatalf("Expecting %s but got %s", c.libraryName, libraryName) - } - libraryItemName := libraryFilePath.GetLibraryItemName() - if libraryItemName != c.libraryItemName { - t.Fatalf("Expecting %s but got %s", c.libraryItemName, libraryItemName) - } - fileName := libraryFilePath.GetFileName() - if fileName != c.fileName { - t.Fatalf("Expecting %s but got %s", c.fileName, fileName) - } - } -} diff --git a/builder/vsphere/driver/network.go b/builder/vsphere/driver/network.go deleted file mode 100644 index f2d90d187..000000000 --- a/builder/vsphere/driver/network.go +++ /dev/null @@ -1,77 +0,0 @@ -package driver - -import ( - "fmt" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type Network struct { - driver *VCenterDriver - network object.NetworkReference -} - -func (d *VCenterDriver) NewNetwork(ref *types.ManagedObjectReference) *Network { - return &Network{ - network: object.NewNetwork(d.client.Client, *ref), - driver: d, - } -} - -func (d *VCenterDriver) FindNetwork(name string) (*Network, error) { - n, err := d.finder.Network(d.ctx, name) - if err != nil { - return nil, err - } - return &Network{ - network: n, - driver: d, - }, nil -} - -func (d *VCenterDriver) FindNetworks(name string) ([]*Network, error) { - ns, err := d.finder.NetworkList(d.ctx, name) - if err != nil { - return nil, err - } - var networks []*Network - for _, n := range ns { - networks = append(networks, &Network{ - network: n, - driver: d, - }) - } - return networks, nil -} - -func (n *Network) Info(params ...string) (*mo.Network, error) { - var p []string - if len(params) == 0 { - p = []string{"*"} - } else { - p = params - } - var info mo.Network - - network, ok := n.network.(*object.Network) - if !ok { - return nil, fmt.Errorf("unexpected %t network object type", n.network) - } - - err := network.Properties(n.driver.ctx, network.Reference(), p, &info) - if err != nil { - return nil, err - } - return &info, nil -} - -type MultipleNetworkFoundError struct { - path string - append string -} - -func (e *MultipleNetworkFoundError) Error() string { - return fmt.Sprintf("path '%s' resolves to multiple networks. %s", e.path, e.append) -} diff --git a/builder/vsphere/driver/resource_pool.go b/builder/vsphere/driver/resource_pool.go deleted file mode 100644 index c982078b0..000000000 --- a/builder/vsphere/driver/resource_pool.go +++ /dev/null @@ -1,91 +0,0 @@ -package driver - -import ( - "fmt" - "log" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type ResourcePool struct { - pool *object.ResourcePool - driver *VCenterDriver -} - -func (d *VCenterDriver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { - return &ResourcePool{ - pool: object.NewResourcePool(d.client.Client, *ref), - driver: d, - } -} - -func (d *VCenterDriver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { - var res string - if cluster != "" { - res = cluster - } else { - res = host - } - - resourcePath := fmt.Sprintf("%v/Resources/%v", res, name) - p, err := d.finder.ResourcePool(d.ctx, resourcePath) - if err != nil { - log.Printf("[WARN] %s not found. Looking for default resource pool.", resourcePath) - dp, dperr := d.finder.DefaultResourcePool(d.ctx) - if _, ok := dperr.(*find.NotFoundError); ok { - // VirtualApp extends ResourcePool, so it should support VirtualApp types. - vapp, verr := d.finder.VirtualApp(d.ctx, name) - if verr != nil { - return nil, err - } - dp = vapp.ResourcePool - } else if dperr != nil { - return nil, err - } - p = dp - } - - return &ResourcePool{ - pool: p, - driver: d, - }, nil -} - -func (p *ResourcePool) Info(params ...string) (*mo.ResourcePool, error) { - var params2 []string - if len(params) == 0 { - params2 = []string{"*"} - } else { - params2 = params - } - var info mo.ResourcePool - err := p.pool.Properties(p.driver.ctx, p.pool.Reference(), params2, &info) - if err != nil { - return nil, err - } - return &info, nil -} - -func (p *ResourcePool) Path() (string, error) { - poolInfo, err := p.Info("name", "parent") - if err != nil { - return "", err - } - if poolInfo.Parent.Type == "ComputeResource" { - return "", nil - } else { - parent := p.driver.NewResourcePool(poolInfo.Parent) - parentPath, err := parent.Path() - if err != nil { - return "", err - } - if parentPath == "" { - return poolInfo.Name, nil - } else { - return fmt.Sprintf("%v/%v", parentPath, poolInfo.Name), nil - } - } -} diff --git a/builder/vsphere/driver/resource_pool_acc_test.go b/builder/vsphere/driver/resource_pool_acc_test.go deleted file mode 100644 index bfb38d2cc..000000000 --- a/builder/vsphere/driver/resource_pool_acc_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package driver - -import "testing" - -func TestResourcePoolAcc(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - d := newTestDriver(t) - p, err := d.FindResourcePool("", "esxi-1.vsphere65.test", "pool1/pool2") - if err != nil { - t.Fatalf("Cannot find the default resource pool '%v': %v", "pool1/pool2", err) - } - - path, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if path != "pool1/pool2" { - t.Errorf("Wrong folder. expected: 'pool1/pool2', got: '%v'", path) - } -} diff --git a/builder/vsphere/driver/resource_pool_test.go b/builder/vsphere/driver/resource_pool_test.go deleted file mode 100644 index 32badbae9..000000000 --- a/builder/vsphere/driver/resource_pool_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package driver - -import ( - "testing" - - "github.com/vmware/govmomi/simulator" -) - -func TestVCenterDriver_FindResourcePool(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - res, err := sim.driver.FindResourcePool("", "DC0_H0", "") - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if res == nil { - t.Fatalf("resource pool should not be nil") - } - expectedResourcePool := "Resources" - if res.pool.Name() != expectedResourcePool { - t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) - } -} - -func TestVCenterDriver_FindResourcePoolStandaloneESX(t *testing.T) { - // standalone ESX host without any vCenter - model := simulator.ESX() - defer model.Remove() - - opts := simulator.VPX() - model.Datastore = opts.Datastore - model.Machine = opts.Machine - model.Autostart = opts.Autostart - model.DelayConfig.Delay = opts.DelayConfig.Delay - model.DelayConfig.MethodDelay = opts.DelayConfig.MethodDelay - model.DelayConfig.DelayJitter = opts.DelayConfig.DelayJitter - - sim, err := NewCustomVCenterSimulator(model) - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - res, err := sim.driver.FindResourcePool("", "localhost.localdomain", "") - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if res == nil { - t.Fatalf("resource pool should not be nil") - } - expectedResourcePool := "Resources" - if res.pool.Name() != expectedResourcePool { - t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) - } - - // Invalid resource name should look for default resource pool - res, err = sim.driver.FindResourcePool("", "localhost.localdomain", "invalid") - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if res == nil { - t.Fatalf("resource pool should not be nil") - } - if res.pool.Name() != expectedResourcePool { - t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) - } -} diff --git a/builder/vsphere/driver/vm.go b/builder/vsphere/driver/vm.go deleted file mode 100644 index 0c739d108..000000000 --- a/builder/vsphere/driver/vm.go +++ /dev/null @@ -1,1102 +0,0 @@ -package driver - -import ( - "context" - "errors" - "fmt" - "log" - "net" - "reflect" - "strings" - "time" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/nfc" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/ovf" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vapi/vcenter" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type VirtualMachine interface { - Info(params ...string) (*mo.VirtualMachine, error) - Devices() (object.VirtualDeviceList, error) - FloppyDevices() (object.VirtualDeviceList, error) - Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) - updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) - AddPublicKeys(ctx context.Context, publicKeys string) error - Properties(ctx context.Context) (*mo.VirtualMachine, error) - Destroy() error - Configure(config *HardwareConfig) error - Customize(spec types.CustomizationSpec) error - ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) - WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) - PowerOn() error - PowerOff() error - IsPoweredOff() (bool, error) - StartShutdown() error - WaitForShutdown(ctx context.Context, timeout time.Duration) error - CreateSnapshot(name string) error - ConvertToTemplate() error - ImportOvfToContentLibrary(ovf vcenter.OVF) error - ImportToContentLibrary(template vcenter.Template) error - GetDir() (string, error) - AddFloppy(imgPath string) error - SetBootOrder(order []string) error - RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error - addDevice(device types.BaseVirtualDevice) error - AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error - Export() (*nfc.Lease, error) - CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) - NewOvfManager() *ovf.Manager - GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) - - AddCdrom(controllerType string, datastoreIsoPath string) error - CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) - RemoveCdroms() error - EjectCdroms() error - AddSATAController() error - FindSATAController() (*types.VirtualAHCIController, error) -} - -type VirtualMachineDriver struct { - vm *object.VirtualMachine - driver *VCenterDriver -} - -type CloneConfig struct { - Name string - Folder string - Cluster string - Host string - ResourcePool string - Datastore string - LinkedClone bool - Network string - MacAddress string - Annotation string - VAppProperties map[string]string - PrimaryDiskSize int64 - StorageConfig StorageConfig -} - -type HardwareConfig struct { - CPUs int32 - CpuCores int32 - CPUReservation int64 - CPULimit int64 - RAM int64 - RAMReservation int64 - RAMReserveAll bool - NestedHV bool - CpuHotAddEnabled bool - MemoryHotAddEnabled bool - VideoRAM int64 - VGPUProfile string - Firmware string - ForceBIOSSetup bool -} - -type NIC struct { - Network string // "" for default network - NetworkCard string // example: vmxnet3 - MacAddress string // set mac if want specific address - Passthrough *bool // direct path i/o -} - -type CreateConfig struct { - Annotation string - Name string - Folder string - Cluster string - Host string - ResourcePool string - Datastore string - GuestOS string // example: otherGuest - NICs []NIC - USBController []string - Version uint // example: 10 - StorageConfig StorageConfig -} - -func (d *VCenterDriver) NewVM(ref *types.ManagedObjectReference) VirtualMachine { - return &VirtualMachineDriver{ - vm: object.NewVirtualMachine(d.client.Client, *ref), - driver: d, - } -} - -func (d *VCenterDriver) FindVM(name string) (VirtualMachine, error) { - vm, err := d.finder.VirtualMachine(d.ctx, name) - if err != nil { - return nil, err - } - return &VirtualMachineDriver{ - vm: vm, - driver: d, - }, nil -} - -func (d *VCenterDriver) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { - vm, err := d.FindVM(vmPath) - if err != nil { - if _, ok := err.(*find.NotFoundError); !ok { - return fmt.Errorf("error looking up old vm: %v", err) - } - } - if force && vm != nil { - ui.Say(fmt.Sprintf("the vm/template %s already exists, but deleting it due to -force flag", vmPath)) - - // power off just in case it is still on - vm.PowerOff() - - err := vm.Destroy() - if err != nil { - return fmt.Errorf("error destroying %s: %v", vmPath, err) - } - } - if !force && vm != nil { - return fmt.Errorf("%s already exists, you can use -force flag to destroy it: %v", vmPath, err) - } - - return nil -} - -func (d *VCenterDriver) CreateVM(config *CreateConfig) (VirtualMachine, error) { - createSpec := types.VirtualMachineConfigSpec{ - Name: config.Name, - Annotation: config.Annotation, - GuestId: config.GuestOS, - } - if config.Version != 0 { - createSpec.Version = fmt.Sprintf("%s%d", "vmx-", config.Version) - } - - folder, err := d.FindFolder(config.Folder) - if err != nil { - return nil, err - } - - resourcePool, err := d.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) - if err != nil { - return nil, err - } - - var host *object.HostSystem - if config.Cluster != "" && config.Host != "" { - h, err := d.FindHost(config.Host) - if err != nil { - return nil, err - } - host = h.host - } - - datastore, err := d.FindDatastore(config.Datastore, config.Host) - if err != nil { - return nil, err - } - - devices := object.VirtualDeviceList{} - storageConfigSpec, err := config.StorageConfig.AddStorageDevices(devices) - if err != nil { - return nil, err - } - createSpec.DeviceChange = append(createSpec.DeviceChange, storageConfigSpec...) - - devices, err = addNetwork(d, devices, config) - if err != nil { - return nil, err - } - - t := true - for _, usbType := range config.USBController { - var usb types.BaseVirtualDevice - switch usbType { - // handle "true" and "1" for backwards compatibility - case "usb", "true", "1": - usb = &types.VirtualUSBController{ - EhciEnabled: &t, - } - case "xhci": - usb = new(types.VirtualUSBXHCIController) - default: - continue - } - - devices = append(devices, usb) - } - - devicesConfigSpec, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) - if err != nil { - return nil, err - } - createSpec.DeviceChange = append(createSpec.DeviceChange, devicesConfigSpec...) - - createSpec.Files = &types.VirtualMachineFileInfo{ - VmPathName: fmt.Sprintf("[%s]", datastore.Name()), - } - - task, err := folder.folder.CreateVM(d.ctx, createSpec, resourcePool.pool, host) - if err != nil { - return nil, err - } - taskInfo, err := task.WaitForResult(d.ctx, nil) - if err != nil { - return nil, err - } - - vmRef, ok := taskInfo.Result.(types.ManagedObjectReference) - if !ok { - return nil, fmt.Errorf("something went wrong when creating the VM") - } - - return d.NewVM(&vmRef), nil -} - -func (vm *VirtualMachineDriver) Info(params ...string) (*mo.VirtualMachine, error) { - var p []string - if len(params) == 0 { - p = []string{"*"} - } else { - p = params - } - var info mo.VirtualMachine - err := vm.vm.Properties(vm.driver.ctx, vm.vm.Reference(), p, &info) - if err != nil { - return nil, err - } - return &info, nil -} - -func (vm *VirtualMachineDriver) Devices() (object.VirtualDeviceList, error) { - vmInfo, err := vm.Info("config.hardware.device") - if err != nil { - return nil, err - } - - return vmInfo.Config.Hardware.Device, nil -} - -func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error) { - device, err := vm.Devices() - if err != nil { - return device, err - } - floppies := device.SelectByType((*types.VirtualFloppy)(nil)) - return floppies, nil -} - -func (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { - folder, err := vm.driver.FindFolder(config.Folder) - if err != nil { - return nil, fmt.Errorf("Error finding filder: %s", err) - } - - var relocateSpec types.VirtualMachineRelocateSpec - - pool, err := vm.driver.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) - if err != nil { - return nil, fmt.Errorf("Error finding resource pool: %s", err) - } - poolRef := pool.pool.Reference() - relocateSpec.Pool = &poolRef - - datastore, err := vm.driver.FindDatastore(config.Datastore, config.Host) - if err != nil { - return nil, fmt.Errorf("Error finding datastore: %s", err) - } - datastoreRef := datastore.Reference() - relocateSpec.Datastore = &datastoreRef - - var cloneSpec types.VirtualMachineCloneSpec - cloneSpec.Location = relocateSpec - cloneSpec.PowerOn = false - - if config.LinkedClone == true { - cloneSpec.Location.DiskMoveType = "createNewChildDiskBacking" - - tpl, err := vm.Info("snapshot") - if err != nil { - return nil, fmt.Errorf("Error getting snapshot info for vm: %s", err) - } - if tpl.Snapshot == nil { - err = errors.New("`linked_clone=true`, but template has no snapshots") - return nil, err - } - cloneSpec.Snapshot = tpl.Snapshot.CurrentSnapshot - } - - var configSpec types.VirtualMachineConfigSpec - cloneSpec.Config = &configSpec - - if config.Annotation != "" { - configSpec.Annotation = config.Annotation - } - - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return nil, err - } - - if config.PrimaryDiskSize > 0 { - deviceResizeSpec, err := vm.ResizeDisk(config.PrimaryDiskSize) - if err != nil { - return nil, fmt.Errorf("failed to resize primary disk: %s", err.Error()) - } - configSpec.DeviceChange = append(configSpec.DeviceChange, deviceResizeSpec...) - } - - virtualDisks := devices.SelectByType((*types.VirtualDisk)(nil)) - virtualControllers := devices.SelectByType((*types.VirtualController)(nil)) - - // Use existing devices to avoid overlapping configuration - existingDevices := object.VirtualDeviceList{} - existingDevices = append(existingDevices, virtualDisks...) - existingDevices = append(existingDevices, virtualControllers...) - - storageConfigSpec, err := config.StorageConfig.AddStorageDevices(existingDevices) - if err != nil { - return nil, fmt.Errorf("failed to add storage devices: %s", err.Error()) - } - configSpec.DeviceChange = append(configSpec.DeviceChange, storageConfigSpec...) - - if config.Network != "" { - net, err := vm.driver.FindNetwork(config.Network) - if err != nil { - return nil, fmt.Errorf("Error finding network: %s", err) - } - backing, err := net.network.EthernetCardBackingInfo(ctx) - if err != nil { - return nil, fmt.Errorf("Error finding ethernet card backing info: %s", err) - } - - devices, err := vm.vm.Device(ctx) - if err != nil { - return nil, fmt.Errorf("Error finding vm devices: %s", err) - } - - adapter, err := findNetworkAdapter(devices) - if err != nil { - return nil, fmt.Errorf("Error finding network adapter: %s", err) - } - - current := adapter.GetVirtualEthernetCard() - current.Backing = backing - current.MacAddress = config.MacAddress - - config := &types.VirtualDeviceConfigSpec{ - Device: adapter.(types.BaseVirtualDevice), - Operation: types.VirtualDeviceConfigSpecOperationEdit, - } - - configSpec.DeviceChange = append(configSpec.DeviceChange, config) - } - - vAppConfig, err := vm.updateVAppConfig(ctx, config.VAppProperties) - if err != nil { - return nil, fmt.Errorf("Error updating VAppConfig: %s", err) - } - configSpec.VAppConfig = vAppConfig - - task, err := vm.vm.Clone(vm.driver.ctx, folder.folder, config.Name, cloneSpec) - if err != nil { - return nil, fmt.Errorf("Error calling vm.vm.Clone task: %s", err) - } - - info, err := task.WaitForResult(ctx, nil) - if err != nil { - if ctx.Err() == context.Canceled { - err = task.Cancel(context.TODO()) - return nil, err - } - - return nil, fmt.Errorf("Error waiting for vm Clone to complete: %s", err) - } - - vmRef, ok := info.Result.(types.ManagedObjectReference) - if !ok { - return nil, fmt.Errorf("something went wrong when cloning the VM") - } - - created := vm.driver.NewVM(&vmRef) - return created, nil -} - -func (vm *VirtualMachineDriver) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { - if len(newProps) == 0 { - return nil, nil - } - - vProps, _ := vm.Properties(ctx) - if vProps.Config.VAppConfig == nil { - return nil, fmt.Errorf("this VM lacks a vApp configuration and cannot have vApp properties set on it") - } - - allProperties := vProps.Config.VAppConfig.GetVmConfigInfo().Property - - var props []types.VAppPropertySpec - for _, p := range allProperties { - userValue, setByUser := newProps[p.Id] - if !setByUser { - continue - } - - if *p.UserConfigurable == false { - return nil, fmt.Errorf("vApp property with userConfigurable=false specified in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) - } - - prop := types.VAppPropertySpec{ - ArrayUpdateSpec: types.ArrayUpdateSpec{ - Operation: types.ArrayUpdateOperationEdit, - }, - Info: &types.VAppPropertyInfo{ - Key: p.Key, - Id: p.Id, - Value: userValue, - UserConfigurable: p.UserConfigurable, - }, - } - props = append(props, prop) - - delete(newProps, p.Id) - } - - if len(newProps) > 0 { - return nil, fmt.Errorf("unsupported vApp properties in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) - } - - return &types.VmConfigSpec{ - Property: props, - }, nil -} - -func (vm *VirtualMachineDriver) AddPublicKeys(ctx context.Context, publicKeys string) error { - newProps := map[string]string{"public-keys": publicKeys} - config, err := vm.updateVAppConfig(ctx, newProps) - if err != nil { - return fmt.Errorf("not possible to save temporary public key: %s", err.Error()) - } - - confSpec := types.VirtualMachineConfigSpec{VAppConfig: config} - task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) - if err != nil { - return err - } - - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) Properties(ctx context.Context) (*mo.VirtualMachine, error) { - log.Printf("fetching properties for VM %q", vm.vm.InventoryPath) - var props mo.VirtualMachine - if err := vm.vm.Properties(ctx, vm.vm.Reference(), nil, &props); err != nil { - return nil, err - } - return &props, nil -} - -func (vm *VirtualMachineDriver) Destroy() error { - task, err := vm.vm.Destroy(vm.driver.ctx) - if err != nil { - return err - } - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) Configure(config *HardwareConfig) error { - var confSpec types.VirtualMachineConfigSpec - confSpec.NumCPUs = config.CPUs - confSpec.NumCoresPerSocket = config.CpuCores - confSpec.MemoryMB = config.RAM - - var cpuSpec types.ResourceAllocationInfo - cpuSpec.Reservation = &config.CPUReservation - if config.CPULimit != 0 { - cpuSpec.Limit = &config.CPULimit - } - confSpec.CpuAllocation = &cpuSpec - - var ramSpec types.ResourceAllocationInfo - ramSpec.Reservation = &config.RAMReservation - confSpec.MemoryAllocation = &ramSpec - - confSpec.MemoryReservationLockedToMax = &config.RAMReserveAll - confSpec.NestedHVEnabled = &config.NestedHV - - confSpec.CpuHotAddEnabled = &config.CpuHotAddEnabled - confSpec.MemoryHotAddEnabled = &config.MemoryHotAddEnabled - - if config.VideoRAM != 0 { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return err - } - l := devices.SelectByType((*types.VirtualMachineVideoCard)(nil)) - if len(l) != 1 { - return err - } - card := l[0].(*types.VirtualMachineVideoCard) - - card.VideoRamSizeInKB = config.VideoRAM - - spec := &types.VirtualDeviceConfigSpec{ - Device: card, - Operation: types.VirtualDeviceConfigSpecOperationEdit, - } - confSpec.DeviceChange = append(confSpec.DeviceChange, spec) - } - if config.VGPUProfile != "" { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return err - } - - pciDevices := devices.SelectByType((*types.VirtualPCIPassthrough)(nil)) - vGPUDevices := pciDevices.SelectByBackingInfo((*types.VirtualPCIPassthroughVmiopBackingInfo)(nil)) - var operation types.VirtualDeviceConfigSpecOperation - if len(vGPUDevices) > 1 { - return err - } else if len(pciDevices) == 1 { - operation = types.VirtualDeviceConfigSpecOperationEdit - } else if len(pciDevices) == 0 { - operation = types.VirtualDeviceConfigSpecOperationAdd - } - - vGPUProfile := newVGPUProfile(config.VGPUProfile) - spec := &types.VirtualDeviceConfigSpec{ - Device: &vGPUProfile, - Operation: operation, - } - log.Printf("Adding vGPU device with profile '%s'", config.VGPUProfile) - confSpec.DeviceChange = append(confSpec.DeviceChange, spec) - } - - efiSecureBootEnabled := false - firmware := config.Firmware - - if firmware == "efi-secure" { - firmware = "efi" - efiSecureBootEnabled = true - } - - confSpec.Firmware = firmware - confSpec.BootOptions = &types.VirtualMachineBootOptions{ - EnterBIOSSetup: types.NewBool(config.ForceBIOSSetup), - EfiSecureBootEnabled: types.NewBool(efiSecureBootEnabled), - } - - task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) - if err != nil { - return err - } - - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) Customize(spec types.CustomizationSpec) error { - task, err := vm.vm.Customize(vm.driver.ctx, spec) - if err != nil { - return err - } - return task.Wait(vm.driver.ctx) -} - -func (vm *VirtualMachineDriver) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return nil, err - } - - disk, err := findDisk(devices) - if err != nil { - return nil, err - } - - disk.CapacityInKB = diskSize * 1024 - - return []types.BaseVirtualDeviceConfigSpec{ - &types.VirtualDeviceConfigSpec{ - Device: disk, - Operation: types.VirtualDeviceConfigSpecOperationEdit, - }, - }, nil -} - -func (vm *VirtualMachineDriver) PowerOn() error { - task, err := vm.vm.PowerOn(vm.driver.ctx) - if err != nil { - return err - } - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { - netIP, err := vm.vm.WaitForNetIP(ctx, false) - if err != nil { - return "", err - } - - for _, ips := range netIP { - for _, ip := range ips { - parseIP := net.ParseIP(ip) - if ipNet != nil && !ipNet.Contains(parseIP) { - // ip address is not in range - continue - } - // default to an ipv4 addresses if no ipNet is defined - if ipNet == nil && parseIP.To4() == nil { - continue - } - return ip, nil - } - } - - // unable to find an IP - return "", nil -} - -func (vm *VirtualMachineDriver) PowerOff() error { - state, err := vm.vm.PowerState(vm.driver.ctx) - if err != nil { - return err - } - - if state == types.VirtualMachinePowerStatePoweredOff { - return nil - } - - task, err := vm.vm.PowerOff(vm.driver.ctx) - if err != nil { - return err - } - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) IsPoweredOff() (bool, error) { - state, err := vm.vm.PowerState(vm.driver.ctx) - if err != nil { - return false, err - } - - return state == types.VirtualMachinePowerStatePoweredOff, nil -} - -func (vm *VirtualMachineDriver) StartShutdown() error { - err := vm.vm.ShutdownGuest(vm.driver.ctx) - return err -} - -func (vm *VirtualMachineDriver) WaitForShutdown(ctx context.Context, timeout time.Duration) error { - shutdownTimer := time.After(timeout) - for { - off, err := vm.IsPoweredOff() - if err != nil { - return err - } - if off { - break - } - - select { - case <-shutdownTimer: - err := errors.New("Timeout while waiting for machine to shut down.") - return err - case <-ctx.Done(): - return nil - default: - time.Sleep(1 * time.Second) - } - } - return nil -} - -func (vm *VirtualMachineDriver) CreateSnapshot(name string) error { - task, err := vm.vm.CreateSnapshot(vm.driver.ctx, name, "", false, false) - if err != nil { - return err - } - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) ConvertToTemplate() error { - return vm.vm.MarkAsTemplate(vm.driver.ctx) -} - -func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error { - err := vm.driver.restClient.Login(vm.driver.ctx) - if err != nil { - return err - } - - l, err := vm.driver.FindContentLibraryByName(ovf.Target.LibraryID) - if err != nil { - return err - } - if l.library.Type != "LOCAL" { - return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ - "the content library must be of type LOCAL", ovf.Target.LibraryID, l.library.Type) - } - - item, err := vm.driver.FindContentLibraryItem(l.library.ID, ovf.Spec.Name) - if err == nil { - // Updates existing library item - ovf.Target.LibraryItemID = item.ID - } - - ovf.Target.LibraryID = l.library.ID - ovf.Source.Value = vm.vm.Reference().Value - ovf.Source.Type = "VirtualMachine" - - vcm := vcenter.NewManager(vm.driver.restClient.client) - _, err = vcm.CreateOVF(vm.driver.ctx, ovf) - if err != nil { - return err - } - - return vm.driver.restClient.Logout(vm.driver.ctx) -} - -func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template) error { - err := vm.driver.restClient.Login(vm.driver.ctx) - if err != nil { - return err - } - - l, err := vm.driver.FindContentLibraryByName(template.Library) - if err != nil { - return err - } - if l.library.Type != "LOCAL" { - return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ - "the content library must be of type LOCAL", template.Library, l.library.Type) - } - - template.Library = l.library.ID - template.SourceVM = vm.vm.Reference().Value - - if template.Placement.Cluster != "" { - c, err := vm.driver.FindCluster(template.Placement.Cluster) - if err != nil { - return err - } - template.Placement.Cluster = c.cluster.Reference().Value - } - if template.Placement.Folder != "" { - f, err := vm.driver.FindFolder(template.Placement.Folder) - if err != nil { - return err - } - template.Placement.Folder = f.folder.Reference().Value - } - if template.Placement.Host != "" { - h, err := vm.driver.FindHost(template.Placement.Host) - if err != nil { - return err - } - template.Placement.Host = h.host.Reference().Value - } - if template.Placement.ResourcePool != "" { - rp, err := vm.driver.FindResourcePool(template.Placement.Cluster, template.Placement.Host, template.Placement.ResourcePool) - if err != nil { - return err - } - template.Placement.ResourcePool = rp.pool.Reference().Value - } - - if template.VMHomeStorage != nil { - d, err := vm.driver.FindDatastore(template.VMHomeStorage.Datastore, template.Placement.Host) - if err != nil { - return err - } - template.VMHomeStorage.Datastore = d.Reference().Value - } - - vcm := vcenter.NewManager(vm.driver.restClient.client) - _, err = vcm.CreateTemplate(vm.driver.ctx, template) - if err != nil { - return err - } - - return vm.driver.restClient.Logout(vm.driver.ctx) -} - -func (vm *VirtualMachineDriver) GetDir() (string, error) { - vmInfo, err := vm.Info("name", "layoutEx.file") - if err != nil { - return "", err - } - - vmxName := fmt.Sprintf("/%s.vmx", vmInfo.Name) - for _, file := range vmInfo.LayoutEx.File { - if strings.Contains(file.Name, vmInfo.Name) { - return RemoveDatastorePrefix(file.Name[:len(file.Name)-len(vmxName)]), nil - } - } - return "", fmt.Errorf("cannot find '%s'", vmxName) -} - -func addNetwork(d *VCenterDriver, devices object.VirtualDeviceList, config *CreateConfig) (object.VirtualDeviceList, error) { - if len(config.NICs) == 0 { - return nil, errors.New("no network adapters have been defined") - } - - for _, nic := range config.NICs { - network, err := findNetwork(nic.Network, config.Host, d) - if err != nil { - return nil, err - } - - backing, err := network.EthernetCardBackingInfo(d.ctx) - if err != nil { - return nil, err - } - - device, err := object.EthernetCardTypes().CreateEthernetCard(nic.NetworkCard, backing) - if err != nil { - return nil, err - } - - card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - if nic.MacAddress != "" { - card.AddressType = string(types.VirtualEthernetCardMacTypeManual) - card.MacAddress = nic.MacAddress - } - card.UptCompatibilityEnabled = nic.Passthrough - - devices = append(devices, device) - } - return devices, nil -} - -func findNetwork(network string, host string, d *VCenterDriver) (object.NetworkReference, error) { - if network != "" { - var err error - networks, err := d.FindNetworks(network) - if err != nil { - return nil, err - } - if len(networks) == 1 { - return networks[0].network, nil - } - - // If there are multiple networks then try to match the host - if host != "" { - h, err := d.FindHost(host) - if err != nil { - return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s: %s", host, err.Error())} - } - for _, n := range networks { - info, err := n.Info("host") - if err != nil { - continue - } - for _, host := range info.Host { - if h.host.Reference().Value == host.Reference().Value { - return n.network, nil - } - } - } - return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s", host)} - } - - return nil, &MultipleNetworkFoundError{network, "please provide a host to match or the network full path"} - } - - if host != "" { - h, err := d.FindHost(host) - if err != nil { - return nil, err - } - - i, err := h.Info("network") - if err != nil { - return nil, err - } - - if len(i.Network) > 1 { - return nil, fmt.Errorf("Host has multiple networks. Specify it explicitly") - } - - return object.NewNetwork(d.client.Client, i.Network[0]), nil - } - - return nil, fmt.Errorf("Couldn't find network; 'host' and 'network' not specified. At least one of the two must be specified.") -} - -func newVGPUProfile(vGPUProfile string) types.VirtualPCIPassthrough { - return types.VirtualPCIPassthrough{ - VirtualDevice: types.VirtualDevice{ - DeviceInfo: &types.Description{ - Summary: "", - Label: fmt.Sprintf("New vGPU %v PCI device", vGPUProfile), - }, - Backing: &types.VirtualPCIPassthroughVmiopBackingInfo{ - Vgpu: vGPUProfile, - }, - }, - } -} - -func (vm *VirtualMachineDriver) AddCdrom(controllerType string, datastoreIsoPath string) error { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return err - } - - var controller *types.VirtualController - if controllerType == "sata" { - c, err := vm.FindSATAController() - if err != nil { - return err - } - controller = c.GetVirtualController() - } else { - c, err := devices.FindIDEController("") - if err != nil { - return err - } - controller = c.GetVirtualController() - } - - cdrom, err := vm.CreateCdrom(controller) - if err != nil { - return err - } - - if datastoreIsoPath != "" { - ds := &DatastoreIsoPath{path: datastoreIsoPath} - if !ds.Validate() { - return fmt.Errorf("%s is not a valid iso path", datastoreIsoPath) - } - if libPath, err := vm.driver.FindContentLibraryFileDatastorePath(ds.GetFilePath()); err == nil { - datastoreIsoPath = libPath - } else { - log.Printf("Using %s as the datastore path", datastoreIsoPath) - } - - devices.InsertIso(cdrom, datastoreIsoPath) - } - - log.Printf("Creating CD-ROM on controller '%v' with iso '%v'", controller, datastoreIsoPath) - return vm.addDevice(cdrom) -} - -func (vm *VirtualMachineDriver) AddFloppy(imgPath string) error { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return err - } - - floppy, err := devices.CreateFloppy() - if err != nil { - return err - } - - if imgPath != "" { - floppy = devices.InsertImg(floppy, imgPath) - } - - return vm.addDevice(floppy) -} - -func (vm *VirtualMachineDriver) SetBootOrder(order []string) error { - devices, err := vm.vm.Device(vm.driver.ctx) - if err != nil { - return err - } - - bootOptions := types.VirtualMachineBootOptions{ - BootOrder: devices.BootOrder(order), - } - - return vm.vm.SetBootOptions(vm.driver.ctx, &bootOptions) -} - -func (vm *VirtualMachineDriver) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { - return vm.vm.RemoveDevice(vm.driver.ctx, keepFiles, device...) -} - -func (vm *VirtualMachineDriver) addDevice(device types.BaseVirtualDevice) error { - newDevices := object.VirtualDeviceList{device} - confSpec := types.VirtualMachineConfigSpec{} - var err error - confSpec.DeviceChange, err = newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) - if err != nil { - return err - } - - task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) - if err != nil { - return err - } - - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err -} - -func (vm *VirtualMachineDriver) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { - var confSpec types.VirtualMachineConfigSpec - - var ov []types.BaseOptionValue - for k, v := range params { - o := types.OptionValue{ - Key: k, - Value: v, - } - ov = append(ov, &o) - } - confSpec.ExtraConfig = ov - - confSpec.Tools = info - - if len(confSpec.ExtraConfig) > 0 || confSpec.Tools != nil { - task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) - if err != nil { - return err - } - - _, err = task.WaitForResult(vm.driver.ctx, nil) - return err - } - - return nil -} - -func (vm *VirtualMachineDriver) Export() (*nfc.Lease, error) { - return vm.vm.Export(vm.driver.ctx) -} - -func (vm *VirtualMachineDriver) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { - return m.CreateDescriptor(vm.driver.ctx, vm.vm, cdp) -} - -func (vm *VirtualMachineDriver) NewOvfManager() *ovf.Manager { - return ovf.NewManager(vm.vm.Client()) -} - -func (vm *VirtualMachineDriver) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { - var mgr mo.OvfManager - err := property.DefaultCollector(vm.vm.Client()).RetrieveOne(vm.driver.ctx, m.Reference(), nil, &mgr) - if err != nil { - return nil, err - } - return mgr.OvfExportOption, nil -} - -func findNetworkAdapter(l object.VirtualDeviceList) (types.BaseVirtualEthernetCard, error) { - c := l.SelectByType((*types.VirtualEthernetCard)(nil)) - if len(c) == 0 { - return nil, errors.New("no network adapter device found") - } - - return c[0].(types.BaseVirtualEthernetCard), nil -} diff --git a/builder/vsphere/driver/vm_cdrom.go b/builder/vsphere/driver/vm_cdrom.go deleted file mode 100644 index 0eab0d196..000000000 --- a/builder/vsphere/driver/vm_cdrom.go +++ /dev/null @@ -1,89 +0,0 @@ -package driver - -import ( - "errors" - - "github.com/vmware/govmomi/vim25/types" -) - -var ( - ErrNoSataController = errors.New("no available SATA controller") -) - -func (vm *VirtualMachineDriver) AddSATAController() error { - sata := &types.VirtualAHCIController{} - return vm.addDevice(sata) -} - -func (vm *VirtualMachineDriver) FindSATAController() (*types.VirtualAHCIController, error) { - l, err := vm.Devices() - if err != nil { - return nil, err - } - - c := l.PickController((*types.VirtualAHCIController)(nil)) - if c == nil { - return nil, ErrNoSataController - } - - return c.(*types.VirtualAHCIController), nil -} - -func (vm *VirtualMachineDriver) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { - l, err := vm.Devices() - if err != nil { - return nil, err - } - - device := &types.VirtualCdrom{} - - l.AssignController(device, c) - - device.Backing = &types.VirtualCdromAtapiBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{}, - } - - device.Connectable = &types.VirtualDeviceConnectInfo{ - AllowGuestControl: true, - Connected: true, - StartConnected: true, - } - - return device, nil -} - -func (vm *VirtualMachineDriver) RemoveCdroms() error { - devices, err := vm.Devices() - if err != nil { - return err - } - cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) - if err = vm.RemoveDevice(true, cdroms...); err != nil { - return err - } - - sata := devices.SelectByType((*types.VirtualAHCIController)(nil)) - if err = vm.RemoveDevice(true, sata...); err != nil { - return err - } - return nil -} - -func (vm *VirtualMachineDriver) EjectCdroms() error { - devices, err := vm.Devices() - if err != nil { - return err - } - cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) - for _, cd := range cdroms { - c := cd.(*types.VirtualCdrom) - c.Backing = &types.VirtualCdromRemotePassthroughBackingInfo{} - c.Connectable = &types.VirtualDeviceConnectInfo{} - err := vm.vm.EditDevice(vm.driver.ctx, c) - if err != nil { - return err - } - } - - return nil -} diff --git a/builder/vsphere/driver/vm_cdrom_test.go b/builder/vsphere/driver/vm_cdrom_test.go deleted file mode 100644 index 8a7b86ba1..000000000 --- a/builder/vsphere/driver/vm_cdrom_test.go +++ /dev/null @@ -1,167 +0,0 @@ -package driver - -import ( - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/vmware/govmomi/vim25/types" -) - -func TestVirtualMachineDriver_FindAndAddSATAController(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - vm, _ := sim.ChooseSimulatorPreCreatedVM() - - _, err = vm.FindSATAController() - if err != nil && !strings.Contains(err.Error(), "no available SATA controller") { - t.Fatalf("unexpected error: %s", err.Error()) - } - if err == nil { - t.Fatalf("vm should not have sata controller") - } - - if err := vm.AddSATAController(); err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - - sc, err := vm.FindSATAController() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if sc == nil { - t.Fatalf("SATA controller wasn't added properly") - } -} - -func TestVirtualMachineDriver_CreateAndRemoveCdrom(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - vm, _ := sim.ChooseSimulatorPreCreatedVM() - - // Add SATA Controller - if err := vm.AddSATAController(); err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - - // Verify if controller was created - sc, err := vm.FindSATAController() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if sc == nil { - t.Fatalf("SATA controller wasn't added properly") - } - - // Create CDROM - controller := sc.GetVirtualController() - cdrom, err := vm.CreateCdrom(controller) - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if cdrom == nil { - t.Fatalf("CDrom wasn't created properly") - } - - // Verify if CDROM was created - devices, err := vm.Devices() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) - if len(cdroms) != 1 { - t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) - } - - // Remove CDROM - err = vm.RemoveCdroms() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - // Verify if CDROM was removed - devices, err = vm.Devices() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - cdroms = devices.SelectByType((*types.VirtualCdrom)(nil)) - if len(cdroms) != 0 { - t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) - } -} - -func TestVirtualMachineDriver_EjectCdrom(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - vm, _ := sim.ChooseSimulatorPreCreatedVM() - - // Add SATA Controller - if err := vm.AddSATAController(); err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - - // Verify if controller was created - sc, err := vm.FindSATAController() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if sc == nil { - t.Fatalf("SATA controller wasn't added properly") - } - - // Create CDROM - controller := sc.GetVirtualController() - cdrom, err := vm.CreateCdrom(controller) - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - if cdrom == nil { - t.Fatalf("CDrom wasn't created properly") - } - - // Verify if CDROM was created - devices, err := vm.Devices() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) - if len(cdroms) != 1 { - t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) - } - - // Remove CDROM - err = vm.EjectCdroms() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - // Verify if CDROM was removed - devices, err = vm.Devices() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - cdroms = devices.SelectByType((*types.VirtualCdrom)(nil)) - if len(cdroms) != 1 { - t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) - } - cd, ok := cdroms[0].(*types.VirtualCdrom) - if !ok { - t.Fatalf("Wrong cdrom type") - } - if diff := cmp.Diff(cd.Backing, &types.VirtualCdromRemotePassthroughBackingInfo{}); diff != "" { - t.Fatalf("Wrong cdrom backing info: %s", diff) - } - if diff := cmp.Diff(cd.Connectable, &types.VirtualDeviceConnectInfo{}); diff != "" { - t.Fatalf("Wrong cdrom connect info: %s", diff) - } -} diff --git a/builder/vsphere/driver/vm_clone_acc_test.go b/builder/vsphere/driver/vm_clone_acc_test.go deleted file mode 100644 index 98d37d6cf..000000000 --- a/builder/vsphere/driver/vm_clone_acc_test.go +++ /dev/null @@ -1,312 +0,0 @@ -package driver - -import ( - "context" - "log" - "net" - "testing" - "time" -) - -func TestVMAcc_clone(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - testCases := []struct { - name string - config *CloneConfig - checkFunction func(*testing.T, VirtualMachine, *CloneConfig) - }{ - {"Default", &CloneConfig{}, cloneDefaultCheck}, - {"LinkedClone", &CloneConfig{LinkedClone: true}, cloneLinkedCloneCheck}, - {"Folder", &CloneConfig{LinkedClone: true, Folder: "folder1/folder2"}, cloneFolderCheck}, - {"ResourcePool", &CloneConfig{LinkedClone: true, ResourcePool: "pool1/pool2"}, cloneResourcePoolCheck}, - {"Configure", &CloneConfig{LinkedClone: true}, configureCheck}, - {"Configure_RAMReserveAll", &CloneConfig{LinkedClone: true}, configureRAMReserveAllCheck}, - {"StartAndStop", &CloneConfig{LinkedClone: true}, startAndStopCheck}, - {"Template", &CloneConfig{LinkedClone: true}, templateCheck}, - {"Snapshot", &CloneConfig{}, snapshotCheck}, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - tc.config.Host = TestHostName - tc.config.Name = newVMName() - - templateName := "alpine" - d := newTestDriver(t) - - template, err := d.FindVM(templateName) // Don't destroy this VM! - if err != nil { - t.Fatalf("Cannot find template vm '%v': %v", templateName, err) - } - - log.Printf("[DEBUG] Clonning VM") - vm, err := template.Clone(context.TODO(), tc.config) - if err != nil { - t.Fatalf("Cannot clone vm '%v': %v", templateName, err) - } - - defer destroyVM(t, vm, tc.config.Name) - - log.Printf("[DEBUG] Running check function") - tc.checkFunction(t, vm, tc.config) - }) - } -} - -func cloneDefaultCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { - d := vm.(*VirtualMachineDriver).driver - - // Check that the clone can be found by its name - if _, err := d.FindVM(config.Name); err != nil { - t.Errorf("Cannot find created vm '%v': %v", config.Name, err) - } - - vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if vmInfo.Name != config.Name { - t.Errorf("Invalid VM name: expected '%v', got '%v'", config.Name, vmInfo.Name) - } - - f := d.NewFolder(vmInfo.Parent) - folderPath, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if folderPath != "" { - t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) - } - - h := d.NewHost(vmInfo.Runtime.Host) - hostInfo, err := h.Info("name") - if err != nil { - t.Fatal("Cannot read host properties: ", err) - } - if hostInfo.Name != TestHostName { - t.Errorf("Invalid host name: expected '%v', got '%v'", TestHostName, hostInfo.Name) - } - - p := d.NewResourcePool(vmInfo.ResourcePool) - poolPath, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if poolPath != "" { - t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) - } - - dsr := vmInfo.Datastore[0].Reference() - ds := d.NewDatastore(&dsr) - dsInfo, err := ds.Info("name") - if err != nil { - t.Fatal("Cannot read datastore properties: ", err) - } - if dsInfo.Name != "datastore1" { - t.Errorf("Invalid datastore name: expected '%v', got '%v'", "datastore1", dsInfo.Name) - } - - if len(vmInfo.LayoutEx.Disk[0].Chain) != 1 { - t.Error("Not a full clone") - } -} - -func configureCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { - log.Printf("[DEBUG] Configuring the vm") - hwConfig := &HardwareConfig{ - CPUs: 2, - CPUReservation: 1000, - CPULimit: 1500, - RAM: 2048, - RAMReservation: 1024, - MemoryHotAddEnabled: true, - CpuHotAddEnabled: true, - } - err := vm.Configure(hwConfig) - if err != nil { - t.Fatalf("Failed to configure VM: %v", err) - } - - log.Printf("[DEBUG] Running checks") - vmInfo, err := vm.Info("config") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - cpuSockets := vmInfo.Config.Hardware.NumCPU - if cpuSockets != hwConfig.CPUs { - t.Errorf("VM should have %v CPU sockets, got %v", hwConfig.CPUs, cpuSockets) - } - - cpuReservation := *vmInfo.Config.CpuAllocation.Reservation - if cpuReservation != hwConfig.CPUReservation { - t.Errorf("VM should have CPU reservation for %v Mhz, got %v", hwConfig.CPUReservation, cpuReservation) - } - - cpuLimit := *vmInfo.Config.CpuAllocation.Limit - if cpuLimit != hwConfig.CPULimit { - t.Errorf("VM should have CPU reservation for %v Mhz, got %v", hwConfig.CPULimit, cpuLimit) - } - - ram := vmInfo.Config.Hardware.MemoryMB - if int64(ram) != hwConfig.RAM { - t.Errorf("VM should have %v MB of RAM, got %v", hwConfig.RAM, ram) - } - - ramReservation := *vmInfo.Config.MemoryAllocation.Reservation - if ramReservation != hwConfig.RAMReservation { - t.Errorf("VM should have RAM reservation for %v MB, got %v", hwConfig.RAMReservation, ramReservation) - } - - cpuHotAdd := vmInfo.Config.CpuHotAddEnabled - if *cpuHotAdd != hwConfig.CpuHotAddEnabled { - t.Errorf("VM should have CPU hot add set to %v, got %v", hwConfig.CpuHotAddEnabled, cpuHotAdd) - } - - memoryHotAdd := vmInfo.Config.MemoryHotAddEnabled - if *memoryHotAdd != hwConfig.MemoryHotAddEnabled { - t.Errorf("VM should have Memroy hot add set to %v, got %v", hwConfig.MemoryHotAddEnabled, memoryHotAdd) - } -} - -func configureRAMReserveAllCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { - log.Printf("[DEBUG] Configuring the vm") - err := vm.Configure(&HardwareConfig{RAMReserveAll: true}) - if err != nil { - t.Fatalf("Failed to configure VM: %v", err) - } - - log.Printf("[DEBUG] Running checks") - vmInfo, err := vm.Info("config") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if *vmInfo.Config.MemoryReservationLockedToMax != true { - t.Errorf("VM should have all RAM reserved") - } -} - -func cloneLinkedCloneCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { - vmInfo, err := vm.Info("layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if len(vmInfo.LayoutEx.Disk[0].Chain) != 2 { - t.Error("Not a linked clone") - } -} - -func cloneFolderCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { - vmInfo, err := vm.Info("parent") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - f := vm.(*VirtualMachineDriver).driver.NewFolder(vmInfo.Parent) - path, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if path != config.Folder { - t.Errorf("Wrong folder. expected: %v, got: %v", config.Folder, path) - } -} - -func cloneResourcePoolCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { - vmInfo, err := vm.Info("resourcePool") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - p := vm.(*VirtualMachineDriver).driver.NewResourcePool(vmInfo.ResourcePool) - path, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if path != config.ResourcePool { - t.Errorf("Wrong folder. expected: %v, got: %v", config.ResourcePool, path) - } -} - -func startAndStopCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { - stopper := startVM(t, vm, config.Name) - defer stopper() - - switch ip, err := vm.WaitForIP(context.TODO(), nil); { - case err != nil: - t.Errorf("Cannot obtain IP address from created vm '%v': %v", config.Name, err) - case net.ParseIP(ip) == nil: - t.Errorf("'%v' is not a valid ip address", ip) - } - - err := vm.StartShutdown() - if err != nil { - t.Fatalf("Failed to initiate guest shutdown: %v", err) - } - log.Printf("[DEBUG] Waiting max 1m0s for shutdown to complete") - err = vm.WaitForShutdown(context.TODO(), 1*time.Minute) - if err != nil { - t.Fatalf("Failed to wait for giest shutdown: %v", err) - } -} - -func snapshotCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { - stopper := startVM(t, vm, config.Name) - defer stopper() - - err := vm.CreateSnapshot("test-snapshot") - if err != nil { - t.Fatalf("Failed to create snapshot: %v", err) - } - - vmInfo, err := vm.Info("layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - layers := len(vmInfo.LayoutEx.Disk[0].Chain) - if layers != 2 { - t.Errorf("VM should have a single snapshot. expected 2 disk layers, got %v", layers) - } -} - -func templateCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { - err := vm.ConvertToTemplate() - if err != nil { - t.Fatalf("Failed to convert to template: %v", err) - } - vmInfo, err := vm.Info("config.template") - if err != nil { - t.Errorf("Cannot read VM properties: %v", err) - } else if !vmInfo.Config.Template { - t.Error("Not a template") - } -} - -func startVM(t *testing.T, vm VirtualMachine, vmName string) (stopper func()) { - log.Printf("[DEBUG] Starting the vm") - if err := vm.PowerOn(); err != nil { - t.Fatalf("Cannot start vm '%v': %v", vmName, err) - } - return func() { - log.Printf("[DEBUG] Powering off the vm") - if err := vm.PowerOff(); err != nil { - t.Errorf("Cannot power off started vm '%v': %v", vmName, err) - } - } -} - -func destroyVM(t *testing.T, vm VirtualMachine, vmName string) { - log.Printf("[DEBUG] Deleting the VM") - if err := vm.Destroy(); err != nil { - t.Errorf("!!! ERROR DELETING VM '%v': %v!!!", vmName, err) - } - - // Check that the clone is no longer exists - if _, err := vm.(*VirtualMachineDriver).driver.FindVM(vmName); err == nil { - t.Errorf("!!! STILL CAN FIND VM '%v'. IT MIGHT NOT HAVE BEEN DELETED !!!", vmName) - } -} diff --git a/builder/vsphere/driver/vm_create_acc_test.go b/builder/vsphere/driver/vm_create_acc_test.go deleted file mode 100644 index c2c2d833f..000000000 --- a/builder/vsphere/driver/vm_create_acc_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package driver - -import ( - "log" - "testing" -) - -func TestVMAcc_create(t *testing.T) { - t.Skip("Acceptance tests not configured yet.") - testCases := []struct { - name string - config *CreateConfig - checkFunction func(*testing.T, VirtualMachine, *CreateConfig) - }{ - {"MinimalConfiguration", &CreateConfig{}, createDefaultCheck}, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - tc.config.Host = TestHostName - tc.config.Name = newVMName() - - d := newTestDriver(t) - - log.Printf("[DEBUG] Creating VM") - vm, err := d.CreateVM(tc.config) - if err != nil { - t.Fatalf("Cannot create VM: %v", err) - } - - defer destroyVM(t, vm, tc.config.Name) - - log.Printf("[DEBUG] Running check function") - tc.checkFunction(t, vm, tc.config) - }) - } -} - -func createDefaultCheck(t *testing.T, vm VirtualMachine, config *CreateConfig) { - d := vm.(*VirtualMachineDriver).driver - - // Check that the clone can be found by its name - if _, err := d.FindVM(config.Name); err != nil { - t.Errorf("Cannot find created vm '%v': %v", config.Name, err) - } - - vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if vmInfo.Name != config.Name { - t.Errorf("Invalid VM name: expected '%v', got '%v'", config.Name, vmInfo.Name) - } - - f := d.NewFolder(vmInfo.Parent) - folderPath, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if folderPath != "" { - t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) - } - - h := d.NewHost(vmInfo.Runtime.Host) - hostInfo, err := h.Info("name") - if err != nil { - t.Fatal("Cannot read host properties: ", err) - } - if hostInfo.Name != TestHostName { - t.Errorf("Invalid host name: expected '%v', got '%v'", TestHostName, hostInfo.Name) - } - - p := d.NewResourcePool(vmInfo.ResourcePool) - poolPath, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if poolPath != "" { - t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) - } - - dsr := vmInfo.Datastore[0].Reference() - ds := d.NewDatastore(&dsr) - dsInfo, err := ds.Info("name") - if err != nil { - t.Fatal("Cannot read datastore properties: ", err) - } - if dsInfo.Name != "datastore1" { - t.Errorf("Invalid datastore name: expected 'datastore1', got '%v'", dsInfo.Name) - } -} diff --git a/builder/vsphere/driver/vm_keyboard.go b/builder/vsphere/driver/vm_keyboard.go deleted file mode 100644 index d50e66e07..000000000 --- a/builder/vsphere/driver/vm_keyboard.go +++ /dev/null @@ -1,39 +0,0 @@ -package driver - -import ( - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/mobile/event/key" -) - -type KeyInput struct { - Scancode key.Code - Alt bool - Ctrl bool - Shift bool -} - -func (vm *VirtualMachineDriver) TypeOnKeyboard(input KeyInput) (int32, error) { - var spec types.UsbScanCodeSpec - - spec.KeyEvents = append(spec.KeyEvents, types.UsbScanCodeSpecKeyEvent{ - UsbHidCode: int32(input.Scancode)<<16 | 7, - Modifiers: &types.UsbScanCodeSpecModifierType{ - LeftControl: &input.Ctrl, - LeftAlt: &input.Alt, - LeftShift: &input.Shift, - }, - }) - - req := &types.PutUsbScanCodes{ - This: vm.vm.Reference(), - Spec: spec, - } - - resp, err := methods.PutUsbScanCodes(vm.driver.ctx, vm.driver.client.RoundTripper, req) - if err != nil { - return 0, err - } - - return resp.Returnval, nil -} diff --git a/builder/vsphere/driver/vm_mock.go b/builder/vsphere/driver/vm_mock.go deleted file mode 100644 index daf62b3c9..000000000 --- a/builder/vsphere/driver/vm_mock.go +++ /dev/null @@ -1,235 +0,0 @@ -package driver - -import ( - "context" - "net" - "time" - - "github.com/vmware/govmomi/nfc" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/ovf" - "github.com/vmware/govmomi/vapi/vcenter" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type VirtualMachineMock struct { - DestroyError error - DestroyCalled bool - - ConfigureError error - ConfigureCalled bool - ConfigureHardwareConfig *HardwareConfig - - FindSATAControllerCalled bool - FindSATAControllerErr error - - AddSATAControllerCalled bool - AddSATAControllerErr error - - AddCdromCalled bool - AddCdromCalledTimes int - AddCdromErr error - AddCdromTypes []string - AddCdromPaths []string - - GetDirCalled bool - GetDirResponse string - GetDirErr error - - AddFloppyCalled bool - AddFloppyImagePath string - AddFloppyErr error - - FloppyDevicesErr error - FloppyDevicesReturn object.VirtualDeviceList - FloppyDevicesCalled bool - - RemoveDeviceErr error - RemoveDeviceCalled bool - RemoveDeviceKeepFiles bool - RemoveDeviceDevices []types.BaseVirtualDevice - - EjectCdromsCalled bool - EjectCdromsErr error - - RemoveCdromsCalled bool - RemoveCdromsErr error - CloneCalled bool - CloneConfig *CloneConfig - CloneError error -} - -func (vm *VirtualMachineMock) Info(params ...string) (*mo.VirtualMachine, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) Devices() (object.VirtualDeviceList, error) { - return object.VirtualDeviceList{}, nil -} - -func (vm *VirtualMachineMock) FloppyDevices() (object.VirtualDeviceList, error) { - vm.FloppyDevicesCalled = true - return vm.FloppyDevicesReturn, vm.FloppyDevicesErr -} - -func (vm *VirtualMachineMock) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { - vm.CloneCalled = true - vm.CloneConfig = config - return vm, vm.CloneError -} - -func (vm *VirtualMachineMock) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) AddPublicKeys(ctx context.Context, publicKeys string) error { - return nil -} - -func (vm *VirtualMachineMock) Properties(ctx context.Context) (*mo.VirtualMachine, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) Destroy() error { - vm.DestroyCalled = true - if vm.DestroyError != nil { - return vm.DestroyError - } - return nil -} - -func (vm *VirtualMachineMock) Configure(config *HardwareConfig) error { - vm.ConfigureCalled = true - vm.ConfigureHardwareConfig = config - if vm.ConfigureError != nil { - return vm.ConfigureError - } - return nil -} - -func (vm *VirtualMachineMock) Customize(spec types.CustomizationSpec) error { - return nil -} - -func (vm *VirtualMachineMock) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) PowerOn() error { - return nil -} - -func (vm *VirtualMachineMock) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { - return "", nil -} - -func (vm *VirtualMachineMock) PowerOff() error { - return nil -} - -func (vm *VirtualMachineMock) IsPoweredOff() (bool, error) { - return false, nil -} - -func (vm *VirtualMachineMock) StartShutdown() error { - return nil -} - -func (vm *VirtualMachineMock) WaitForShutdown(ctx context.Context, timeout time.Duration) error { - return nil -} - -func (vm *VirtualMachineMock) CreateSnapshot(name string) error { - return nil -} - -func (vm *VirtualMachineMock) ConvertToTemplate() error { - return nil -} - -func (vm *VirtualMachineMock) ImportOvfToContentLibrary(ovf vcenter.OVF) error { - return nil -} - -func (vm *VirtualMachineMock) ImportToContentLibrary(template vcenter.Template) error { - return nil -} - -func (vm *VirtualMachineMock) GetDir() (string, error) { - vm.GetDirCalled = true - return vm.GetDirResponse, vm.GetDirErr -} - -func (vm *VirtualMachineMock) AddCdrom(cdromType string, isoPath string) error { - vm.AddCdromCalledTimes++ - vm.AddCdromCalled = true - vm.AddCdromTypes = append(vm.AddCdromTypes, cdromType) - vm.AddCdromPaths = append(vm.AddCdromPaths, isoPath) - return vm.AddCdromErr -} - -func (vm *VirtualMachineMock) AddFloppy(imgPath string) error { - vm.AddFloppyCalled = true - vm.AddFloppyImagePath = imgPath - return vm.AddFloppyErr -} - -func (vm *VirtualMachineMock) SetBootOrder(order []string) error { - return nil -} - -func (vm *VirtualMachineMock) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { - vm.RemoveDeviceCalled = true - vm.RemoveDeviceKeepFiles = keepFiles - vm.RemoveDeviceDevices = device - return vm.RemoveDeviceErr -} - -func (vm *VirtualMachineMock) addDevice(device types.BaseVirtualDevice) error { - return nil -} - -func (vm *VirtualMachineMock) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { - return nil -} - -func (vm *VirtualMachineMock) Export() (*nfc.Lease, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) NewOvfManager() *ovf.Manager { - return nil -} - -func (vm *VirtualMachineMock) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) AddSATAController() error { - vm.AddSATAControllerCalled = true - return vm.AddSATAControllerErr -} - -func (vm *VirtualMachineMock) FindSATAController() (*types.VirtualAHCIController, error) { - vm.FindSATAControllerCalled = true - return nil, vm.FindSATAControllerErr -} - -func (vm *VirtualMachineMock) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { - return nil, nil -} - -func (vm *VirtualMachineMock) RemoveCdroms() error { - vm.RemoveCdromsCalled = true - return vm.RemoveCdromsErr -} - -func (vm *VirtualMachineMock) EjectCdroms() error { - vm.EjectCdromsCalled = true - return vm.EjectCdromsErr -} diff --git a/builder/vsphere/driver/vm_test.go b/builder/vsphere/driver/vm_test.go deleted file mode 100644 index 186538974..000000000 --- a/builder/vsphere/driver/vm_test.go +++ /dev/null @@ -1,187 +0,0 @@ -package driver - -import ( - "context" - "testing" - - "github.com/vmware/govmomi/simulator" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -// ReconfigureFail changes the behavior of simulator.VirtualMachine -type ReconfigureFail struct { - *simulator.VirtualMachine -} - -// Override simulator.VirtualMachine.ReconfigVMTask to inject faults -func (vm *ReconfigureFail) ReconfigVMTask(req *types.ReconfigVM_Task) soap.HasFault { - task := simulator.CreateTask(req.This, "reconfigure", func(*simulator.Task) (types.AnyType, types.BaseMethodFault) { - return nil, &types.TaskInProgress{} - }) - - return &methods.ReconfigVM_TaskBody{ - Res: &types.ReconfigVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func TestVirtualMachineDriver_Configure(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - vm, machine := sim.ChooseSimulatorPreCreatedVM() - - // Happy test - hardwareConfig := &HardwareConfig{ - CPUs: 1, - CpuCores: 1, - CPUReservation: 2500, - CPULimit: 1, - RAM: 1024, - RAMReserveAll: true, - VideoRAM: 512, - VGPUProfile: "grid_m10-8q", - Firmware: "efi-secure", - ForceBIOSSetup: true, - } - if err = vm.Configure(hardwareConfig); err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - - //Fail test - //Wrap the existing vm object with the mocked reconfigure task which will return a fault - simulator.Map.Put(&ReconfigureFail{machine}) - if err = vm.Configure(&HardwareConfig{}); err == nil { - t.Fatalf("Configure should fail") - } -} - -func TestVirtualMachineDriver_CreateVMWithMultipleDisks(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - _, datastore := sim.ChooseSimulatorPreCreatedDatastore() - - config := &CreateConfig{ - Name: "mock name", - Host: "DC0_H0", - Datastore: datastore.Name, - NICs: []NIC{ - { - Network: "VM Network", - NetworkCard: "vmxnet3", - }, - }, - StorageConfig: StorageConfig{ - DiskControllerType: []string{"pvscsi"}, - Storage: []Disk{ - { - DiskSize: 3072, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - { - DiskSize: 20480, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - }, - }, - } - - vm, err := sim.driver.CreateVM(config) - if err != nil { - t.Fatalf("unexpected error %s", err.Error()) - } - - devices, err := vm.Devices() - if err != nil { - t.Fatalf("unexpected error %s", err.Error()) - } - - var disks []*types.VirtualDisk - for _, device := range devices { - switch d := device.(type) { - case *types.VirtualDisk: - disks = append(disks, d) - } - } - - if len(disks) != 2 { - t.Fatalf("unexpected number of devices") - } -} - -func TestVirtualMachineDriver_CloneWithPrimaryDiskResize(t *testing.T) { - sim, err := NewVCenterSimulator() - if err != nil { - t.Fatalf("should not fail: %s", err.Error()) - } - defer sim.Close() - - _, datastore := sim.ChooseSimulatorPreCreatedDatastore() - vm, _ := sim.ChooseSimulatorPreCreatedVM() - - config := &CloneConfig{ - Name: "mock name", - Host: "DC0_H0", - Datastore: datastore.Name, - PrimaryDiskSize: 204800, - StorageConfig: StorageConfig{ - DiskControllerType: []string{"pvscsi"}, - Storage: []Disk{ - { - DiskSize: 3072, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - { - DiskSize: 20480, - DiskThinProvisioned: true, - ControllerIndex: 0, - }, - }, - }, - } - - clonedVM, err := vm.Clone(context.TODO(), config) - if err != nil { - t.Fatalf("unexpected error %s", err.Error()) - } - - devices, err := clonedVM.Devices() - if err != nil { - t.Fatalf("unexpected error %s", err.Error()) - } - - var disks []*types.VirtualDisk - for _, device := range devices { - switch d := device.(type) { - case *types.VirtualDisk: - disks = append(disks, d) - } - } - - if len(disks) != 3 { - t.Fatalf("unexpected number of devices") - } - - if disks[0].CapacityInKB != config.PrimaryDiskSize*1024 { - t.Fatalf("unexpected disk size for primary disk: %d", disks[0].CapacityInKB) - } - if disks[1].CapacityInKB != config.StorageConfig.Storage[0].DiskSize*1024 { - t.Fatalf("unexpected disk size for primary disk: %d", disks[1].CapacityInKB) - } - if disks[2].CapacityInKB != config.StorageConfig.Storage[1].DiskSize*1024 { - t.Fatalf("unexpected disk size for primary disk: %d", disks[2].CapacityInKB) - } -} diff --git a/builder/vsphere/examples/alpine/alpine-3.8.json b/builder/vsphere/examples/alpine/alpine-3.8.json deleted file mode 100644 index f16895dcc..000000000 --- a/builder/vsphere/examples/alpine/alpine-3.8.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "builders": [ - { - "type": "vsphere-iso", - "CPUs": 1, - "RAM": 512, - "RAM_reserve_all": true, - "boot_command": [ - "root", - "mount -t vfat /dev/fd0 /media/floppy", - "setup-alpine -f /media/floppy/answerfile", - "", - "jetbrains", - "jetbrains", - "", - "y", - "", - "reboot", - "", - "root", - "jetbrains", - "mount -t vfat /dev/fd0 /media/floppy", - "/media/floppy/SETUP.SH" - ], - "boot_wait": "15s", - "disk_controller_type": "pvscsi", - "floppy_files": [ - "{{template_dir}}/answerfile", - "{{template_dir}}/setup.sh" - ], - "guest_os_type": "other3xLinux64Guest", - "host": "esxi-1.vsphere65.test", - "insecure_connection": true, - "iso_paths": [ - "[datastore1] ISO/alpine-standard-3.8.2-x86_64.iso" - ], - "network_adapters": [ - { - "network_card": "vmxnet3" - } - ], - "password": "jetbrains", - "ssh_password": "jetbrains", - "ssh_username": "root", - "storage": [ - { - "disk_size": 1024, - "disk_thin_provisioned": true - } - ], - "username": "root", - "vcenter_server": "vcenter.vsphere65.test", - "vm_name": "alpine-{{timestamp}}" - } - ], - "provisioners": [ - { - "inline": [ - "ls /" - ], - "type": "shell" - } - ] -} \ No newline at end of file diff --git a/builder/vsphere/examples/alpine/alpine-3.8.pkr.hcl b/builder/vsphere/examples/alpine/alpine-3.8.pkr.hcl deleted file mode 100644 index a4879333b..000000000 --- a/builder/vsphere/examples/alpine/alpine-3.8.pkr.hcl +++ /dev/null @@ -1,44 +0,0 @@ -# "timestamp" template function replacement -locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } - -# source blocks are analogous to the "builders" in json templates. They are used -# in build blocks. A build block runs provisioners and post-processors on a -# source. Read the documentation for source blocks here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/source -source "vsphere-iso" "autogenerated_1" { - CPUs = 1 - RAM = 512 - RAM_reserve_all = true - boot_command = ["root", "mount -t vfat /dev/fd0 /media/floppy", "setup-alpine -f /media/floppy/answerfile", "", "jetbrains", "jetbrains", "", "y", "", "reboot", "", "root", "jetbrains", "mount -t vfat /dev/fd0 /media/floppy", "/media/floppy/SETUP.SH"] - boot_wait = "15s" - disk_controller_type = ["pvscsi"] - floppy_files = ["${path.root}/answerfile", "${path.root}/setup.sh"] - guest_os_type = "other3xLinux64Guest" - host = "esxi-1.vsphere65.test" - insecure_connection = true - iso_paths = ["[datastore1] ISO/alpine-standard-3.8.2-x86_64.iso"] - network_adapters { - network_card = "vmxnet3" - } - password = "jetbrains" - ssh_password = "jetbrains" - ssh_username = "root" - storage { - disk_size = 1024 - disk_thin_provisioned = true - } - username = "root" - vcenter_server = "vcenter.vsphere65.test" - vm_name = "alpine-${local.timestamp}" -} - -# a build block invokes sources and runs provisioning steps on them. The -# documentation for build blocks can be found here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/build -build { - sources = ["source.vsphere-iso.autogenerated_1"] - - provisioner "shell" { - inline = ["ls /"] - } -} diff --git a/builder/vsphere/examples/alpine/answerfile b/builder/vsphere/examples/alpine/answerfile deleted file mode 100644 index e278b737b..000000000 --- a/builder/vsphere/examples/alpine/answerfile +++ /dev/null @@ -1,15 +0,0 @@ -KEYMAPOPTS="us us" -HOSTNAMEOPTS="-n alpine" -INTERFACESOPTS="auto lo -iface lo inet loopback - -auto eth0 -iface eth0 inet dhcp - hostname alpine -" -TIMEZONEOPTS="-z UTC" -PROXYOPTS="none" -APKREPOSOPTS="http://mirror.yandex.ru/mirrors/alpine/v3.8/main" -SSHDOPTS="-c openssh" -NTPOPTS="-c none" -DISKOPTS="-m sys /dev/sda" diff --git a/builder/vsphere/examples/alpine/setup.sh b/builder/vsphere/examples/alpine/setup.sh deleted file mode 100644 index de9b9179a..000000000 --- a/builder/vsphere/examples/alpine/setup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -set -ex - -apk add libressl -apk add open-vm-tools -rc-update add open-vm-tools -/etc/init.d/open-vm-tools start - -cat >/usr/local/bin/shutdown <", - "ut", - "/Volumes/setup/setup.sh" - ], - "boot_wait": "4m", - "cdrom_type": "sata", - "configuration_parameters": { - "ich7m.present": "TRUE", - "smc.present": "TRUE" - }, - "guest_os_type": "darwin16_64Guest", - "host": "esxi-mac.vsphere65.test", - "insecure_connection": "true", - "iso_checksum": "file:///{{template_dir}}/setup/out/sha256sums", - "iso_paths": [ - "[datastore-mac] ISO/macOS 10.13.3.iso", - "[datastore-mac] ISO/VMware Tools/10.2.0/darwin.iso" - ], - "iso_urls": [ - "{{template_dir}}/setup/out/setup.iso" - ], - "network_adapters": [ - { - "network_card": "e1000e" - } - ], - "password": "jetbrains", - "ssh_password": "jetbrains", - "ssh_username": "jetbrains", - "storage": [ - { - "disk_size": 32768, - "disk_thin_provisioned": true - } - ], - "usb_controller": true, - "username": "root", - "vcenter_server": "vcenter.vsphere65.test", - "vm_name": "macos-packer" - } - ] -} \ No newline at end of file diff --git a/builder/vsphere/examples/macos/macos-10.13.pkr.hcl b/builder/vsphere/examples/macos/macos-10.13.pkr.hcl deleted file mode 100644 index 544d37f12..000000000 --- a/builder/vsphere/examples/macos/macos-10.13.pkr.hcl +++ /dev/null @@ -1,43 +0,0 @@ -# source blocks are analogous to the "builders" in json templates. They are used -# in build blocks. A build block runs provisioners and post-processors on a -# source. Read the documentation for source blocks here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/source -source "vsphere-iso" "example_osx" { - CPUs = 1 - RAM = 4096 - boot_command = ["", "ut", "/Volumes/setup/setup.sh"] - boot_wait = "4m" - cdrom_type = "sata" - configuration_parameters = { - "ich7m.present" = "TRUE" - "smc.present" = "TRUE" - } - guest_os_type = "darwin16_64Guest" - host = "esxi-mac.vsphere65.test" - insecure_connection = "true" - iso_checksum = "file:///${path.root}/setup/out/sha256sums" - iso_paths = ["[datastore-mac] ISO/macOS 10.13.3.iso", "[datastore-mac] ISO/VMware Tools/10.2.0/darwin.iso"] - iso_urls = ["${path.root}/setup/out/setup.iso"] - network_adapters { - network_card = "e1000e" - } - password = "jetbrains" - ssh_password = "jetbrains" - ssh_username = "jetbrains" - storage { - disk_size = 32768 - disk_thin_provisioned = true - } - usb_controller = ["usb"] - username = "root" - vcenter_server = "vcenter.vsphere65.test" - vm_name = "macos-packer" -} - -# a build block invokes sources and runs provisioning steps on them. The -# documentation for build blocks can be found here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/build -build { - sources = ["source.vsphere-iso.example_osx"] - -} diff --git a/builder/vsphere/examples/macos/setup/.gitignore b/builder/vsphere/examples/macos/setup/.gitignore deleted file mode 100644 index 89f9ac04a..000000000 --- a/builder/vsphere/examples/macos/setup/.gitignore +++ /dev/null @@ -1 +0,0 @@ -out/ diff --git a/builder/vsphere/examples/macos/setup/iso-macos.sh b/builder/vsphere/examples/macos/setup/iso-macos.sh deleted file mode 100644 index fa24728f4..000000000 --- a/builder/vsphere/examples/macos/setup/iso-macos.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -eux - -# Based on -# https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b#gistcomment-2304505 - -mkdir -p out - -hdiutil create -o out/HighSierra.cdr -size 5530m -layout SPUD -fs HFS+J -hdiutil attach out/HighSierra.cdr.dmg -noverify -mountpoint /Volumes/install_build -sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction -hdiutil detach /Volumes/Install\ macOS\ High\ Sierra -hdiutil convert out/HighSierra.cdr.dmg -format UDTO -o out/HighSierra.iso -mv out/HighSierra.iso.cdr out/HighSierra.iso -rm out/HighSierra.cdr.dmg diff --git a/builder/vsphere/examples/macos/setup/iso-setup.sh b/builder/vsphere/examples/macos/setup/iso-setup.sh deleted file mode 100644 index 116b9259b..000000000 --- a/builder/vsphere/examples/macos/setup/iso-setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -set -eux - -mkdir -p out/pkgroot -rm -rf /out/pkgroot/* - -mkdir -p out/scripts -rm -rf /out/scripts/* -cp postinstall out/scripts/ - -pkgbuild \ - --identifier io.packer.install \ - --root out/pkgroot \ - --scripts out/scripts \ - out/postinstall.pkg - -mkdir -p out/iso -rm -rf out/iso/* -cp setup.sh out/iso/ -chmod +x out/iso/setup.sh - -productbuild --package out/postinstall.pkg out/iso/postinstall.pkg - -rm -f out/setup.iso -hdiutil makehybrid -iso -joliet -default-volume-name setup -o out/setup.iso out/iso -cd out -shasum -a 256 setup.iso >sha256sums diff --git a/builder/vsphere/examples/macos/setup/postinstall b/builder/vsphere/examples/macos/setup/postinstall deleted file mode 100644 index d9c8c8562..000000000 --- a/builder/vsphere/examples/macos/setup/postinstall +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -eux -# debug output in /var/log/install.log - -# Create user account -USERNAME=jetbrains -PASSWORD=jetbrains -dscl . -create "/Users/${USERNAME}" -dscl . -create "/Users/${USERNAME}" UserShell /bin/bash -dscl . -create "/Users/${USERNAME}" RealName "${USERNAME}" -dscl . -create "/Users/${USERNAME}" UniqueID 510 -dscl . -create "/Users/${USERNAME}" PrimaryGroupID 20 -dscl . -create "/Users/${USERNAME}" NFSHomeDirectory "/Users/${USERNAME}" -dscl . -passwd "/Users/${USERNAME}" "${PASSWORD}" -dscl . -append /Groups/admin GroupMembership "${USERNAME}" -createhomedir -c - -# Start VMware Tools daemon explicitly -launchctl load /Library/LaunchDaemons/com.vmware.launchd.tools.plist - -# Enable SSH -systemsetup -setremotelogin on - -# Disable the welcome screen -touch "$3/private/var/db/.AppleSetupDone" diff --git a/builder/vsphere/examples/macos/setup/setup.sh b/builder/vsphere/examples/macos/setup/setup.sh deleted file mode 100644 index 9fb49a9f5..000000000 --- a/builder/vsphere/examples/macos/setup/setup.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -eux - -# Format partition -diskutil eraseDisk JHFS+ Disk disk0 - -# Packages are installed in reversed order - why? -"/Volumes/Image Volume/Install macOS High Sierra.app/Contents/Resources/startosinstall" \ - --volume /Volumes/Disk \ - --converttoapfs no \ - --agreetolicense \ - --installpackage "/Volumes/setup/postinstall.pkg" \ - --installpackage "/Volumes/VMware Tools/Install VMware Tools.app/Contents/Resources/VMware Tools.pkg" diff --git a/builder/vsphere/examples/ubuntu/preseed.cfg b/builder/vsphere/examples/ubuntu/preseed.cfg deleted file mode 100644 index ec963b6b2..000000000 --- a/builder/vsphere/examples/ubuntu/preseed.cfg +++ /dev/null @@ -1,16 +0,0 @@ -d-i passwd/user-fullname string jetbrains -d-i passwd/username string jetbrains -d-i passwd/user-password password jetbrains -d-i passwd/user-password-again password jetbrains -d-i user-setup/allow-password-weak boolean true - -d-i partman-auto/disk string /dev/sda -d-i partman-auto/method string regular -d-i partman-partitioning/confirm_write_new_label boolean true -d-i partman/choose_partition select finish -d-i partman/confirm boolean true -d-i partman/confirm_nooverwrite boolean true - -d-i pkgsel/include string open-vm-tools openssh-server - -d-i finish-install/reboot_in_progress note diff --git a/builder/vsphere/examples/ubuntu/ubuntu-16.04.json b/builder/vsphere/examples/ubuntu/ubuntu-16.04.json deleted file mode 100644 index f5c87b2c5..000000000 --- a/builder/vsphere/examples/ubuntu/ubuntu-16.04.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "builders": [ - { - "type": "vsphere-iso", - "CPUs": 1, - "RAM": 1024, - "RAM_reserve_all": true, - "boot_command": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "/install/vmlinuz", - " initrd=/install/initrd.gz", - " priority=critical", - " locale=en_US", - " file=/media/preseed.cfg", - "" - ], - "disk_controller_type": "pvscsi", - "floppy_files": [ - "{{template_dir}}/preseed.cfg" - ], - "guest_os_type": "ubuntu64Guest", - "host": "esxi-1.vsphere65.test", - "insecure_connection": true, - "iso_paths": [ - "[datastore1] ISO/ubuntu-16.04.3-server-amd64.iso" - ], - "network_adapters": [ - { - "network_card": "vmxnet3" - } - ], - "password": "jetbrains", - "ssh_password": "jetbrains", - "ssh_username": "jetbrains", - "storage": [ - { - "disk_size": 32768, - "disk_thin_provisioned": true - } - ], - "username": "root", - "vcenter_server": "vcenter.vsphere65.test", - "vm_name": "example-ubuntu" - } - ], - "provisioners": [ - { - "inline": [ - "ls /" - ], - "type": "shell" - } - ] -} \ No newline at end of file diff --git a/builder/vsphere/examples/ubuntu/ubuntu-16.04.pkr.hcl b/builder/vsphere/examples/ubuntu/ubuntu-16.04.pkr.hcl deleted file mode 100644 index 9901293b6..000000000 --- a/builder/vsphere/examples/ubuntu/ubuntu-16.04.pkr.hcl +++ /dev/null @@ -1,52 +0,0 @@ -# source blocks are analogous to the "builders" in json templates. They are used -# in build blocks. A build block runs provisioners and post-processors on a -# source. Read the documentation for source blocks here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/source -source "vsphere-iso" "example" { - CPUs = 1 - RAM = 1024 - RAM_reserve_all = true - boot_command = ["", - "", - "", - "", - "", - "", - "", - "", - "", - "", "/install/vmlinuz", - " initrd=/install/initrd.gz", " priority=critical", - " locale=en_US", " file=/media/preseed.cfg", - ""] - disk_controller_type = ["pvscsi"] - floppy_files = ["${path.root}/preseed.cfg"] - guest_os_type = "ubuntu64Guest" - host = "esxi-1.vsphere65.test" - insecure_connection = true - iso_paths = ["[datastore1] ISO/ubuntu-16.04.3-server-amd64.iso"] - network_adapters { - network_card = "vmxnet3" - } - password = "jetbrains" - ssh_password = "jetbrains" - ssh_username = "jetbrains" - storage { - disk_size = 32768 - disk_thin_provisioned = true - } - username = "root" - vcenter_server = "vcenter.vsphere65.test" - vm_name = "example-ubuntu" -} - -# a build block invokes sources and runs provisioning steps on them. The -# documentation for build blocks can be found here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/build -build { - sources = ["source.vsphere-iso.example"] - - provisioner "shell" { - inline = ["ls /"] - } -} diff --git a/builder/vsphere/examples/windows/.gitattributes b/builder/vsphere/examples/windows/.gitattributes deleted file mode 100644 index da5ccf8df..000000000 --- a/builder/vsphere/examples/windows/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.cmd text eol=crlf -*.ps1 text eol=crlf diff --git a/builder/vsphere/examples/windows/setup/Autounattend.xml b/builder/vsphere/examples/windows/setup/Autounattend.xml deleted file mode 100644 index 9c3d30416..000000000 --- a/builder/vsphere/examples/windows/setup/Autounattend.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - en-US - - - - - - - B:\ - - - - - - - true - - - - - - - - - /IMAGE/NAME - Windows 10 Pro - - - true - - - - - - 0 - - - 1 - true - Primary - - - - - - - - - - - false - - - - - - - - 1 - - a:\vmtools.cmd - Always - - - - - - - - en-US - - - - - - 3 - - - - - - - - jetbrains - - jetbrains - true</PlainText> - </Password> - <Group>Administrators</Group> - </LocalAccount> - </LocalAccounts> - </UserAccounts> - - <AutoLogon> - <Enabled>true</Enabled> - <Username>jetbrains</Username> - <Password> - <Value>jetbrains</Value> - <PlainText>true</PlainText> - </Password> - <LogonCount>1</LogonCount> - </AutoLogon> - <FirstLogonCommands> - <SynchronousCommand wcm:action="add"> - <Order>1</Order> - <!-- Enable WinRM service --> - <CommandLine>powershell -ExecutionPolicy Bypass -File a:\setup.ps1</CommandLine> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - </FirstLogonCommands> - </component> - </settings> -</unattend> diff --git a/builder/vsphere/examples/windows/setup/setup.ps1 b/builder/vsphere/examples/windows/setup/setup.ps1 deleted file mode 100644 index 27e65a55e..000000000 --- a/builder/vsphere/examples/windows/setup/setup.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -$ErrorActionPreference = "Stop" - -# Switch network connection to private mode -# Required for WinRM firewall rules -$profile = Get-NetConnectionProfile -Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private - -# Enable WinRM service -winrm quickconfig -quiet -winrm set winrm/config/service '@{AllowUnencrypted="true"}' -winrm set winrm/config/service/auth '@{Basic="true"}' - -# Reset auto logon count -# https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue -Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 0 diff --git a/builder/vsphere/examples/windows/setup/vmtools.cmd b/builder/vsphere/examples/windows/setup/vmtools.cmd deleted file mode 100644 index 19a942d80..000000000 --- a/builder/vsphere/examples/windows/setup/vmtools.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@rem Silent mode, basic UI, no reboot -e:\setup64 /s /v "/qb REBOOT=R" diff --git a/builder/vsphere/examples/windows/windows-10.json b/builder/vsphere/examples/windows/windows-10.json deleted file mode 100644 index e9df38503..000000000 --- a/builder/vsphere/examples/windows/windows-10.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "builders": [ - { - "type": "vsphere-iso", - "CPUs": 1, - "RAM": 4096, - "RAM_reserve_all": true, - "communicator": "winrm", - "disk_controller_type": "pvscsi", - "floppy_files": [ - "{{template_dir}}/setup/" - ], - "floppy_img_path": "[datastore1] ISO/VMware Tools/10.2.0/pvscsi-Windows8.flp", - "guest_os_type": "windows9_64Guest", - "host": "esxi-1.vsphere65.test", - "insecure_connection": "true", - "iso_paths": [ - "[datastore1] ISO/en_windows_10_multi-edition_vl_version_1709_updated_dec_2017_x64_dvd_100406172.iso", - "[datastore1] ISO/VMware Tools/10.2.0/windows.iso" - ], - "network_adapters": [ - { - "network_card": "vmxnet3" - } - ], - "password": "jetbrains", - "storage": [ - { - "disk_size": 32768, - "disk_thin_provisioned": true - } - ], - "username": "root", - "vcenter_server": "vcenter.vsphere65.test", - "vm_name": "example-windows", - "winrm_password": "jetbrains", - "winrm_username": "jetbrains" - } - ], - "provisioners": [ - { - "inline": [ - "dir c:\\" - ], - "type": "windows-shell" - } - ] -} \ No newline at end of file diff --git a/builder/vsphere/examples/windows/windows-10.pkr.hcl b/builder/vsphere/examples/windows/windows-10.pkr.hcl deleted file mode 100644 index e2b2ad670..000000000 --- a/builder/vsphere/examples/windows/windows-10.pkr.hcl +++ /dev/null @@ -1,41 +0,0 @@ -# source blocks are generated from your builders; a source can be referenced in -# build blocks. A build block runs provisioner and post-processors on a -# source. Read the documentation for source blocks here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/source -source "vsphere-iso" "example_windows" { - CPUs = 1 - RAM = 4096 - RAM_reserve_all = true - communicator = "winrm" - disk_controller_type = ["pvscsi"] - floppy_files = ["${path.root}/setup/"] - floppy_img_path = "[datastore1] ISO/VMware Tools/10.2.0/pvscsi-Windows8.flp" - guest_os_type = "windows9_64Guest" - host = "esxi-1.vsphere65.test" - insecure_connection = "true" - iso_paths = ["[datastore1] ISO/en_windows_10_multi-edition_vl_version_1709_updated_dec_2017_x64_dvd_100406172.iso", "[datastore1] ISO/VMware Tools/10.2.0/windows.iso"] - network_adapters { - network_card = "vmxnet3" - } - password = "jetbrains" - storage { - disk_size = 32768 - disk_thin_provisioned = true - } - username = "root" - vcenter_server = "vcenter.vsphere65.test" - vm_name = "example-windows" - winrm_password = "jetbrains" - winrm_username = "jetbrains" -} - -# a build block invokes sources and runs provisioning steps on them. The -# documentation for build blocks can be found here: -# https://www.packer.io/docs/templates/hcl_templates/blocks/build -build { - sources = ["source.vsphere-iso.example_windows"] - - provisioner "windows-shell" { - inline = ["dir c:\\"] - } -} diff --git a/builder/vsphere/iso/builder.go b/builder/vsphere/iso/builder.go deleted file mode 100644 index f975bad84..000000000 --- a/builder/vsphere/iso/builder.go +++ /dev/null @@ -1,179 +0,0 @@ -package iso - -import ( - "context" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -type Builder struct { - config Config - runner multistep.Runner -} - -func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } - -func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { - warnings, errs := b.config.Prepare(raws...) - if errs != nil { - return nil, warnings, errs - } - - return nil, warnings, nil -} - -func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { - state := new(multistep.BasicStateBag) - state.Put("debug", b.config.PackerDebug) - state.Put("hook", hook) - state.Put("ui", ui) - - var steps []multistep.Step - - steps = append(steps, - &common.StepConnect{ - Config: &b.config.ConnectConfig, - }, - &common.StepDownload{ - DownloadStep: &commonsteps.StepDownload{ - Checksum: b.config.ISOChecksum, - Description: "ISO", - Extension: b.config.TargetExtension, - ResultKey: "iso_path", - TargetPath: b.config.TargetPath, - Url: b.config.ISOUrls, - }, - Url: b.config.ISOUrls, - ResultKey: "iso_path", - Datastore: b.config.Datastore, - Host: b.config.Host, - }, - &commonsteps.StepCreateCD{ - Files: b.config.CDConfig.CDFiles, - Label: b.config.CDConfig.CDLabel, - }, - &common.StepRemoteUpload{ - Datastore: b.config.Datastore, - Host: b.config.Host, - SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, - }, - &StepCreateVM{ - Config: &b.config.CreateConfig, - Location: &b.config.LocationConfig, - Force: b.config.PackerConfig.PackerForce, - }, - &common.StepConfigureHardware{ - Config: &b.config.HardwareConfig, - }, - &common.StepAddCDRom{ - Config: &b.config.CDRomConfig, - }, - &common.StepConfigParams{ - Config: &b.config.ConfigParamsConfig, - }, - &commonsteps.StepCreateFloppy{ - Files: b.config.FloppyFiles, - Directories: b.config.FloppyDirectories, - Label: b.config.FloppyLabel, - }, - &common.StepAddFloppy{ - Config: &b.config.FloppyConfig, - Datastore: b.config.Datastore, - Host: b.config.Host, - SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, - }, - &common.StepHTTPIPDiscover{ - HTTPIP: b.config.BootConfig.HTTPIP, - Network: b.config.WaitIpConfig.GetIPNet(), - }, - commonsteps.HTTPServerFromHTTPConfig(&b.config.HTTPConfig), - &common.StepRun{ - Config: &b.config.RunConfig, - SetOrder: true, - }, - &common.StepBootCommand{ - Config: &b.config.BootConfig, - Ctx: b.config.ctx, - VMName: b.config.VMName, - }, - ) - - if b.config.Comm.Type != "none" { - steps = append(steps, - &common.StepWaitForIp{ - Config: &b.config.WaitIpConfig, - }, - &communicator.StepConnect{ - Config: &b.config.Comm, - Host: common.CommHost(b.config.Comm.Host()), - SSHConfig: b.config.Comm.SSHConfigFunc(), - }, - &commonsteps.StepProvision{}, - ) - } - - steps = append(steps, - &common.StepShutdown{ - Config: &b.config.ShutdownConfig, - }, - &common.StepRemoveFloppy{ - Datastore: b.config.Datastore, - Host: b.config.Host, - }, - &common.StepRemoveCDRom{ - Config: &b.config.RemoveCDRomConfig, - }, - &common.StepCreateSnapshot{ - CreateSnapshot: b.config.CreateSnapshot, - }, - &common.StepConvertToTemplate{ - ConvertToTemplate: b.config.ConvertToTemplate, - }, - ) - - if b.config.ContentLibraryDestinationConfig != nil { - steps = append(steps, &common.StepImportToContentLibrary{ - ContentLibConfig: b.config.ContentLibraryDestinationConfig, - }) - } - - if b.config.Export != nil { - steps = append(steps, &common.StepExport{ - Name: b.config.Export.Name, - Force: b.config.Export.Force, - Images: b.config.Export.Images, - Manifest: b.config.Export.Manifest, - OutputDir: b.config.Export.OutputDir.OutputDir, - Options: b.config.Export.Options, - }) - } - - b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) - b.runner.Run(ctx, state) - - if rawErr, ok := state.GetOk("error"); ok { - return nil, rawErr.(error) - } - - if _, ok := state.GetOk("vm"); !ok { - return nil, nil - } - - artifact := &common.Artifact{ - Name: b.config.VMName, - VM: state.Get("vm").(*driver.VirtualMachineDriver), - StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, - } - - if b.config.Export != nil { - artifact.Outconfig = &b.config.Export.OutputDir - } - - return artifact, nil -} diff --git a/builder/vsphere/iso/builder_acc_test.go b/builder/vsphere/iso/builder_acc_test.go deleted file mode 100644 index 63dc6b520..000000000 --- a/builder/vsphere/iso/builder_acc_test.go +++ /dev/null @@ -1,568 +0,0 @@ -package iso - -import ( - "fmt" - "io/ioutil" - "os" - "testing" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - builderT "github.com/hashicorp/packer/acctest" - commonT "github.com/hashicorp/packer/builder/vsphere/common/testing" - "github.com/vmware/govmomi/vim25/types" -) - -func TestISOBuilderAcc_default(t *testing.T) { - config := defaultConfig() - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - Check: checkDefault(t, config["vm_name"].(string), config["host"].(string), "datastore1"), - }) -} - -func defaultConfig() map[string]interface{} { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - config := map[string]interface{}{ - "vcenter_server": "vcenter.vsphere65.test", - "username": username, - "password": password, - "insecure_connection": true, - - "host": "esxi-1.vsphere65.test", - - "ssh_username": "root", - "ssh_password": "jetbrains", - - "vm_name": commonT.NewVMName(), - "storage": map[string]interface{}{ - "disk_size": 2048, - }, - - "communicator": "none", // do not start the VM without any bootable devices - } - - return config -} - -func checkDefault(t *testing.T, name string, host string, datastore string) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk", "config.firmware") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - if vmInfo.Name != name { - t.Errorf("Invalid VM name: expected '%v', got '%v'", name, vmInfo.Name) - } - - f := d.NewFolder(vmInfo.Parent) - folderPath, err := f.Path() - if err != nil { - t.Fatalf("Cannot read folder name: %v", err) - } - if folderPath != "" { - t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) - } - - h := d.NewHost(vmInfo.Runtime.Host) - hostInfo, err := h.Info("name") - if err != nil { - t.Fatal("Cannot read host properties: ", err) - } - if hostInfo.Name != host { - t.Errorf("Invalid host name: expected '%v', got '%v'", host, hostInfo.Name) - } - - p := d.NewResourcePool(vmInfo.ResourcePool) - poolPath, err := p.Path() - if err != nil { - t.Fatalf("Cannot read resource pool name: %v", err) - } - if poolPath != "" { - t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) - } - - dsr := vmInfo.Datastore[0].Reference() - ds := d.NewDatastore(&dsr) - dsInfo, err := ds.Info("name") - if err != nil { - t.Fatal("Cannot read datastore properties: ", err) - } - if dsInfo.Name != datastore { - t.Errorf("Invalid datastore name: expected '%v', got '%v'", datastore, dsInfo.Name) - } - - fw := vmInfo.Config.Firmware - if fw != "bios" { - t.Errorf("Invalid firmware: expected 'bios', got '%v'", fw) - } - - return nil - } -} - -func TestISOBuilderAcc_notes(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: notesConfig(), - Check: checkNotes(t), - }) -} - -func notesConfig() string { - config := defaultConfig() - config["notes"] = "test" - - return commonT.RenderConfig(config) -} - -func checkNotes(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.annotation") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - notes := vmInfo.Config.Annotation - if notes != "test" { - t.Errorf("notes should be 'test'") - } - - return nil - } -} - -func TestISOBuilderAcc_hardware(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: hardwareConfig(), - Check: checkHardware(t), - }) -} - -func hardwareConfig() string { - config := defaultConfig() - config["CPUs"] = 2 - config["cpu_cores"] = 2 - config["CPU_reservation"] = 1000 - config["CPU_limit"] = 1500 - config["RAM"] = 2048 - config["RAM_reservation"] = 1024 - config["NestedHV"] = true - config["firmware"] = "efi" - config["video_ram"] = 8192 - - return commonT.RenderConfig(config) -} - -func checkHardware(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("config") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - cpuSockets := vmInfo.Config.Hardware.NumCPU - if cpuSockets != 2 { - t.Errorf("VM should have 2 CPU sockets, got %v", cpuSockets) - } - - cpuCores := vmInfo.Config.Hardware.NumCoresPerSocket - if cpuCores != 2 { - t.Errorf("VM should have 2 CPU cores per socket, got %v", cpuCores) - } - - cpuReservation := *vmInfo.Config.CpuAllocation.Reservation - if cpuReservation != 1000 { - t.Errorf("VM should have CPU reservation for 1000 Mhz, got %v", cpuReservation) - } - - cpuLimit := *vmInfo.Config.CpuAllocation.Limit - if cpuLimit != 1500 { - t.Errorf("VM should have CPU reservation for 1500 Mhz, got %v", cpuLimit) - } - - ram := vmInfo.Config.Hardware.MemoryMB - if ram != 2048 { - t.Errorf("VM should have 2048 MB of RAM, got %v", ram) - } - - ramReservation := *vmInfo.Config.MemoryAllocation.Reservation - if ramReservation != 1024 { - t.Errorf("VM should have RAM reservation for 1024 MB, got %v", ramReservation) - } - - nestedHV := vmInfo.Config.NestedHVEnabled - if !*nestedHV { - t.Errorf("VM should have NestedHV enabled, got %v", nestedHV) - } - - fw := vmInfo.Config.Firmware - if fw != "efi" { - t.Errorf("Invalid firmware: expected 'efi', got '%v'", fw) - } - - l, err := vm.Devices() - if err != nil { - t.Fatalf("Cannot read VM devices: %v", err) - } - c := l.PickController((*types.VirtualIDEController)(nil)) - if c == nil { - t.Errorf("VM should have IDE controller") - } - s := l.PickController((*types.VirtualAHCIController)(nil)) - if s != nil { - t.Errorf("VM should have no SATA controllers") - } - - v := l.SelectByType((*types.VirtualMachineVideoCard)(nil)) - if len(v) != 1 { - t.Errorf("VM should have one video card") - } - if v[0].(*types.VirtualMachineVideoCard).VideoRamSizeInKB != 8192 { - t.Errorf("Video RAM should be equal 8192") - } - - return nil - } -} - -func TestISOBuilderAcc_limit(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: limitConfig(), - Check: checkLimit(t), - }) -} - -func limitConfig() string { - config := defaultConfig() - config["CPUs"] = 1 // hardware is customized, but CPU limit is not specified explicitly - - return commonT.RenderConfig(config) -} - -func checkLimit(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - vmInfo, err := vm.Info("config.cpuAllocation") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - limit := *vmInfo.Config.CpuAllocation.Limit - if limit != -1 { // must be unlimited - t.Errorf("Invalid CPU limit: expected '%v', got '%v'", -1, limit) - } - - return nil - } -} - -func TestISOBuilderAcc_sata(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: sataConfig(), - Check: checkSata(t), - }) -} - -func sataConfig() string { - config := defaultConfig() - config["cdrom_type"] = "sata" - - return commonT.RenderConfig(config) -} - -func checkSata(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - - l, err := vm.Devices() - if err != nil { - t.Fatalf("Cannot read VM devices: %v", err) - } - - c := l.PickController((*types.VirtualAHCIController)(nil)) - if c == nil { - t.Errorf("VM has no SATA controllers") - } - - return nil - } -} - -func TestISOBuilderAcc_cdrom(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: cdromConfig(), - }) -} - -func cdromConfig() string { - config := defaultConfig() - config["iso_paths"] = []string{ - "[datastore1] test0.iso", - "[datastore1] test1.iso", - } - return commonT.RenderConfig(config) -} - -func TestISOBuilderAcc_networkCard(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: networkCardConfig(), - Check: checkNetworkCard(t), - }) -} - -func networkCardConfig() string { - config := defaultConfig() - config["network_adapters"] = map[string]interface{}{ - "network_card": "vmxnet3", - } - return commonT.RenderConfig(config) -} - -func checkNetworkCard(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - - vm := commonT.GetVM(t, d, artifacts) - devices, err := vm.Devices() - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - netCards := devices.SelectByType((*types.VirtualEthernetCard)(nil)) - if len(netCards) == 0 { - t.Fatalf("Cannot find the network card") - } - if len(netCards) > 1 { - t.Fatalf("Found several network catds") - } - if _, ok := netCards[0].(*types.VirtualVmxnet3); !ok { - t.Errorf("The network card type is not the expected one (vmxnet3)") - } - - return nil - } -} - -func TestISOBuilderAcc_createFloppy(t *testing.T) { - tmpFile, err := ioutil.TempFile("", "packer-vsphere-iso-test") - if err != nil { - t.Fatalf("Error creating temp file: %v", err) - } - _, err = fmt.Fprint(tmpFile, "Hello, World!") - if err != nil { - t.Fatalf("Error creating temp file: %v", err) - } - err = tmpFile.Close() - if err != nil { - t.Fatalf("Error creating temp file: %v", err) - } - - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: createFloppyConfig(tmpFile.Name()), - }) -} - -func createFloppyConfig(filePath string) string { - config := defaultConfig() - config["floppy_files"] = []string{filePath} - return commonT.RenderConfig(config) -} - -func TestISOBuilderAcc_full(t *testing.T) { - config := fullConfig() - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - Check: checkFull(t), - }) -} - -func fullConfig() map[string]interface{} { - username := os.Getenv("VSPHERE_USERNAME") - if username == "" { - username = "root" - } - password := os.Getenv("VSPHERE_PASSWORD") - if password == "" { - password = "jetbrains" - } - - config := map[string]interface{}{ - "vcenter_server": "vcenter.vsphere65.test", - "username": username, - "password": password, - "insecure_connection": true, - - "vm_name": commonT.NewVMName(), - "host": "esxi-1.vsphere65.test", - - "RAM": 512, - "disk_controller_type": []string{ - "pvscsi", - }, - "storage": map[string]interface{}{ - "disk_size": 1024, - "disk_thin_provisioned": true, - }, - "network_adapters": map[string]interface{}{ - "network_card": "vmxnet3", - }, - "guest_os_type": "other3xLinux64Guest", - - "iso_paths": []string{ - "[datastore1] ISO/alpine-standard-3.8.2-x86_64.iso", - }, - "floppy_files": []string{ - "../examples/alpine/answerfile", - "../examples/alpine/setup.sh", - }, - - "boot_wait": "20s", - "boot_command": []string{ - "root<enter><wait>", - "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", - "setup-alpine -f /media/floppy/answerfile<enter>", - "<wait5>", - "jetbrains<enter>", - "jetbrains<enter>", - "<wait5>", - "y<enter>", - "<wait10><wait10><wait10><wait10>", - "reboot<enter>", - "<wait10><wait10><wait10>", - "root<enter>", - "jetbrains<enter><wait>", - "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", - "/media/floppy/SETUP.SH<enter>", - }, - - "ssh_username": "root", - "ssh_password": "jetbrains", - } - - return config -} - -func checkFull(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.bootOptions") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - order := vmInfo.Config.BootOptions.BootOrder - if order != nil { - t.Errorf("Boot order must be empty") - } - - devices, err := vm.Devices() - if err != nil { - t.Fatalf("Cannot read devices: %v", err) - } - cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) - for _, cd := range cdroms { - _, ok := cd.(*types.VirtualCdrom).Backing.(*types.VirtualCdromRemotePassthroughBackingInfo) - if !ok { - t.Errorf("wrong cdrom backing") - } - } - - return nil - } -} - -func TestISOBuilderAcc_bootOrder(t *testing.T) { - config := fullConfig() - config["boot_order"] = "disk,cdrom,floppy" - - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: commonT.RenderConfig(config), - Check: checkBootOrder(t), - }) -} - -func checkBootOrder(t *testing.T) builderT.TestCheckFunc { - return func(artifacts []packersdk.Artifact) error { - d := commonT.TestConn(t) - vm := commonT.GetVM(t, d, artifacts) - - vmInfo, err := vm.Info("config.bootOptions") - if err != nil { - t.Fatalf("Cannot read VM properties: %v", err) - } - - order := vmInfo.Config.BootOptions.BootOrder - if order == nil { - t.Errorf("Boot order must not be empty") - } - - return nil - } -} - -func TestISOBuilderAcc_cluster(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: clusterConfig(), - }) -} - -func clusterConfig() string { - config := defaultConfig() - config["cluster"] = "cluster1" - config["host"] = "esxi-2.vsphere65.test" - - return commonT.RenderConfig(config) -} - -func TestISOBuilderAcc_clusterDRS(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - Builder: &Builder{}, - Template: clusterDRSConfig(), - }) -} - -func clusterDRSConfig() string { - config := defaultConfig() - config["cluster"] = "cluster2" - config["host"] = "" - config["datastore"] = "datastore3" // bug #183 - config["network_adapters"] = map[string]interface{}{ - "network": "VM Network", - } - - return commonT.RenderConfig(config) -} diff --git a/builder/vsphere/iso/common_test.go b/builder/vsphere/iso/common_test.go deleted file mode 100644 index f35c006a1..000000000 --- a/builder/vsphere/iso/common_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package iso - -import ( - "bytes" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" -) - -func basicStateBag() *multistep.BasicStateBag { - state := new(multistep.BasicStateBag) - state.Put("ui", &packersdk.BasicUi{ - Reader: new(bytes.Buffer), - Writer: new(bytes.Buffer), - }) - return state -} diff --git a/builder/vsphere/iso/config.go b/builder/vsphere/iso/config.go deleted file mode 100644 index f0edbde1d..000000000 --- a/builder/vsphere/iso/config.go +++ /dev/null @@ -1,107 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type Config - -package iso - -import ( - packerCommon "github.com/hashicorp/packer-plugin-sdk/common" - "github.com/hashicorp/packer-plugin-sdk/communicator" - "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - "github.com/hashicorp/packer/builder/vsphere/common" -) - -type Config struct { - packerCommon.PackerConfig `mapstructure:",squash"` - commonsteps.HTTPConfig `mapstructure:",squash"` - commonsteps.CDConfig `mapstructure:",squash"` - - common.ConnectConfig `mapstructure:",squash"` - CreateConfig `mapstructure:",squash"` - common.LocationConfig `mapstructure:",squash"` - common.HardwareConfig `mapstructure:",squash"` - common.ConfigParamsConfig `mapstructure:",squash"` - - commonsteps.ISOConfig `mapstructure:",squash"` - - common.CDRomConfig `mapstructure:",squash"` - common.RemoveCDRomConfig `mapstructure:",squash"` - common.FloppyConfig `mapstructure:",squash"` - common.RunConfig `mapstructure:",squash"` - common.BootConfig `mapstructure:",squash"` - common.WaitIpConfig `mapstructure:",squash"` - Comm communicator.Config `mapstructure:",squash"` - - common.ShutdownConfig `mapstructure:",squash"` - - // Create a snapshot when set to `true`, so the VM can be used as a base - // for linked clones. Defaults to `false`. - CreateSnapshot bool `mapstructure:"create_snapshot"` - // Convert VM to a template. Defaults to `false`. - ConvertToTemplate bool `mapstructure:"convert_to_template"` - // Configuration for exporting VM to an ovf file. - // The VM will not be exported if no [Export Configuration](#export-configuration) is specified. - Export *common.ExportConfig `mapstructure:"export"` - // Configuration for importing the VM template to a Content Library. - // The VM template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. - // The import doesn't work if [convert_to_template](#convert_to_template) is set to true. - ContentLibraryDestinationConfig *common.ContentLibraryDestinationConfig `mapstructure:"content_library_destination"` - - ctx interpolate.Context -} - -func (c *Config) Prepare(raws ...interface{}) ([]string, error) { - err := config.Decode(c, &config.DecodeOpts{ - PluginType: common.BuilderId, - Interpolate: true, - InterpolateContext: &c.ctx, - InterpolateFilter: &interpolate.RenderFilter{ - Exclude: []string{ - "boot_command", - }, - }, - }, raws...) - if err != nil { - return nil, err - } - - warnings := make([]string, 0) - errs := new(packersdk.MultiError) - - if c.ISOUrls != nil || c.RawSingleISOUrl != "" { - isoWarnings, isoErrs := c.ISOConfig.Prepare(&c.ctx) - warnings = append(warnings, isoWarnings...) - errs = packersdk.MultiErrorAppend(errs, isoErrs...) - } - - errs = packersdk.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.CreateConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.LocationConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.HTTPConfig.Prepare(&c.ctx)...) - - errs = packersdk.MultiErrorAppend(errs, c.CDRomConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.CDConfig.Prepare(&c.ctx)...) - errs = packersdk.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) - errs = packersdk.MultiErrorAppend(errs, c.WaitIpConfig.Prepare()...) - errs = packersdk.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) - - shutdownWarnings, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) - warnings = append(warnings, shutdownWarnings...) - errs = packersdk.MultiErrorAppend(errs, shutdownErrs...) - - if c.Export != nil { - errs = packersdk.MultiErrorAppend(errs, c.Export.Prepare(&c.ctx, &c.LocationConfig, &c.PackerConfig)...) - } - if c.ContentLibraryDestinationConfig != nil { - errs = packersdk.MultiErrorAppend(errs, c.ContentLibraryDestinationConfig.Prepare(&c.LocationConfig)...) - } - - if len(errs.Errors) > 0 { - return warnings, errs - } - - return warnings, nil -} diff --git a/builder/vsphere/iso/config.hcl2spec.go b/builder/vsphere/iso/config.hcl2spec.go deleted file mode 100644 index ee8298e49..000000000 --- a/builder/vsphere/iso/config.hcl2spec.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. - -package iso - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/zclconf/go-cty/cty" -) - -// FlatConfig is an auto-generated flat version of Config. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConfig struct { - PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` - PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` - PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` - PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` - PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` - PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` - PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` - PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` - HTTPDir *string `mapstructure:"http_directory" cty:"http_directory" hcl:"http_directory"` - HTTPContent map[string]string `mapstructure:"http_content" cty:"http_content" hcl:"http_content"` - HTTPPortMin *int `mapstructure:"http_port_min" cty:"http_port_min" hcl:"http_port_min"` - HTTPPortMax *int `mapstructure:"http_port_max" cty:"http_port_max" hcl:"http_port_max"` - HTTPAddress *string `mapstructure:"http_bind_address" cty:"http_bind_address" hcl:"http_bind_address"` - HTTPInterface *string `mapstructure:"http_interface" undocumented:"true" cty:"http_interface" hcl:"http_interface"` - CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"` - CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"` - VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` - Username *string `mapstructure:"username" cty:"username" hcl:"username"` - Password *string `mapstructure:"password" cty:"password" hcl:"password"` - InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` - Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` - Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` - GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` - DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` - Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` - NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` - USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` - Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` - VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` - Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` - Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` - Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` - SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` - CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` - CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` - CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` - CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` - CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` - RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` - RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` - RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` - MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` - VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` - VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` - NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` - Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` - ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` - ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` - ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` - ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` - ISOChecksum *string `mapstructure:"iso_checksum" required:"true" cty:"iso_checksum" hcl:"iso_checksum"` - RawSingleISOUrl *string `mapstructure:"iso_url" required:"true" cty:"iso_url" hcl:"iso_url"` - ISOUrls []string `mapstructure:"iso_urls" cty:"iso_urls" hcl:"iso_urls"` - TargetPath *string `mapstructure:"iso_target_path" cty:"iso_target_path" hcl:"iso_target_path"` - TargetExtension *string `mapstructure:"iso_target_extension" cty:"iso_target_extension" hcl:"iso_target_extension"` - CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` - ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` - RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` - FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` - FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` - FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` - FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` - BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` - BootGroupInterval *string `mapstructure:"boot_keygroup_interval" cty:"boot_keygroup_interval" hcl:"boot_keygroup_interval"` - BootWait *string `mapstructure:"boot_wait" cty:"boot_wait" hcl:"boot_wait"` - BootCommand []string `mapstructure:"boot_command" cty:"boot_command" hcl:"boot_command"` - HTTPIP *string `mapstructure:"http_ip" cty:"http_ip" hcl:"http_ip"` - WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` - SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` - WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` - Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` - PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` - SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` - SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` - SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` - SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` - SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` - SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` - SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` - SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` - SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` - SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` - SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` - SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` - SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` - SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` - SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` - SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` - SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` - SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` - SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` - SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` - SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` - SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` - SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` - SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` - SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` - SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` - SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` - SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` - SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` - SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` - SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` - WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` - WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` - WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` - WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` - WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` - WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` - WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` - WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` - WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` - Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` - Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` - DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` - CreateSnapshot *bool `mapstructure:"create_snapshot" cty:"create_snapshot" hcl:"create_snapshot"` - ConvertToTemplate *bool `mapstructure:"convert_to_template" cty:"convert_to_template" hcl:"convert_to_template"` - Export *common.FlatExportConfig `mapstructure:"export" cty:"export" hcl:"export"` - ContentLibraryDestinationConfig *common.FlatContentLibraryDestinationConfig `mapstructure:"content_library_destination" cty:"content_library_destination" hcl:"content_library_destination"` -} - -// FlatMapstructure returns a new FlatConfig. -// FlatConfig is an auto-generated flat version of Config. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConfig) -} - -// HCL2Spec returns the hcl spec of a Config. -// This spec is used by HCL to read the fields of Config. -// The decoded values from this spec will then be applied to a FlatConfig. -func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, - "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, - "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, - "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, - "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, - "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, - "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, - "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, - "http_directory": &hcldec.AttrSpec{Name: "http_directory", Type: cty.String, Required: false}, - "http_content": &hcldec.AttrSpec{Name: "http_content", Type: cty.Map(cty.String), Required: false}, - "http_port_min": &hcldec.AttrSpec{Name: "http_port_min", Type: cty.Number, Required: false}, - "http_port_max": &hcldec.AttrSpec{Name: "http_port_max", Type: cty.Number, Required: false}, - "http_bind_address": &hcldec.AttrSpec{Name: "http_bind_address", Type: cty.String, Required: false}, - "http_interface": &hcldec.AttrSpec{Name: "http_interface", Type: cty.String, Required: false}, - "cd_files": &hcldec.AttrSpec{Name: "cd_files", Type: cty.List(cty.String), Required: false}, - "cd_label": &hcldec.AttrSpec{Name: "cd_label", Type: cty.String, Required: false}, - "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, - "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, - "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, - "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, - "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, - "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, - "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, - "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, - "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, - "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, - "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, - "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, - "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, - "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, - "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, - "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, - "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, - "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, - "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, - "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, - "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, - "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, - "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, - "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, - "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, - "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, - "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, - "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, - "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, - "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, - "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, - "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, - "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, - "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, - "iso_checksum": &hcldec.AttrSpec{Name: "iso_checksum", Type: cty.String, Required: false}, - "iso_url": &hcldec.AttrSpec{Name: "iso_url", Type: cty.String, Required: false}, - "iso_urls": &hcldec.AttrSpec{Name: "iso_urls", Type: cty.List(cty.String), Required: false}, - "iso_target_path": &hcldec.AttrSpec{Name: "iso_target_path", Type: cty.String, Required: false}, - "iso_target_extension": &hcldec.AttrSpec{Name: "iso_target_extension", Type: cty.String, Required: false}, - "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, - "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, - "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, - "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, - "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, - "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, - "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, - "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, - "boot_keygroup_interval": &hcldec.AttrSpec{Name: "boot_keygroup_interval", Type: cty.String, Required: false}, - "boot_wait": &hcldec.AttrSpec{Name: "boot_wait", Type: cty.String, Required: false}, - "boot_command": &hcldec.AttrSpec{Name: "boot_command", Type: cty.List(cty.String), Required: false}, - "http_ip": &hcldec.AttrSpec{Name: "http_ip", Type: cty.String, Required: false}, - "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, - "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, - "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, - "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, - "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, - "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, - "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, - "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, - "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, - "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, - "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, - "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, - "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, - "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, - "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, - "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, - "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, - "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, - "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, - "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, - "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, - "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, - "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, - "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, - "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, - "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, - "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, - "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, - "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, - "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, - "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, - "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, - "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, - "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, - "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, - "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, - "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, - "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, - "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, - "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, - "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, - "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, - "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, - "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, - "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, - "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, - "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, - "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, - "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, - "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, - "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, - "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, - "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, - "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, - "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, - "create_snapshot": &hcldec.AttrSpec{Name: "create_snapshot", Type: cty.Bool, Required: false}, - "convert_to_template": &hcldec.AttrSpec{Name: "convert_to_template", Type: cty.Bool, Required: false}, - "export": &hcldec.BlockSpec{TypeName: "export", Nested: hcldec.ObjectSpec((*common.FlatExportConfig)(nil).HCL2Spec())}, - "content_library_destination": &hcldec.BlockSpec{TypeName: "content_library_destination", Nested: hcldec.ObjectSpec((*common.FlatContentLibraryDestinationConfig)(nil).HCL2Spec())}, - } - return s -} diff --git a/builder/vsphere/iso/step_create.go b/builder/vsphere/iso/step_create.go deleted file mode 100644 index 87f0fc12c..000000000 --- a/builder/vsphere/iso/step_create.go +++ /dev/null @@ -1,188 +0,0 @@ -//go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type NIC,CreateConfig - -package iso - -import ( - "context" - "fmt" - "path" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -// Defines a Network Adapter -// -// Example that creates two network adapters: -// -// In JSON: -// ```json -// "network_adapters": [ -// { -// "network": "VM Network", -// "network_card": "vmxnet3" -// }, -// { -// "network": "OtherNetwork", -// "network_card": "vmxnet3" -// } -// ], -// ``` -// In HCL2: -// ```hcl -// network_adapters { -// network = "VM Network" -// network_card = "vmxnet3" -// } -// network_adapters { -// network = "OtherNetwork" -// network_card = "vmxnet3" -// } -// ``` -type NIC struct { - // Set the network in which the VM will be connected to. If no network is - // specified, `host` must be specified to allow Packer to look for the - // available network. If the network is inside a network folder in vCenter, - // you need to provide the full path to the network. - Network string `mapstructure:"network"` - // Set VM network card type. Example `vmxnet3`. - NetworkCard string `mapstructure:"network_card" required:"true"` - // Set network card MAC address - MacAddress string `mapstructure:"mac_address"` - // Enable DirectPath I/O passthrough - Passthrough *bool `mapstructure:"passthrough"` -} - -type CreateConfig struct { - // Set VM hardware version. Defaults to the most current VM hardware - // version supported by vCenter. See - // [VMWare article 1003746](https://kb.vmware.com/s/article/1003746) for - // the full list of supported VM hardware versions. - Version uint `mapstructure:"vm_version"` - // Set VM OS type. Defaults to `otherGuest`. See [ - // here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) - // for a full list of possible values. - GuestOSType string `mapstructure:"guest_os_type"` - StorageConfig common.StorageConfig `mapstructure:",squash"` - // Network adapters - NICs []NIC `mapstructure:"network_adapters"` - // Create USB controllers for the virtual machine. "usb" for a usb 2.0 controller. "xhci" for a usb 3.0 controller. There can only be at most one of each. - USBController []string `mapstructure:"usb_controller"` - // VM notes. - Notes string `mapstructure:"notes"` -} - -func (c *CreateConfig) Prepare() []error { - var errs []error - - if len(c.StorageConfig.DiskControllerType) == 0 { - c.StorageConfig.DiskControllerType = append(c.StorageConfig.DiskControllerType, "") - } - - // there should be at least one - if len(c.StorageConfig.Storage) == 0 { - errs = append(errs, fmt.Errorf("no storage devices have been defined")) - } - errs = append(errs, c.StorageConfig.Prepare()...) - - if c.GuestOSType == "" { - c.GuestOSType = "otherGuest" - } - - usbCount := 0 - xhciCount := 0 - - for i, s := range c.USBController { - switch s { - // 1 and true for backwards compatibility - case "usb", "1", "true": - usbCount++ - case "xhci": - xhciCount++ - // 0 and false for backwards compatibility - case "false", "0": - continue - default: - errs = append(errs, fmt.Errorf("usb_controller[%d] references an unknown usb controller", i)) - } - } - if usbCount > 1 || xhciCount > 1 { - errs = append(errs, fmt.Errorf("there can only be one usb controller and one xhci controller")) - } - - return errs -} - -type StepCreateVM struct { - Config *CreateConfig - Location *common.LocationConfig - Force bool -} - -func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - d := state.Get("driver").(driver.Driver) - vmPath := path.Join(s.Location.Folder, s.Location.VMName) - - err := d.PreCleanVM(ui, vmPath, s.Force) - if err != nil { - state.Put("error", err) - return multistep.ActionHalt - } - - ui.Say("Creating VM...") - - // add network/network card an the first nic for backwards compatibility in the type is defined - var networkCards []driver.NIC - for _, nic := range s.Config.NICs { - networkCards = append(networkCards, driver.NIC{ - Network: nic.Network, - NetworkCard: nic.NetworkCard, - MacAddress: nic.MacAddress, - Passthrough: nic.Passthrough, - }) - } - - // add disk as the first drive for backwards compatibility if the type is defined - var disks []driver.Disk - for _, disk := range s.Config.StorageConfig.Storage { - disks = append(disks, driver.Disk{ - DiskSize: disk.DiskSize, - DiskEagerlyScrub: disk.DiskEagerlyScrub, - DiskThinProvisioned: disk.DiskThinProvisioned, - ControllerIndex: disk.DiskControllerIndex, - }) - } - - vm, err := d.CreateVM(&driver.CreateConfig{ - StorageConfig: driver.StorageConfig{ - DiskControllerType: s.Config.StorageConfig.DiskControllerType, - Storage: disks, - }, - Annotation: s.Config.Notes, - Name: s.Location.VMName, - Folder: s.Location.Folder, - Cluster: s.Location.Cluster, - Host: s.Location.Host, - ResourcePool: s.Location.ResourcePool, - Datastore: s.Location.Datastore, - GuestOS: s.Config.GuestOSType, - NICs: networkCards, - USBController: s.Config.USBController, - Version: s.Config.Version, - }) - if err != nil { - state.Put("error", fmt.Errorf("error creating vm: %v", err)) - return multistep.ActionHalt - } - state.Put("vm", vm) - - return multistep.ActionContinue -} - -func (s *StepCreateVM) Cleanup(state multistep.StateBag) { - common.CleanupVM(state) -} diff --git a/builder/vsphere/iso/step_create.hcl2spec.go b/builder/vsphere/iso/step_create.hcl2spec.go deleted file mode 100644 index 9d9699529..000000000 --- a/builder/vsphere/iso/step_create.hcl2spec.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type NIC,CreateConfig"; DO NOT EDIT. - -package iso - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/zclconf/go-cty/cty" -) - -// FlatCreateConfig is an auto-generated flat version of CreateConfig. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatCreateConfig struct { - Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` - GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` - DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` - Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` - NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` - USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` - Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` -} - -// FlatMapstructure returns a new FlatCreateConfig. -// FlatCreateConfig is an auto-generated flat version of CreateConfig. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*CreateConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatCreateConfig) -} - -// HCL2Spec returns the hcl spec of a CreateConfig. -// This spec is used by HCL to read the fields of CreateConfig. -// The decoded values from this spec will then be applied to a FlatCreateConfig. -func (*FlatCreateConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, - "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, - "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, - "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, - "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, - "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, - "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, - } - return s -} - -// FlatNIC is an auto-generated flat version of NIC. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatNIC struct { - Network *string `mapstructure:"network" cty:"network" hcl:"network"` - NetworkCard *string `mapstructure:"network_card" required:"true" cty:"network_card" hcl:"network_card"` - MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` - Passthrough *bool `mapstructure:"passthrough" cty:"passthrough" hcl:"passthrough"` -} - -// FlatMapstructure returns a new FlatNIC. -// FlatNIC is an auto-generated flat version of NIC. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*NIC) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatNIC) -} - -// HCL2Spec returns the hcl spec of a NIC. -// This spec is used by HCL to read the fields of NIC. -// The decoded values from this spec will then be applied to a FlatNIC. -func (*FlatNIC) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, - "network_card": &hcldec.AttrSpec{Name: "network_card", Type: cty.String, Required: false}, - "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, - "passthrough": &hcldec.AttrSpec{Name: "passthrough", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/builder/vsphere/iso/step_create_test.go b/builder/vsphere/iso/step_create_test.go deleted file mode 100644 index b05b0d1c6..000000000 --- a/builder/vsphere/iso/step_create_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package iso - -import ( - "context" - "errors" - "io/ioutil" - "path" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/builder/vsphere/driver" -) - -func TestCreateConfig_Prepare(t *testing.T) { - // Empty config - check defaults - config := &CreateConfig{ - // Storage is required - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - } - if errs := config.Prepare(); len(errs) != 0 { - t.Fatalf("Config preprare should not fail: %s", errs[0]) - } - if config.GuestOSType != "otherGuest" { - t.Fatalf("GuestOSType should default to 'otherGuest'") - } - if len(config.StorageConfig.DiskControllerType) != 1 { - t.Fatalf("DiskControllerType should have at least one element as default") - } - - // Data validation - tc := []struct { - name string - config *CreateConfig - fail bool - expectedErrMsg string - }{ - { - name: "Storage validate disk_size", - config: &CreateConfig{ - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 0, - DiskThinProvisioned: true, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "storage[0].'disk_size' is required", - }, - { - name: "Storage validate disk_controller_index", - config: &CreateConfig{ - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - DiskControllerIndex: 3, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "storage[0].'disk_controller_index' references an unknown disk controller", - }, - { - name: "USBController validate 'usb' and 'xhci' can be set together", - config: &CreateConfig{ - USBController: []string{"usb", "xhci"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: false, - }, - { - name: "USBController validate '1' and '0' can be set together", - config: &CreateConfig{ - USBController: []string{"1", "0"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: false, - }, - { - name: "USBController validate 'true' and 'false' can be set together", - config: &CreateConfig{ - USBController: []string{"true", "false"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: false, - }, - { - name: "USBController validate 'true' and 'usb' cannot be set together", - config: &CreateConfig{ - USBController: []string{"true", "usb"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "there can only be one usb controller and one xhci controller", - }, - { - name: "USBController validate '1' and 'usb' cannot be set together", - config: &CreateConfig{ - USBController: []string{"1", "usb"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "there can only be one usb controller and one xhci controller", - }, - { - name: "USBController validate 'xhci' cannot be set more that once", - config: &CreateConfig{ - USBController: []string{"xhci", "xhci"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "there can only be one usb controller and one xhci controller", - }, - { - name: "USBController validate unknown value cannot be set", - config: &CreateConfig{ - USBController: []string{"unknown"}, - StorageConfig: common.StorageConfig{ - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - }, - }, - }, - }, - fail: true, - expectedErrMsg: "usb_controller[0] references an unknown usb controller", - }, - } - - for _, c := range tc { - errs := c.config.Prepare() - if c.fail { - if len(errs) == 0 { - t.Fatalf("Config preprare should fail") - } - if errs[0].Error() != c.expectedErrMsg { - t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error()) - } - } else { - if len(errs) != 0 { - t.Fatalf("Config preprare should not fail: %s", errs[0]) - } - } - } -} - -func TestStepCreateVM_Run(t *testing.T) { - state := basicStateBag() - driverMock := driver.NewDriverMock() - state.Put("driver", driverMock) - step := basicStepCreateVM() - step.Force = true - vmPath := path.Join(step.Location.Folder, step.Location.VMName) - - if action := step.Run(context.TODO(), state); action == multistep.ActionHalt { - t.Fatalf("Should not halt.") - } - - // Pre clean VM - if !driverMock.PreCleanVMCalled { - t.Fatalf("driver.PreCleanVM should be called.") - } - if driverMock.PreCleanForce != step.Force { - t.Fatalf("Force PreCleanVM should be %t but was %t.", step.Force, driverMock.PreCleanForce) - } - if driverMock.PreCleanVMPath != vmPath { - t.Fatalf("VM path expected to be %s but was %s", vmPath, driverMock.PreCleanVMPath) - } - - if !driverMock.CreateVMCalled { - t.Fatalf("driver.CreateVM should be called.") - } - if diff := cmp.Diff(driverMock.CreateConfig, driverCreateConfig(step.Config, step.Location)); diff != "" { - t.Fatalf("wrong driver.CreateConfig: %s", diff) - } - vm, ok := state.GetOk("vm") - if !ok { - t.Fatal("state must contain the VM") - } - if vm != driverMock.VM { - t.Fatalf("state doesn't contain the created VM.") - } -} - -func TestStepCreateVM_RunHalt(t *testing.T) { - state := basicStateBag() - step := basicStepCreateVM() - - // PreCleanVM fails - driverMock := driver.NewDriverMock() - driverMock.PreCleanShouldFail = true - state.Put("driver", driverMock) - if action := step.Run(context.TODO(), state); action != multistep.ActionHalt { - t.Fatalf("Step should halt.") - } - if !driverMock.PreCleanVMCalled { - t.Fatalf("driver.PreCleanVM should be called") - } - - // CreateVM fails - driverMock = driver.NewDriverMock() - driverMock.CreateVMShouldFail = true - state.Put("driver", driverMock) - if action := step.Run(context.TODO(), state); action != multistep.ActionHalt { - t.Fatalf("Step should halt.") - } - if !driverMock.PreCleanVMCalled { - t.Fatalf("driver.PreCleanVM should be called") - } - if !driverMock.CreateVMCalled { - t.Fatalf("driver.PreCleanVM should be called") - } - if _, ok := state.GetOk("vm"); ok { - t.Fatal("state should not contain a VM") - } -} - -func TestStepCreateVM_Cleanup(t *testing.T) { - state := basicStateBag() - step := basicStepCreateVM() - vm := new(driver.VirtualMachineMock) - state.Put("vm", vm) - - // Clean up when state is cancelled - state.Put(multistep.StateCancelled, true) - step.Cleanup(state) - if !vm.DestroyCalled { - t.Fatalf("vm.Destroy should be called") - } - vm.DestroyCalled = false - state.Remove(multistep.StateCancelled) - - // Clean up when state is halted - state.Put(multistep.StateHalted, true) - step.Cleanup(state) - if !vm.DestroyCalled { - t.Fatalf("vm.Destroy should be called") - } - vm.DestroyCalled = false - state.Remove(multistep.StateHalted) - - // Clean up when state is destroy_vm is set - state.Put("destroy_vm", true) - step.Cleanup(state) - if !vm.DestroyCalled { - t.Fatalf("vm.Destroy should be called") - } - vm.DestroyCalled = false - state.Remove("destroy_vm") - - // Don't clean up if state is not set with previous values - step.Cleanup(state) - if vm.DestroyCalled { - t.Fatalf("vm.Destroy should not be called") - } - - // Destroy fail - errorBuffer := &strings.Builder{} - ui := &packersdk.BasicUi{ - Reader: strings.NewReader(""), - Writer: ioutil.Discard, - ErrorWriter: errorBuffer, - } - state.Put("ui", ui) - state.Put(multistep.StateCancelled, true) - vm.DestroyError = errors.New("destroy failed") - - step.Cleanup(state) - if !vm.DestroyCalled { - t.Fatalf("vm.Destroy should be called") - } - if !strings.Contains(errorBuffer.String(), vm.DestroyError.Error()) { - t.Fatalf("Destroy should fail with error message '%s' but failed with '%s'", vm.DestroyError.Error(), errorBuffer.String()) - } - vm.DestroyCalled = false - state.Remove(multistep.StateCancelled) - - // Should not destroy if VM is not set - state.Remove("vm") - state.Put(multistep.StateCancelled, true) - step.Cleanup(state) - if vm.DestroyCalled { - t.Fatalf("vm.Destroy should not be called") - } -} - -func basicStepCreateVM() *StepCreateVM { - step := &StepCreateVM{ - Config: createConfig(), - Location: basicLocationConfig(), - } - return step -} - -func basicLocationConfig() *common.LocationConfig { - return &common.LocationConfig{ - VMName: "test-vm", - Folder: "test-folder", - Cluster: "test-cluster", - Host: "test-host", - ResourcePool: "test-resource-pool", - Datastore: "test-datastore", - } -} - -func createConfig() *CreateConfig { - return &CreateConfig{ - Version: 1, - GuestOSType: "ubuntu64Guest", - StorageConfig: common.StorageConfig{ - DiskControllerType: []string{"pvscsi"}, - Storage: []common.DiskConfig{ - { - DiskSize: 32768, - DiskThinProvisioned: true, - }, - }, - }, - NICs: []NIC{ - { - Network: "VM Network", - NetworkCard: "vmxnet3", - }, - }, - } -} - -func driverCreateConfig(config *CreateConfig, location *common.LocationConfig) *driver.CreateConfig { - var networkCards []driver.NIC - for _, nic := range config.NICs { - networkCards = append(networkCards, driver.NIC{ - Network: nic.Network, - NetworkCard: nic.NetworkCard, - MacAddress: nic.MacAddress, - Passthrough: nic.Passthrough, - }) - } - - var disks []driver.Disk - for _, disk := range config.StorageConfig.Storage { - disks = append(disks, driver.Disk{ - DiskSize: disk.DiskSize, - DiskEagerlyScrub: disk.DiskEagerlyScrub, - DiskThinProvisioned: disk.DiskThinProvisioned, - ControllerIndex: disk.DiskControllerIndex, - }) - } - - return &driver.CreateConfig{ - StorageConfig: driver.StorageConfig{ - DiskControllerType: config.StorageConfig.DiskControllerType, - Storage: disks, - }, - Annotation: config.Notes, - Name: location.VMName, - Folder: location.Folder, - Cluster: location.Cluster, - Host: location.Host, - ResourcePool: location.ResourcePool, - Datastore: location.Datastore, - GuestOS: config.GuestOSType, - NICs: networkCards, - USBController: config.USBController, - Version: config.Version, - } -} diff --git a/builder/vsphere/test/lab.ovpn b/builder/vsphere/test/lab.ovpn deleted file mode 100644 index 45941a2af..000000000 --- a/builder/vsphere/test/lab.ovpn +++ /dev/null @@ -1,38 +0,0 @@ -dev tun -persist-tun -persist-key -cipher AES-256-CBC -ncp-ciphers AES-256-GCM:AES-128-GCM -auth SHA1 -tls-client -client -resolv-retry infinite -remote 91.132.204.28 2000 tcp-client -remote-cert-tls server - -pkcs12 lab.p12 - -<tls-auth> -# -# 2048 bit OpenVPN static key -# ------BEGIN OpenVPN Static key V1----- -6c9efab783fc2ee1a558bcedeaf92f8d -85322bc05432fbb00745fcd00bb48857 -77cbf0c82462726a848657c56b62f6fd -b9b1622c633188e848ce78c1b4476e9f -938338532c79784f36d80156e3b29bcf -493e64c393ee216b776c7a5d62c03aa8 -5fc5fea73990612f07660988da133b61 -34c847e67f65b8af407ae0b2761de402 -49ede990747659a878acaaf8fa1a6201 -1aa8ec5aeb01ccf50d1dc6e675dea291 -8d4c199c1c126fee9c112ce16c736159 -3234d5eaea167f5e60d01ad618fd33bb -c262fb3d5227933d6149e45ab0246d58 -5f5d66d835fbfc8e8d51e0462194d835 -8f66f166ccef5616abba26dd38046a87 -9476359e2dc7a5b4dc045e3fbe39d6e6 ------END OpenVPN Static key V1----- -</tls-auth> -key-direction 1 diff --git a/builder/vsphere/test/lab.p12 b/builder/vsphere/test/lab.p12 deleted file mode 100644 index e628d471c1566966c8d66deadfa728888015faa6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4141 zcmY+GXD}R!yN4}yb<S#G_1;<H=px#xQ6fUrV2R#^V<T9-trjh6bkVKeqeqPvT{aR{ z^d)+`IWza(|GgjHd1s#A%scO=-#k#{Ujq050w|K|5JVyvsTp}r0U!btAgM5fNUGI8 zcoB*uP5e&;DnOEk{6TN<0eF9w-+vMSlo>?&-xtUMASfjvv75f3hPq__Pkel0ybvU* zrhdePU;}`9{#T!3#&oK)7T&z^(xaluj26y5kDkijX*4k~6rjN`3D&yZZp!V@G9?Xh zIVc%-yJhu%JF}`J7iD{_w&}Fy<-GWkA}e8=R2{~qn(m&aBC0D8mzp36uz#c;&I<g! zd8V@Z1lGIXBjc`#v94n-0A-wP3wAz+^i5cCKa-+6+g>_rZeXm9!MhHvmUvONG-Ns& z3?3eC9*$8f2K`p1>+2Vr+xi5Nx3f2y(B#xsfOA&oVcfHDANv2k<{uDg-5|{UD@A6S ze<d0nO`x!G8qDW!=9t~N3K$_<6OArMIcez71bb>>Ps5p3PWTs#UbRxK{UFVn0VjRt zcn->rxZAwG_4gU48;c$MF5&PE;vyW)+Aw=~8^Uga|4OKAy(6AIrAFduV2TiyAjh9C zZNndCd#WjSi4W|pEGTV~S*3BM;_T$Ha@8zVr)wKC9^G4Pn9wPeo}=3ZD5HI_w`8py zv&4;IpWg<H{d&-}pj~IcBp9qTqD=el_NsKoT*Ti?Qd@EVLbN*%z-40^)7k}E0r>UG ziE~M*F#V)UEbhfnlBWJLSywj%VK30<^5lSLTCG-t496r0Vp2O_S-cM%V9`ZA0C(A5 z)xk9{NX(m3PTNn+(A9W)Ovnngb1t~I8Q@2-(?6#96g)4u2kGYP>vV%(IE+PW$lWzx zDiJY_{XPV|;l3WGGSg2#(B=KsGa^k=acviCu=!bZfo$r=#_A%@PUMRc>_^+q#-4*F zeWamY7;WFHfjAobk37aY#*!IhMygf>1ef&q!<Up_1~2!gCkbUpxOnyGk~Y-PCAde^ z5(}2ldAMCzJfXyTdoX_Wws9`Y(<Q73s_tAQ&i|+P<}ZL2Ikuk98JselKZUErh{g`8 zw|`b~33;Uxo(nH!_lyN*8oaIGI*}tbUVPr}3F-DqZGcpUF;vbvRlQHAIq23nS7hk2 zUwLihXTdTiRX6XnER(G3e<Y=lyNN+&;tt|cly(vx#U|8>jt9AaL_`ciRwp>38eR^x zRVN~lWBF2745eXB998RLiXAL7Fy#ow+HLcFZd-v0^Xmg9oGiBq#U%)Euc#NhJd1NX z;FS#Ia9pgUFlS2hS&ud*_+&h2cB(`o^G4vl^&ge~9<A(->9Z#rU#C-f2-iK4PnXey zClfEeCquKePyLooxxL(}-zb=H6f&eADXVK9%2U&Pf27`7OQBP8b4C(Fcu~4$5C!9x z_AcD^ux$C5b5}?c72WLdWV14FW%_&0C#b%COtUmH<-qXM`WkMNhYA#Dq{XU`xy-L_ zpz%@GE{+U%BgKuUfwSYf=4J~s!7$RC*`^)x^dK&^CASKr>v(WGuxNm>{K1jA;51@% zd=i&rS8Q>WnfT#UG}Wh^2MeQmw|+Jl$cpoD2x<$cHEb1+-3otJXGoomi>E<SN`mO> z;s#81*Pt3^&V1e6=+o=1;nFvX_gl8R(&~88#ZypI6&r_RVRksR*Q|}Wuhye{GpF<0 zc8{+Dc|vfJ_sUZcbN~v@NEsEzPnkvq7L|*P?{f05&5)HHKWn!RBhc+}7_|iTq`QF; zu8d+_<X%ZO<#MdZawqL;NAqjhAG0pqD3`sd+L}AfpQ^qbvZrZofjp_^Ktmuans);3 z&Se|G_hd*(uAw6>vh3|fV~seMHK#-2a?ZOz!|&}Y=}xR=MIwa?zJHg<3n<|W0~jCI z{BCf1oc?T&S_Xrw|G98eMYJ~o`tw<C$yt^?&Tm7F%cNl^+M0}bnyH^7uq&rxi67i6 zo8SStyNF-%rlNvk;5%mS8Uj6dv@&bSl!>z#;OU$@&ojzaV#9rkcIOX+Mqb%Tx4ubq z1Wx)bWmUoU_IX2z4|Ebo#_tR&f%^-uA`I!kH4|+$A{-kmR1+^pakE}yIY?2A|IN3d zs`K?<n}m{38&Rdi&TpOiFC5q*ccFdNuc4MO8gDUuyh~jajKY8z^o~Z>Kx$v2CM8yz zGS@husnYKSWFbp9uQ`$YXp{7iYp|2T8O*)OA8MVpoUrjcy7yvj2j8I`Vq~B`ihpK# zX!w538{GmTLJVUpb;}%AUc#jnZ&p9r7PrC<tEj6gMtnLq;obC}%1h9t$nxR=-tJOb zF8#y1AQ^O}LWdhcTQ%*{$dq-r-T9dLKVSKAL#iIp(s`Mh!D%F2`$}}kspa3-5;C8_ zVZ>1NbVvItoF|>6s%j(h@awVYdTn3a5h@H8m5^hMzCIo;PEAYlU##-sT<65sTD&Va zCnaqRwN7Yy>Y`bV?w%IDH#Vou%C%0MLKUR#RIxV#E0X4J&l(oWX9j{lHGlm(@Ju`R zW5sg5iBE$Wn_wC1MqZ|M&fFlNsKvcR?-<+5_bGJd#=B#Pu`*h%zC*~*=mDL`gU&c@ z?rPYF`o``Q;|<%`wB>r7)@&6fi?C(iA;C&FK83?Z`!vzQTH&>aSJ`e)(8PDD%f3@4 zlG3lX=kJsZ4V@W=t!C8Zay0$vO*$K@MqNrVQDVn!59TR_9?!ktaE_yM-%6IB`9%Yb z1Y1OnMqVM}gnJYcr8zb8GOiqjdQRiv#C#Eh&IALYdlo|zVxHU?3z(oI=r3P*G5E_t zQZiu^bJO0dP#T|<<kBqWCCRw)iS*r!id{+%3F&K;yis-L^$*Kx58>pA6XyN3Z;au% zxIC+&Y*d1idTx6_ZU_0n*INNvR`eCc7v^U-Ly^#YdN<PLP5*!`#;(!Bk5GK{7f2t2 zR5f=BkMv*6N4k#~-<pn2wOzi_6P6p0oJTP%8y%mpI;FT4^$BF{yu_K$*1{%1Hyn9~ zQb)~^IYK)iM<pf2Q}xxH;m3-3=#J0(tLIyTGFvuRW5YYP^p;!X;WdK}vKO*+9P-b) z7MG34dS)+=%&KuhdXA!IiQ=S%c;}6QUU(DpHM`GuaMSm-)-xQQwqvU+b3aaRmoM_( zFPlr4w~&ZrVMQFGbP*>qjdX~0<JUqj*6Lj&<QSQaUHII&B-p*j6&U@Ig&|6P#C`Fz z?;m3HG^lpJ2MYw(-CmY=9pQNz1=tG$@f!|+a-9Q968JwBP}j$AV?Jw?Sj=gJF;BYQ z3RwyApN>(P<JELP#E`#d9<HfXO{q68zI=wcbH68eCQZ)&6yje7avMo$dfPpH6(7Zl zG!gnnx7zS#MJ0lIFFSoTrSDDPHWdggw%M{gE(nHnG&@?nc#av((`8Dypl2`Q|7|L# zY){M!Y4SBFxW`?KoOpvPGE7R$qD0I#90RRj4s_ybNQzKh@Ym3dEt1Aij>6mKAXYb4 z&dBI`s+`@yKt+m-dF?}=osYCnJ|%6iefc&8-5tr%-BmSqK%;aV<|nx;=eC(tTfZj} zu{tE(#2kO~O|F2acCvR`FR0l+#!LL$#g@TNjh?r+3yl<l;KB#2u&adOSuhcj&B>p! z=XtWR<tp!0l2;JYDsZc*`f3sCYzw3F(mggP5~%!t#IpbilpsU`MgL&IKf?<m`yUM@ z1>hGT2@jx1!kzzTrv(4n>Bfw6k7rwT*S~g3h$I~8FYb?0Rt5H#NadbY$j;&SWHQH? zJ`GwkZ0H*it;rXs)ec)g;g`s<Lf`@wHj3^U2o}!EDd+9<XQ;E`wALhjmY?t?8Y0a7 zX9It`>j$0z<K5{9bFYi)vZ4g_4d+VhuU32`$T$Av{@-aL_M{L$OwILw#>TsqP?zA* z>PpNdWuE)<VqX@QC;KtlQorD5*6g;L|CJp*WC)AlGt6eG_Wtk*#2y|+7W^!irby9I z3s<y}mW(1J%8X3N(xthu71}{m5S51<(QpNYFFqwW7DIVj`Q3bv)BoUHS1AxZN!(7! zZ?Tu(5l6+vme~)%e$i4V&5}fT+}xDGSJ(IemlT-%1aaAE_$_lwcd1FsT_n?W=LFhH ziLfvLtfYldcRz44L6r4~u-y1=XIxKKBIZ$^(Kwrjn(>B-S_Khp2vtt`c{Bp%m|n|V z#kN52W+oVR_@Ek9{1f}iRy5AdS*Pp`f$95Oh2os&R*?%i-(p+%7EQ@wf{N>zVl;z% zL7cT-A9t`@jpFDZby}L~gQaTHHe`u*Gc^ztQbv!i7CGGk)?(4G2En@%glPw<^R)2R zt$E?TnIZx&Uc>ss1@p4HmVGAv%8OhU%nL0QuiZVR?vIt*wk1uY4DG$r&eW0KRwCLi z!hVJlvhAl-4}f7e2~pb&9SL6g2{DS=F3OdiA#-@CRg7x}Ch*1~JquBSH8%%lSkvJ4 zD_-QLZh8_>PA<Gtf^}lmmlQcsVeoaTGv7y0X^2aCVlpvtoVlT(FRa{|$gN|4_(`J> z_bH29MB1Gb=9b;PGRAoO<E4U|ZHDp`K-rZiuEq5Vrq8$0DCCA_U}LGgYs*i{lrDKO zi9b9~dsMvxcI&Hmvb1{c_5S+P%(i5eP+b<rftBcSeSQy`1;AKhysL*pV3`c4l#W%* z={M{<8X7j`@rKJmF6<SeDFM_9ObmsB*n1r+4beMO>((GHwkD<YF8h>%;ihnFj-!O_ zndGkfe+mSOq)PA>nROv0p+JhA>9)m3x5DG3@}pFTJYzA9510h9Eqjuis{Td{LZA8( zRr|RAE_DxikV68H$x-G6T<UpveZFVcue_Z4V3~UPjhvjQ+((!+5bNx7pVgz9z9L-M zH&kL_lNvmF-t5gr5VBUjPc2g{i%MZmq->*U`p|dAKQ;C+xcT^gDy`PG<s;a$ur*sb zqQKNbioAMNKa&uDA$2!U5xz;lQu_rLdSHYiTJ2?e6_&XN#1fI(`&&veJ7!!Bsd48E z1daRRPTn$67bkqk?#34lX0M1j8z|{KS?z|Ayn@p`Fr-I>myi4f(z)V@EQ<0sDYPAS z=fzeKSg{bi&WKyVackG#%f5^CcGkgT5)Tqi|4<kA({{O44cqua?w6dC9yOMgXT8xj zD49CN6)ImMm&i6=+?K4-FdJb{A#j*{d?ZAhMW_p;4P$5T&-zWApShTzJiEUp5z&F1 zd<&xv`5FpQ;oA`$e;+|j62=~RaqD!I3{36N81US`I|-Lg=7};EN<?OhcFo(2I`TfI z$6ys7O4h0kJ_PO#IK)b2&b&Ukpw0y>II8-8ITFDWd^lgixG>x+&$Iphr}c9Gyz3J> zlK|fEE^!_x*Z;O737t4SAuX#d%Tm|*Y5Q5Z;UJ2p^nfLGMII^+<$#iafI^f6_z)l- nA#J|)!OE23(Ua}T!MlHm;~}uz(myQ;uh8C`^y9()+minU{|(y8 diff --git a/builder/vsphere/test/test-key.pem b/builder/vsphere/test/test-key.pem deleted file mode 100644 index 8dad2ecd3..000000000 --- a/builder/vsphere/test/test-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA2J9w3cbqMJSDTCUtFW3qRHhqgXbSOW32anqEWQYvW48WKXJm -ZmuuSViC0tcAMCnX8pu5YGlAMCi5RBDtdoE9mZzUCfE4Q1Om42S2jKRrSSbhU9Ts -8jTRL0V81Tja64SEt5l1dDHS5sgNJy8C4nWaWob1HT+YloPEllj80ogwoQoL3ufp -r5me/TOrA3ApHXewWm0feBkkkuN6NkL1Z9sILCstLrjD+RVEOvI/wrHZEaLpYJ4P -LgS8LmTNKaFafmqwgcC4VcA4kVbhxw9X385v+mQLqpiOJa+vS51dT2qINEw+80Y+ -HL7k7OIZTLg803wubI3rUZQ/2PX/STBq1zO9RwIDAQABAoIBAAmrDBGJ6Dfk2PtU -CXAUaMlHipFeqUFQ7BeSgkeq5AA1IasV5QYbNjslzSj12ZdMtsuoMZzg9bFwj9w+ -2SpZ2FL70ebjsjwnBqLNguxCBlvMdXAVZ8Hjo5Z1hn3JvNOYJYhAPCLEeoI8WYHv -MjTDRPFXZqc4iGnnVaXUMOyAkZMOV6sMQzvuJad4x7gvQGRhCgcdnFdGbVs+MZQc -WPI6cO6imj27F6rJK3W6s5XcSjDbkpytf2wUuWYgck93Fdm3kYy3ER6B3P/MiM95 -qGRmg6OuEYbXAr4ytamjKUThl83SGvDS89N5SIjS5rgrEBgrOFBgMhjG/ibaxbrh -c84oplECgYEA+vyI4VUYgce8voYmdDijlM/NwPbCpD3SGiyXIYcDN1i/CUdDhBYh -z4982H6I1b2cg+veBWICro9Dp20CpfGtXT6Y3o1yNWkbKlosd+f2Us10fG1gkcyI -TiZCYaJPrtdoTT0vMKbdUbkgn0FLNbW1TCh5FQ7K7RXhDonb9BbsTzkCgYEA3PMu -bv/MgaET654GAItudazJmh4FfR905w59yVNJfe+7iG/f5zzv7vIpaERvBo245hcu -IaO8QbW5OKYuCaNIjGOSd1uxN5ytcOHcf1bmjS+WRQdu/FR5v9BM0BY66NFjqKMb -dZLXVZPnU3EOqCKmi9SI2VOVKrDL5XzMOHhL8H8CgYBFJh5wNomx993AgCVID/LB -pR8C8vldVsrz+yUIT7JLJWA8pi2rzo0yKk4zN2lrufnNPsbEpOQoQ8BX+GiqX5Ns -BTsI1d+JZ5Pcb0uhHX94ALL/NQNOKBPFtDTFwXpCqYZLAXhm5xJC2cZrGgommhGB -EgWKD7FI8KY44zJ+ZXJlwQKBgGvw/eFKZI17tPCp3cLMW2VvyXnaatIK2SC8SqVd -ZAz7XoG0Lg2ZDpqMgcAnlpn8CLWX43iZtjHf5qIPRXR96cZ0KqzXBcfmajE4lnE7 -chzNf7sve4AYgPY9fBk4kwUEroxHSvXwi/SJ8jwogoGPlA/CAC00ES6u+p2dj2OT -GX5fAoGBAM6saTeyjAjLDE/vlPM9OButsoj5CJg7DklRgrRuRyygbyRBudafslnl -8e4+4mlXEBwKDnrDTtXFhX1Ur95/w/4GjyFXO/TB/Tmn+vaEBQTzgViKc2cJ/yay -ttiF6oJh9EjCaFDTz5P11wX7DajRux/2tUcBXX/C3FcGhNEkVb2P ------END RSA PRIVATE KEY----- diff --git a/builder/vsphere/test/test-key.pub b/builder/vsphere/test/test-key.pub deleted file mode 100644 index c4c14bb04..000000000 --- a/builder/vsphere/test/test-key.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYn3DdxuowlINMJS0VbepEeGqBdtI5bfZqeoRZBi9bjxYpcmZma65JWILS1wAwKdfym7lgaUAwKLlEEO12gT2ZnNQJ8ThDU6bjZLaMpGtJJuFT1OzyNNEvRXzVONrrhIS3mXV0MdLmyA0nLwLidZpahvUdP5iWg8SWWPzSiDChCgve5+mvmZ79M6sDcCkdd7BabR94GSSS43o2QvVn2wgsKy0uuMP5FUQ68j/CsdkRoulgng8uBLwuZM0poVp+arCBwLhVwDiRVuHHD1ffzm/6ZAuqmI4lr69LnV1Paog0TD7zRj4cvuTs4hlMuDzTfC5sjetRlD/Y9f9JMGrXM71H diff --git a/builder/vsphere/version/version.go b/builder/vsphere/version/version.go deleted file mode 100644 index 001eefe9c..000000000 --- a/builder/vsphere/version/version.go +++ /dev/null @@ -1,13 +0,0 @@ -package version - -import ( - "github.com/hashicorp/packer-plugin-sdk/version" - packerVersion "github.com/hashicorp/packer/version" -) - -var VSpherePluginVersion *version.PluginVersion - -func init() { - VSpherePluginVersion = version.InitializePluginVersion( - packerVersion.Version, packerVersion.VersionPrerelease) -} diff --git a/command/plugin.go b/command/plugin.go index 57ccbf1d2..f5bb2ab61 100644 --- a/command/plugin.go +++ b/command/plugin.go @@ -56,8 +56,6 @@ import ( virtualboxvmbuilder "github.com/hashicorp/packer/builder/virtualbox/vm" vmwareisobuilder "github.com/hashicorp/packer/builder/vmware/iso" vmwarevmxbuilder "github.com/hashicorp/packer/builder/vmware/vmx" - vsphereclonebuilder "github.com/hashicorp/packer/builder/vsphere/clone" - vsphereisobuilder "github.com/hashicorp/packer/builder/vsphere/iso" yandexbuilder "github.com/hashicorp/packer/builder/yandex" alicloudimportpostprocessor "github.com/hashicorp/packer/post-processor/alicloud-import" artificepostprocessor "github.com/hashicorp/packer/post-processor/artifice" @@ -71,8 +69,6 @@ import ( ucloudimportpostprocessor "github.com/hashicorp/packer/post-processor/ucloud-import" vagrantpostprocessor "github.com/hashicorp/packer/post-processor/vagrant" vagrantcloudpostprocessor "github.com/hashicorp/packer/post-processor/vagrant-cloud" - vspherepostprocessor "github.com/hashicorp/packer/post-processor/vsphere" - vspheretemplatepostprocessor "github.com/hashicorp/packer/post-processor/vsphere-template" yandexexportpostprocessor "github.com/hashicorp/packer/post-processor/yandex-export" yandeximportpostprocessor "github.com/hashicorp/packer/post-processor/yandex-import" ansibleprovisioner "github.com/hashicorp/packer/provisioner/ansible" @@ -143,8 +139,6 @@ var Builders = map[string]packersdk.Builder{ "virtualbox-vm": new(virtualboxvmbuilder.Builder), "vmware-iso": new(vmwareisobuilder.Builder), "vmware-vmx": new(vmwarevmxbuilder.Builder), - "vsphere-clone": new(vsphereclonebuilder.Builder), - "vsphere-iso": new(vsphereisobuilder.Builder), "yandex": new(yandexbuilder.Builder), } @@ -182,8 +176,6 @@ var PostProcessors = map[string]packersdk.PostProcessor{ "ucloud-import": new(ucloudimportpostprocessor.PostProcessor), "vagrant": new(vagrantpostprocessor.PostProcessor), "vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor), - "vsphere": new(vspherepostprocessor.PostProcessor), - "vsphere-template": new(vspheretemplatepostprocessor.PostProcessor), "yandex-export": new(yandexexportpostprocessor.PostProcessor), "yandex-import": new(yandeximportpostprocessor.PostProcessor), } diff --git a/post-processor/vsphere-template/post-processor.go b/post-processor/vsphere-template/post-processor.go deleted file mode 100644 index 852ce677f..000000000 --- a/post-processor/vsphere-template/post-processor.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:generate mapstructure-to-hcl2 -type Config - -package vsphere_template - -import ( - "context" - "errors" - "fmt" - "net/url" - "strings" - "time" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer-plugin-sdk/common" - "github.com/hashicorp/packer-plugin-sdk/multistep" - "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" - vmwcommon "github.com/hashicorp/packer/builder/vmware/common" - vsphere "github.com/hashicorp/packer/builder/vsphere/common" - "github.com/hashicorp/packer/post-processor/artifice" - vspherepost "github.com/hashicorp/packer/post-processor/vsphere" - "github.com/vmware/govmomi" -) - -var builtins = map[string]string{ - vspherepost.BuilderId: "vmware", - vmwcommon.BuilderIdESX: "vmware", - vsphere.BuilderId: "vsphere", - artifice.BuilderId: "artifice", -} - -type Config struct { - common.PackerConfig `mapstructure:",squash"` - Host string `mapstructure:"host"` - Insecure bool `mapstructure:"insecure"` - Username string `mapstructure:"username"` - Password string `mapstructure:"password"` - Datacenter string `mapstructure:"datacenter"` - Folder string `mapstructure:"folder"` - SnapshotEnable bool `mapstructure:"snapshot_enable"` - SnapshotName string `mapstructure:"snapshot_name"` - SnapshotDescription string `mapstructure:"snapshot_description"` - ReregisterVM config.Trilean `mapstructure:"reregister_vm"` - - ctx interpolate.Context -} - -type PostProcessor struct { - config Config - url *url.URL -} - -func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } - -func (p *PostProcessor) Configure(raws ...interface{}) error { - err := config.Decode(&p.config, &config.DecodeOpts{ - PluginType: vsphere.BuilderId, - Interpolate: true, - InterpolateContext: &p.config.ctx, - InterpolateFilter: &interpolate.RenderFilter{ - Exclude: []string{}, - }, - }, raws...) - - if err != nil { - return err - } - - errs := new(packersdk.MultiError) - vc := map[string]*string{ - "host": &p.config.Host, - "username": &p.config.Username, - "password": &p.config.Password, - } - - for key, ptr := range vc { - if *ptr == "" { - errs = packersdk.MultiErrorAppend( - errs, fmt.Errorf("%s must be set", key)) - } - } - - if p.config.Folder != "" && !strings.HasPrefix(p.config.Folder, "/") { - errs = packersdk.MultiErrorAppend( - errs, fmt.Errorf("Folder must be bound to the root")) - } - - sdk, err := url.Parse(fmt.Sprintf("https://%v/sdk", p.config.Host)) - if err != nil { - errs = packersdk.MultiErrorAppend( - errs, fmt.Errorf("Error invalid vSphere sdk endpoint: %s", err)) - return errs - } - - sdk.User = url.UserPassword(p.config.Username, p.config.Password) - p.url = sdk - - if len(errs.Errors) > 0 { - return errs - } - return nil -} - -func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { - if _, ok := builtins[artifact.BuilderId()]; !ok { - return nil, false, false, fmt.Errorf("The Packer vSphere Template post-processor "+ - "can only take an artifact from the VMware-iso builder, built on "+ - "ESXi (i.e. remote) or an artifact from the vSphere post-processor. "+ - "Artifact type %s does not fit this requirement", artifact.BuilderId()) - } - - f := artifact.State(vmwcommon.ArtifactConfFormat) - k := artifact.State(vmwcommon.ArtifactConfKeepRegistered) - s := artifact.State(vmwcommon.ArtifactConfSkipExport) - - if f != "" && k != "true" && s == "false" { - return nil, false, false, errors.New("To use this post-processor with exporting behavior you need set keep_registered as true") - } - - // In some occasions the VM state is powered on and if we immediately try to mark as template - // (after the ESXi creates it) it will fail. If vSphere is given a few seconds this behavior doesn't reappear. - ui.Message("Waiting 10s for VMware vSphere to start") - time.Sleep(10 * time.Second) - c, err := govmomi.NewClient(context.Background(), p.url, p.config.Insecure) - if err != nil { - return nil, false, false, fmt.Errorf("Error connecting to vSphere: %s", err) - } - - defer c.Logout(context.Background()) - - state := new(multistep.BasicStateBag) - state.Put("ui", ui) - state.Put("client", c) - - steps := []multistep.Step{ - &stepChooseDatacenter{ - Datacenter: p.config.Datacenter, - }, - &stepCreateFolder{ - Folder: p.config.Folder, - }, - NewStepCreateSnapshot(artifact, p), - NewStepMarkAsTemplate(artifact, p), - } - runner := commonsteps.NewRunnerWithPauseFn(steps, p.config.PackerConfig, ui, state) - runner.Run(ctx, state) - if rawErr, ok := state.GetOk("error"); ok { - return nil, false, false, rawErr.(error) - } - return artifact, true, true, nil -} diff --git a/post-processor/vsphere-template/post-processor.hcl2spec.go b/post-processor/vsphere-template/post-processor.hcl2spec.go deleted file mode 100644 index 214568087..000000000 --- a/post-processor/vsphere-template/post-processor.hcl2spec.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. - -package vsphere_template - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatConfig is an auto-generated flat version of Config. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConfig struct { - PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` - PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` - PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` - PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` - PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` - PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` - PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` - PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` - Username *string `mapstructure:"username" cty:"username" hcl:"username"` - Password *string `mapstructure:"password" cty:"password" hcl:"password"` - Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` - Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` - SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable" hcl:"snapshot_enable"` - SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name" hcl:"snapshot_name"` - SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description" hcl:"snapshot_description"` - ReregisterVM *bool `mapstructure:"reregister_vm" cty:"reregister_vm" hcl:"reregister_vm"` -} - -// FlatMapstructure returns a new FlatConfig. -// FlatConfig is an auto-generated flat version of Config. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConfig) -} - -// HCL2Spec returns the hcl spec of a Config. -// This spec is used by HCL to read the fields of Config. -// The decoded values from this spec will then be applied to a FlatConfig. -func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, - "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, - "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, - "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, - "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, - "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, - "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, - "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, - "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, - "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, - "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, - "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, - "snapshot_enable": &hcldec.AttrSpec{Name: "snapshot_enable", Type: cty.Bool, Required: false}, - "snapshot_name": &hcldec.AttrSpec{Name: "snapshot_name", Type: cty.String, Required: false}, - "snapshot_description": &hcldec.AttrSpec{Name: "snapshot_description", Type: cty.String, Required: false}, - "reregister_vm": &hcldec.AttrSpec{Name: "reregister_vm", Type: cty.Bool, Required: false}, - } - return s -} diff --git a/post-processor/vsphere-template/post-processor_test.go b/post-processor/vsphere-template/post-processor_test.go deleted file mode 100644 index b1f682d60..000000000 --- a/post-processor/vsphere-template/post-processor_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package vsphere_template - -import ( - "testing" -) - -func getTestConfig() Config { - return Config{ - Username: "me", - Password: "notpassword", - Host: "myhost", - } -} - -func TestConfigure_Good(t *testing.T) { - var p PostProcessor - - config := getTestConfig() - - err := p.Configure(config) - if err != nil { - t.Errorf("Error: %s", err) - } -} - -func TestConfigure_ReRegisterVM(t *testing.T) { - var p PostProcessor - - config := getTestConfig() - - err := p.Configure(config) - if err != nil { - t.Errorf("Error: %s", err) - } - - if p.config.ReregisterVM.False() { - t.Errorf("This should default to unset, not false.") - } -} diff --git a/post-processor/vsphere-template/step_choose_datacenter.go b/post-processor/vsphere-template/step_choose_datacenter.go deleted file mode 100644 index 6645c4dc5..000000000 --- a/post-processor/vsphere-template/step_choose_datacenter.go +++ /dev/null @@ -1,35 +0,0 @@ -package vsphere_template - -import ( - "context" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/find" -) - -type stepChooseDatacenter struct { - Datacenter string -} - -func (s *stepChooseDatacenter) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - cli := state.Get("client").(*govmomi.Client) - finder := find.NewFinder(cli.Client, false) - - ui.Message("Choosing datacenter...") - - dc, err := finder.DatacenterOrDefault(context.Background(), s.Datacenter) - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - state.Put("dcPath", dc.InventoryPath) - - return multistep.ActionContinue -} - -func (s *stepChooseDatacenter) Cleanup(multistep.StateBag) {} diff --git a/post-processor/vsphere-template/step_create_folder.go b/post-processor/vsphere-template/step_create_folder.go deleted file mode 100644 index 282848434..000000000 --- a/post-processor/vsphere-template/step_create_folder.go +++ /dev/null @@ -1,86 +0,0 @@ -package vsphere_template - -import ( - "context" - "fmt" - "path" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/object" -) - -type stepCreateFolder struct { - Folder string -} - -func (s *stepCreateFolder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - cli := state.Get("client").(*govmomi.Client) - dcPath := state.Get("dcPath").(string) - - ui.Message("Creating or checking destination folders...") - - base := path.Join(dcPath, "vm") - fullPath := path.Join(base, s.Folder) - si := object.NewSearchIndex(cli.Client) - - var folders []string - var err error - var ref object.Reference - - // We iterate over the path starting with full path - // If we don't find it, we save the folder name and continue with the previous path - // The iteration ends when we find an existing path otherwise it throws error - for { - ref, err = si.FindByInventoryPath(context.Background(), fullPath) - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - if ref == nil { - dir, folder := path.Split(fullPath) - fullPath = path.Clean(dir) - - if fullPath == dcPath { - err = fmt.Errorf("vSphere base path %s not found", base) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - folders = append(folders, folder) - } else { - break - } - } - - if root, ok := ref.(*object.Folder); ok { - for i := len(folders) - 1; i >= 0; i-- { - ui.Message(fmt.Sprintf("Creating folder: %v", folders[i])) - - root, err = root.CreateFolder(context.Background(), folders[i]) - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - fullPath = path.Join(fullPath, folders[i]) - } - root.SetInventoryPath(fullPath) - state.Put("folder", root) - } else { - err = fmt.Errorf("folder not found: '%v'", ref) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *stepCreateFolder) Cleanup(multistep.StateBag) {} diff --git a/post-processor/vsphere-template/step_create_snapshot.go b/post-processor/vsphere-template/step_create_snapshot.go deleted file mode 100644 index da815abb3..000000000 --- a/post-processor/vsphere-template/step_create_snapshot.go +++ /dev/null @@ -1,76 +0,0 @@ -package vsphere_template - -import ( - "context" - "strings" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer/post-processor/vsphere" - "github.com/vmware/govmomi" -) - -type stepCreateSnapshot struct { - VMName string - RemoteFolder string - SnapshotName string - SnapshotDescription string - SnapshotEnable bool -} - -func NewStepCreateSnapshot(artifact packersdk.Artifact, p *PostProcessor) *stepCreateSnapshot { - remoteFolder := "Discovered virtual machine" - vmname := artifact.Id() - - if artifact.BuilderId() == vsphere.BuilderId { - id := strings.Split(artifact.Id(), "::") - remoteFolder = id[1] - vmname = id[2] - } - - return &stepCreateSnapshot{ - VMName: vmname, - RemoteFolder: remoteFolder, - SnapshotEnable: p.config.SnapshotEnable, - SnapshotName: p.config.SnapshotName, - SnapshotDescription: p.config.SnapshotDescription, - } -} - -func (s *stepCreateSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - cli := state.Get("client").(*govmomi.Client) - dcPath := state.Get("dcPath").(string) - - if !s.SnapshotEnable { - return multistep.ActionContinue - } - - ui.Message("Creating a Snapshot...") - - vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) - - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - task, err := vm.CreateSnapshot(context.Background(), s.SnapshotName, s.SnapshotDescription, false, false) - - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - if err = task.Wait(context.Background()); err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func (s *stepCreateSnapshot) Cleanup(multistep.StateBag) {} diff --git a/post-processor/vsphere-template/step_mark_as_template.go b/post-processor/vsphere-template/step_mark_as_template.go deleted file mode 100644 index 6b5bc81ce..000000000 --- a/post-processor/vsphere-template/step_mark_as_template.go +++ /dev/null @@ -1,186 +0,0 @@ -package vsphere_template - -import ( - "context" - "fmt" - "path" - "regexp" - "strings" - - "github.com/hashicorp/packer-plugin-sdk/multistep" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer/post-processor/vsphere" - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type stepMarkAsTemplate struct { - VMName string - RemoteFolder string - ReregisterVM config.Trilean -} - -func NewStepMarkAsTemplate(artifact packersdk.Artifact, p *PostProcessor) *stepMarkAsTemplate { - remoteFolder := "Discovered virtual machine" - vmname := artifact.Id() - - if artifact.BuilderId() == vsphere.BuilderId { - id := strings.Split(artifact.Id(), "::") - remoteFolder = id[1] - vmname = id[2] - } - - return &stepMarkAsTemplate{ - VMName: vmname, - RemoteFolder: remoteFolder, - ReregisterVM: p.config.ReregisterVM, - } -} - -func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packersdk.Ui) - cli := state.Get("client").(*govmomi.Client) - folder := state.Get("folder").(*object.Folder) - dcPath := state.Get("dcPath").(string) - - vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - // Use a simple "MarkAsTemplate" method unless `reregister_vm` is true - if s.ReregisterVM.False() { - ui.Message("Marking as a template...") - - if err := vm.MarkAsTemplate(context.Background()); err != nil { - state.Put("error", err) - ui.Error("vm.MarkAsTemplate:" + err.Error()) - return multistep.ActionHalt - } - return multistep.ActionContinue - } - - ui.Message("Re-register VM as a template...") - - dsPath, err := datastorePath(vm) - if err != nil { - state.Put("error", err) - ui.Error("datastorePath:" + err.Error()) - return multistep.ActionHalt - } - - host, err := vm.HostSystem(context.Background()) - if err != nil { - state.Put("error", err) - ui.Error("vm.HostSystem:" + err.Error()) - return multistep.ActionHalt - } - - if err := vm.Unregister(context.Background()); err != nil { - state.Put("error", err) - ui.Error("vm.Unregister:" + err.Error()) - return multistep.ActionHalt - } - - if err := unregisterPreviousVM(cli, folder, s.VMName); err != nil { - state.Put("error", err) - ui.Error("unregisterPreviousVM:" + err.Error()) - return multistep.ActionHalt - } - - task, err := folder.RegisterVM(context.Background(), dsPath.String(), s.VMName, true, nil, host) - if err != nil { - state.Put("error", err) - ui.Error("RegisterVM:" + err.Error()) - return multistep.ActionHalt - } - - if err = task.Wait(context.Background()); err != nil { - state.Put("error", err) - ui.Error("task.Wait:" + err.Error()) - return multistep.ActionHalt - } - - return multistep.ActionContinue -} - -func datastorePath(vm *object.VirtualMachine) (*object.DatastorePath, error) { - devices, err := vm.Device(context.Background()) - if err != nil { - return nil, err - } - - disk := "" - for _, device := range devices { - if d, ok := device.(*types.VirtualDisk); ok { - if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { - disk = b.GetVirtualDeviceFileBackingInfo().FileName - } - break - } - } - - if disk == "" { - return nil, fmt.Errorf("disk not found in '%v'", vm.Name()) - } - - re := regexp.MustCompile("\\[(.*?)\\]") - - datastore := re.FindStringSubmatch(disk)[1] - vmxPath := path.Join("/", path.Dir(strings.Split(disk, " ")[1]), vm.Name()+".vmx") - - return &object.DatastorePath{ - Datastore: datastore, - Path: vmxPath, - }, nil -} - -func findRuntimeVM(cli *govmomi.Client, dcPath, name, remoteFolder string) (*object.VirtualMachine, error) { - si := object.NewSearchIndex(cli.Client) - fullPath := path.Join(dcPath, "vm", remoteFolder, name) - - ref, err := si.FindByInventoryPath(context.Background(), fullPath) - if err != nil { - return nil, err - } - - if ref == nil { - return nil, fmt.Errorf("VM at path %s not found", fullPath) - } - - vm := ref.(*object.VirtualMachine) - if vm.InventoryPath == "" { - vm.SetInventoryPath(fullPath) - } - - return vm, nil -} - -// If in the target folder a virtual machine or template already exists -// it will be removed to maintain consistency -func unregisterPreviousVM(cli *govmomi.Client, folder *object.Folder, name string) error { - si := object.NewSearchIndex(cli.Client) - fullPath := path.Join(folder.InventoryPath, name) - - ref, err := si.FindByInventoryPath(context.Background(), fullPath) - if err != nil { - return err - } - - if ref != nil { - if vm, ok := ref.(*object.VirtualMachine); ok { - return vm.Unregister(context.Background()) - } else { - return fmt.Errorf("an object name '%v' already exists", name) - } - - } - - return nil -} - -func (s *stepMarkAsTemplate) Cleanup(multistep.StateBag) {} diff --git a/post-processor/vsphere-template/version/version.go b/post-processor/vsphere-template/version/version.go deleted file mode 100644 index 46226fc6e..000000000 --- a/post-processor/vsphere-template/version/version.go +++ /dev/null @@ -1,13 +0,0 @@ -package version - -import ( - "github.com/hashicorp/packer-plugin-sdk/version" - packerVersion "github.com/hashicorp/packer/version" -) - -var VSphereTemplatePostprocessorVersion *version.PluginVersion - -func init() { - VSphereTemplatePostprocessorVersion = version.InitializePluginVersion( - packerVersion.Version, packerVersion.VersionPrerelease) -} diff --git a/post-processor/vsphere/artifact.go b/post-processor/vsphere/artifact.go deleted file mode 100644 index 90e475a28..000000000 --- a/post-processor/vsphere/artifact.go +++ /dev/null @@ -1,47 +0,0 @@ -package vsphere - -import ( - "fmt" -) - -const BuilderId = "packer.post-processor.vsphere" - -type Artifact struct { - files []string - datastore string - vmfolder string - vmname string -} - -func NewArtifact(datastore, vmfolder, vmname string, files []string) *Artifact { - return &Artifact{ - files: files, - datastore: datastore, - vmfolder: vmfolder, - vmname: vmname, - } -} - -func (*Artifact) BuilderId() string { - return BuilderId -} - -func (a *Artifact) Files() []string { - return a.files -} - -func (a *Artifact) Id() string { - return fmt.Sprintf("%s::%s::%s", a.datastore, a.vmfolder, a.vmname) -} - -func (a *Artifact) String() string { - return fmt.Sprintf("VM: %s Folder: %s Datastore: %s", a.vmname, a.vmfolder, a.datastore) -} - -func (*Artifact) State(name string) interface{} { - return nil -} - -func (a *Artifact) Destroy() error { - return nil -} diff --git a/post-processor/vsphere/artifact_test.go b/post-processor/vsphere/artifact_test.go deleted file mode 100644 index c5cf8c9cc..000000000 --- a/post-processor/vsphere/artifact_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package vsphere - -import ( - "testing" - - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" -) - -func TestArtifact_ImplementsArtifact(t *testing.T) { - var raw interface{} - raw = &Artifact{} - if _, ok := raw.(packersdk.Artifact); !ok { - t.Fatalf("Artifact should be a Artifact") - } -} - -func TestArtifact_Id(t *testing.T) { - artifact := NewArtifact("datastore", "vmfolder", "vmname", nil) - if artifact.Id() != "datastore::vmfolder::vmname" { - t.Fatalf("must return datastore, vmfolder and vmname splitted by :: as Id") - } -} diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go deleted file mode 100644 index 827ad7273..000000000 --- a/post-processor/vsphere/post-processor.go +++ /dev/null @@ -1,280 +0,0 @@ -//go:generate mapstructure-to-hcl2 -type Config - -package vsphere - -import ( - "bytes" - "context" - "fmt" - "log" - "net/url" - "os/exec" - "regexp" - "runtime" - "strings" - "time" - - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/packer-plugin-sdk/common" - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - shelllocal "github.com/hashicorp/packer-plugin-sdk/shell-local" - "github.com/hashicorp/packer-plugin-sdk/template/config" - "github.com/hashicorp/packer-plugin-sdk/template/interpolate" -) - -var ovftool string = "ovftool" - -var ( - // Regular expression to validate RFC1035 hostnames from full fqdn or simple hostname. - // For example "packer-esxi1". Requires proper DNS setup and/or correct DNS search domain setting. - hostnameRegex = regexp.MustCompile(`^[[:alnum:]][[:alnum:]\-]{0,61}[[:alnum:]]|[[:alpha:]]$`) - - // Simple regular expression to validate IPv4 values. - // For example "192.168.1.1". - ipv4Regex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) -) - -type Config struct { - common.PackerConfig `mapstructure:",squash"` - - Cluster string `mapstructure:"cluster"` - Datacenter string `mapstructure:"datacenter"` - Datastore string `mapstructure:"datastore"` - DiskMode string `mapstructure:"disk_mode"` - Host string `mapstructure:"host"` - ESXiHost string `mapstructure:"esxi_host"` - Insecure bool `mapstructure:"insecure"` - Options []string `mapstructure:"options"` - Overwrite bool `mapstructure:"overwrite"` - Password string `mapstructure:"password"` - ResourcePool string `mapstructure:"resource_pool"` - Username string `mapstructure:"username"` - VMFolder string `mapstructure:"vm_folder"` - VMName string `mapstructure:"vm_name"` - VMNetwork string `mapstructure:"vm_network"` - - ctx interpolate.Context -} - -type PostProcessor struct { - config Config -} - -func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } - -func (p *PostProcessor) Configure(raws ...interface{}) error { - err := config.Decode(&p.config, &config.DecodeOpts{ - PluginType: BuilderId, - Interpolate: true, - InterpolateContext: &p.config.ctx, - InterpolateFilter: &interpolate.RenderFilter{ - Exclude: []string{}, - }, - }, raws...) - if err != nil { - return err - } - - // Defaults - if p.config.DiskMode == "" { - p.config.DiskMode = "thick" - } - - // Accumulate any errors - errs := new(packersdk.MultiError) - - if runtime.GOOS == "windows" { - ovftool = "ovftool.exe" - } - - if _, err := exec.LookPath(ovftool); err != nil { - errs = packersdk.MultiErrorAppend( - errs, fmt.Errorf("ovftool not found: %s", err)) - } - - // First define all our templatable parameters that are _required_ - templates := map[string]*string{ - "cluster": &p.config.Cluster, - "datacenter": &p.config.Datacenter, - "diskmode": &p.config.DiskMode, - "host": &p.config.Host, - "password": &p.config.Password, - "username": &p.config.Username, - "vm_name": &p.config.VMName, - } - for key, ptr := range templates { - if *ptr == "" { - errs = packersdk.MultiErrorAppend( - errs, fmt.Errorf("%s must be set", key)) - } - } - - if len(errs.Errors) > 0 { - return errs - } - - return nil -} - -func (p *PostProcessor) generateURI() (*url.URL, error) { - // use net/url lib to encode and escape url elements - ovftool_uri := fmt.Sprintf("vi://%s/%s/host/%s", - p.config.Host, - p.config.Datacenter, - p.config.Cluster) - - if p.config.ResourcePool != "" { - ovftool_uri += "/Resources/" + p.config.ResourcePool - } - - u, err := url.Parse(ovftool_uri) - if err != nil { - return nil, fmt.Errorf("Couldn't generate uri for ovftool: %s", err) - } - u.User = url.UserPassword(p.config.Username, p.config.Password) - - if p.config.ESXiHost != "" { - q := u.Query() - if ipv4Regex.MatchString(p.config.ESXiHost) { - q.Add("ip", p.config.ESXiHost) - } else if hostnameRegex.MatchString(p.config.ESXiHost) { - q.Add("dns", p.config.ESXiHost) - } - u.RawQuery = q.Encode() - } - return u, nil -} - -func getEncodedPassword(u *url.URL) (string, bool) { - // filter password from all logging - password, passwordSet := u.User.Password() - if passwordSet && password != "" { - encodedPassword := strings.Split(u.User.String(), ":")[1] - return encodedPassword, true - } - return password, false -} - -func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { - source := "" - for _, path := range artifact.Files() { - if strings.HasSuffix(path, ".vmx") || strings.HasSuffix(path, ".ovf") || strings.HasSuffix(path, ".ova") { - source = path - break - } - } - - if source == "" { - return nil, false, false, fmt.Errorf("VMX, OVF or OVA file not found") - } - - ovftool_uri, err := p.generateURI() - if err != nil { - return nil, false, false, err - } - encodedPassword, isSet := getEncodedPassword(ovftool_uri) - if isSet { - packersdk.LogSecretFilter.Set(encodedPassword) - } - - args, err := p.BuildArgs(source, ovftool_uri.String()) - if err != nil { - ui.Message(fmt.Sprintf("Failed: %s\n", err)) - } - - ui.Message(fmt.Sprintf("Uploading %s to vSphere", source)) - - log.Printf("Starting ovftool with parameters: %s", strings.Join(args, " ")) - - ui.Message("Validating Username and Password with dry-run") - err = p.ValidateOvfTool(args, ovftool) - if err != nil { - return nil, false, false, err - } - - // Validation has passed, so run for real. - ui.Message("Calling OVFtool to upload vm") - commandAndArgs := []string{ovftool} - commandAndArgs = append(commandAndArgs, args...) - comm := &shelllocal.Communicator{ - ExecuteCommand: commandAndArgs, - } - flattenedCmd := strings.Join(commandAndArgs, " ") - cmd := &packersdk.RemoteCmd{Command: flattenedCmd} - log.Printf("[INFO] (vsphere): starting ovftool command: %s", flattenedCmd) - err = cmd.RunWithUi(ctx, comm, ui) - if err != nil || cmd.ExitStatus() != 0 { - return nil, false, false, fmt.Errorf( - "Error uploading virtual machine: Please see output above for more information.") - } - - artifact = NewArtifact(p.config.Datastore, p.config.VMFolder, p.config.VMName, artifact.Files()) - - return artifact, false, false, nil -} - -func (p *PostProcessor) ValidateOvfTool(args []string, ofvtool string) error { - args = append([]string{"--verifyOnly"}, args...) - var out bytes.Buffer - cmdCtx, cancel := context.WithTimeout(context.Background(), 20*time.Second) - defer cancel() - cmd := exec.CommandContext(cmdCtx, ovftool, args...) - cmd.Stdout = &out - - // Need to manually close stdin or else the ofvtool call will hang - // forever in a situation where the user has provided an invalid - // password or username - stdin, err := cmd.StdinPipe() - if err != nil { - return err - } - defer stdin.Close() - - if err := cmd.Run(); err != nil { - outString := out.String() - if strings.Contains(outString, "Enter login information for") { - err = fmt.Errorf("Error performing OVFtool dry run; the username " + - "or password you provided to ovftool is likely invalid.") - return err - } - return nil - } - return nil -} - -func (p *PostProcessor) BuildArgs(source, ovftool_uri string) ([]string, error) { - args := []string{ - "--acceptAllEulas", - fmt.Sprintf(`--name=%s`, p.config.VMName), - fmt.Sprintf(`--datastore=%s`, p.config.Datastore), - } - - if p.config.Insecure { - args = append(args, fmt.Sprintf(`--noSSLVerify=%t`, p.config.Insecure)) - } - - if p.config.DiskMode != "" { - args = append(args, fmt.Sprintf(`--diskMode=%s`, p.config.DiskMode)) - } - - if p.config.VMFolder != "" { - args = append(args, fmt.Sprintf(`--vmFolder=%s`, p.config.VMFolder)) - } - - if p.config.VMNetwork != "" { - args = append(args, fmt.Sprintf(`--network=%s`, p.config.VMNetwork)) - } - - if p.config.Overwrite == true { - args = append(args, "--overwrite") - } - - if len(p.config.Options) > 0 { - args = append(args, p.config.Options...) - } - - args = append(args, source) - args = append(args, ovftool_uri) - - return args, nil -} diff --git a/post-processor/vsphere/post-processor.hcl2spec.go b/post-processor/vsphere/post-processor.hcl2spec.go deleted file mode 100644 index da4d82973..000000000 --- a/post-processor/vsphere/post-processor.hcl2spec.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. - -package vsphere - -import ( - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/zclconf/go-cty/cty" -) - -// FlatConfig is an auto-generated flat version of Config. -// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. -type FlatConfig struct { - PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` - PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` - PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` - PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` - PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` - PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` - PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` - PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` - Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` - Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` - Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` - DiskMode *string `mapstructure:"disk_mode" cty:"disk_mode" hcl:"disk_mode"` - Host *string `mapstructure:"host" cty:"host" hcl:"host"` - ESXiHost *string `mapstructure:"esxi_host" cty:"esxi_host" hcl:"esxi_host"` - Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` - Options []string `mapstructure:"options" cty:"options" hcl:"options"` - Overwrite *bool `mapstructure:"overwrite" cty:"overwrite" hcl:"overwrite"` - Password *string `mapstructure:"password" cty:"password" hcl:"password"` - ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` - Username *string `mapstructure:"username" cty:"username" hcl:"username"` - VMFolder *string `mapstructure:"vm_folder" cty:"vm_folder" hcl:"vm_folder"` - VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` - VMNetwork *string `mapstructure:"vm_network" cty:"vm_network" hcl:"vm_network"` -} - -// FlatMapstructure returns a new FlatConfig. -// FlatConfig is an auto-generated flat version of Config. -// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. -func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { - return new(FlatConfig) -} - -// HCL2Spec returns the hcl spec of a Config. -// This spec is used by HCL to read the fields of Config. -// The decoded values from this spec will then be applied to a FlatConfig. -func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { - s := map[string]hcldec.Spec{ - "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, - "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, - "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, - "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, - "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, - "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, - "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, - "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, - "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, - "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, - "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, - "disk_mode": &hcldec.AttrSpec{Name: "disk_mode", Type: cty.String, Required: false}, - "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, - "esxi_host": &hcldec.AttrSpec{Name: "esxi_host", Type: cty.String, Required: false}, - "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, - "options": &hcldec.AttrSpec{Name: "options", Type: cty.List(cty.String), Required: false}, - "overwrite": &hcldec.AttrSpec{Name: "overwrite", Type: cty.Bool, Required: false}, - "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, - "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, - "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, - "vm_folder": &hcldec.AttrSpec{Name: "vm_folder", Type: cty.String, Required: false}, - "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, - "vm_network": &hcldec.AttrSpec{Name: "vm_network", Type: cty.String, Required: false}, - } - return s -} diff --git a/post-processor/vsphere/post-processor_test.go b/post-processor/vsphere/post-processor_test.go deleted file mode 100644 index c666cb625..000000000 --- a/post-processor/vsphere/post-processor_test.go +++ /dev/null @@ -1,130 +0,0 @@ -package vsphere - -import ( - "fmt" - "net/url" - "strings" - "testing" -) - -func getTestConfig() Config { - return Config{ - Username: "me", - Password: "notpassword", - Host: "myhost", - Datacenter: "mydc", - Cluster: "mycluster", - VMName: "my vm", - Datastore: "my datastore", - Insecure: true, - DiskMode: "thin", - VMFolder: "my folder", - } -} - -func TestArgs(t *testing.T) { - var p PostProcessor - - p.config = getTestConfig() - - source := "something.vmx" - ovftool_uri := fmt.Sprintf("vi://%s:%s@%s/%s/host/%s", - url.QueryEscape(p.config.Username), - url.QueryEscape(p.config.Password), - p.config.Host, - p.config.Datacenter, - p.config.Cluster) - - if p.config.ResourcePool != "" { - ovftool_uri += "/Resources/" + p.config.ResourcePool - } - - args, err := p.BuildArgs(source, ovftool_uri) - if err != nil { - t.Errorf("Error: %s", err) - } - - t.Logf("ovftool %s", strings.Join(args, " ")) -} - -func TestGenerateURI_Basic(t *testing.T) { - var p PostProcessor - - p.config = getTestConfig() - - uri, err := p.generateURI() - if err != nil { - t.Fatalf("had error: %s", err) - } - expected_uri := "vi://me:notpassword@myhost/mydc/host/mycluster" - if uri.String() != expected_uri { - t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri) - } -} - -func TestGenerateURI_PasswordEscapes(t *testing.T) { - type escapeCases struct { - Input string - Expected string - } - - cases := []escapeCases{ - {`this has spaces`, `this%20has%20spaces`}, - {`exclaimation_!`, `exclaimation_%21`}, - {`hash_#_dollar_$`, `hash_%23_dollar_$`}, - {`ampersand_&awesome`, `ampersand_&awesome`}, - {`single_quote_'_and_another_'`, `single_quote_%27_and_another_%27`}, - {`open_paren_(_close_paren_)`, `open_paren_%28_close_paren_%29`}, - {`asterisk_*_plus_+`, `asterisk_%2A_plus_+`}, - {`comma_,slash_/`, `comma_,slash_%2F`}, - {`colon_:semicolon_;`, `colon_%3Asemicolon_;`}, - {`equal_=question_?`, `equal_=question_%3F`}, - {`at_@`, `at_%40`}, - {`open_bracket_[closed_bracket]`, `open_bracket_%5Bclosed_bracket%5D`}, - {`user:password with $paces@host/name.foo`, `user%3Apassword%20with%20$paces%40host%2Fname.foo`}, - } - - for _, escapeCase := range cases { - var p PostProcessor - - p.config = getTestConfig() - p.config.Password = escapeCase.Input - - uri, err := p.generateURI() - if err != nil { - t.Fatalf("had error: %s", err) - } - expected_uri := fmt.Sprintf("vi://me:%s@myhost/mydc/host/mycluster", escapeCase.Expected) - - if uri.String() != expected_uri { - t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri) - } - } -} - -func TestGetEncodedPassword(t *testing.T) { - - // Password is encoded, and contains a colon - ovftool_uri := fmt.Sprintf("vi://hostname/Datacenter/host/cluster") - - u, _ := url.Parse(ovftool_uri) - u.User = url.UserPassword("us:ername", "P@ssW:rd") - - encoded, isSet := getEncodedPassword(u) - expected := "P%40ssW%3Ard" - if !isSet { - t.Fatalf("Password is set but test said it is not") - } - if encoded != expected { - t.Fatalf("Should have successfully gotten encoded password. Expected: %s; recieved: %s", expected, encoded) - } - - // There is no password - u.User = url.UserPassword("us:ername", "") - - _, isSet = getEncodedPassword(u) - if isSet { - t.Fatalf("Should have determined that password was not set") - } - -} diff --git a/post-processor/vsphere/version/version.go b/post-processor/vsphere/version/version.go deleted file mode 100644 index 5226fb020..000000000 --- a/post-processor/vsphere/version/version.go +++ /dev/null @@ -1,13 +0,0 @@ -package version - -import ( - "github.com/hashicorp/packer-plugin-sdk/version" - packerVersion "github.com/hashicorp/packer/version" -) - -var VSpherePostprocessorVersion *version.PluginVersion - -func init() { - VSpherePostprocessorVersion = version.InitializePluginVersion( - packerVersion.Version, packerVersion.VersionPrerelease) -} diff --git a/website/content/docs/builders/vmware/index.mdx b/website/content/docs/builders/vmware/index.mdx index 778f03745..58930e194 100644 --- a/website/content/docs/builders/vmware/index.mdx +++ b/website/content/docs/builders/vmware/index.mdx @@ -25,14 +25,3 @@ the following VMware builders: an existing VMware VM you want to use as the source. As an additional benefit, you can feed the artifact of this builder back into Packer to iterate on a machine. - -- [vsphere-iso](/docs/builders/vsphere-iso) - This builder starts from an - ISO file, but utilizes the vSphere API rather than the esxcli to build on a - remote esx instance. This allows you to build vms even if you do not have - SSH access to your vSphere cluster. - -- [vsphere-clone](/docs/builders/vsphere-clone) - This builder clones a - vm from an existing template, then modifies it and saves it as a new - template. It uses the vSphere API rather than the esxcli to build on a - remote esx instance. This allows you to build vms even if you do not have - SSH access to your vSphere cluster. diff --git a/website/content/docs/builders/vmware/vsphere-clone.mdx b/website/content/docs/builders/vmware/vsphere-clone.mdx deleted file mode 100644 index 0c817518c..000000000 --- a/website/content/docs/builders/vmware/vsphere-clone.mdx +++ /dev/null @@ -1,416 +0,0 @@ ---- -modeline: | - vim: set ft=pandoc: -description: > - This VMware Packer builder uses the vSphere API to clone an existing vSphere - template and create a new virtual machine remotely. -page_title: VSphere Clone - Builders ---- - -# VMWare Vsphere Clone Builder - -Type: `vsphere-clone` -Artifact BuilderId: `jetbrains.vsphere` - -This builder clones VMs from existing templates. - -- VMware Player is not required. -- It uses the official vCenter API, and does not require ESXi host [modification](/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor) -- This builder is supported for vSphere version 6.5 and greater. Builds on lower - versions may work, but some configuration options may throw errors because they - do not exist in the older versions of the vSphere API. - -## Examples - -See complete Ubuntu, Windows, and macOS templates in the [examples folder](https://github.com/hashicorp/packer/tree/master/builder/vsphere/examples/). - -## VSphere-Clone Configuration Reference - -There are many configuration options available for this builder. In addition to -the items listed here, you will want to look at the general configuration -references for [Hardware](#hardware-configuration), -[Output](#output-configuration), -[Boot](#boot-configuration), -[Run](#run-configuration), -[Shutdown](#shutdown-configuration), -[Communicator](#communicator-configuration), -[Export](#export-configuration), -configuration references, which are -necessary for this build to succeed and can be found further down the page. - -@include 'builder/vsphere/clone/Config-not-required.mdx' - -### Clone Configuration - -@include 'builder/vsphere/clone/CloneConfig-not-required.mdx' - -@include 'builder/vsphere/common/StorageConfig-not-required.mdx' - -### Storage Configuration - -When cloning a VM, the storage configuration can be used to add additional storage and disk controllers. The resulting VM -will contain the origin VM storage and disk controller plus the new configured ones. - -@include 'builder/vsphere/common/DiskConfig.mdx' - -@include 'builder/vsphere/common/DiskConfig-required.mdx' - -#### Optional - -@include 'builder/vsphere/common/DiskConfig-not-required.mdx' - -### vApp Options Configuration - -@include 'builder/vsphere/clone/vAppConfig-not-required.mdx' - -Example of usage: - -<Tabs> -<Tab heading="JSON"> - -```json - "vapp": { - "properties": { - "hostname": "{{ user `hostname`}}", - "user-data": "{{ env `USERDATA`}}" - } - } -``` - -A `user-data` field requires the content of a yaml file to be encoded with base64. This -can be done via environment variable: -`export USERDATA=$(gzip -c9 <userdata.yaml | { base64 -w0 2>/dev/null || base64; })` - -</Tab> -<Tab heading="HCL2"> - -```hcl - vapp { - properties = { - hostname = var.hostname - user-data = base64encode(var.user_data) - } - } -``` - -</Tab> -</Tabs> - -### Extra Configuration Parameters - -@include 'builder/vsphere/common/ConfigParamsConfig-not-required.mdx' - -### Customization - -@include '/builder/vsphere/clone/CustomizeConfig.mdx' - -@include 'builder/vsphere/clone/CustomizeConfig-not-required.mdx' - -#### Network Interface Settings - -@include 'builder/vsphere/clone/NetworkInterface-not-required.mdx' - -#### Global Routing Settings - -@include 'builder/vsphere/clone/GlobalRoutingSettings.mdx' - -@include 'builder/vsphere/clone/GlobalRoutingSettings-not-required.mdx' - -#### Global DNS Settings - -@include 'builder/vsphere/clone/GlobalDnsSettings.mdx' - -@include 'builder/vsphere/clone/GlobalDnsSettings-not-required.mdx' - -#### Linux Customization Settings - -@include 'builder/vsphere/clone/LinuxOptions-not-required.mdx' - -#### Customization Example - -<Tabs> -<Tab heading="JSON"> - -```json - "customize": { - "linux_options": { - "host_name": "packer-test", - "domain": "test.internal" - }, - "network_interface": { - "ipv4_address": "10.0.0.10", - "ipv4_netmask": "24" - }, - "ipv4_gateway": "10.0.0.1", - "dns_server_list": ["10.0.0.18"] - } -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl - customize { - linux_options { - host_name = "packer-test" - domain = "test.internal" - } - - network_interface { - ipv4_address = "10.0.0.10" - ipv4_netmask = "24" - } - - ipv4_gateway = 10.0.0.1 - dns_server_list = ["10.0.0.18"] - } -``` - -</Tab> -</Tabs> - -### Boot configuration - -@include 'packer-plugin-sdk/bootcommand/BootConfig.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx' - -@include 'builder/vsphere/common/BootConfig-not-required.mdx' - -### Http directory configuration - -@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig-not-required.mdx' - -### Floppy configuration - -@include 'builder/vsphere/common/FloppyConfig-not-required.mdx' - -### Connection Configuration - -@include 'builder/vsphere/common/ConnectConfig-not-required.mdx' - -### Hardware Configuration - -@include 'builder/vsphere/common/HardwareConfig-not-required.mdx' - -### Location Configuration - -@include 'builder/vsphere/common/LocationConfig-not-required.mdx' - -### Run Configuration - -@include 'builder/vsphere/common/RunConfig-not-required.mdx' - -### Shutdown Configuration - -@include 'builder/vsphere/common/ShutdownConfig-not-required.mdx' - -### Wait Configuration - -@include 'builder/vsphere/common/WaitIpConfig-not-required.mdx' - -### CDRom Configuration - -@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx' - -@include 'builder/vsphere/common/CDRomConfig-not-required.mdx' - -@include 'builder/vsphere/common/RemoveCDRomConfig-not-required.mdx' - -### Communicator configuration - -#### Optional common fields: - -@include 'packer-plugin-sdk/communicator/Config-not-required.mdx' - -#### Optional SSH fields: - -@include 'packer-plugin-sdk/communicator/SSH-not-required.mdx' - -@include 'packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx' - -@include 'packer-plugin-sdk/communicator/SSH-Key-Pair-Name-not-required.mdx' - -@include 'packer-plugin-sdk/communicator/SSH-Private-Key-File-not-required.mdx' - -@include 'packer-plugin-sdk/communicator/SSH-Agent-Auth-not-required.mdx' - --> **NOTE:** Packer uses vApp Options to inject ssh public keys to the Virtual Machine. -The [temporary_key_pair_name](/docs/builders/vmware/vsphere-clone#temporary_key_pair_name) will only work -if the template being cloned contains the vApp property `public-keys`. -If using [ssh_private_key_file](/docs/builders/vmware/vsphere-clone#ssh_private_key_file), provide -the public key via [configuration_parameters](/docs/builders/vmware/vsphere-clone#configuration_parameters) or -[vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) whenever the `guestinto.userdata` -is available. See [VMware Guestinfo datasource](https://github.com/vmware/cloud-init-vmware-guestinfo) for more information -about the key. - -#### Optional WinRM fields: - -@include 'packer-plugin-sdk/communicator/WinRM-not-required.mdx' - -### Export Configuration - -@include 'builder/vsphere/common/ExportConfig.mdx' - -#### Optional: - -@include 'builder/vsphere/common/ExportConfig-not-required.mdx' - -#### Output Configuration: - -@include 'builder/vsphere/common/OutputConfig-not-required.mdx' - -### Content Library Import Configuration - -@include 'builder/vsphere/common/ContentLibraryDestinationConfig.mdx' - -@include 'builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx' - -Minimal example of usage: - -<Tabs> -<Tab heading="JSON"> - -```json - "content_library_destination" : { - "library": "Packer Library Test" - } -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl - content_library_destination { - library = "Packer Library Test" - } -``` - -</Tab> -</Tabs> - -## Working With Clusters And Hosts - -#### Standalone Hosts - -Only use the `host` option. Optionally specify a `resource_pool`: - -<Tabs> -<Tab heading="JSON"> - -```json -"host": "esxi-1.vsphere65.test", -"resource_pool": "pool1", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -host = "esxi-1.vsphere65.test" -resource_pool = "pool1" -``` - -</Tab> -</Tabs> - -#### Clusters Without DRS - -Use the `cluster` and `host`parameters: - -<Tabs> -<Tab heading="JSON"> - -```json -"cluster": "cluster1", -"host": "esxi-2.vsphere65.test", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -cluster = "cluster1" -host = "esxi-2.vsphere65.test" -``` - -</Tab> -</Tabs> - -#### Clusters With DRS - -Only use the `cluster` option. Optionally specify a `resource_pool`: - -<Tabs> -<Tab heading="JSON"> - -```json -"cluster": "cluster2", -"resource_pool": "pool1", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -cluster = "cluster2" -resource_pool = "pool1" -``` - -</Tab> -</Tabs> - -## Required vSphere Permissions - -- VM folder (this object and children): - ```text - Virtual machine -> Inventory - Virtual machine -> Configuration - Virtual machine -> Interaction - Virtual machine -> Snapshot management - Virtual machine -> Provisioning - ``` - Individual privileges are listed in https://github.com/jetbrains-infra/packer-builder-vsphere/issues/97#issuecomment-436063235. -- Resource pool, host, or cluster (this object): - ```text - Resource -> Assign virtual machine to resource pool - ``` -- Host in clusters without DRS (this object): - ```text - Read-only - ``` -- Datastore (this object): - ```text - Datastore -> Allocate space - Datastore -> Browse datastore - Datastore -> Low level file operations - ``` -- Network (this object): - ```text - Network -> Assign network - ``` -- Distributed switch (this object): - ```text - Read-only - ``` - -For floppy image upload: - -- Datacenter (this object): - ```text - Datastore -> Low level file operations - ``` -- Host (this object): - ```text - Host -> Configuration -> System Management - ``` diff --git a/website/content/docs/builders/vmware/vsphere-iso.mdx b/website/content/docs/builders/vmware/vsphere-iso.mdx deleted file mode 100644 index c4b794bc2..000000000 --- a/website/content/docs/builders/vmware/vsphere-iso.mdx +++ /dev/null @@ -1,410 +0,0 @@ ---- -modeline: | - vim: set ft=pandoc: -description: | - This VMware Packer builder starts from an ISO and creates a vm using the - vSphere API to build on a remote VMWare machine. -page_title: VSphere ISO - Builders ---- - -# Packer Builder for VMware vSphere - -Type: `vsphere-iso` -Artifact BuilderId: `jetbrains.vsphere` - -This builder uses the vSphere API, and creates virtual machines remotely. It -starts from an ISO file and creates new VMs from scratch. - -- VMware Player is not required. -- It uses the official vCenter API, and does not require ESXi host [modification](/docs/builders/vmware-iso#building-on-a-remote-vsphere-hypervisor) -- This builder is supported for vSphere version 6.5 and greater. Builds on lower - versions may work, but some configuration options may throw errors because they - do not exist in the older versions of the vSphere API. - -## Examples - -See complete Ubuntu, Windows, and macOS templates in the [examples folder](https://github.com/hashicorp/packer/tree/master/builder/vsphere/examples/). - -# Configuration Reference - -There are many configuration options available for this builder. In addition to -the items listed here, you will want to look at the general configuration -references for [HTTP](#http-directory-configuration), -[Floppy](#floppy-configuration), -[Boot](#boot-configuration), -[Hardware](#hardware-configuration), -[Output](#output-configuration), -[Run](#run-configuration), -[Shutdown](#shutdown-configuration), -[Communicator](#communicator-configuration), -[Export](#export-configuration), -configuration references, which are -necessary for this build to succeed and can be found further down the page. - -@include 'builder/vsphere/iso/Config-not-required.mdx' - -### Boot Configuration - -@include 'packer-plugin-sdk/bootcommand/BootConfig.mdx' - -We send each character to the VM with a default delay of 100ms between groups. -The delay alleviates possible issues with latency and CPU -contention. If you notice missing keys, you can tune this delay by specifying -"boot_keygroup_interval" in your Packer template, for example: - -<Tabs> -<Tab heading="JSON"> - -```json -{ - "builders": [ - { - "type": "vsphere-iso", - "boot_keygroup_interval": "500ms" - ... - } - ] -} -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -source "vsphere-iso" "example" { - boot_keygroup_interval = "500ms" - # ... -} -``` - -</Tab> -</Tabs> - -#### Optional: - -@include 'packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx' - -@include 'builder/vsphere/common/BootConfig-not-required.mdx' - -### Http directory configuration - -@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig-not-required.mdx' - -### Floppy configuration - -@include 'builder/vsphere/common/FloppyConfig-not-required.mdx' - -### Connection Configuration - -@include 'builder/vsphere/common/ConnectConfig-not-required.mdx' - -### Hardware Configuration - -@include 'builder/vsphere/common/HardwareConfig-not-required.mdx' - -### Location Configuration - -@include 'builder/vsphere/common/LocationConfig-not-required.mdx' - -### Run Configuration - -@include 'builder/vsphere/common/RunConfig-not-required.mdx' - -### Shutdown Configuration - -@include 'builder/vsphere/common/ShutdownConfig-not-required.mdx' - -### Wait Configuration - -@include 'builder/vsphere/common/WaitIpConfig-not-required.mdx' - -### ISO Configuration - -@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig.mdx' - -#### Required: - -@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx' - -### CDRom Configuration - -Each iso defined in the CDRom Configuration adds a new drive. If the "iso_url" is defined in -addition to the "iso_paths", the "iso_url" is added to the VM first. This keeps the "iso_url" first in -the boot order by default allowing the boot iso being defined by the iso_url and the vmware tools iso added -from the datastore. Example: - -<Tabs> -<Tab heading="JSON"> - -```json -"iso_urls": [ - "win10.iso", - "http://example.org/isos/win10.iso" -], -"iso_paths": [ - "[] /usr/lib/vmware/isoimages/windows.iso" -], -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -iso_urls = [ - "win10.iso", - "http://example.org/isos/win10.iso" -] - -iso_paths = [ - "[] /usr/lib/vmware/isoimages/windows.iso" -] -``` - -</Tab> -</Tabs> - -@include 'builder/vsphere/common/CDRomConfig-not-required.mdx' - -@include 'builder/vsphere/common/RemoveCDRomConfig-not-required.mdx' - -@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx' - -#### Optional: - -@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx' - -### Create Configuration - -@include 'builder/vsphere/iso/CreateConfig-not-required.mdx' - -@include 'builder/vsphere/common/StorageConfig-not-required.mdx' - -### Network Adapter Configuration - -@include 'builder/vsphere/iso/NIC.mdx' - -@include 'builder/vsphere/iso/NIC-required.mdx' - -#### Optional - -@include 'builder/vsphere/iso/NIC-not-required.mdx' - -### Storage Configuration - -@include 'builder/vsphere/common/DiskConfig.mdx' - -@include 'builder/vsphere/common/DiskConfig-required.mdx' - -#### Optional - -@include 'builder/vsphere/common/DiskConfig-not-required.mdx' - -### Export Configuration - -@include 'builder/vsphere/common/ExportConfig.mdx' - -#### Optional: - -@include 'builder/vsphere/common/ExportConfig-not-required.mdx' - -#### Output Configuration: - -@include 'builder/vsphere/common/OutputConfig-not-required.mdx' - -### Content Library Import Configuration - -@include 'builder/vsphere/common/ContentLibraryDestinationConfig.mdx' - -@include 'builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx' - -Minimal example of usage to import a VM template: - -<Tabs> -<Tab heading="JSON"> - -```json - "content_library_destination" : { - "library": "Packer Library Test" - } -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl - content_library_destination { - library = "Packer Library Test" - } -``` - -</Tab> -</Tabs> - -Minimal example of usage to import a OVF template: - -<Tabs> -<Tab heading="JSON"> - -```json - "content_library_destination" : { - "library": "Packer Library Test", - "ovf": true - } -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl - content_library_destination { - library = "Packer Library Test" - ovf = true - } -``` - -</Tab> -</Tabs> - -### Extra Configuration Parameters - -@include 'builder/vsphere/common/ConfigParamsConfig-not-required.mdx' - -### Communicator configuration - -#### Optional common fields: - -@include 'packer-plugin-sdk/communicator/Config-not-required.mdx' - -#### Optional SSH fields: - -@include 'packer-plugin-sdk/communicator/SSH-not-required.mdx' - -@include 'packer-plugin-sdk/communicator/SSH-Private-Key-File-not-required.mdx' - -#### Optional WinRM fields: - -@include 'packer-plugin-sdk/communicator/WinRM-not-required.mdx' - -## Working With Clusters And Hosts - -#### Standalone Hosts - -Only use the `host` option. Optionally specify a `resource_pool`: - -<Tabs> -<Tab heading="JSON"> - -```json -"host": "esxi-1.vsphere65.test", -"resource_pool": "pool1", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -host = ""esxi-1.vsphere65.test"" -resource_pool = "pool1" -``` - -</Tab> -</Tabs> - -#### Clusters Without DRS - -Use the `cluster` and `host`parameters: - -<Tabs> -<Tab heading="JSON"> - -```json -"cluster": "cluster1", -"host": "esxi-2.vsphere65.test", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -cluster = "cluster1" -host = "esxi-2.vsphere65.test" -``` - -</Tab> -</Tabs> - -#### Clusters With DRS - -Only use the `cluster` option. Optionally specify a `resource_pool`: - -<Tabs> -<Tab heading="JSON"> - -```json -"cluster": "cluster2", -"resource_pool": "pool1", -``` - -</Tab> -<Tab heading="HCL2"> - -```hcl -cluster = "cluster2" -resource_pool = "pool1" -``` - -</Tab> -</Tabs> - -## Required vSphere Permissions - -- VM folder (this object and children): - ```text - Virtual machine -> Inventory - Virtual machine -> Configuration - Virtual machine -> Interaction - Virtual machine -> Snapshot management - Virtual machine -> Provisioning - ``` - Individual privileges are listed in https://github.com/jetbrains-infra/packer-builder-vsphere/issues/97#issuecomment-436063235. -- Resource pool, host, or cluster (this object): - ```text - Resource -> Assign virtual machine to resource pool - ``` -- Host in clusters without DRS (this object): - ```text - Read-only - ``` -- Datastore (this object): - ```text - Datastore -> Allocate space - Datastore -> Browse datastore - Datastore -> Low level file operations - ``` -- Network (this object): - ```text - Network -> Assign network - ``` -- Distributed switch (this object): - ```text - Read-only - ``` - -For floppy image upload: - -- Datacenter (this object): - ```text - Datastore -> Low level file operations - ``` -- Host (this object): - ```text - Host -> Configuration -> System Management - ``` diff --git a/website/content/docs/post-processors/vsphere-template.mdx b/website/content/docs/post-processors/vsphere-template.mdx deleted file mode 100644 index a401b99b1..000000000 --- a/website/content/docs/post-processors/vsphere-template.mdx +++ /dev/null @@ -1,168 +0,0 @@ ---- -description: > - The Packer vSphere Template post-processor takes an artifact from the - VMware-iso builder, built on ESXi (i.e. remote) or an artifact from the - [vSphere](/docs/post-processors/vsphere) post-processor, marks the VM as a - template, and leaves it in the path of your choice. -page_title: vSphere Template - Post-Processors ---- - -# vSphere Template Post-Processor - -Type: `vsphere-template` -Artifact BuilderId: `packer.post-processor.vsphere` - -The Packer vSphere Template post-processor takes an artifact from the -VMware-iso builder, built on ESXi (i.e. remote) or an artifact from the -[vSphere](/docs/post-processors/vsphere) post-processor, marks the VM as a -template, and leaves it in the path of your choice. - -## Example - -An example is shown below, showing only the post-processor configuration: - -```json -{ - "type": "vsphere-template", - "host": "vcenter.local", - "insecure": true, - "username": "root", - "password": "secret", - "datacenter": "mydatacenter", - "folder": "/packer-templates/os/distro-7" -} -``` - -## Configuration - -There are many configuration options available for the post-processor. They are -segmented below into two categories: required and optional parameters. Within -each category, the available configuration keys are alphabetized. - -Required: - -- `host` (string) - The vSphere host that contains the VM built by the - vmware-iso. - -- `password` (string) - Password to use to authenticate to the vSphere - endpoint. - -- `username` (string) - The username to use to authenticate to the vSphere - endpoint. - -Optional: - -- `datacenter` (string) - If you have more than one, you will need to specify - which one the ESXi used. - -- `folder` (string) - Target path where the template will be created. - -- `insecure` (boolean) - If it's true skip verification of server - certificate. Default is false - -- `keep_input_artifact` (boolean) - Unlike most post-processors, this option - has no effect for vsphere-template. This is because in order for a template - to work, you can't delete the vm that you generate the template from. The - vsphere template post-processor will therefore always preserve the original - vm. - -- `snapshot_enable` (boolean) - Create a snapshot before marking as a - template. Default is false - -- `snapshot_name` (string) - Name for the snapshot. Required when - `snapshot_enable` is `true` - -- `snapshot_description` (string) - Description for the snapshot. Required - when `snapshot_enable` is `true` - -- `reregister_vm` (boolean) - Use the method of unregister VM and reregister - as a template, rather than using the markAsTemplate method in vmWare. - NOTE: If you are getting permission denied errors when trying to mark as a - template, but it works fine in the vSphere UI, try setting this to `false`. - Default is `true`. - -## Using the vSphere Template with local builders - -Once the [vSphere](/docs/post-processors/vsphere) takes an artifact from -the VMware builder and uploads it to a vSphere endpoint, you will likely want -to mark that VM as template. Packer can do this for you automatically using a -sequence definition (a collection of post-processors that are treated as as -single pipeline, see [Post-Processors](/docs/templates/legacy_json_templates/post-processors) -for more information): - -```json -{ - "post-processors": [ - [ - { - "type": "vsphere", - ... - }, - { - "type": "vsphere-template", - ... - } - ], - { - "type": "...", - ... - } - ] -} -``` - -In the example above, the result of each builder is passed through the defined -sequence of post-processors starting with the `vsphere` post-processor which -will upload the artifact to a vSphere endpoint. The resulting artifact is then -passed on to the `vsphere-template` post-processor which handles marking a VM -as a template. Note that the `vsphere` and `vsphere-template` post-processors -are paired together in their own JSON array. - -## Permissions - -The vsphere post processor needs several permissions to be able to mark the -vm as a template. Rather than giving full administrator access, you can create -a role to give the post-processor the permissions necessary to run. Here is an -example role that will work. Please note that this is a user-supplied list so -there may be a few extraneous permissions that are not strictly required. - -For Vsphere 5.5 the role needs the following privileges: - - Datastore.AllocateSpace - Host.Config.AdvancedConfig - Host.Config.NetService - Host.Config.Network - Network.Assign - System.Anonymous - System.Read - System.View - VApp.Import - VirtualMachine.Config.AddNewDisk - VirtualMachine.Config.AdvancedConfig - VirtualMachine.Inventory.Delete - -and either (If reregister_vm is false): - - VirtualMachine.Provisioning.MarkAsTemplate - -or (if reregister_vm is true or unset): - - VirtualMachine.Inventory.Register - VirtualMachine.Inventory.Unregister - -And this role must be authorized on the: - - Cluster of the host - The destination folder (not on Datastore, on the Vsphere logical view) - The network to be assigned - The destination datastore. - -# Troubleshooting - -Some users have reported that vSphere templates created from local VMWare builds -get their boot order reset to cdrom only instead of the original boot order -defined by the template. If this issue affects you, the solution is to set -`"bios.hddOrder": "scsi0:0"` in your builder's `vmx_data`. - -Packer doesn't automatically do this for you because it causes strange upload -behavior in certain versions of `ovftool`. diff --git a/website/content/docs/post-processors/vsphere.mdx b/website/content/docs/post-processors/vsphere.mdx deleted file mode 100644 index dbf8629f0..000000000 --- a/website/content/docs/post-processors/vsphere.mdx +++ /dev/null @@ -1,180 +0,0 @@ ---- -description: > - The Packer vSphere post-processor takes an artifact and uploads it to a - vSphere endpoint. -page_title: vSphere - Post-Processors ---- - -# vSphere Post-Processor - -Type: `vsphere` -Artifact BuilderId: `packer.post-processor.vsphere` - -The Packer vSphere post-processor takes an artifact and uploads it to a vSphere endpoint. -The artifact must have a vmx/ova/ovf image. - -## Configuration - -There are many configuration options available for the post-processor. They are -segmented below into two categories: required and optional parameters. Within -each category, the available configuration keys are alphabetized. - -Required: - -- `cluster` (string) - The cluster or host to upload the VM to. This can be - either the name of the cluster, or the IP address of the esx host that you - want to upload to. - -- `datacenter` (string) - The name of the datacenter within vSphere to add - the VM to. - -- `datastore` (string) - The name of the datastore to store this VM. This is - _not required_ if `resource_pool` is specified. - -- `host` (string) - The vSphere host that will be contacted to perform the VM - upload. - -- `password` (string) - Password to use to authenticate to the vSphere - endpoint. - -- `username` (string) - The username to use to authenticate to the vSphere - endpoint. - -- `vm_name` (string) - The name of the VM once it is uploaded. - -Optional: - -- `esxi_host` (string) - Target vSphere host. Used to assign specific esx - host to upload the resulting VM to, when a vCenter Server is used as - `host`. Can be either a hostname (e.g. "packer-esxi1", requires proper DNS - setup and/or correct DNS search domain setting) or an IPv4 address. - -- `disk_mode` (string) - Target disk format. See `ovftool` manual for - available options. By default, `thick` will be used. - -- `insecure` (boolean) - Whether or not the connection to vSphere can be done - over an insecure connection. By default this is `false`. - -- `keep_input_artifact` (boolean) - When `true`, preserve the local VM files, - even after importing them to vsphere. Defaults to `false`. - -- `resource_pool` (string) - The resource pool to upload the VM to. - -- `vm_folder` (string) - The folder within the datastore to store the VM. - -- `vm_network` (string) - The name of the VM network this VM will be added - to. - -- `overwrite` (boolean) - If it's true force the system to overwrite the - existing files instead create new ones. Default is `false` - -- `options` (array of strings) - Custom options to add in `ovftool`. See - `ovftool --help` to list all the options - -# Example - -The following is an example of the vSphere post-processor being used in -conjunction with the null builder and artifice post-processor to upload a vmx -to a vSphere cluster. - -You can also use this post-processor with the vmx artifact from a vmware build. - -<Tabs> -<Tab heading="HCL2"> - -```hcl -source "null" "example" { - communicator = "none" -} - -build { - sources = [ - "source.null.example" - ] - - post-processors{ - post-processor "artifice"{ - files = ["output-vmware-iso/packer-vmware-iso.vmx"] - } - - post-processor "vsphere"{ - keep_input_artifact = true - vm_name = "packerparty" - vm_network = "VM Network" - cluster = "123.45.678.1" - datacenter = "PackerDatacenter" - datastore = "datastore1" - host = "123.45.678.9" - password = "SuperSecretPassword" - username = "Administrator@vsphere.local" - } - } -} -``` - -</Tab> -<Tab heading="JSON"> - -```json -{ - "builders": [ - { - "type": "null", - "communicator": "none" - } - ], - "post-processors": [ - [ - { - "type": "artifice", - "files": ["output-vmware-iso/packer-vmware-iso.vmx"] - }, - { - "type": "vsphere", - "keep_input_artifact": true, - "vm_name": "packerparty", - "vm_network": "VM Network", - "cluster": "123.45.678.1", - "datacenter": "PackerDatacenter", - "datastore": "datastore1", - "host": "123.45.678.9", - "password": "SuperSecretPassword", - "username": "Administrator@vsphere.local" - } - ] - ] -} -``` - -</Tab> -</Tabs> - -# Permissions - -The vsphere post processor uses `ovftool` and therefore needs the same privileges -as `ovftool`. Rather than giving full administrator access, you can create a role -to give the post-processor the permissions necessary to run. Below is an example -role. Please note that this is a user-supplied list so there may be a few -extraneous permissions that are not strictly required. - -For Vsphere 5.5 the role needs the following privileges: - - Datastore.AllocateSpace - Host.Config.AdvancedConfig - Host.Config.NetService - Host.Config.Network - Network.Assign - System.Anonymous - System.Read - System.View - VApp.Import - VirtualMachine.Config.AddNewDisk - VirtualMachine.Config.AdvancedConfig - VirtualMachine.Inventory.Delete - -And this role must be authorized on the: - - Cluster of the host - The destination folder (not on Datastore, on the Vsphere logical view) - The network to be assigned - The destination datastore. diff --git a/website/content/partials/builder/vsphere/clone/CloneConfig-not-required.mdx b/website/content/partials/builder/vsphere/clone/CloneConfig-not-required.mdx deleted file mode 100644 index d9ffbd790..000000000 --- a/website/content/partials/builder/vsphere/clone/CloneConfig-not-required.mdx +++ /dev/null @@ -1,20 +0,0 @@ -<!-- Code generated from the comments of the CloneConfig struct in builder/vsphere/clone/step_clone.go; DO NOT EDIT MANUALLY --> - -- `template` (string) - Name of source VM. Path is optional. - -- `disk_size` (int64) - The size of the disk in MB. - -- `linked_clone` (bool) - Create VM as a linked clone from latest snapshot. Defaults to `false`. - -- `network` (string) - Set the network in which the VM will be connected to. If no network is - specified, `host` must be specified to allow Packer to look for the - available network. If the network is inside a network folder in vCenter, - you need to provide the full path to the network. - -- `mac_address` (string) - Sets a custom Mac Address to the network adapter. If set, the [network](#network) must be also specified. - -- `notes` (string) - VM notes. - -- `vapp` (vAppConfig) - Set the vApp Options to a virtual machine. - See the [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) - to know the available options and how to use it. diff --git a/website/content/partials/builder/vsphere/clone/Config-not-required.mdx b/website/content/partials/builder/vsphere/clone/Config-not-required.mdx deleted file mode 100644 index b44beb590..000000000 --- a/website/content/partials/builder/vsphere/clone/Config-not-required.mdx +++ /dev/null @@ -1,15 +0,0 @@ -<!-- Code generated from the comments of the Config struct in builder/vsphere/clone/config.go; DO NOT EDIT MANUALLY --> - -- `create_snapshot` (bool) - Create a snapshot when set to `true`, so the VM can be used as a base - for linked clones. Defaults to `false`. - -- `convert_to_template` (bool) - Convert VM to a template. Defaults to `false`. - -- `export` (\*common.ExportConfig) - Configuration for exporting VM to an ovf file. - The VM will not be exported if no [Export Configuration](#export-configuration) is specified. - -- `content_library_destination` (\*common.ContentLibraryDestinationConfig) - Configuration for importing a VM template or OVF template to a Content Library. - The template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. - The import doesn't work if [convert_to_template](#convert_to_template) is set to true. - -- `customize` (\*CustomizeConfig) - Customize the cloned VM to configure host, network, or licensing settings. See the [customization options](#customization). diff --git a/website/content/partials/builder/vsphere/clone/CustomizeConfig-not-required.mdx b/website/content/partials/builder/vsphere/clone/CustomizeConfig-not-required.mdx deleted file mode 100644 index 487975075..000000000 --- a/website/content/partials/builder/vsphere/clone/CustomizeConfig-not-required.mdx +++ /dev/null @@ -1,9 +0,0 @@ -<!-- Code generated from the comments of the CustomizeConfig struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -- `linux_options` (\*LinuxOptions) - Settings to Linux guest OS customization. See [Linux customization settings](#linux-customization-settings). - -- `windows_sysprep_file` (string) - Supply your own sysprep.xml file to allow full control of the customization process out-of-band of vSphere. - -- `network_interface` (NetworkInterfaces) - Configure network interfaces on a per-interface basis that should matched up to the network adapters present in the VM. - To use DHCP, declare an empty network_interface for each adapter being configured. This field is required. - See [Network interface settings](#network-interface-settings). diff --git a/website/content/partials/builder/vsphere/clone/CustomizeConfig.mdx b/website/content/partials/builder/vsphere/clone/CustomizeConfig.mdx deleted file mode 100644 index fca10d1e6..000000000 --- a/website/content/partials/builder/vsphere/clone/CustomizeConfig.mdx +++ /dev/null @@ -1,12 +0,0 @@ -<!-- Code generated from the comments of the CustomizeConfig struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -A cloned virtual machine can be [customized](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-58E346FF-83AE-42B8-BE58-253641D257BC.html) -to configure host, network, or licensing settings. - -To perform virtual machine customization as a part of the clone process, specify the customize block with the -respective customization options. Windows guests are customized using Sysprep, which will result in the machine SID being reset. -Before using customization, check that your source VM meets the [requirements](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-E63B6FAA-8D35-428D-B40C-744769845906.html) -for guest OS customization on vSphere. -See the [customization example](#customization-example) for a usage synopsis. - -The settings for customize are as follows: diff --git a/website/content/partials/builder/vsphere/clone/GlobalDnsSettings-not-required.mdx b/website/content/partials/builder/vsphere/clone/GlobalDnsSettings-not-required.mdx deleted file mode 100644 index 095d11a8a..000000000 --- a/website/content/partials/builder/vsphere/clone/GlobalDnsSettings-not-required.mdx +++ /dev/null @@ -1,5 +0,0 @@ -<!-- Code generated from the comments of the GlobalDnsSettings struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -- `dns_server_list` ([]string) - The list of DNS servers to configure on a virtual machine. - -- `dns_suffix_list` ([]string) - A list of DNS search domains to add to the DNS configuration on the virtual machine. diff --git a/website/content/partials/builder/vsphere/clone/GlobalDnsSettings.mdx b/website/content/partials/builder/vsphere/clone/GlobalDnsSettings.mdx deleted file mode 100644 index adbcafe54..000000000 --- a/website/content/partials/builder/vsphere/clone/GlobalDnsSettings.mdx +++ /dev/null @@ -1,4 +0,0 @@ -<!-- Code generated from the comments of the GlobalDnsSettings struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -The following settings configure DNS globally, generally for Linux systems. For Windows systems, -this is done per-interface, see [network interface](#network_interface) settings. diff --git a/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings-not-required.mdx b/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings-not-required.mdx deleted file mode 100644 index e83ad8150..000000000 --- a/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings-not-required.mdx +++ /dev/null @@ -1,5 +0,0 @@ -<!-- Code generated from the comments of the GlobalRoutingSettings struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -- `ipv4_gateway` (string) - The IPv4 default gateway when using network_interface customization on the virtual machine. - -- `ipv6_gateway` (string) - The IPv6 default gateway when using network_interface customization on the virtual machine. diff --git a/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings.mdx b/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings.mdx deleted file mode 100644 index 55aa29735..000000000 --- a/website/content/partials/builder/vsphere/clone/GlobalRoutingSettings.mdx +++ /dev/null @@ -1,3 +0,0 @@ -<!-- Code generated from the comments of the GlobalRoutingSettings struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -The settings here must match the IP/mask of at least one network_interface supplied to customization. diff --git a/website/content/partials/builder/vsphere/clone/LinuxOptions-not-required.mdx b/website/content/partials/builder/vsphere/clone/LinuxOptions-not-required.mdx deleted file mode 100644 index 462b7bab8..000000000 --- a/website/content/partials/builder/vsphere/clone/LinuxOptions-not-required.mdx +++ /dev/null @@ -1,9 +0,0 @@ -<!-- Code generated from the comments of the LinuxOptions struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -- `domain` (string) - The domain name for this machine. This, along with [host_name](#host_name), make up the FQDN of this virtual machine. - -- `host_name` (string) - The host name for this machine. This, along with [domain](#domain), make up the FQDN of this virtual machine. - -- `hw_clock_utc` (boolean) - Tells the operating system that the hardware clock is set to UTC. Default: true. - -- `time_zone` (string) - Sets the time zone. The default is UTC. diff --git a/website/content/partials/builder/vsphere/clone/NetworkInterface-not-required.mdx b/website/content/partials/builder/vsphere/clone/NetworkInterface-not-required.mdx deleted file mode 100644 index 7f9a33468..000000000 --- a/website/content/partials/builder/vsphere/clone/NetworkInterface-not-required.mdx +++ /dev/null @@ -1,15 +0,0 @@ -<!-- Code generated from the comments of the NetworkInterface struct in builder/vsphere/clone/step_customize.go; DO NOT EDIT MANUALLY --> - -- `dns_server_list` ([]string) - Network interface-specific DNS server settings for Windows operating systems. - Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. - -- `dns_domain` (string) - Network interface-specific DNS search domain for Windows operating systems. - Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. - -- `ipv4_address` (string) - The IPv4 address assigned to this network adapter. If left blank or not included, DHCP is used. - -- `ipv4_netmask` (int) - The IPv4 subnet mask, in bits (example: 24 for 255.255.255.0). - -- `ipv6_address` (string) - The IPv6 address assigned to this network adapter. If left blank or not included, auto-configuration is used. - -- `ipv6_netmask` (int) - The IPv6 subnet mask, in bits (example: 32). diff --git a/website/content/partials/builder/vsphere/clone/vAppConfig-not-required.mdx b/website/content/partials/builder/vsphere/clone/vAppConfig-not-required.mdx deleted file mode 100644 index daa4b2d4f..000000000 --- a/website/content/partials/builder/vsphere/clone/vAppConfig-not-required.mdx +++ /dev/null @@ -1,9 +0,0 @@ -<!-- Code generated from the comments of the vAppConfig struct in builder/vsphere/clone/step_clone.go; DO NOT EDIT MANUALLY --> - -- `properties` (map[string]string) - Set values for the available vApp Properties to supply configuration parameters to a virtual machine cloned from - a template that came from an imported OVF or OVA file. - - -> **Note:** The only supported usage path for vApp properties is for existing user-configurable keys. - These generally come from an existing template that was created from an imported OVF or OVA file. - You cannot set values for vApp properties on virtual machines created from scratch, - virtual machines lacking a vApp configuration, or on property keys that do not exist. diff --git a/website/content/partials/builder/vsphere/common/BootConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/BootConfig-not-required.mdx deleted file mode 100644 index b3899332d..000000000 --- a/website/content/partials/builder/vsphere/common/BootConfig-not-required.mdx +++ /dev/null @@ -1,4 +0,0 @@ -<!-- Code generated from the comments of the BootConfig struct in builder/vsphere/common/step_boot_command.go; DO NOT EDIT MANUALLY --> - -- `http_ip` (string) - The IP address to use for the HTTP server started to serve the `http_directory`. - If unset, Packer will automatically discover and assign an IP. diff --git a/website/content/partials/builder/vsphere/common/CDRomConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/CDRomConfig-not-required.mdx deleted file mode 100644 index e225b4820..000000000 --- a/website/content/partials/builder/vsphere/common/CDRomConfig-not-required.mdx +++ /dev/null @@ -1,12 +0,0 @@ -<!-- Code generated from the comments of the CDRomConfig struct in builder/vsphere/common/step_add_cdrom.go; DO NOT EDIT MANUALLY --> - -- `cdrom_type` (string) - Which controller to use. Example: `sata`. Defaults to `ide`. - -- `iso_paths` ([]string) - List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - Here's an HCL2 example: - ```hcl - iso_paths = [ - "[datastore1] ISO/ubuntu.iso", - "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" - ] - ``` diff --git a/website/content/partials/builder/vsphere/common/ConfigParamsConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/ConfigParamsConfig-not-required.mdx deleted file mode 100644 index 29b4922d4..000000000 --- a/website/content/partials/builder/vsphere/common/ConfigParamsConfig-not-required.mdx +++ /dev/null @@ -1,9 +0,0 @@ -<!-- Code generated from the comments of the ConfigParamsConfig struct in builder/vsphere/common/step_config_params.go; DO NOT EDIT MANUALLY --> - -- `configuration_parameters` (map[string]string) - configuration_parameters is a direct passthrough to the VSphere API's - ConfigSpec: https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html - -- `tools_sync_time` (bool) - Enables time synchronization with the host. Defaults to false. - -- `tools_upgrade_policy` (bool) - If sets to true, vSphere will automatically check and upgrade VMware Tools upon a system power cycle. - If not set, defaults to manual upgrade. diff --git a/website/content/partials/builder/vsphere/common/ConnectConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/ConnectConfig-not-required.mdx deleted file mode 100644 index 69185294b..000000000 --- a/website/content/partials/builder/vsphere/common/ConnectConfig-not-required.mdx +++ /dev/null @@ -1,11 +0,0 @@ -<!-- Code generated from the comments of the ConnectConfig struct in builder/vsphere/common/step_connect.go; DO NOT EDIT MANUALLY --> - -- `vcenter_server` (string) - vCenter server hostname. - -- `username` (string) - vSphere username. - -- `password` (string) - vSphere password. - -- `insecure_connection` (bool) - Do not validate vCenter server's TLS certificate. Defaults to `false`. - -- `datacenter` (string) - VMware datacenter name. Required if there is more than one datacenter in vCenter. diff --git a/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx deleted file mode 100644 index 86eefcb6b..000000000 --- a/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig-not-required.mdx +++ /dev/null @@ -1,46 +0,0 @@ -<!-- Code generated from the comments of the ContentLibraryDestinationConfig struct in builder/vsphere/common/step_import_to_content_library.go; DO NOT EDIT MANUALLY --> - -- `library` (string) - Name of the library in which the new library item containing the template should be created/updated. - The Content Library should be of type Local to allow deploying virtual machines. - -- `name` (string) - Name of the library item that will be created or updated. - For VM templates, the name of the item should be different from [vm_name](#vm_name) and - the default is [vm_name](#vm_name) + timestamp when not set. VM templates will be always imported to a new library item. - For OVF templates, the name defaults to [vm_name](#vm_name) when not set, and if an item with the same name already - exists it will be then updated with the new OVF template, otherwise a new item will be created. - - ~> **Note**: It's not possible to update existing library items with a new VM template. If updating an existing library - item is necessary, use an OVF template instead by setting the [ovf](#ovf) option as `true`. - -- `description` (string) - Description of the library item that will be created. - This option is not used when importing OVF templates. - Defaults to "Packer imported [vm_name](#vm_name) VM template". - -- `cluster` (string) - Cluster onto which the virtual machine template should be placed. - If cluster and resource_pool are both specified, resource_pool must belong to cluster. - If cluster and host are both specified, host must be a member of cluster. - This option is not used when importing OVF templates. - Defaults to [cluster](#cluster). - -- `folder` (string) - Virtual machine folder into which the virtual machine template should be placed. - This option is not used when importing OVF templates. - Defaults to the same folder as the source virtual machine. - -- `host` (string) - Host onto which the virtual machine template should be placed. - If host and resource_pool are both specified, resource_pool must belong to host. - If host and cluster are both specified, host must be a member of cluster. - This option is not used when importing OVF templates. - Defaults to [host](#host). - -- `resource_pool` (string) - Resource pool into which the virtual machine template should be placed. - Defaults to [resource_pool](#resource_pool). if [resource_pool](#resource_pool) is also unset, - the system will attempt to choose a suitable resource pool for the virtual machine template. - -- `datastore` (string) - The datastore for the virtual machine template's configuration and log files. - This option is not used when importing OVF templates. - Defaults to the storage backing associated with the library specified by library. - -- `destroy` (bool) - If set to true, the VM will be destroyed after deploying the template to the Content Library. - Defaults to `false`. - -- `ovf` (bool) - When set to true, Packer will import and OVF template to the content library item. Defaults to `false`. diff --git a/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig.mdx b/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig.mdx deleted file mode 100644 index 06a6844ac..000000000 --- a/website/content/partials/builder/vsphere/common/ContentLibraryDestinationConfig.mdx +++ /dev/null @@ -1,5 +0,0 @@ -<!-- Code generated from the comments of the ContentLibraryDestinationConfig struct in builder/vsphere/common/step_import_to_content_library.go; DO NOT EDIT MANUALLY --> - -With this configuration Packer creates a library item in a content library whose content is a VM template -or an OVF template created from the just built VM. -The template is stored in a existing or newly created library item. diff --git a/website/content/partials/builder/vsphere/common/DiskConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/DiskConfig-not-required.mdx deleted file mode 100644 index f7267b405..000000000 --- a/website/content/partials/builder/vsphere/common/DiskConfig-not-required.mdx +++ /dev/null @@ -1,7 +0,0 @@ -<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY --> - -- `disk_thin_provisioned` (bool) - Enable VMDK thin provisioning for VM. Defaults to `false`. - -- `disk_eagerly_scrub` (bool) - Enable VMDK eager scrubbing for VM. Defaults to `false`. - -- `disk_controller_index` (int) - The assigned disk controller. Defaults to the first one (0) diff --git a/website/content/partials/builder/vsphere/common/DiskConfig-required.mdx b/website/content/partials/builder/vsphere/common/DiskConfig-required.mdx deleted file mode 100644 index 29a583222..000000000 --- a/website/content/partials/builder/vsphere/common/DiskConfig-required.mdx +++ /dev/null @@ -1,3 +0,0 @@ -<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY --> - -- `disk_size` (int64) - The size of the disk in MB. diff --git a/website/content/partials/builder/vsphere/common/DiskConfig.mdx b/website/content/partials/builder/vsphere/common/DiskConfig.mdx deleted file mode 100644 index 44040b0f7..000000000 --- a/website/content/partials/builder/vsphere/common/DiskConfig.mdx +++ /dev/null @@ -1,74 +0,0 @@ -<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY --> - -Defines the disk storage for a VM. - -Example that will create a 15GB and a 20GB disk on the VM. The second disk will be thin provisioned: - -In JSON: -```json - "storage": [ - { - "disk_size": 15000 - }, - { - "disk_size": 20000, - "disk_thin_provisioned": true - } - ], -``` -In HCL2: -```hcl - storage { - disk_size = 15000 - } - storage { - disk_size = 20000 - disk_thin_provisioned = true - } -``` - -Example that creates 2 pvscsi controllers and adds 2 disks to each one: - -In JSON: -```json - "disk_controller_type": ["pvscsi", "pvscsi"], - "storage": [ - { - "disk_size": 15000, - "disk_controller_index": 0 - }, - { - "disk_size": 15000, - "disk_controller_index": 0 - }, - { - "disk_size": 15000, - "disk_controller_index": 1 - }, - { - "disk_size": 15000, - "disk_controller_index": 1 - } - ], -``` - -In HCL2: -```hcl - disk_controller_type = ["pvscsi", "pvscsi"] - storage { - disk_size = 15000, - disk_controller_index = 0 - } - storage { - disk_size = 15000 - disk_controller_index = 0 - } - storage { - disk_size = 15000 - disk_controller_index = 1 - } - storage { - disk_size = 15000 - disk_controller_index = 1 - } -``` diff --git a/website/content/partials/builder/vsphere/common/ExportConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/ExportConfig-not-required.mdx deleted file mode 100644 index 8f1a355a4..000000000 --- a/website/content/partials/builder/vsphere/common/ExportConfig-not-required.mdx +++ /dev/null @@ -1,32 +0,0 @@ -<!-- Code generated from the comments of the ExportConfig struct in builder/vsphere/common/step_export.go; DO NOT EDIT MANUALLY --> - -- `name` (string) - name of the ovf. defaults to the name of the VM - -- `force` (bool) - overwrite ovf if it exists - -- `images` (bool) - include iso and img image files that are attached to the VM - -- `manifest` (string) - generate manifest using sha1, sha256, sha512. Defaults to 'sha256'. Use 'none' for no manifest. - -- `options` ([]string) - Advanced ovf export options. Options can include: - * mac - MAC address is exported for all ethernet devices - * uuid - UUID is exported for all virtual machines - * extraconfig - all extra configuration options are exported for a virtual machine - * nodevicesubtypes - resource subtypes for CD/DVD drives, floppy drives, and serial and parallel ports are not exported - - For example, adding the following export config option would output the mac addresses for all Ethernet devices in the ovf file: - - In JSON: - ```json - ... - "export": { - "options": ["mac"] - }, - ``` - In HCL2: - ```hcl - ... - export { - options = ["mac"] - } - ``` diff --git a/website/content/partials/builder/vsphere/common/ExportConfig.mdx b/website/content/partials/builder/vsphere/common/ExportConfig.mdx deleted file mode 100644 index 074c74302..000000000 --- a/website/content/partials/builder/vsphere/common/ExportConfig.mdx +++ /dev/null @@ -1,33 +0,0 @@ -<!-- Code generated from the comments of the ExportConfig struct in builder/vsphere/common/step_export.go; DO NOT EDIT MANUALLY --> - -You may optionally export an ovf from VSphere to the instance running Packer. - -Example usage: - -In JSON: -```json -... - "vm_name": "example-ubuntu", -... - "export": { - "force": true, - "output_directory": "./output_vsphere" - }, -``` -In HCL2: -```hcl - # ... - vm_name = "example-ubuntu" - # ... - export { - force = true - output_directory = "./output_vsphere" - } -``` -The above configuration would create the following files: - -```text -./output_vsphere/example-ubuntu-disk-0.vmdk -./output_vsphere/example-ubuntu.mf -./output_vsphere/example-ubuntu.ovf -``` diff --git a/website/content/partials/builder/vsphere/common/FloppyConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/FloppyConfig-not-required.mdx deleted file mode 100644 index fc41e65e1..000000000 --- a/website/content/partials/builder/vsphere/common/FloppyConfig-not-required.mdx +++ /dev/null @@ -1,14 +0,0 @@ -<!-- Code generated from the comments of the FloppyConfig struct in builder/vsphere/common/step_add_floppy.go; DO NOT EDIT MANUALLY --> - -- `floppy_img_path` (string) - Datastore path to a floppy image that will be mounted to the VM. - Example: `[datastore1] ISO/pvscsi-Windows8.flp`. - -- `floppy_files` ([]string) - List of local files to be mounted to the VM floppy drive. Can be used to - make Debian preseed or RHEL kickstart files available to the VM. - -- `floppy_dirs` ([]string) - List of directories to copy files from. - -- `floppy_label` (string) - The label to use for the floppy disk that - is attached when the VM is booted. This is most useful for cloud-init, - Kickstart or other early initialization tools, which can benefit from labelled floppy disks. - By default, the floppy label will be 'packer'. diff --git a/website/content/partials/builder/vsphere/common/HardwareConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/HardwareConfig-not-required.mdx deleted file mode 100644 index ccc4f5e90..000000000 --- a/website/content/partials/builder/vsphere/common/HardwareConfig-not-required.mdx +++ /dev/null @@ -1,31 +0,0 @@ -<!-- Code generated from the comments of the HardwareConfig struct in builder/vsphere/common/step_hardware.go; DO NOT EDIT MANUALLY --> - -- `CPUs` (int32) - Number of CPU cores. - -- `cpu_cores` (int32) - Number of CPU cores per socket. - -- `CPU_reservation` (int64) - Amount of reserved CPU resources in MHz. - -- `CPU_limit` (int64) - Upper limit of available CPU resources in MHz. - -- `CPU_hot_plug` (bool) - Enable CPU hot plug setting for virtual machine. Defaults to `false`. - -- `RAM` (int64) - Amount of RAM in MB. - -- `RAM_reservation` (int64) - Amount of reserved RAM in MB. - -- `RAM_reserve_all` (bool) - Reserve all available RAM. Defaults to `false`. Cannot be used together - with `RAM_reservation`. - -- `RAM_hot_plug` (bool) - Enable RAM hot plug setting for virtual machine. Defaults to `false`. - -- `video_ram` (int64) - Amount of video memory in KB. - -- `vgpu_profile` (string) - vGPU profile for accelerated graphics. See [NVIDIA GRID vGPU documentation](https://docs.nvidia.com/grid/latest/grid-vgpu-user-guide/index.html#configure-vmware-vsphere-vm-with-vgpu) - for examples of profile names. Defaults to none. - -- `NestedHV` (bool) - Enable nested hardware virtualization for VM. Defaults to `false`. - -- `firmware` (string) - Set the Firmware for virtual machine. Supported values: `bios`, `efi` or `efi-secure`. Defaults to `bios`. - -- `force_bios_setup` (bool) - During the boot, force entry into the BIOS setup screen. Defaults to `false`. diff --git a/website/content/partials/builder/vsphere/common/LocationConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/LocationConfig-not-required.mdx deleted file mode 100644 index 58e2afb38..000000000 --- a/website/content/partials/builder/vsphere/common/LocationConfig-not-required.mdx +++ /dev/null @@ -1,24 +0,0 @@ -<!-- Code generated from the comments of the LocationConfig struct in builder/vsphere/common/config_location.go; DO NOT EDIT MANUALLY --> - -- `vm_name` (string) - Name of the new VM to create. - -- `folder` (string) - VM folder to create the VM in. - -- `cluster` (string) - ESXi cluster where target VM is created. See the - [Working With Clusters And Hosts](#working-with-clusters-and-hosts) - section above for more details. - -- `host` (string) - ESXi host where target VM is created. A full path must be specified if - the host is in a folder. For example `folder/host`. See the - [Working With Clusters And Hosts](#working-with-clusters-and-hosts) - section above for more details. - -- `resource_pool` (string) - VMWare resource pool. If not set, it will look for the root resource - pool of the `host` or `cluster`. If a root resource is not found, it - will then look for a default resource pool. - -- `datastore` (string) - VMWare datastore. Required if `host` is a cluster, or if `host` has - multiple datastores. - -- `set_host_for_datastore_uploads` (bool) - Set this to true if packer should use the host for uploading files - to the datastore. Defaults to false. diff --git a/website/content/partials/builder/vsphere/common/OutputConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/OutputConfig-not-required.mdx deleted file mode 100644 index 6e5476c97..000000000 --- a/website/content/partials/builder/vsphere/common/OutputConfig-not-required.mdx +++ /dev/null @@ -1,16 +0,0 @@ -<!-- Code generated from the comments of the OutputConfig struct in builder/vsphere/common/output_config.go; DO NOT EDIT MANUALLY --> - -- `output_directory` (string) - This setting specifies the directory that - artifacts from the build, such as the virtual machine files and disks, - will be output to. The path to the directory may be relative or - absolute. If relative, the path is relative to the working directory - packer is executed from. This directory must not exist or, if - created, must be empty prior to running the builder. By default this is - "output-BUILDNAME" where "BUILDNAME" is the name of the build. - -- `directory_permission` (os.FileMode) - The permissions to apply to the "output_directory", and to any parent - directories that get created for output_directory. By default this is - "0750". You should express the permission as quoted string with a - leading zero such as "0755" in JSON file, because JSON does not support - octal value. In Unix-like OS, the actual permission may differ from - this value because of umask. diff --git a/website/content/partials/builder/vsphere/common/RemoveCDRomConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/RemoveCDRomConfig-not-required.mdx deleted file mode 100644 index 651bffa6e..000000000 --- a/website/content/partials/builder/vsphere/common/RemoveCDRomConfig-not-required.mdx +++ /dev/null @@ -1,3 +0,0 @@ -<!-- Code generated from the comments of the RemoveCDRomConfig struct in builder/vsphere/common/step_remove_cdrom.go; DO NOT EDIT MANUALLY --> - -- `remove_cdrom` (bool) - Remove CD-ROM devices from template. Defaults to `false`. diff --git a/website/content/partials/builder/vsphere/common/RunConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/RunConfig-not-required.mdx deleted file mode 100644 index b5dedf69d..000000000 --- a/website/content/partials/builder/vsphere/common/RunConfig-not-required.mdx +++ /dev/null @@ -1,3 +0,0 @@ -<!-- Code generated from the comments of the RunConfig struct in builder/vsphere/common/step_run.go; DO NOT EDIT MANUALLY --> - -- `boot_order` (string) - Priority of boot devices. Defaults to `disk,cdrom` diff --git a/website/content/partials/builder/vsphere/common/ShutdownConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/ShutdownConfig-not-required.mdx deleted file mode 100644 index 1b950c176..000000000 --- a/website/content/partials/builder/vsphere/common/ShutdownConfig-not-required.mdx +++ /dev/null @@ -1,16 +0,0 @@ -<!-- Code generated from the comments of the ShutdownConfig struct in builder/vsphere/common/step_shutdown.go; DO NOT EDIT MANUALLY --> - -- `shutdown_command` (string) - Specify a VM guest shutdown command. This command will be executed using - the `communicator`. Otherwise the VMware guest tools are used to gracefully - shutdown the VM guest. - -- `shutdown_timeout` (duration string | ex: "1h5m2s") - Amount of time to wait for graceful VM shutdown. - Defaults to 5m or five minutes. - This will likely need to be modified if the `communicator` is 'none'. - -- `disable_shutdown` (bool) - Packer normally halts the virtual machine after all provisioners have - run when no `shutdown_command` is defined. If this is set to `true`, Packer - *will not* halt the virtual machine but will assume that you will send the stop - signal yourself through a preseed.cfg, a script or the final provisioner. - Packer will wait for a default of five minutes until the virtual machine is shutdown. - The timeout can be changed using `shutdown_timeout` option. diff --git a/website/content/partials/builder/vsphere/common/StorageConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/StorageConfig-not-required.mdx deleted file mode 100644 index 2146f4442..000000000 --- a/website/content/partials/builder/vsphere/common/StorageConfig-not-required.mdx +++ /dev/null @@ -1,8 +0,0 @@ -<!-- Code generated from the comments of the StorageConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY --> - -- `disk_controller_type` ([]string) - Set VM disk controller type. Example `lsilogic`, `pvscsi`, `nvme`, or `scsi`. Use a list to define additional controllers. - Defaults to `lsilogic`. See - [SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html#GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362) - for additional details. - -- `storage` ([]DiskConfig) - Configures a collection of one or more disks to be provisioned along with the VM. See the [Storage Configuration](#storage-configuration). diff --git a/website/content/partials/builder/vsphere/common/WaitIpConfig-not-required.mdx b/website/content/partials/builder/vsphere/common/WaitIpConfig-not-required.mdx deleted file mode 100644 index 905d44690..000000000 --- a/website/content/partials/builder/vsphere/common/WaitIpConfig-not-required.mdx +++ /dev/null @@ -1,20 +0,0 @@ -<!-- Code generated from the comments of the WaitIpConfig struct in builder/vsphere/common/step_wait_for_ip.go; DO NOT EDIT MANUALLY --> - -- `ip_wait_timeout` (duration string | ex: "1h5m2s") - Amount of time to wait for VM's IP, similar to 'ssh_timeout'. - Defaults to 30m (30 minutes). See the Golang - [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation - for full details. - -- `ip_settle_timeout` (duration string | ex: "1h5m2s") - Amount of time to wait for VM's IP to settle down, sometimes VM may - report incorrect IP initially, then its recommended to set that - parameter to apx. 2 minutes. Examples 45s and 10m. Defaults to - 5s(5 seconds). See the Golang - [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation - for full details. - -- `ip_wait_address` (\*string) - Set this to a CIDR address to cause the service to wait for an address that is contained in - this network range. Defaults to "0.0.0.0/0" for any ipv4 address. Examples include: - - * empty string ("") - remove all filters - * `0:0:0:0:0:0:0:0/0` - allow only ipv6 addresses - * `192.168.1.0/24` - only allow ipv4 addresses from 192.168.1.1 to 192.168.1.254 diff --git a/website/content/partials/builder/vsphere/iso/Config-not-required.mdx b/website/content/partials/builder/vsphere/iso/Config-not-required.mdx deleted file mode 100644 index 72cc35ecf..000000000 --- a/website/content/partials/builder/vsphere/iso/Config-not-required.mdx +++ /dev/null @@ -1,13 +0,0 @@ -<!-- Code generated from the comments of the Config struct in builder/vsphere/iso/config.go; DO NOT EDIT MANUALLY --> - -- `create_snapshot` (bool) - Create a snapshot when set to `true`, so the VM can be used as a base - for linked clones. Defaults to `false`. - -- `convert_to_template` (bool) - Convert VM to a template. Defaults to `false`. - -- `export` (\*common.ExportConfig) - Configuration for exporting VM to an ovf file. - The VM will not be exported if no [Export Configuration](#export-configuration) is specified. - -- `content_library_destination` (\*common.ContentLibraryDestinationConfig) - Configuration for importing the VM template to a Content Library. - The VM template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. - The import doesn't work if [convert_to_template](#convert_to_template) is set to true. diff --git a/website/content/partials/builder/vsphere/iso/CreateConfig-not-required.mdx b/website/content/partials/builder/vsphere/iso/CreateConfig-not-required.mdx deleted file mode 100644 index cd2ddc28d..000000000 --- a/website/content/partials/builder/vsphere/iso/CreateConfig-not-required.mdx +++ /dev/null @@ -1,16 +0,0 @@ -<!-- Code generated from the comments of the CreateConfig struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY --> - -- `vm_version` (uint) - Set VM hardware version. Defaults to the most current VM hardware - version supported by vCenter. See - [VMWare article 1003746](https://kb.vmware.com/s/article/1003746) for - the full list of supported VM hardware versions. - -- `guest_os_type` (string) - Set VM OS type. Defaults to `otherGuest`. See [ - here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) - for a full list of possible values. - -- `network_adapters` ([]NIC) - Network adapters - -- `usb_controller` ([]string) - Create USB controllers for the virtual machine. "usb" for a usb 2.0 controller. "xhci" for a usb 3.0 controller. There can only be at most one of each. - -- `notes` (string) - VM notes. diff --git a/website/content/partials/builder/vsphere/iso/NIC-not-required.mdx b/website/content/partials/builder/vsphere/iso/NIC-not-required.mdx deleted file mode 100644 index fa5f0da5c..000000000 --- a/website/content/partials/builder/vsphere/iso/NIC-not-required.mdx +++ /dev/null @@ -1,10 +0,0 @@ -<!-- Code generated from the comments of the NIC struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY --> - -- `network` (string) - Set the network in which the VM will be connected to. If no network is - specified, `host` must be specified to allow Packer to look for the - available network. If the network is inside a network folder in vCenter, - you need to provide the full path to the network. - -- `mac_address` (string) - Set network card MAC address - -- `passthrough` (\*bool) - Enable DirectPath I/O passthrough diff --git a/website/content/partials/builder/vsphere/iso/NIC-required.mdx b/website/content/partials/builder/vsphere/iso/NIC-required.mdx deleted file mode 100644 index a73b8a26e..000000000 --- a/website/content/partials/builder/vsphere/iso/NIC-required.mdx +++ /dev/null @@ -1,3 +0,0 @@ -<!-- Code generated from the comments of the NIC struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY --> - -- `network_card` (string) - Set VM network card type. Example `vmxnet3`. diff --git a/website/content/partials/builder/vsphere/iso/NIC.mdx b/website/content/partials/builder/vsphere/iso/NIC.mdx deleted file mode 100644 index e891469b0..000000000 --- a/website/content/partials/builder/vsphere/iso/NIC.mdx +++ /dev/null @@ -1,30 +0,0 @@ -<!-- Code generated from the comments of the NIC struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY --> - -Defines a Network Adapter - -Example that creates two network adapters: - -In JSON: -```json - "network_adapters": [ - { - "network": "VM Network", - "network_card": "vmxnet3" - }, - { - "network": "OtherNetwork", - "network_card": "vmxnet3" - } - ], -``` -In HCL2: -```hcl - network_adapters { - network = "VM Network" - network_card = "vmxnet3" - } - network_adapters { - network = "OtherNetwork" - network_card = "vmxnet3" - } -``` diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index f6d0a9419..1198fe8f2 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -912,14 +912,6 @@ { "title": "VMWare VMX", "path": "builders/vmware/vmx" - }, - { - "title": "VSphere ISO", - "path": "builders/vmware/vsphere-iso" - }, - { - "title": "VSphere Clone", - "path": "builders/vmware/vsphere-clone" } ] }, @@ -1082,14 +1074,6 @@ "title": "Vagrant Cloud", "path": "post-processors/vagrant-cloud" }, - { - "title": "vSphere", - "path": "post-processors/vsphere" - }, - { - "title": "vSphere Template", - "path": "post-processors/vsphere-template" - }, { "title": "Yandex.Cloud Compute Export", "path": "post-processors/yandex-export" From f6854f5528bf68625f4b4143af102d0daeefd0be Mon Sep 17 00:00:00 2001 From: sylviamoss <moss@hashicorp.com> Date: Fri, 9 Apr 2021 14:43:29 +0200 Subject: [PATCH 2/7] update go vendor --- go.mod | 1 - vendor/github.com/vmware/govmomi/ovf/cim.go | 128 - vendor/github.com/vmware/govmomi/ovf/doc.go | 25 - vendor/github.com/vmware/govmomi/ovf/env.go | 99 - .../github.com/vmware/govmomi/ovf/envelope.go | 200 - .../github.com/vmware/govmomi/ovf/manager.go | 103 - vendor/github.com/vmware/govmomi/ovf/ovf.go | 35 - .../simulator/authorization_manager.go | 280 - .../simulator/cluster_compute_resource.go | 382 - .../vmware/govmomi/simulator/container.go | 408 - .../simulator/custom_fields_manager.go | 199 - .../simulator/customization_spec_manager.go | 349 - .../vmware/govmomi/simulator/datacenter.go | 198 - .../vmware/govmomi/simulator/datastore.go | 90 - .../vmware/govmomi/simulator/doc.go | 22 - .../vmware/govmomi/simulator/dvs.go | 281 - .../vmware/govmomi/simulator/entity.go | 46 - .../govmomi/simulator/environment_browser.go | 225 - .../simulator/esx/authorization_manager.go | 85 - .../govmomi/simulator/esx/datacenter.go | 60 - .../vmware/govmomi/simulator/esx/doc.go | 20 - .../govmomi/simulator/esx/event_manager.go | 248 - .../govmomi/simulator/esx/host_config_info.go | 1115 - .../simulator/esx/host_firewall_system.go | 1425 - .../simulator/esx/host_hardware_info.go | 864 - .../simulator/esx/host_storage_device_info.go | 346 - .../govmomi/simulator/esx/host_system.go | 1801 -- .../simulator/esx/performance_manager.go | 15057 ----------- .../simulator/esx/performance_manager_data.go | 1213 - .../govmomi/simulator/esx/resource_pool.go | 165 - .../govmomi/simulator/esx/root_folder.go | 76 - .../govmomi/simulator/esx/service_content.go | 86 - .../vmware/govmomi/simulator/esx/setting.go | 33 - .../govmomi/simulator/esx/task_manager.go | 10412 -------- .../govmomi/simulator/esx/virtual_device.go | 242 - .../vmware/govmomi/simulator/event_manager.go | 494 - .../vmware/govmomi/simulator/file_manager.go | 252 - .../vmware/govmomi/simulator/folder.go | 690 - .../vmware/govmomi/simulator/guest_id.go | 171 - .../vmware/govmomi/simulator/guest_id.sh | 35 - .../simulator/guest_operations_manager.go | 111 - .../simulator/host_datastore_browser.go | 252 - .../simulator/host_datastore_system.go | 174 - .../govmomi/simulator/host_firewall_system.go | 87 - .../simulator/host_local_account_manager.go | 72 - .../govmomi/simulator/host_network_system.go | 212 - .../govmomi/simulator/host_storage_system.go | 134 - .../vmware/govmomi/simulator/host_system.go | 269 - .../govmomi/simulator/http_nfc_lease.go | 137 - .../govmomi/simulator/internal/server.go | 343 - .../govmomi/simulator/internal/testcert.go | 41 - .../govmomi/simulator/internal/types.go | 73 - .../govmomi/simulator/ip_pool_manager.go | 387 - .../govmomi/simulator/license_manager.go | 188 - .../vmware/govmomi/simulator/model.go | 824 - .../vmware/govmomi/simulator/object.go | 79 - .../govmomi/simulator/option_manager.go | 110 - .../vmware/govmomi/simulator/os_unix.go | 38 - .../vmware/govmomi/simulator/os_windows.go | 26 - .../vmware/govmomi/simulator/ovf_manager.go | 292 - .../govmomi/simulator/performance_manager.go | 255 - .../vmware/govmomi/simulator/portgroup.go | 73 - .../govmomi/simulator/property_collector.go | 841 - .../govmomi/simulator/property_filter.go | 108 - .../vmware/govmomi/simulator/registry.go | 558 - .../vmware/govmomi/simulator/resource_pool.go | 402 - .../vmware/govmomi/simulator/search_index.go | 256 - .../govmomi/simulator/service_instance.go | 95 - .../govmomi/simulator/session_manager.go | 454 - .../vmware/govmomi/simulator/simulator.go | 920 - .../vmware/govmomi/simulator/snapshot.go | 167 - .../simulator/storage_resource_manager.go | 184 - .../vmware/govmomi/simulator/task.go | 109 - .../vmware/govmomi/simulator/task_manager.go | 64 - .../govmomi/simulator/user_directory.go | 104 - .../vmware/govmomi/simulator/view_manager.go | 267 - .../govmomi/simulator/virtual_disk_manager.go | 220 - .../govmomi/simulator/virtual_machine.go | 2122 -- .../vmware/govmomi/simulator/vpx/doc.go | 20 - .../simulator/vpx/performance_manager.go | 21801 ---------------- .../simulator/vpx/performance_manager_data.go | 1877 -- .../govmomi/simulator/vpx/root_folder.go | 64 - .../govmomi/simulator/vpx/service_content.go | 86 - .../vmware/govmomi/simulator/vpx/setting.go | 76 - .../govmomi/simulator/vpx/task_manager.go | 11133 -------- .../simulator/vstorage_object_manager.go | 451 - .../vmware/govmomi/vapi/library/library.go | 308 - .../govmomi/vapi/library/library_file.go | 56 - .../govmomi/vapi/library/library_item.go | 180 - .../library_item_downloadsession_file.go | 71 - .../library/library_item_updatesession.go | 165 - .../library_item_updatesession_file.go | 149 - .../govmomi/vapi/vcenter/vcenter_ovf.go | 304 - .../govmomi/vapi/vcenter/vcenter_vmtx.go | 285 - vendor/modules.txt | 8 - 95 files changed, 86043 deletions(-) delete mode 100644 vendor/github.com/vmware/govmomi/ovf/cim.go delete mode 100644 vendor/github.com/vmware/govmomi/ovf/doc.go delete mode 100644 vendor/github.com/vmware/govmomi/ovf/env.go delete mode 100644 vendor/github.com/vmware/govmomi/ovf/envelope.go delete mode 100644 vendor/github.com/vmware/govmomi/ovf/manager.go delete mode 100644 vendor/github.com/vmware/govmomi/ovf/ovf.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/authorization_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/container.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/datacenter.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/datastore.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/doc.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/dvs.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/entity.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/environment_browser.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/doc.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/host_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/service_content.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/setting.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/event_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/file_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/folder.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/guest_id.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/guest_id.sh delete mode 100644 vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_network_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_storage_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/host_system.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/internal/server.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/internal/testcert.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/internal/types.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/license_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/model.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/object.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/option_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/os_unix.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/os_windows.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/ovf_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/performance_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/portgroup.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/property_collector.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/property_filter.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/registry.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/resource_pool.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/search_index.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/service_instance.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/session_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/simulator.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/snapshot.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/task.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/task_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/user_directory.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/view_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/virtual_machine.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/doc.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/setting.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_file.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go delete mode 100644 vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go diff --git a/go.mod b/go.mod index 549e6d052..797690093 100644 --- a/go.mod +++ b/go.mod @@ -90,7 +90,6 @@ require ( github.com/zclconf/go-cty v1.8.1 github.com/zclconf/go-cty-yaml v1.0.1 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad - golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2 golang.org/x/mod v0.3.0 golang.org/x/net v0.0.0-20210119194325-5f4716e94777 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 diff --git a/vendor/github.com/vmware/govmomi/ovf/cim.go b/vendor/github.com/vmware/govmomi/ovf/cim.go deleted file mode 100644 index 427699954..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/cim.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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 ovf - -import ( - "github.com/vmware/govmomi/vim25/types" -) - -/* -Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd -*/ - -type CIMVirtualSystemSettingData struct { - ElementName string `xml:"ElementName"` - InstanceID string `xml:"InstanceID"` - - AutomaticRecoveryAction *uint8 `xml:"AutomaticRecoveryAction"` - AutomaticShutdownAction *uint8 `xml:"AutomaticShutdownAction"` - AutomaticStartupAction *uint8 `xml:"AutomaticStartupAction"` - AutomaticStartupActionDelay *string `xml:"AutomaticStartupActionDelay>Interval"` - AutomaticStartupActionSequenceNumber *uint16 `xml:"AutomaticStartupActionSequenceNumber"` - Caption *string `xml:"Caption"` - ConfigurationDataRoot *string `xml:"ConfigurationDataRoot"` - ConfigurationFile *string `xml:"ConfigurationFile"` - ConfigurationID *string `xml:"ConfigurationID"` - CreationTime *string `xml:"CreationTime"` - Description *string `xml:"Description"` - LogDataRoot *string `xml:"LogDataRoot"` - Notes []string `xml:"Notes"` - RecoveryFile *string `xml:"RecoveryFile"` - SnapshotDataRoot *string `xml:"SnapshotDataRoot"` - SuspendDataRoot *string `xml:"SuspendDataRoot"` - SwapFileDataRoot *string `xml:"SwapFileDataRoot"` - VirtualSystemIdentifier *string `xml:"VirtualSystemIdentifier"` - VirtualSystemType *string `xml:"VirtualSystemType"` -} - -/* -Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_ResourceAllocationSettingData.xsd -*/ - -type CIMResourceAllocationSettingData struct { - ElementName string `xml:"ElementName"` - InstanceID string `xml:"InstanceID"` - - ResourceType *uint16 `xml:"ResourceType"` - OtherResourceType *string `xml:"OtherResourceType"` - ResourceSubType *string `xml:"ResourceSubType"` - - AddressOnParent *string `xml:"AddressOnParent"` - Address *string `xml:"Address"` - AllocationUnits *string `xml:"AllocationUnits"` - AutomaticAllocation *bool `xml:"AutomaticAllocation"` - AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` - Caption *string `xml:"Caption"` - Connection []string `xml:"Connection"` - ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` - Description *string `xml:"Description"` - HostResource []string `xml:"HostResource"` - Limit *uint64 `xml:"Limit"` - MappingBehavior *uint `xml:"MappingBehavior"` - Parent *string `xml:"Parent"` - PoolID *string `xml:"PoolID"` - Reservation *uint64 `xml:"Reservation"` - VirtualQuantity *uint `xml:"VirtualQuantity"` - VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` - Weight *uint `xml:"Weight"` -} - -/* -Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_StorageAllocationSettingData.xsd -*/ -type CIMStorageAllocationSettingData struct { - ElementName string `xml:"ElementName"` - InstanceID string `xml:"InstanceID"` - - ResourceType *uint16 `xml:"ResourceType"` - OtherResourceType *string `xml:"OtherResourceType"` - ResourceSubType *string `xml:"ResourceSubType"` - - Access *uint16 `xml:"Access"` - Address *string `xml:"Address"` - AddressOnParent *string `xml:"AddressOnParent"` - AllocationUnits *string `xml:"AllocationUnits"` - AutomaticAllocation *bool `xml:"AutomaticAllocation"` - AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` - Caption *string `xml:"Caption"` - ChangeableType *uint16 `xml:"ChangeableType"` - ComponentSetting []types.AnyType `xml:"ComponentSetting"` - ConfigurationName *string `xml:"ConfigurationName"` - Connection []string `xml:"Connection"` - ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` - Description *string `xml:"Description"` - Generation *uint64 `xml:"Generation"` - HostExtentName *string `xml:"HostExtentName"` - HostExtentNameFormat *uint16 `xml:"HostExtentNameFormat"` - HostExtentNameNamespace *uint16 `xml:"HostExtentNameNamespace"` - HostExtentStartingAddress *uint64 `xml:"HostExtentStartingAddress"` - HostResource []string `xml:"HostResource"` - HostResourceBlockSize *uint64 `xml:"HostResourceBlockSize"` - Limit *uint64 `xml:"Limit"` - MappingBehavior *uint `xml:"MappingBehavior"` - OtherHostExtentNameFormat *string `xml:"OtherHostExtentNameFormat"` - OtherHostExtentNameNamespace *string `xml:"OtherHostExtentNameNamespace"` - Parent *string `xml:"Parent"` - PoolID *string `xml:"PoolID"` - Reservation *uint64 `xml:"Reservation"` - SoID *string `xml:"SoID"` - SoOrgID *string `xml:"SoOrgID"` - VirtualQuantity *uint `xml:"VirtualQuantity"` - VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` - VirtualResourceBlockSize *uint64 `xml:"VirtualResourceBlockSize"` - Weight *uint `xml:"Weight"` -} diff --git a/vendor/github.com/vmware/govmomi/ovf/doc.go b/vendor/github.com/vmware/govmomi/ovf/doc.go deleted file mode 100644 index 6284b1ac5..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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 ovf provides functionality to unmarshal and inspect the structure -of an OVF file. It is not a complete implementation of the specification and -is intended to be used to import virtual infrastructure into vSphere. - -For a complete specification of the OVF standard, refer to: -https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf -*/ -package ovf diff --git a/vendor/github.com/vmware/govmomi/ovf/env.go b/vendor/github.com/vmware/govmomi/ovf/env.go deleted file mode 100644 index 3ec1b99d0..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/env.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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 ovf - -import ( - "bytes" - "fmt" - - "github.com/vmware/govmomi/vim25/xml" -) - -const ( - ovfEnvHeader = `<Environment - xmlns="http://schemas.dmtf.org/ovf/environment/1" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" - xmlns:ve="http://www.vmware.com/schema/ovfenv" - oe:id="" - ve:esxId="%s">` - ovfEnvPlatformSection = `<PlatformSection> - <Kind>%s</Kind> - <Version>%s</Version> - <Vendor>%s</Vendor> - <Locale>%s</Locale> - </PlatformSection>` - ovfEnvPropertyHeader = `<PropertySection>` - ovfEnvPropertyEntry = `<Property oe:key="%s" oe:value="%s"/>` - ovfEnvPropertyFooter = `</PropertySection>` - ovfEnvFooter = `</Environment>` -) - -type Env struct { - XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment"` - ID string `xml:"id,attr"` - EsxID string `xml:"http://www.vmware.com/schema/ovfenv esxId,attr"` - - Platform *PlatformSection `xml:"PlatformSection"` - Property *PropertySection `xml:"PropertySection"` -} - -type PlatformSection struct { - Kind string `xml:"Kind"` - Version string `xml:"Version"` - Vendor string `xml:"Vendor"` - Locale string `xml:"Locale"` -} - -type PropertySection struct { - Properties []EnvProperty `xml:"Property"` -} - -type EnvProperty struct { - Key string `xml:"key,attr"` - Value string `xml:"value,attr"` -} - -// Marshal marshals Env to xml by using xml.Marshal. -func (e Env) Marshal() (string, error) { - x, err := xml.Marshal(e) - if err != nil { - return "", err - } - - return fmt.Sprintf("%s%s", xml.Header, x), nil -} - -// MarshalManual manually marshals Env to xml suitable for a vApp guest. -// It exists to overcome the lack of expressiveness in Go's XML namespaces. -func (e Env) MarshalManual() string { - var buffer bytes.Buffer - - buffer.WriteString(xml.Header) - buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) - buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) - - buffer.WriteString(fmt.Sprint(ovfEnvPropertyHeader)) - for _, p := range e.Property.Properties { - buffer.WriteString(fmt.Sprintf(ovfEnvPropertyEntry, p.Key, p.Value)) - } - buffer.WriteString(fmt.Sprint(ovfEnvPropertyFooter)) - - buffer.WriteString(fmt.Sprint(ovfEnvFooter)) - - return buffer.String() -} diff --git a/vendor/github.com/vmware/govmomi/ovf/envelope.go b/vendor/github.com/vmware/govmomi/ovf/envelope.go deleted file mode 100644 index fa4690d88..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/envelope.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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 ovf - -type Envelope struct { - References []File `xml:"References>File"` - - // Package level meta-data - Annotation *AnnotationSection `xml:"AnnotationSection"` - Product *ProductSection `xml:"ProductSection"` - Network *NetworkSection `xml:"NetworkSection"` - Disk *DiskSection `xml:"DiskSection"` - OperatingSystem *OperatingSystemSection `xml:"OperatingSystemSection"` - Eula *EulaSection `xml:"EulaSection"` - VirtualHardware *VirtualHardwareSection `xml:"VirtualHardwareSection"` - ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection"` - DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection"` - - // Content: A VirtualSystem or a VirtualSystemCollection - VirtualSystem *VirtualSystem `xml:"VirtualSystem"` -} - -type VirtualSystem struct { - Content - - Annotation []AnnotationSection `xml:"AnnotationSection"` - Product []ProductSection `xml:"ProductSection"` - OperatingSystem []OperatingSystemSection `xml:"OperatingSystemSection"` - Eula []EulaSection `xml:"EulaSection"` - VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection"` -} - -type File struct { - ID string `xml:"id,attr"` - Href string `xml:"href,attr"` - Size uint `xml:"size,attr"` - Compression *string `xml:"compression,attr"` - ChunkSize *int `xml:"chunkSize,attr"` -} - -type Content struct { - ID string `xml:"id,attr"` - Info string `xml:"Info"` - Name *string `xml:"Name"` -} - -type Section struct { - Required *bool `xml:"required,attr"` - Info string `xml:"Info"` -} - -type AnnotationSection struct { - Section - - Annotation string `xml:"Annotation"` -} - -type ProductSection struct { - Section - - Class *string `xml:"class,attr"` - Instance *string `xml:"instance,attr"` - - Product string `xml:"Product"` - Vendor string `xml:"Vendor"` - Version string `xml:"Version"` - FullVersion string `xml:"FullVersion"` - ProductURL string `xml:"ProductUrl"` - VendorURL string `xml:"VendorUrl"` - AppURL string `xml:"AppUrl"` - Property []Property `xml:"Property"` -} - -type Property struct { - Key string `xml:"key,attr"` - Type string `xml:"type,attr"` - Qualifiers *string `xml:"qualifiers,attr"` - UserConfigurable *bool `xml:"userConfigurable,attr"` - Default *string `xml:"value,attr"` - Password *bool `xml:"password,attr"` - - Label *string `xml:"Label"` - Description *string `xml:"Description"` - - Values []PropertyConfigurationValue `xml:"Value"` -} - -type PropertyConfigurationValue struct { - Value string `xml:"value,attr"` - Configuration *string `xml:"configuration,attr"` -} - -type NetworkSection struct { - Section - - Networks []Network `xml:"Network"` -} - -type Network struct { - Name string `xml:"name,attr"` - - Description string `xml:"Description"` -} - -type DiskSection struct { - Section - - Disks []VirtualDiskDesc `xml:"Disk"` -} - -type VirtualDiskDesc struct { - DiskID string `xml:"diskId,attr"` - FileRef *string `xml:"fileRef,attr"` - Capacity string `xml:"capacity,attr"` - CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr"` - Format *string `xml:"format,attr"` - PopulatedSize *int `xml:"populatedSize,attr"` - ParentRef *string `xml:"parentRef,attr"` -} - -type OperatingSystemSection struct { - Section - - ID int16 `xml:"id,attr"` - Version *string `xml:"version,attr"` - OSType *string `xml:"osType,attr"` - - Description *string `xml:"Description"` -} - -type EulaSection struct { - Section - - License string `xml:"License"` -} - -type VirtualHardwareSection struct { - Section - - ID *string `xml:"id,attr"` - Transport *string `xml:"transport,attr"` - - System *VirtualSystemSettingData `xml:"System"` - Item []ResourceAllocationSettingData `xml:"Item"` - StorageItem []StorageAllocationSettingData `xml:"StorageItem"` -} - -type VirtualSystemSettingData struct { - CIMVirtualSystemSettingData -} - -type ResourceAllocationSettingData struct { - CIMResourceAllocationSettingData - - Required *bool `xml:"required,attr"` - Configuration *string `xml:"configuration,attr"` - Bound *string `xml:"bound,attr"` -} - -type StorageAllocationSettingData struct { - CIMStorageAllocationSettingData - - Required *bool `xml:"required,attr"` - Configuration *string `xml:"configuration,attr"` - Bound *string `xml:"bound,attr"` -} - -type ResourceAllocationSection struct { - Section - - Item []ResourceAllocationSettingData `xml:"Item"` -} - -type DeploymentOptionSection struct { - Section - - Configuration []DeploymentOptionConfiguration `xml:"Configuration"` -} - -type DeploymentOptionConfiguration struct { - ID string `xml:"id,attr"` - Default *bool `xml:"default,attr"` - - Label string `xml:"Label"` - Description string `xml:"Description"` -} diff --git a/vendor/github.com/vmware/govmomi/ovf/manager.go b/vendor/github.com/vmware/govmomi/ovf/manager.go deleted file mode 100644 index 3ee2afdd4..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/manager.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. - -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 ovf - -import ( - "context" - - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type Manager struct { - types.ManagedObjectReference - - c *vim25.Client -} - -func NewManager(c *vim25.Client) *Manager { - return &Manager{*c.ServiceContent.OvfManager, c} -} - -// CreateDescriptor wraps methods.CreateDescriptor -func (m *Manager) CreateDescriptor(ctx context.Context, obj mo.Reference, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { - req := types.CreateDescriptor{ - This: m.Reference(), - Obj: obj.Reference(), - Cdp: cdp, - } - - res, err := methods.CreateDescriptor(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// CreateImportSpec wraps methods.CreateImportSpec -func (m *Manager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool mo.Reference, datastore mo.Reference, cisp types.OvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error) { - req := types.CreateImportSpec{ - This: m.Reference(), - OvfDescriptor: ovfDescriptor, - ResourcePool: resourcePool.Reference(), - Datastore: datastore.Reference(), - Cisp: cisp, - } - - res, err := methods.CreateImportSpec(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// ParseDescriptor wraps methods.ParseDescriptor -func (m *Manager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error) { - req := types.ParseDescriptor{ - This: m.Reference(), - OvfDescriptor: ovfDescriptor, - Pdp: pdp, - } - - res, err := methods.ParseDescriptor(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// ValidateHost wraps methods.ValidateHost -func (m *Manager) ValidateHost(ctx context.Context, ovfDescriptor string, host mo.Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error) { - req := types.ValidateHost{ - This: m.Reference(), - OvfDescriptor: ovfDescriptor, - Host: host.Reference(), - Vhp: vhp, - } - - res, err := methods.ValidateHost(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} diff --git a/vendor/github.com/vmware/govmomi/ovf/ovf.go b/vendor/github.com/vmware/govmomi/ovf/ovf.go deleted file mode 100644 index bd279e757..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/ovf.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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 ovf - -import ( - "io" - - "github.com/vmware/govmomi/vim25/xml" -) - -func Unmarshal(r io.Reader) (*Envelope, error) { - var e Envelope - - dec := xml.NewDecoder(r) - err := dec.Decode(&e) - if err != nil { - return nil, err - } - - return &e, nil -} diff --git a/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go b/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go deleted file mode 100644 index 0aceb0715..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go +++ /dev/null @@ -1,280 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(req *types.RetrieveEntityPermissions) soap.HasFault { - e := Map.Get(req.Entity).(mo.Entity) - - p := m.permissions[e.Reference()] - - if req.Inherited { - for { - parent := e.Entity().Parent - if parent == nil { - break - } - - e = 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) 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/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go b/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go deleted file mode 100644 index 906261d32..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go +++ /dev/null @@ -1,382 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "log" - "math/rand" - "sync/atomic" - "time" - - "github.com/google/uuid" - "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(req *types.Rename_Task) soap.HasFault { - return RenameTask(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{} - } - - host := NewHostSystem(esx.HostSystem) - host.configure(spec, add.req.AsConnected) - - cr := add.ClusterComputeResource - Map.PutEntity(cr, Map.NewEntity(host)) - host.Summary.Host = &host.Self - - cr.Host = append(cr.Host, host.Reference()) - addComputeResource(cr.Summary.GetComputeResourceSummary(), host) - host.Network = cr.Network[:1] // VM Network - - return host.Reference(), nil -} - -func (c *ClusterComputeResource) AddHostTask(add *types.AddHost_Task) soap.HasFault { - return &methods.AddHost_TaskBody{ - Res: &types.AddHost_TaskResponse{ - Returnval: NewTask(&addHost{c, add}).Run(), - }, - } -} - -func (c *ClusterComputeResource) updateRules(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(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(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(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) ReconfigureComputeResourceTask(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(*types.ClusterConfigInfoEx, *types.ClusterConfigSpecEx) types.BaseMethodFault{ - c.updateRules, - c.updateGroups, - c.updateOverridesDAS, - c.updateOverridesDRS, - } - - for _, update := range updates { - if err := update(c.ConfigurationEx.(*types.ClusterConfigInfoEx), spec); err != nil { - return nil, err - } - } - - return nil, nil - }) - - return &methods.ReconfigureComputeResource_TaskBody{ - Res: &types.ReconfigureComputeResource_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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 - } - - spec := &types.VirtualMachineRelocateSpec{ - Datastore: &datastores[rand.Intn(len(c.Datastore))], - Host: &hosts[rand.Intn(len(c.Host))], - Pool: c.ResourcePool, - } - - switch types.PlacementSpecPlacementType(req.PlacementSpec.PlacementType) { - case types.PlacementSpecPlacementTypeClone, types.PlacementSpecPlacementTypeCreate: - res.Action = append(res.Action, &types.PlacementAction{ - Vm: req.PlacementSpec.Vm, - TargetHost: spec.Host, - RelocateSpec: spec, - }) - 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 -} - -func CreateClusterComputeResource(ctx *Context, f *Folder, name string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, types.BaseMethodFault) { - if e := Map.FindByName(name, f.ChildEntity); e != nil { - return nil, &types.DuplicateName{ - Name: e.Entity().Name, - Object: e.Reference(), - } - } - - cluster := &ClusterComputeResource{} - cluster.EnvironmentBrowser = newEnvironmentBrowser() - cluster.Name = name - cluster.Network = 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() - Map.PutEntity(cluster, Map.NewEntity(pool)) - cluster.ResourcePool = &pool.Self - - folderPutChild(ctx, &f.Folder, cluster) - pool.Owner = cluster.Self - - return cluster, nil -} diff --git a/vendor/github.com/vmware/govmomi/simulator/container.go b/vendor/github.com/vmware/govmomi/simulator/container.go deleted file mode 100644 index e02989805..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/container.go +++ /dev/null @@ -1,408 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "archive/tar" - "bytes" - "encoding/hex" - "encoding/json" - "fmt" - "io" - "log" - "net/http" - "os/exec" - "path" - "strconv" - "strings" - "time" - - "github.com/google/uuid" - - "github.com/vmware/govmomi/vim25/types" -) - -var ( - shell = "/bin/sh" -) - -func init() { - if sh, err := exec.LookPath("bash"); err != nil { - shell = sh - } -} - -// container provides methods to manage a container within a simulator VM lifecycle. -type container struct { - id string - name string -} - -type networkSettings struct { - Gateway string - IPAddress string - IPPrefixLen int - MacAddress string -} - -// inspect applies container network settings to vm.Guest properties. -func (c *container) inspect(vm *VirtualMachine) error { - if c.id == "" { - return nil - } - - var objects []struct { - NetworkSettings struct { - networkSettings - Networks map[string]networkSettings - } - } - - cmd := exec.Command("docker", "inspect", c.id) - out, err := cmd.Output() - if err != nil { - return err - } - if err = json.NewDecoder(bytes.NewReader(out)).Decode(&objects); err != nil { - return err - } - - vm.Config.Annotation = strings.Join(cmd.Args, " ") - vm.logPrintf("%s: %s", vm.Config.Annotation, string(out)) - - for _, o := range objects { - s := o.NetworkSettings.networkSettings - - for _, n := range o.NetworkSettings.Networks { - s = n - break - } - - if s.IPAddress == "" { - continue - } - - vm.Guest.IpAddress = s.IPAddress - vm.Summary.Guest.IpAddress = s.IPAddress - - if len(vm.Guest.Net) != 0 { - net := &vm.Guest.Net[0] - net.IpAddress = []string{s.IPAddress} - net.MacAddress = s.MacAddress - } - } - - return nil -} - -func (c *container) prepareGuestOperation(vm *VirtualMachine, auth types.BaseGuestAuthentication) types.BaseMethodFault { - if c.id == "" { - return new(types.GuestOperationsUnavailable) - } - if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { - return &types.InvalidPowerState{ - RequestedState: types.VirtualMachinePowerStatePoweredOn, - ExistingState: 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 -} - -// createDMI writes BIOS UUID DMI files to a container volume -func (c *container) createDMI(vm *VirtualMachine, name string) error { - cmd := exec.Command("docker", "run", "--rm", "-i", "-v", name+":"+"/"+name, "busybox", "tar", "-C", "/"+name, "-xf", "-") - stdin, err := cmd.StdinPipe() - if err != nil { - return err - } - - err = cmd.Start() - if err != nil { - return err - } - - tw := tar.NewWriter(stdin) - - dmi := []struct { - name string - val func(uuid.UUID) string - }{ - {"product_uuid", productUUID}, - {"product_serial", productSerial}, - } - - for _, file := range dmi { - val := file.val(vm.uid) - _ = tw.WriteHeader(&tar.Header{ - Name: file.name, - Size: int64(len(val) + 1), - Mode: 0444, - ModTime: time.Now(), - }) - _, _ = fmt.Fprintln(tw, val) - } - - _ = tw.Close() - _ = stdin.Close() - - return cmd.Wait() -} - -// start runs the container if specified by the RUN.container extraConfig property. -func (c *container) start(vm *VirtualMachine) { - if c.id != "" { - start := "start" - if vm.Runtime.PowerState == types.VirtualMachinePowerStateSuspended { - start = "unpause" - } - cmd := exec.Command("docker", start, c.id) - err := cmd.Run() - if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) - } - return - } - - var args []string - var env []string - - for _, opt := range vm.Config.ExtraConfig { - val := opt.GetOptionValue() - if val.Key == "RUN.container" { - run := val.Value.(string) - err := json.Unmarshal([]byte(run), &args) - if err != nil { - args = []string{run} - } - - continue - } - if strings.HasPrefix(val.Key, "guestinfo.") { - key := strings.Replace(strings.ToUpper(val.Key), ".", "_", -1) - env = append(env, "--env", fmt.Sprintf("VMX_%s=%s", key, val.Value.(string))) - } - } - - if len(args) == 0 { - return - } - if len(env) != 0 { - // Configure env as the data access method for cloud-init-vmware-guestinfo - env = append(env, "--env", "VMX_GUESTINFO=true") - } - - c.name = fmt.Sprintf("vcsim-%s-%s", vm.Name, vm.uid) - run := append([]string{"docker", "run", "-d", "--name", c.name}, env...) - - if err := c.createDMI(vm, c.name); err != nil { - log.Printf("%s: %s", vm.Name, err) - return - } - run = append(run, "-v", fmt.Sprintf("%s:%s:ro", c.name, "/sys/class/dmi/id")) - - args = append(run, args...) - cmd := exec.Command(shell, "-c", strings.Join(args, " ")) - out, err := cmd.Output() - if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) - return - } - - c.id = strings.TrimSpace(string(out)) - vm.logPrintf("%s %s: %s", cmd.Path, cmd.Args, c.id) - - if err = c.inspect(vm); err != nil { - log.Printf("%s inspect %s: %s", vm.Name, c.id, err) - } -} - -// stop the container (if any) for the given vm. -func (c *container) stop(vm *VirtualMachine) { - if c.id == "" { - return - } - - cmd := exec.Command("docker", "stop", c.id) - err := cmd.Run() - if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) - } -} - -// pause the container (if any) for the given vm. -func (c *container) pause(vm *VirtualMachine) { - if c.id == "" { - return - } - - cmd := exec.Command("docker", "pause", c.id) - err := cmd.Run() - if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) - } -} - -// remove the container (if any) for the given vm. -func (c *container) remove(vm *VirtualMachine) { - if c.id == "" { - return - } - - args := [][]string{ - []string{"rm", "-v", "-f", c.id}, - []string{"volume", "rm", "-f", c.name}, - } - - for i := range args { - cmd := exec.Command("docker", args[i]...) - err := cmd.Run() - if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) - } - } - - c.id = "" -} - -func guestUpload(file string, r *http.Request) error { - cmd := exec.Command("docker", "cp", "-", path.Dir(file)) - stdin, err := cmd.StdinPipe() - if err != nil { - return err - } - if err = cmd.Start(); err != nil { - return err - } - - tw := tar.NewWriter(stdin) - _ = tw.WriteHeader(&tar.Header{ - Name: path.Base(file), - Size: r.ContentLength, - Mode: 0444, - ModTime: time.Now(), - }) - - _, _ = io.Copy(tw, r.Body) - - _ = tw.Close() - _ = stdin.Close() - _ = r.Body.Close() - - return cmd.Wait() -} - -func guestDownload(file string, w http.ResponseWriter) error { - cmd := exec.Command("docker", "cp", file, "-") - 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 - } - - w.Header().Set("Content-Length", strconv.FormatInt(header.Size, 10)) - _, _ = io.Copy(w, tr) - - _ = stdout.Close() - - return cmd.Wait() -} - -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 := id + ":" + strings.TrimPrefix(r.URL.Path, guestPrefix[:len(guestPrefix)-1]) - var err error - - switch r.Method { - case http.MethodPut: - err = guestUpload(file, r) - case http.MethodGet: - err = guestDownload(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/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go b/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go deleted file mode 100644 index aa68119ff..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(field types.CustomFieldDef) { - entities := Map.All(field.ManagedObjectType) - for _, e := range entities { - entity := e.Entity() - Map.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(field types.CustomFieldDef) { - entities := Map.All(field.ManagedObjectType) - for _, e := range entities { - entity := e.Entity() - Map.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(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 := Map.All(req.MoType) - for _, e := range entities { - entity := e.Entity() - Map.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(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(*field) - - c.Field = append(c.Field[:i], c.Field[i+1:]...) - - body.Res = &types.RemoveCustomFieldDefResponse{} - return body -} - -func (c *CustomFieldsManager) RenameCustomFieldDef(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(*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, - } - - entity := Map.Get(req.Entity).(mo.Entity).Entity() - ctx.WithLock(entity, func() { - entity.CustomValue = append(entity.CustomValue, newValue) - entity.Value = append(entity.Value, newValue) - }) - - body.Res = &types.SetFieldResponse{} - return body -} diff --git a/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go b/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go deleted file mode 100644 index 4711864b5..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "fmt" - "sync/atomic" - "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 DefaultCustomizationSpec = []types.CustomizationSpecItem{ - 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, - }, - }, - types.CustomizationSpecItem{ - 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, - }, - }, - types.CustomizationSpecItem{ - 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: []uint8{0x30}, - }, - }, - types.CustomizationSpecItem{ - 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: []uint8{0x30}, - }, - }, -} - -type CustomizationSpecManager struct { - mo.CustomizationSpecManager - - items []types.CustomizationSpecItem -} - -func (m *CustomizationSpecManager) init(r *Registry) { - m.items = DefaultCustomizationSpec -} - -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/vendor/github.com/vmware/govmomi/simulator/datacenter.go b/vendor/github.com/vmware/govmomi/simulator/datacenter.go deleted file mode 100644 index 10d0f1999..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/datacenter.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(r *types.Rename_Task) soap.HasFault { - return RenameTask(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 - Map.PutEntity(dc, folder) - } else { - folder.ChildType = f.types - e := Map.PutEntity(dc, folder) - - // propagate the generated morefs to Datacenter - ref := e.Reference() - f.ref.Type = ref.Type - f.ref.Value = ref.Value - } - } - - net := 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(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(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(obj mo.Entity) *types.DatacenterEventArgument { - dc, ok := obj.(*Datacenter) - if !ok { - dc = 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) - } - - for _, ref := range req.Vm { - vm := Map.Get(ref).(*VirtualMachine) - Map.WithLock(vm, func() { - vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{}) - }) - } - - return nil, nil - }) - - return &methods.PowerOnMultiVM_TaskBody{ - Res: &types.PowerOnMultiVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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(Map.Get(ref)) - if len(f.ChildEntity) != 0 { - return nil, &types.ResourceInUse{} - } - } - - p, _ := asFolderMO(Map.Get(*d.Parent)) - folderRemoveChild(ctx, p, d.Self) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/datastore.go b/vendor/github.com/vmware/govmomi/simulator/datastore.go deleted file mode 100644 index 62103d321..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/datastore.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "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 Datastore struct { - mo.Datastore -} - -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(*types.RefreshDatastore) soap.HasFault { - r := &methods.RefreshDatastoreBody{} - - err := ds.stat() - if err != nil { - r.Fault_ = Fault(err.Error(), &types.HostConfigFault{}) - return r - } - - info := ds.Info.GetDatastoreInfo() - - now := time.Now() - - info.Timestamp = &now - info.MaxMemoryFileSize = info.FreeSpace - info.MaxFileSize = info.FreeSpace - - 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 := Map.Get(mount.Key).(*HostSystem) - Map.RemoveReference(host, &host.Datastore, ds.Self) - parent := hostParent(&host.HostSystem) - Map.RemoveReference(parent, &parent.Datastore, ds.Self) - } - - p, _ := asFolderMO(Map.Get(*ds.Parent)) - folderRemoveChild(ctx, p, ds.Self) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/doc.go b/vendor/github.com/vmware/govmomi/simulator/doc.go deleted file mode 100644 index 441e9a0e7..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator is a mock framework for the vSphere API. - -See also: https://github.com/vmware/govmomi/blob/master/vcsim/README.md -*/ -package simulator diff --git a/vendor/github.com/vmware/govmomi/simulator/dvs.go b/vendor/github.com/vmware/govmomi/simulator/dvs.go deleted file mode 100644 index d40ae9250..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/dvs.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "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" -) - -type DistributedVirtualSwitch struct { - mo.DistributedVirtualSwitch -} - -func (s *DistributedVirtualSwitch) AddDVPortgroupTask(ctx *Context, c *types.AddDVPortgroup_Task) soap.HasFault { - task := CreateTask(s, "addDVPortgroup", func(t *Task) (types.AnyType, types.BaseMethodFault) { - f := 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-") { - if obj := 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, - 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 := Map.Get(h).(*HostSystem) - Map.AppendReference(host, &host.Network, pg.Reference()) - - parent := Map.Get(*host.HostSystem.Parent) - computeNetworks := append(hostParent(&host.HostSystem).Network, pg.Reference()) - Map.Update(parent, []types.PropertyChange{ - {Name: "network", Val: computeNetworks}, - }) - } - } - - Map.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(), - }, - } -} - -func (s *DistributedVirtualSwitch) ReconfigureDvsTask(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 := 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...) - Map.Update(host, []types.PropertyChange{ - {Name: "network", Val: hostNetworks}, - }) - members = append(members, member.Host) - parent := Map.Get(*host.HostSystem.Parent) - - var pgs []types.ManagedObjectReference - for _, ref := range s.Portgroup { - pg := Map.Get(ref).(*DistributedVirtualPortgroup) - pgs = append(pgs, ref) - - pgHosts := append(pg.Host, member.Host) - Map.Update(pg, []types.PropertyChange{ - {Name: "host", Val: pgHosts}, - }) - - cr := hostParent(&host.HostSystem) - if FindReference(cr.Network, ref) == nil { - computeNetworks := append(cr.Network, ref) - Map.Update(parent, []types.PropertyChange{ - {Name: "network", Val: computeNetworks}, - }) - } - } - - case types.ConfigSpecOperationRemove: - for _, ref := range host.Vm { - vm := 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) - case types.ConfigSpecOperationEdit: - return nil, &types.NotSupported{} - } - } - - Map.Update(s, []types.PropertyChange{ - {Name: "summary.hostMember", Val: members}, - }) - - return nil, nil - }) - - return &methods.ReconfigureDvs_TaskBody{ - Res: &types.ReconfigureDvs_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (s *DistributedVirtualSwitch) FetchDVPorts(req *types.FetchDVPorts) soap.HasFault { - body := &methods.FetchDVPortsBody{} - body.Res = &types.FetchDVPortsResponse{ - Returnval: s.dvPortgroups(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) { - f := Map.getEntityParent(s, "Folder").(*Folder) - folderRemoveChild(ctx, &f.Folder, s.Reference()) - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (s *DistributedVirtualSwitch) dvPortgroups(_ *types.DistributedVirtualSwitchPortCriteria) []types.DistributedVirtualPort { - // TODO(agui): Filter is not implemented yet - var res []types.DistributedVirtualPort - for _, ref := range s.Portgroup { - pg := Map.Get(ref).(*DistributedVirtualPortgroup) - res = append(res, types.DistributedVirtualPort{ - DvsUuid: s.Uuid, - Key: pg.Key, - Config: types.DVPortConfigInfo{ - Setting: pg.Config.DefaultPortConfig, - }, - }) - - for _, key := range pg.PortKeys { - res = append(res, types.DistributedVirtualPort{ - DvsUuid: s.Uuid, - Key: key, - Config: types.DVPortConfigInfo{ - Setting: pg.Config.DefaultPortConfig, - }, - }) - } - } - return res -} diff --git a/vendor/github.com/vmware/govmomi/simulator/entity.go b/vendor/github.com/vmware/govmomi/simulator/entity.go deleted file mode 100644 index a18c78451..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/entity.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(e mo.Entity, r *types.Rename_Task) soap.HasFault { - task := CreateTask(e, "rename", func(t *Task) (types.AnyType, types.BaseMethodFault) { - obj := Map.Get(r.This).(mo.Entity).Entity() - - if parent, ok := asFolderMO(Map.Get(*obj.Parent)); ok { - if Map.FindByName(r.NewName, parent.ChildEntity) != nil { - return nil, &types.InvalidArgument{InvalidProperty: "name"} - } - } - - Map.Update(e, []types.PropertyChange{{Name: "name", Val: r.NewName}}) - - return nil, nil - }) - - return &methods.Rename_TaskBody{ - Res: &types.Rename_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go b/vendor/github.com/vmware/govmomi/simulator/environment_browser.go deleted file mode 100644 index a68633f27..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 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 -} - -func newEnvironmentBrowser() *types.ManagedObjectReference { - env := new(EnvironmentBrowser) - Map.Put(env) - return &env.Self -} - -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 := &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 := &types.VirtualMachineConfigOption{ - Version: esx.HardwareVersion, - DefaultDevice: esx.VirtualDevice, - } - - // 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: new(types.QueryConfigOptionDescriptorResponse), - } - - body.Res.Returnval = []types.VirtualMachineConfigOptionDescriptor{{ - Key: esx.HardwareVersion, - Description: esx.HardwareVersion, - Host: b.hosts(ctx), - CreateSupported: types.NewBool(true), - DefaultConfigOption: types.NewBool(false), - RunSupported: types.NewBool(true), - UpgradeSupported: types.NewBool(true), - }} - - return body -} - -func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryConfigTarget) soap.HasFault { - body := &methods.QueryConfigTargetBody{ - Res: &types.QueryConfigTargetResponse{ - Returnval: &types.ConfigTarget{ - SmcPresent: types.NewBool(false), - }, - }, - } - target := body.Res.Returnval - - 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 -} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go deleted file mode 100644 index d76459be9..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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: -6, - System: true, - Name: "NoCryptoAdmin", - Info: &types.Description{ - Label: "No cryptography administrator", - Summary: "Full access without Cryptographic operations privileges", - }, - Privilege: []string{"Alarm.Acknowledge", "Alarm.Create", "Alarm.Delete", "Alarm.DisableActions", "Alarm.Edit", "Alarm.SetStatus", "Authorization.ModifyPermissions", "Authorization.ModifyPrivileges", "Authorization.ModifyRoles", "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", "ContentLibrary.AddLibraryItem", "ContentLibrary.CreateLocalLibrary", "ContentLibrary.CreateSubscribedLibrary", "ContentLibrary.DeleteLibraryItem", "ContentLibrary.DeleteLocalLibrary", "ContentLibrary.DeleteSubscribedLibrary", "ContentLibrary.DownloadSession", "ContentLibrary.EvictLibraryItem", "ContentLibrary.EvictSubscribedLibrary", "ContentLibrary.GetConfiguration", "ContentLibrary.ImportStorage", "ContentLibrary.ProbeSubscription", "ContentLibrary.ReadStorage", "ContentLibrary.SyncLibrary", "ContentLibrary.SyncLibraryItem", "ContentLibrary.TypeIntrospection", "ContentLibrary.UpdateConfiguration", "ContentLibrary.UpdateLibrary", "ContentLibrary.UpdateLibraryItem", "ContentLibrary.UpdateLocalLibrary", "ContentLibrary.UpdateSession", "ContentLibrary.UpdateSubscribedLibrary", "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", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.Move", "Folder.Rename", "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", "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.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemManagement", "Host.Hbr.HbrManagement", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "Host.Inventory.MoveCluster", "Host.Inventory.MoveHost", "Host.Inventory.RemoveHostFromCluster", "Host.Inventory.RenameCluster", "Host.Local.CreateVM", "Host.Local.DeleteVM", "Host.Local.InstallAgent", "Host.Local.ReconfigVM", "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", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Performance.ModifyIntervals", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "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", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "StoragePod.Config", "StorageProfile.Update", "StorageProfile.View", "StorageViews.ConfigureService", "StorageViews.View", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "TransferService.Manage", "TransferService.Monitor", "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.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VRMPolicy.Query", "VRMPolicy.Update", "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.Unlock", "VirtualMachine.Config.UpgradeVirtualHardware", "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.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", "vService.CreateDependency", "vService.DestroyDependency", "vService.ReconfigureDependency", "vService.UpdateDependency"}, - }, - { - 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", "Authorization.ModifyPermissions", "Authorization.ModifyRoles", "Authorization.ReassignRolePermissions", "Certificate.Manage", "Cryptographer.Access", "Cryptographer.AddDisk", "Cryptographer.Clone", "Cryptographer.Decrypt", "Cryptographer.Encrypt", "Cryptographer.EncryptNew", "Cryptographer.ManageEncryptionPolicy", "Cryptographer.ManageKeyServers", "Cryptographer.ManageKeys", "Cryptographer.Migrate", "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", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.Move", "Folder.Rename", "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", "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.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemManagement", "Host.Hbr.HbrManagement", "Host.Inventory.AddHostToCluster", "Host.Inventory.AddStandaloneHost", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "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", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Performance.ModifyIntervals", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "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", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "StoragePod.Config", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "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.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VRMPolicy.Query", "VRMPolicy.Update", "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.Unlock", "VirtualMachine.Config.UpgradeVirtualHardware", "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.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"}, - }, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go b/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go deleted file mode 100644 index c0f95eff9..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/datacenter.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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: []types.ManagedObjectReference{ - {Type: "Datastore", Value: "57089c25-85e3ccd4-17b6-000c29d0beb3"}, - }, - Network: []types.ManagedObjectReference{ - {Type: "Network", Value: "HaNetwork-VM Network"}, - }, - Configuration: types.DatacenterConfigInfo{}, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/doc.go b/vendor/github.com/vmware/govmomi/simulator/esx/doc.go deleted file mode 100644 index 50b6202fa..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 esx contains SOAP responses from an ESX server, captured using `govc ... -dump`. -*/ -package esx diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go deleted file mode 100644 index 7024b404a..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 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: "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}}", - }, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go deleted file mode 100644 index fd7877b28..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go +++ /dev/null @@ -1,1115 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 esx - -import "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 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", - }, - 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, - 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: []uint8{0x31, 0x30}, - 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/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go deleted file mode 100644 index 11c1285aa..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_firewall_system.go +++ /dev/null @@ -1,1425 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go deleted file mode 100644 index aa633ad34..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go +++ /dev/null @@ -1,864 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go deleted file mode 100644 index 9d1ae32dd..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_storage_device_info.go +++ /dev/null @@ -1,346 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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{0x2d, 0x37, 0x39}, - }, - { - Namespace: "GENERIC_VPD", - NamespaceId: 0x5, - Data: []uint8{0x30}, - }, - }, - StandardInquiry: []uint8{0x30}, - 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{0x2d, 0x37, 0x39}, - }, - { - Namespace: "GENERIC_VPD", - NamespaceId: 0x5, - Data: []uint8{0x30}, - }, - }, - StandardInquiry: []uint8{0x30}, - 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/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go deleted file mode 100644 index 26cd1962f..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go +++ /dev/null @@ -1,1801 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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: "", - 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: "", - 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/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go deleted file mode 100644 index 532f0ad5b..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager.go +++ /dev/null @@ -1,15057 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 esx - -import "github.com/vmware/govmomi/vim25/types" - -// 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/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go b/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go deleted file mode 100644 index 8d0eaca30..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/performance_manager_data.go +++ /dev/null @@ -1,1213 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go b/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go deleted file mode 100644 index 90382dd32..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/resource_pool.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go b/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go deleted file mode 100644 index 3aefd1d81..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/root_folder.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go b/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go deleted file mode 100644 index cc8938f87..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/service_content.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/esx/setting.go b/vendor/github.com/vmware/govmomi/simulator/esx/setting.go deleted file mode 100644 index 757dfc039..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/setting.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 esx - -import "github.com/vmware/govmomi/vim25/types" - -// HardwareVersion is the default VirtualMachine.Config.Version -var HardwareVersion = "vmx-13" - -// Setting 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 Setting = []types.BaseOptionValue{ - // This list is currently pruned to include a single option for testing - &types.OptionValue{ - Key: "Config.HostAgent.log.level", - Value: "info", - }, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go deleted file mode 100644 index b429ad490..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go +++ /dev/null @@ -1,10412 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 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: "<internal>", - Summary: "<internal>", - }, - 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: "<internal>", - Summary: "<internal>", - }, - 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/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go b/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go deleted file mode 100644 index 628d7e053..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go +++ /dev/null @@ -1,242 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/event_manager.go b/vendor/github.com/vmware/govmomi/simulator/event_manager.go deleted file mode 100644 index b7d5d6b20..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/event_manager.go +++ /dev/null @@ -1,494 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "bytes" - "container/ring" - "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 ( - maxPageSize = 1000 - logEvents = false -) - -type EventManager struct { - mo.EventManager - - root types.ManagedObjectReference - page *ring.Ring - key int32 - collectors map[types.ManagedObjectReference]*EventHistoryCollector - 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 { - m.MaxCollector = 1000 - } - m.root = r.content().RootFolder - m.page = ring.New(maxPageSize) - m.collectors = make(map[types.ManagedObjectReference]*EventHistoryCollector) - 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.collectors) >= int(m.MaxCollector) { - return nil, Fault("Too many event collectors to create", new(types.InvalidState)) - } - - collector := &EventHistoryCollector{ - m: m, - page: ring.New(size), - } - collector.Filter = req.Filter - collector.fillPage(size) - - 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 - } - - ref := ctx.Session.Put(collector).Reference() - m.collectors[ref] = collector - - body.Res = &types.CreateCollectorForEventsResponse{ - Returnval: ref, - } - - return body -} - -func (m *EventManager) QueryEvents(ctx *Context, req *types.QueryEvents) soap.HasFault { - if 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 - } - - 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.page = m.page.Prev() - m.page.Value = req.EventToPost - m.formatMessage(req.EventToPost) - - for _, c := range m.collectors { - ctx.WithLock(c, func() { - if c.eventMatches(req.EventToPost) { - c.page = c.page.Prev() - c.page.Value = req.EventToPost - Map.Update(c, []types.PropertyChange{{Name: "latestPage", Val: c.GetLatestPage()}}) - } - }) - } - - return &methods.PostEventBody{ - Res: new(types.PostEventResponse), - } -} - -type EventHistoryCollector struct { - mo.EventHistoryCollector - - m *EventManager - page *ring.Ring - pos int -} - -// 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 { - 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(event types.BaseEvent, self types.ManagedObjectReference) 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 == self { - seen = true - return - } - - walk(child, match) - } - - walk(ref, match) - - return seen - }) -} - -// entityMatches returns true if the spec Entity filter matches the event. -func (c *EventHistoryCollector) entityMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { - e := spec.Entity - if e == nil { - return true - } - - isRootFolder := c.m.root == e.Entity - - switch e.Recursion { - case types.EventFilterSpecRecursionOptionSelf: - return isRootFolder || eventFilterSelf(event, e.Entity) - case types.EventFilterSpecRecursionOptionChildren: - return eventFilterChildren(event, e.Entity) - case types.EventFilterSpecRecursionOptionAll: - if isRootFolder || eventFilterSelf(event, e.Entity) { - return true - } - return eventFilterChildren(event, e.Entity) - } - - return false -} - -// typeMatches returns true if one of the spec EventTypeId types matches the event. -func (c *EventHistoryCollector) typeMatches(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 - } - 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 -} - -// eventMatches returns true one of the filters matches the event. -func (c *EventHistoryCollector) eventMatches(event types.BaseEvent) bool { - spec := c.Filter.(types.EventFilterSpec) - - if !c.typeMatches(event, &spec) { - return false - } - - // TODO: spec.Time, spec.UserName, etc - - return c.entityMatches(event, &spec) -} - -// filePage copies the manager's latest events into the collector's page with Filter applied. -func (c *EventHistoryCollector) fillPage(size int) { - c.pos = 0 - l := c.page.Len() - delta := size - l - - if delta < 0 { - // Shrink ring size - c.page = c.page.Unlink(-delta) - return - } - - matches := 0 - mpage := c.m.page - page := c.page - - if delta != 0 { - // Grow ring size - c.page = c.page.Link(ring.New(delta)) - } - - for i := 0; i < maxPageSize; i++ { - event, ok := mpage.Value.(types.BaseEvent) - mpage = mpage.Prev() - if !ok { - continue - } - - if c.eventMatches(event) { - page.Value = event - page = page.Prev() - matches++ - if matches == size { - break - } - } - } -} - -func validatePageSize(count int32) (int, *soap.Fault) { - size := int(count) - - if size == 0 { - size = 10 // defaultPageSize - } else if size < 0 || size > maxPageSize { - return -1, Fault("", &types.InvalidArgument{InvalidProperty: "maxCount"}) - } - - return size, nil -} - -func (c *EventHistoryCollector) 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 - } - - ctx.WithLock(c.m, func() { - c.fillPage(size) - }) - - body.Res = new(types.SetCollectorPageSizeResponse) - return body -} - -func (c *EventHistoryCollector) ResetCollector(ctx *Context, req *types.ResetCollector) soap.HasFault { - c.pos = len(c.GetLatestPage()) - - return &methods.ResetCollectorBody{ - Res: new(types.ResetCollectorResponse), - } -} - -func (c *EventHistoryCollector) RewindCollector(ctx *Context, req *types.RewindCollector) soap.HasFault { - c.pos = 0 - return &methods.RewindCollectorBody{ - Res: new(types.RewindCollectorResponse), - } -} - -func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNextEvents) soap.HasFault { - body := &methods.ReadNextEventsBody{} - if req.MaxCount <= 0 { - body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "maxCount"}) - return body - } - body.Res = new(types.ReadNextEventsResponse) - - events := c.GetLatestPage() - nevents := len(events) - if c.pos == nevents { - return body // already read to EOF - } - - start := c.pos - end := start + int(req.MaxCount) - c.pos += int(req.MaxCount) - if end > nevents { - end = nevents - c.pos = nevents - } - - body.Res.Returnval = events[start:end] - - return body -} - -func (c *EventHistoryCollector) ReadPreviousEvents(ctx *Context, req *types.ReadPreviousEvents) soap.HasFault { - body := &methods.ReadPreviousEventsBody{} - if req.MaxCount <= 0 { - body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "maxCount"}) - return body - } - body.Res = new(types.ReadPreviousEventsResponse) - - events := c.GetLatestPage() - if c.pos == 0 { - return body // already read to EOF - } - - start := c.pos - int(req.MaxCount) - end := c.pos - c.pos -= int(req.MaxCount) - if start < 0 { - start = 0 - c.pos = 0 - } - - body.Res.Returnval = events[start:end] - - return body -} - -func (c *EventHistoryCollector) DestroyCollector(ctx *Context, req *types.DestroyCollector) soap.HasFault { - ctx.Session.Remove(req.This) - - ctx.WithLock(c.m, func() { - delete(c.m.collectors, req.This) - }) - - return &methods.DestroyCollectorBody{ - Res: new(types.DestroyCollectorResponse), - } -} - -func (c *EventHistoryCollector) GetLatestPage() []types.BaseEvent { - var latestPage []types.BaseEvent - - c.page.Do(func(val interface{}) { - if val == nil { - return - } - latestPage = append(latestPage, val.(types.BaseEvent)) - }) - - return latestPage -} - -func (c *EventHistoryCollector) Get() mo.Reference { - clone := *c - - clone.LatestPage = clone.GetLatestPage() - - return &clone -} diff --git a/vendor/github.com/vmware/govmomi/simulator/file_manager.go b/vendor/github.com/vmware/govmomi/simulator/file_manager.go deleted file mode 100644 index 831b1b870..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/file_manager.go +++ /dev/null @@ -1,252 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "io" - "os" - "path" - "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" -) - -type FileManager struct { - mo.FileManager -} - -func (f *FileManager) findDatastore(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 := Map.Get(ref) - - if ds, ok := obj.(*Datastore); ok && ds.Name == name { - return ds, nil - } - if p, ok := obj.(*StoragePod); ok { - ds, _ := f.findDatastore(p, name) - if ds != nil { - return ds, nil - } - } - if d, ok := asFolderMO(obj); ok { - ds, _ := f.findDatastore(d, name) - if ds != nil { - return ds, nil - } - } - } - - return nil, &types.InvalidDatastore{Name: name} -} - -func (f *FileManager) resolve(dc *types.ManagedObjectReference, name string) (string, types.BaseMethodFault) { - p, fault := parseDatastorePath(name) - if fault != nil { - return "", fault - } - - if dc == nil { - if Map.IsESX() { - dc = &esx.Datacenter.Self - } else { - return "", &types.InvalidArgument{InvalidProperty: "dc"} - } - } - - folder := Map.Get(*dc).(*Datacenter).DatastoreFolder - - ds, fault := f.findDatastore(Map.Get(folder), p.Datastore) - if fault != nil { - return "", fault - } - - dir := ds.Info.GetDatastoreInfo().Url - - return path.Join(dir, p.Path), 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(req *types.DeleteDatastoreFile_Task) types.BaseMethodFault { - file, fault := f.resolve(req.Datacenter, req.Name) - 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) DeleteDatastoreFileTask(req *types.DeleteDatastoreFile_Task) soap.HasFault { - task := CreateTask(f, "deleteDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { - return nil, f.deleteDatastoreFile(req) - }) - - return &methods.DeleteDatastoreFile_TaskBody{ - Res: &types.DeleteDatastoreFile_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (f *FileManager) MakeDirectory(req *types.MakeDirectory) soap.HasFault { - body := &methods.MakeDirectoryBody{} - - name, fault := f.resolve(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(req *types.MoveDatastoreFile_Task) types.BaseMethodFault { - src, fault := f.resolve(req.SourceDatacenter, req.SourceName) - if fault != nil { - return fault - } - - dst, fault := f.resolve(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(req *types.MoveDatastoreFile_Task) soap.HasFault { - task := CreateTask(f, "moveDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { - return nil, f.moveDatastoreFile(req) - }) - - return &methods.MoveDatastoreFile_TaskBody{ - Res: &types.MoveDatastoreFile_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (f *FileManager) copyDatastoreFile(req *types.CopyDatastoreFile_Task) types.BaseMethodFault { - src, fault := f.resolve(req.SourceDatacenter, req.SourceName) - if fault != nil { - return fault - } - - dst, fault := f.resolve(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(req *types.CopyDatastoreFile_Task) soap.HasFault { - task := CreateTask(f, "copyDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { - return nil, f.copyDatastoreFile(req) - }) - - return &methods.CopyDatastoreFile_TaskBody{ - Res: &types.CopyDatastoreFile_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/folder.go b/vendor/github.com/vmware/govmomi/simulator/folder.go deleted file mode 100644 index cf26bed93..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/folder.go +++ /dev/null @@ -1,690 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "errors" - "fmt" - "math/rand" - "path" - "strings" - - "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(f *mo.Folder, o mo.Reference, u func(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 := Map.getEntityDatacenter(f) - - switch ref.Type { - case "Network", "DistributedVirtualSwitch", "DistributedVirtualPortgroup": - u(dc, &dc.Network, ref) - case "Datastore": - u(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) { - Map.PutEntity(f, o) - - ctx.WithLock(f, func() { - f.ChildEntity = append(f.ChildEntity, o.Reference()) - folderUpdate(f, o, Map.AddReference) - - ctx.WithLock(o, func() { - 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) { - Map.Remove(o.Reference()) - - ctx.WithLock(f, func() { - RemoveReference(&f.ChildEntity, o.Reference()) - - folderUpdate(f, o, 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(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(internalContext, &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(), - } - } 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") { - if obj := Map.FindByName(c.Name, f.ChildEntity); obj != nil { - r.Fault_ = Fault("", &types.DuplicateName{ - Name: c.Name, - Object: f.Self, - }) - - return r - } - - folder := &Folder{} - - folder.Name = c.Name - folder.ChildType = f.ChildType - - folderPutChild(ctx, &f.Folder, folder) - - r.Res = &types.CreateFolderResponse{ - Returnval: folder.Self, - } - } else { - r.Fault_ = f.typeNotSupported() - } - - return r -} - -// 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 := Map.FindByName(c.Name, f.ChildEntity); obj != nil { - r.Fault_ = Fault("", &types.DuplicateName{ - Name: c.Name, - Object: f.Self, - }) - - 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 { - f := &Folder{Folder: p.Folder} - res := f.MoveIntoFolderTask(ctx, c) - p.ChildEntity = append(p.ChildEntity, f.ChildEntity...) - return res -} - -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) - - dc.Name = c.Name - - r.Res = &types.CreateDatacenterResponse{ - Returnval: dc.Self, - } - - ctx.postEvent(&types.DatacenterCreatedEvent{ - DatacenterEvent: types.DatacenterEvent{ - Event: types.Event{ - Datacenter: datacenterEventArgument(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(hosts []types.ManagedObjectReference, path string) []types.ManagedObjectReference { - attached := hosts[:0] - var p object.DatastorePath - p.FromString(path) - - for _, host := range hosts { - h := Map.Get(host).(*HostSystem) - if Map.FindByName(p.Datastore, h.Datastore) != nil { - attached = append(attached, host) - } - } - - return attached -} - -func (c *createVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { - vm, err := NewVirtualMachine(c.ctx, c.Folder.Self, &c.req.Config) - if err != nil { - folderRemoveChild(c.ctx, &c.Folder.Folder, vm) - return nil, err - } - - vm.ResourcePool = &c.req.Pool - - if c.req.Host == nil { - pool := Map.Get(c.req.Pool).(mo.Entity) - cr := Map.getEntityComputeResource(pool) - - Map.WithLock(cr, func() { - var hosts []types.ManagedObjectReference - switch cr := cr.(type) { - case *mo.ComputeResource: - hosts = cr.Host - case *ClusterComputeResource: - hosts = cr.Host - } - - hosts = hostsWithDatastore(hosts, c.req.Config.Files.VmPathName) - host := hosts[rand.Intn(len(hosts))] - vm.Runtime.Host = &host - }) - } else { - vm.Runtime.Host = c.req.Host - } - - 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.req.Config, c.register) - if err != nil { - folderRemoveChild(c.ctx, &c.Folder.Folder, vm) - return nil, err - } - - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - Map.AppendReference(host, &host.Vm, vm.Self) - vm.EnvironmentBrowser = *hostParent(&host.HostSystem).EnvironmentBrowser - - for i := range vm.Datastore { - ds := Map.Get(vm.Datastore[i]).(*Datastore) - Map.AppendReference(ds, &ds.Vm, vm.Self) - } - - pool := 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.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) - - 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(), - }, - } -} - -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(&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 := Map.SearchIndex() - r := s.FindByDatastorePath(&types.FindByDatastorePath{ - This: s.Reference(), - Path: c.req.Path, - Datacenter: 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.Run() - - 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(&registerVM{f, ctx, c}).Run(), - }, - } -} - -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 := Map.Get(ref).(mo.Entity) - - parent, ok := Map.Get(*(obj.Entity()).Parent).(*Folder) - - if !ok || !folderHasChildType(&f.Folder, ref.Type) { - return nil, &types.NotSupported{} - } - - folderRemoveChild(ctx, &parent.Folder, ref) - folderPutChild(ctx, &f.Folder, obj) - } - - return nil, nil - }) - - return &methods.MoveIntoFolder_TaskBody{ - Res: &types.MoveIntoFolder_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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 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.Contact != nil { - configInfo.Contact = *spec.Contact - } - - dvs.Config = configInfo - - if dvs.Summary.ProductInfo == nil { - product := Map.content().About - dvs.Summary.ProductInfo = &types.DistributedVirtualSwitchProductSpec{ - Name: "DVS", - Vendor: product.Vendor, - Version: product.Version, - Build: product.Build, - ForwardingClass: "etherswitch", - } - } - - dvs.AddDVPortgroupTask(ctx, &types.AddDVPortgroup_Task{ - Spec: []types.DVPortgroupConfigSpec{{ - Name: dvs.Name + "-DVUplinks" + strings.TrimPrefix(dvs.Self.Value, "dvs"), - 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(), - }, - } -} - -func (f *Folder) RenameTask(r *types.Rename_Task) soap.HasFault { - return RenameTask(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 := Map.Get(c).(destroyer) - if !ok { - continue - } - - var fault types.BaseMethodFault - Map.WithLock(obj, func() { - id := obj.DestroyTask(&types.Destroy_Task{ - This: c, - }).(*methods.Destroy_TaskBody).Res.Returnval - - t := Map.Get(id).(*Task) - 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, &Map.Get(*f.Parent).(*Folder).Folder, f.Self) - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/guest_id.go b/vendor/github.com/vmware/govmomi/simulator/guest_id.go deleted file mode 100644 index 87cf4aaf8..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/guest_id.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import "github.com/vmware/govmomi/vim25/types" - -// GuestID is the list of valid types.VirtualMachineGuestOsIdentifier -var GuestID = []types.VirtualMachineGuestOsIdentifier{ - types.VirtualMachineGuestOsIdentifierDosGuest, - types.VirtualMachineGuestOsIdentifierWin31Guest, - types.VirtualMachineGuestOsIdentifierWin95Guest, - types.VirtualMachineGuestOsIdentifierWin98Guest, - types.VirtualMachineGuestOsIdentifierWinMeGuest, - types.VirtualMachineGuestOsIdentifierWinNTGuest, - types.VirtualMachineGuestOsIdentifierWin2000ProGuest, - types.VirtualMachineGuestOsIdentifierWin2000ServGuest, - types.VirtualMachineGuestOsIdentifierWin2000AdvServGuest, - types.VirtualMachineGuestOsIdentifierWinXPHomeGuest, - types.VirtualMachineGuestOsIdentifierWinXPProGuest, - types.VirtualMachineGuestOsIdentifierWinXPPro64Guest, - types.VirtualMachineGuestOsIdentifierWinNetWebGuest, - types.VirtualMachineGuestOsIdentifierWinNetStandardGuest, - types.VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest, - types.VirtualMachineGuestOsIdentifierWinNetDatacenterGuest, - types.VirtualMachineGuestOsIdentifierWinNetBusinessGuest, - types.VirtualMachineGuestOsIdentifierWinNetStandard64Guest, - types.VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest, - types.VirtualMachineGuestOsIdentifierWinLonghornGuest, - types.VirtualMachineGuestOsIdentifierWinLonghorn64Guest, - types.VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest, - types.VirtualMachineGuestOsIdentifierWinVistaGuest, - types.VirtualMachineGuestOsIdentifierWinVista64Guest, - types.VirtualMachineGuestOsIdentifierWindows7Guest, - types.VirtualMachineGuestOsIdentifierWindows7_64Guest, - types.VirtualMachineGuestOsIdentifierWindows7Server64Guest, - types.VirtualMachineGuestOsIdentifierWindows8Guest, - types.VirtualMachineGuestOsIdentifierWindows8_64Guest, - types.VirtualMachineGuestOsIdentifierWindows8Server64Guest, - types.VirtualMachineGuestOsIdentifierWindows9Guest, - types.VirtualMachineGuestOsIdentifierWindows9_64Guest, - types.VirtualMachineGuestOsIdentifierWindows9Server64Guest, - types.VirtualMachineGuestOsIdentifierWindowsHyperVGuest, - types.VirtualMachineGuestOsIdentifierFreebsdGuest, - types.VirtualMachineGuestOsIdentifierFreebsd64Guest, - types.VirtualMachineGuestOsIdentifierRedhatGuest, - types.VirtualMachineGuestOsIdentifierRhel2Guest, - types.VirtualMachineGuestOsIdentifierRhel3Guest, - types.VirtualMachineGuestOsIdentifierRhel3_64Guest, - types.VirtualMachineGuestOsIdentifierRhel4Guest, - types.VirtualMachineGuestOsIdentifierRhel4_64Guest, - types.VirtualMachineGuestOsIdentifierRhel5Guest, - types.VirtualMachineGuestOsIdentifierRhel5_64Guest, - types.VirtualMachineGuestOsIdentifierRhel6Guest, - types.VirtualMachineGuestOsIdentifierRhel6_64Guest, - types.VirtualMachineGuestOsIdentifierRhel7Guest, - types.VirtualMachineGuestOsIdentifierRhel7_64Guest, - types.VirtualMachineGuestOsIdentifierCentosGuest, - types.VirtualMachineGuestOsIdentifierCentos64Guest, - types.VirtualMachineGuestOsIdentifierCentos6Guest, - types.VirtualMachineGuestOsIdentifierCentos6_64Guest, - types.VirtualMachineGuestOsIdentifierCentos7Guest, - types.VirtualMachineGuestOsIdentifierCentos7_64Guest, - types.VirtualMachineGuestOsIdentifierOracleLinuxGuest, - types.VirtualMachineGuestOsIdentifierOracleLinux64Guest, - types.VirtualMachineGuestOsIdentifierOracleLinux6Guest, - types.VirtualMachineGuestOsIdentifierOracleLinux6_64Guest, - types.VirtualMachineGuestOsIdentifierOracleLinux7Guest, - types.VirtualMachineGuestOsIdentifierOracleLinux7_64Guest, - types.VirtualMachineGuestOsIdentifierSuseGuest, - types.VirtualMachineGuestOsIdentifierSuse64Guest, - types.VirtualMachineGuestOsIdentifierSlesGuest, - types.VirtualMachineGuestOsIdentifierSles64Guest, - types.VirtualMachineGuestOsIdentifierSles10Guest, - types.VirtualMachineGuestOsIdentifierSles10_64Guest, - types.VirtualMachineGuestOsIdentifierSles11Guest, - types.VirtualMachineGuestOsIdentifierSles11_64Guest, - types.VirtualMachineGuestOsIdentifierSles12Guest, - types.VirtualMachineGuestOsIdentifierSles12_64Guest, - types.VirtualMachineGuestOsIdentifierNld9Guest, - types.VirtualMachineGuestOsIdentifierOesGuest, - types.VirtualMachineGuestOsIdentifierSjdsGuest, - types.VirtualMachineGuestOsIdentifierMandrakeGuest, - types.VirtualMachineGuestOsIdentifierMandrivaGuest, - types.VirtualMachineGuestOsIdentifierMandriva64Guest, - types.VirtualMachineGuestOsIdentifierTurboLinuxGuest, - types.VirtualMachineGuestOsIdentifierTurboLinux64Guest, - types.VirtualMachineGuestOsIdentifierUbuntuGuest, - types.VirtualMachineGuestOsIdentifierUbuntu64Guest, - types.VirtualMachineGuestOsIdentifierDebian4Guest, - types.VirtualMachineGuestOsIdentifierDebian4_64Guest, - types.VirtualMachineGuestOsIdentifierDebian5Guest, - types.VirtualMachineGuestOsIdentifierDebian5_64Guest, - types.VirtualMachineGuestOsIdentifierDebian6Guest, - types.VirtualMachineGuestOsIdentifierDebian6_64Guest, - types.VirtualMachineGuestOsIdentifierDebian7Guest, - types.VirtualMachineGuestOsIdentifierDebian7_64Guest, - types.VirtualMachineGuestOsIdentifierDebian8Guest, - types.VirtualMachineGuestOsIdentifierDebian8_64Guest, - types.VirtualMachineGuestOsIdentifierDebian9Guest, - types.VirtualMachineGuestOsIdentifierDebian9_64Guest, - types.VirtualMachineGuestOsIdentifierDebian10Guest, - types.VirtualMachineGuestOsIdentifierDebian10_64Guest, - types.VirtualMachineGuestOsIdentifierAsianux3Guest, - types.VirtualMachineGuestOsIdentifierAsianux3_64Guest, - types.VirtualMachineGuestOsIdentifierAsianux4Guest, - types.VirtualMachineGuestOsIdentifierAsianux4_64Guest, - types.VirtualMachineGuestOsIdentifierAsianux5_64Guest, - types.VirtualMachineGuestOsIdentifierAsianux7_64Guest, - types.VirtualMachineGuestOsIdentifierOpensuseGuest, - types.VirtualMachineGuestOsIdentifierOpensuse64Guest, - types.VirtualMachineGuestOsIdentifierFedoraGuest, - types.VirtualMachineGuestOsIdentifierFedora64Guest, - types.VirtualMachineGuestOsIdentifierCoreos64Guest, - types.VirtualMachineGuestOsIdentifierVmwarePhoton64Guest, - types.VirtualMachineGuestOsIdentifierOther24xLinuxGuest, - types.VirtualMachineGuestOsIdentifierOther26xLinuxGuest, - types.VirtualMachineGuestOsIdentifierOtherLinuxGuest, - types.VirtualMachineGuestOsIdentifierOther3xLinuxGuest, - types.VirtualMachineGuestOsIdentifierGenericLinuxGuest, - types.VirtualMachineGuestOsIdentifierOther24xLinux64Guest, - types.VirtualMachineGuestOsIdentifierOther26xLinux64Guest, - types.VirtualMachineGuestOsIdentifierOther3xLinux64Guest, - types.VirtualMachineGuestOsIdentifierOtherLinux64Guest, - types.VirtualMachineGuestOsIdentifierSolaris6Guest, - types.VirtualMachineGuestOsIdentifierSolaris7Guest, - types.VirtualMachineGuestOsIdentifierSolaris8Guest, - types.VirtualMachineGuestOsIdentifierSolaris9Guest, - types.VirtualMachineGuestOsIdentifierSolaris10Guest, - types.VirtualMachineGuestOsIdentifierSolaris10_64Guest, - types.VirtualMachineGuestOsIdentifierSolaris11_64Guest, - types.VirtualMachineGuestOsIdentifierOs2Guest, - types.VirtualMachineGuestOsIdentifierEComStationGuest, - types.VirtualMachineGuestOsIdentifierEComStation2Guest, - types.VirtualMachineGuestOsIdentifierNetware4Guest, - types.VirtualMachineGuestOsIdentifierNetware5Guest, - types.VirtualMachineGuestOsIdentifierNetware6Guest, - types.VirtualMachineGuestOsIdentifierOpenServer5Guest, - types.VirtualMachineGuestOsIdentifierOpenServer6Guest, - types.VirtualMachineGuestOsIdentifierUnixWare7Guest, - types.VirtualMachineGuestOsIdentifierDarwinGuest, - types.VirtualMachineGuestOsIdentifierDarwin64Guest, - types.VirtualMachineGuestOsIdentifierDarwin10Guest, - types.VirtualMachineGuestOsIdentifierDarwin10_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin11Guest, - types.VirtualMachineGuestOsIdentifierDarwin11_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin12_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin13_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin14_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin15_64Guest, - types.VirtualMachineGuestOsIdentifierDarwin16_64Guest, - types.VirtualMachineGuestOsIdentifierVmkernelGuest, - types.VirtualMachineGuestOsIdentifierVmkernel5Guest, - types.VirtualMachineGuestOsIdentifierVmkernel6Guest, - types.VirtualMachineGuestOsIdentifierVmkernel65Guest, - types.VirtualMachineGuestOsIdentifierOtherGuest, - types.VirtualMachineGuestOsIdentifierOtherGuest64, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/guest_id.sh b/vendor/github.com/vmware/govmomi/simulator/guest_id.sh deleted file mode 100644 index e79816337..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/guest_id.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -e - -pushd "$(dirname "$0")" >/dev/null - -{ - cat <<EOF -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -// GuestID is the list of valid types.VirtualMachineGuestOsIdentifier -var GuestID = []types.VirtualMachineGuestOsIdentifier{ -EOF - - ids=($(grep 'VirtualMachineGuestOsIdentifier(' ../vim25/types/enum.go | grep = | awk '{print $1}')) - printf "types.%s,\n" "${ids[@]}" - - echo "}" -} > guest_id.go - -goimports -w guest_id.go diff --git a/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go b/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go deleted file mode 100644 index 83eeb6b8e..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (c) 2020 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "net/url" - "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 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 - 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.run.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.run.prepareGuestOperation(vm, 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.run.prepareGuestOperation(vm, 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 -} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go deleted file mode 100644 index adc1ec671..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go +++ /dev/null @@ -1,252 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "io/ioutil" - "log" - "os" - "path" - "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 HostDatastoreBrowser struct { - mo.HostDatastoreBrowser -} - -type searchDatastore struct { - *HostDatastoreBrowser - - DatastorePath string - SearchSpec *types.HostDatastoreBrowserSearchSpec - - res []types.HostDatastoreBrowserSearchResults - - recurse bool -} - -func (s *searchDatastore) addFile(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, - } - - 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 (s *searchDatastore) search(ds *types.ManagedObjectReference, folder string, dir string) error { - files, err := ioutil.ReadDir(dir) - if err != nil { - log.Printf("search %s: %s", dir, err) - return err - } - - res := types.HostDatastoreBrowserSearchResults{ - Datastore: ds, - FolderPath: folder, - } - - for _, file := range files { - name := file.Name() - - if s.queryMatch(file) { - for _, m := range s.SearchSpec.MatchPattern { - if ok, _ := path.Match(m, name); ok { - s.addFile(file, &res) - break - } - } - } - - if s.recurse && file.IsDir() { - _ = s.search(ds, path.Join(folder, name), path.Join(dir, name)) - } - } - - 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 := Map.FindByName(p.Datastore, s.Datastore) - if ref == nil { - return nil, &types.InvalidDatastore{Name: p.Datastore} - } - - ds := ref.(*Datastore) - task.Info.Entity = &ds.Self // TODO: CreateTask() should require mo.Entity, rather than mo.Reference - task.Info.EntityName = ds.Name - - dir := path.Join(ds.Info.GetDatastoreInfo().Url, p.Path) - - err := s.search(&ds.Self, s.DatastorePath, dir) - 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(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(), - }, - } -} - -func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(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(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go deleted file mode 100644 index a40528795..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "os" - "path" - - "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 -} - -func (dss *HostDatastoreSystem) add(ctx *Context, ds *Datastore) *soap.Fault { - info := ds.Info.GetDatastoreInfo() - - info.Name = ds.Name - - if e := 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 := Map.getEntityFolder(dss.Host, "datastore") - ds.Self.Type = typeName(ds) - // Datastore is the only type where create methods do not include the parent (Folder in this case), - // but we need the moref to be unique per DC/datastoreFolder, but not per-HostSystem. - ds.Self.Value += "@" + folder.Self.Value - // TODO: name should be made unique in the case of Local ds type - - ds.Summary.Datastore = &ds.Self - ds.Summary.Name = ds.Name - ds.Summary.Url = info.Url - ds.Capability = types.DatastoreCapability{ - DirectoryHierarchySupported: true, - RawDiskMappingsSupported: false, - PerFileThinProvisioningSupported: true, - StorageIORMSupported: types.NewBool(true), - NativeSnapshotSupported: types.NewBool(false), - TopLevelDirectoryCreateSupported: types.NewBool(true), - SeSparseSupported: types.NewBool(true), - } - - dss.Datastore = append(dss.Datastore, ds.Self) - dss.Host.Datastore = dss.Datastore - parent := hostParent(dss.Host) - Map.AddReference(parent, &parent.Datastore, ds.Self) - - browser := &HostDatastoreBrowser{} - browser.Datastore = dss.Datastore - ds.Browser = Map.Put(browser).Reference() - - folderPutChild(ctx, folder, ds) - - return nil -} - -func (dss *HostDatastoreSystem) CreateLocalDatastore(ctx *Context, c *types.CreateLocalDatastore) soap.HasFault { - r := &methods.CreateLocalDatastoreBody{} - - ds := &Datastore{} - ds.Name = c.Name - ds.Self.Value = c.Path - - 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 - - if err := dss.add(ctx, ds); err != nil { - r.Fault_ = err - return r - } - - 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(&types.RefreshDatastore{This: ds.Self}) - - r.Res = &types.CreateLocalDatastoreResponse{ - Returnval: ds.Self, - } - - return r -} - -func (dss *HostDatastoreSystem) CreateNasDatastore(ctx *Context, c *types.CreateNasDatastore) soap.HasFault { - r := &methods.CreateNasDatastoreBody{} - - ds := &Datastore{} - ds.Name = path.Base(c.Spec.LocalPath) - ds.Self.Value = c.Spec.RemoteHost + ":" + c.Spec.RemotePath - - 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 - - if err := dss.add(ctx, ds); err != nil { - r.Fault_ = err - return r - } - - _ = ds.RefreshDatastore(&types.RefreshDatastore{This: ds.Self}) - - r.Res = &types.CreateNasDatastoreResponse{ - Returnval: ds.Self, - } - - return r -} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go b/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go deleted file mode 100644 index fd596386a..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_firewall_system.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go b/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go deleted file mode 100644 index 993e3fe87..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(req *types.CreateUser) soap.HasFault { - spec := req.User.GetHostAccountSpec() - userDirectory := 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(req *types.RemoveUser) soap.HasFault { - userDirectory := 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/vendor/github.com/vmware/govmomi/simulator/host_network_system.go b/vendor/github.com/vmware/govmomi/simulator/host_network_system.go deleted file mode 100644 index 017837f6e..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_network_system.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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 -} - -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() *Folder { - f := Map.getEntityDatacenter(s.Host).NetworkFolder - return 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() - - if obj := 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() - e := 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 { - var info []types.PhysicalNicHintInfo - - for _, nic := range s.Host.Config.Network.Pnic { - info = append(info, types.PhysicalNicHintInfo{ - Device: nic.Device, - }) - } - - return &methods.QueryNetworkHintBody{ - Res: &types.QueryNetworkHintResponse{ - Returnval: info, - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go b/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go deleted file mode 100644 index da2fd528c..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -Copyright (c) 2020 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/host_system.go b/vendor/github.com/vmware/govmomi/simulator/host_system.go deleted file mode 100644 index 28c4b3e69..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/host_system.go +++ /dev/null @@ -1,269 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "net" - "os" - "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" -) - -type HostSystem struct { - mo.HostSystem -} - -func asHostSystemMO(obj mo.Reference) (*mo.HostSystem, bool) { - h, ok := getManagedObject(obj).Addr().Interface().(*mo.HostSystem) - return h, ok -} - -func NewHostSystem(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 - - hardware := *host.Summary.Hardware - hs.Summary.Hardware = &hardware - - info := *esx.HostHardwareInfo - hs.Hardware = &info - - cfg := new(types.HostConfigInfo) - deepCopy(hs.Config, cfg) - hs.Config = cfg - - config := []struct { - ref **types.ManagedObjectReference - obj mo.Reference - }{ - {&hs.ConfigManager.DatastoreSystem, &HostDatastoreSystem{Host: &hs.HostSystem}}, - {&hs.ConfigManager.NetworkSystem, NewHostNetworkSystem(&hs.HostSystem)}, - {&hs.ConfigManager.AdvancedOption, NewOptionManager(nil, esx.Setting)}, - {&hs.ConfigManager.FirewallSystem, NewHostFirewallSystem(&hs.HostSystem)}, - {&hs.ConfigManager.StorageSystem, NewHostStorageSystem(&hs.HostSystem)}, - } - - for _, c := range config { - ref := Map.Put(c.obj).Reference() - - *c.ref = &ref - } - - return hs -} - -func (h *HostSystem) configure(spec types.HostConnectSpec, connected bool) { - h.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected - if connected { - h.Runtime.ConnectionState = types.HostSystemConnectionStateConnected - } - 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 -} - -func (h *HostSystem) event() types.HostEvent { - return types.HostEvent{ - Event: types.Event{ - Datacenter: datacenterEventArgument(h), - ComputeResource: h.eventArgumentParent(), - 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() *types.ComputeResourceEventArgument { - parent := hostParent(&h.HostSystem) - - return &types.ComputeResourceEventArgument{ - ComputeResource: parent.Self, - EntityEventArgument: types.EntityEventArgument{Name: parent.Name}, - } -} - -func hostParent(host *mo.HostSystem) *mo.ComputeResource { - switch parent := 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(esx.HostSystem) - - summary := new(types.ComputeResourceSummary) - addComputeResource(summary, host) - - cr := &mo.ComputeResource{ - Summary: summary, - Network: esx.Datacenter.Network, - } - cr.EnvironmentBrowser = newEnvironmentBrowser() - cr.Self = *host.Parent - cr.Name = host.Name - cr.Host = append(cr.Host, host.Reference()) - host.Network = cr.Network - Map.PutEntity(cr, host) - - pool := NewResourcePool() - cr.ResourcePool = &pool.Self - Map.PutEntity(cr, pool) - pool.Owner = cr.Self - - folderPutChild(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{} - } - - pool := NewResourcePool() - host := NewHostSystem(esx.HostSystem) - host.configure(spec, false) - - summary := new(types.ComputeResourceSummary) - addComputeResource(summary, host) - - cr := &mo.ComputeResource{ - ConfigurationEx: &types.ComputeResourceConfigInfo{ - VmSwapPlacement: string(types.VirtualMachineConfigInfoSwapPlacementTypeVmDirectory), - }, - Summary: summary, - EnvironmentBrowser: newEnvironmentBrowser(), - } - - Map.PutEntity(cr, Map.NewEntity(host)) - host.Summary.Host = &host.Self - - Map.PutEntity(cr, Map.NewEntity(pool)) - - cr.Name = host.Name - cr.Network = Map.getEntityDatacenter(f).defaultNetwork() - 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()}) - - f := Map.getEntityParent(h, "Folder").(*Folder) - folderRemoveChild(ctx, &f.Folder, h.Reference()) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (h *HostSystem) EnterMaintenanceModeTask(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(), - }, - } -} - -func (h *HostSystem) ExitMaintenanceModeTask(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(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go b/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go deleted file mode 100644 index 886be5e80..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "fmt" - "io" - "io/ioutil" - "log" - "net/http" - "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 HttpNfcLease struct { - mo.HttpNfcLease - files map[string]string -} - -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 dst io.Writer - var src io.ReadCloser - - switch r.Method { - case http.MethodPut, http.MethodPost: - dst = ioutil.Discard - 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() - - msg := fmt.Sprintf("transferred %d bytes", n) - if err != nil { - status = http.StatusInternalServerError - msg = err.Error() - } - log.Printf("nfc %s %s: %s", r.Method, file, msg) - w.WriteHeader(status) -} - -func NewHttpNfcLease(ctx *Context, entity types.ManagedObjectReference) *HttpNfcLease { - lease := &HttpNfcLease{ - HttpNfcLease: mo.HttpNfcLease{ - Info: &types.HttpNfcLeaseInfo{ - Entity: entity, - LeaseTimeout: 30000, - }, - State: types.HttpNfcLeaseStateReady, - }, - files: make(map[string]string), - } - - ctx.Session.Put(lease) - nfcLease.Store(lease.Reference(), lease) - - return lease -} - -func (l *HttpNfcLease) HttpNfcLeaseComplete(ctx *Context, req *types.HttpNfcLeaseComplete) soap.HasFault { - ctx.Session.Remove(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(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), - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/server.go b/vendor/github.com/vmware/govmomi/simulator/internal/server.go deleted file mode 100644 index f2a394b91..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/internal/server.go +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright 2011 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. - -// Implementation of Server - -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: - s.wg.Add(1) - if _, exists := s.conns[c]; exists { - panic("invalid state transition") - } - if s.conns == nil { - s.conns = make(map[net.Conn]http.ConnState) - } - 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: - s.forgetConn(c) - } - 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{}{} - } -} - -// forgetConn removes c from the set of tracked conns and decrements it from the -// waitgroup, unless it was previously removed. -// s.mu must be held. -func (s *Server) forgetConn(c net.Conn) { - if _, ok := s.conns[c]; ok { - delete(s.conns, c) - s.wg.Done() - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go b/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go deleted file mode 100644 index 407890920..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 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 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 1024 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h -var LocalhostCert = []byte(`-----BEGIN CERTIFICATE----- -MIICEzCCAXygAwIBAgIQMIMChMLGrR+QvmQvpwAU6zANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw -MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9SjY1bIw4 -iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZBl2+XsDul -rKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQABo2gwZjAO -BgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUw -AwEB/zAuBgNVHREEJzAlggtleGFtcGxlLmNvbYcEfwAAAYcQAAAAAAAAAAAAAAAA -AAAAATANBgkqhkiG9w0BAQsFAAOBgQCEcetwO59EWk7WiJsG4x8SY+UIAA+flUI9 -tyC4lNhbcF2Idq9greZwbYCqTTTr2XiRNSMLCOjKyI7ukPoPjo16ocHj+P3vZGfs -h1fIw3cSS2OolhloGw/XM6RWPWtPAlGykKLciQrBru5NAPvCMsb/I1DAceTiotQM -fblo6RBxUQ== ------END CERTIFICATE-----`) - -// LocalhostKey is the private key for localhostCert. -var LocalhostKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9 -SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZB -l2+XsDulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB -AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet -3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb -uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H -qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp -jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY -fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U -fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU -y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtIX -qyUBnu3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo -f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA== ------END RSA PRIVATE KEY-----`) diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/types.go b/vendor/github.com/vmware/govmomi/simulator/internal/types.go deleted file mode 100644 index fa09b31d3..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/internal/types.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 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 { - 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/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go b/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go deleted file mode 100644 index d8ef992a3..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go +++ /dev/null @@ -1,387 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/license_manager.go b/vendor/github.com/vmware/govmomi/simulator/license_manager.go deleted file mode 100644 index 609735966..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/license_manager.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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. -*/ -// Copyright 2017 VMware, Inc. All Rights Reserved. -// -// 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 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" -) - -// 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) { - m.Licenses = []types.LicenseManagerLicenseInfo{EvalLicense} - - if r.IsVPX() { - am := Map.Put(&LicenseAssignmentManager{}).Reference() - m.LicenseAssignmentManager = &am - } -} - -func (m *LicenseManager) AddLicense(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(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) UpdateLicenseLabel(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 -} - -func (m *LicenseAssignmentManager) QueryAssignedLicenses(req *types.QueryAssignedLicenses) soap.HasFault { - body := &methods.QueryAssignedLicensesBody{ - Res: &types.QueryAssignedLicensesResponse{}, - } - - // EntityId can be a HostSystem or the vCenter InstanceUuid - if req.EntityId != "" { - if req.EntityId != Map.content().About.InstanceUuid { - id := types.ManagedObjectReference{ - Type: "HostSystem", - Value: req.EntityId, - } - - if Map.Get(id) == nil { - return body - } - } - } - - body.Res.Returnval = []types.LicenseAssignmentManagerLicenseAssignment{ - { - EntityId: req.EntityId, - AssignedLicense: EvalLicense, - }, - } - - return body -} - -func licenseInfo(key string, labels []types.KeyValue) types.LicenseManagerLicenseInfo { - info := EvalLicense - - info.LicenseKey = key - info.Labels = labels - - return info -} diff --git a/vendor/github.com/vmware/govmomi/simulator/model.go b/vendor/github.com/vmware/govmomi/simulator/model.go deleted file mode 100644 index a551e437d..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/model.go +++ /dev/null @@ -1,824 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "context" - "crypto/tls" - "fmt" - "io/ioutil" - "log" - "os" - "path" - "path/filepath" - "reflect" - - "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/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 - - // Portgroup specifies the number of DistributedVirtualPortgroup entities to create per Datacenter - // Name prefix: DVPG, vcsim flag: -pg - Portgroup int - - // PortgroupNSX specifies the number NSX backed DistributedVirtualPortgroup entities to create per Datacenter - // Name prefix: NSXPG, vcsim flag: -nsx-pg - PortgroupNSX int - - // 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 - - // Host specifies the number of standalone HostSystems entities to create per Datacenter - // Name prefix: H, vcsim flag: -standalone-host - Host int `json:",omitempty"` - - // Cluster specifies the number of ClusterComputeResource entities to create per Datacenter - // Name prefix: C, vcsim flag: -cluster - Cluster int - - // ClusterHost specifies the number of HostSystems entities to create within a Cluster - // Name prefix: H, vcsim flag: -host - ClusterHost int `json:",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. - // For example: /DC0/host/DC0_C0/Resources/DC0_C0_RP1 - // Name prefix: RP, vcsim flag: -pool - Pool int - - // 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 - - // Machine specifies the number of VirtualMachine entities to create per ResourcePool - // Name prefix: VM, vcsim flag: -vm - Machine int - - // 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 - - // App specifies the number of VirtualApp to create per Cluster - // Name prefix: APP, vcsim flag: -app - App int - - // Pod specifies the number of StoragePod to create per Cluster - // Name prefix: POD, vcsim flag: -pod - Pod int - - // Delay configurations - DelayConfig DelayConfig `json:"-"` - - // total number of inventory objects, set by Count() - total int - - dirs []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, - }, - } -} - -// Count returns a Model with total number of each existing type -func (m *Model) Count() Model { - count := Model{} - - for ref, obj := range 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{ - "AuthorizationManager": reflect.TypeOf((*AuthorizationManager)(nil)).Elem(), - "ClusterComputeResource": reflect.TypeOf((*ClusterComputeResource)(nil)).Elem(), - "CustomFieldsManager": reflect.TypeOf((*CustomFieldsManager)(nil)).Elem(), - "CustomizationSpecManager": reflect.TypeOf((*CustomizationSpecManager)(nil)).Elem(), - "Datacenter": reflect.TypeOf((*Datacenter)(nil)).Elem(), - "Datastore": reflect.TypeOf((*Datastore)(nil)).Elem(), - "DistributedVirtualPortgroup": reflect.TypeOf((*DistributedVirtualPortgroup)(nil)).Elem(), - "DistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), - "EnvironmentBrowser": reflect.TypeOf((*EnvironmentBrowser)(nil)).Elem(), - "EventManager": reflect.TypeOf((*EventManager)(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(), - "HostSystem": reflect.TypeOf((*HostSystem)(nil)).Elem(), - "IpPoolManager": reflect.TypeOf((*IpPoolManager)(nil)).Elem(), - "LicenseManager": reflect.TypeOf((*LicenseManager)(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(), - "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(), - "VmwareDistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), -} - -func loadObject(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() - 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(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 := Map.Any("Datacenter").(*Datacenter) - if !ok { - // Need to have at least 1 Datacenter - root := Map.Get(Map.content().RootFolder).(*Folder) - ref := root.CreateDatacenter(internalContext, &types.CreateDatacenter{ - This: root.Self, - Name: "DC0", - }).(*methods.CreateDatacenterBody).Res.Returnval - dc = Map.Get(ref).(*Datacenter) - } - - for ref, val := range Map.objects { - me, ok := val.(mo.Entity) - if !ok { - continue - } - e := me.Entity() - if e.Parent == nil || ref.Type == "Folder" { - continue - } - if 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(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 -} - -// Load Model from the given directory, as created by the 'govc object.save' command. -func (m *Model) Load(dir string) error { - ctx := internalContext - var s *ServiceInstance - - err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if info.IsDir() { - return nil - } - if filepath.Ext(path) != ".xml" { - return nil - } - - f, err := os.Open(path) - if err != nil { - return err - } - defer func() { _ = f.Close() }() - - dec := xml.NewDecoder(f) - dec.TypeFunc = types.TypeFunc() - var content types.ObjectContent - err = dec.Decode(&content) - if err != nil { - return err - } - - if content.Obj == vim25.ServiceInstance { - s = new(ServiceInstance) - s.Self = content.Obj - Map = NewRegistry() - Map.Put(s) - return mo.LoadObjectContent([]types.ObjectContent{content}, &s.ServiceInstance) - } - - if s == nil { - s = NewServiceInstance(m.ServiceContent, m.RootFolder) - } - - obj, err := loadObject(content) - if err != nil { - return err - } - - Map.Put(obj) - - return nil - }) - - if err != nil { - return err - } - - m.Service = New(s) - - return m.resolveReferences(ctx) -} - -// Create populates the Model with the given ModelConfig -func (m *Model) Create() error { - ctx := internalContext - m.Service = New(NewServiceInstance(m.ServiceContent, m.RootFolder)) - - 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 stanalone 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(), - }}, - } - - _, _ = dvs.Reconfigure(ctx, config) - } - - 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 = 1024 - - 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 { - _, _ = vm.PowerOn(ctx) - } - } - - 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) - - task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{{Name: name}}) - 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 := Map.Get(folders.NetworkFolder.Reference()).(*Folder) - pg := 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, - LogicalSwitchUuid: uuid.New().String(), - } - - 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 := 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(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 - } - } - - pool, err := cluster.ResourcePool(ctx) - if err != nil { - return err - } - - prefix := clusterName + "_RP" - - addMachine(prefix+"0", nil, pool, folders) - - for npool := 1; npool <= m.Pool; npool++ { - spec := types.DefaultResourceConfigSpec() - - _, err = pool.Create(ctx, m.fmtName(prefix, npool), spec) - 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 := pool.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) createLocalDatastore(dc string, name string, hosts []*object.HostSystem) error { - ctx := context.Background() - dir, err := ioutil.TempDir("", fmt.Sprintf("govcsim-%s-%s-", dc, name)) - if err != nil { - return err - } - - m.dirs = append(m.dirs, dir) - - 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() { - // Remove associated vm containers, if any - for _, obj := range Map.objects { - if vm, ok := obj.(*VirtualMachine); ok { - vm.run.remove(vm) - } - } - - for _, dir := range m.dirs { - _ = os.RemoveAll(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 { - ctx := context.Background() - - defer m.Remove() - - if m.Service == nil { - err := m.Create() - if err != nil { - return err - } - } - - m.Service.TLS = new(tls.Config) - m.Service.RegisterEndpoints = true - - s := m.Service.NewServer() - defer s.Close() - - 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...) -} diff --git a/vendor/github.com/vmware/govmomi/simulator/object.go b/vendor/github.com/vmware/govmomi/simulator/object.go deleted file mode 100644 index 8a1bed439..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/object.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "bytes" - - "github.com/google/uuid" - "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 := 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 sha1UUID(s).String() -} - -// sha1UUID returns a stable UUID based on input s -func sha1UUID(s string) uuid.UUID { - return uuid.NewSHA1(uuid.NameSpaceOID, []byte(s)) -} - -// deepCopy uses xml encode/decode to copy src to dst -func deepCopy(src, dst interface{}) { - 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/vendor/github.com/vmware/govmomi/simulator/option_manager.go b/vendor/github.com/vmware/govmomi/simulator/option_manager.go deleted file mode 100644 index efcdee215..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/option_manager.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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" -) - -type OptionManager struct { - mo.OptionManager -} - -func NewOptionManager(ref *types.ManagedObjectReference, setting []types.BaseOptionValue) object.Reference { - s := &OptionManager{} - if ref != nil { - s.Self = *ref - } - s.Setting = setting - return s -} - -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) 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) - } - - body.Res = new(types.UpdateOptionsResponse) - return body -} diff --git a/vendor/github.com/vmware/govmomi/simulator/os_unix.go b/vendor/github.com/vmware/govmomi/simulator/os_unix.go deleted file mode 100644 index 30ea88e92..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/os_unix.go +++ /dev/null @@ -1,38 +0,0 @@ -//+build !windows - -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import "syscall" - -func (ds *Datastore) stat() error { - info := ds.Info.GetDatastoreInfo() - var stat syscall.Statfs_t - - err := syscall.Statfs(info.Url, &stat) - if err != nil { - return err - } - - info.FreeSpace = int64(stat.Bfree * uint64(stat.Bsize)) - - ds.Summary.FreeSpace = info.FreeSpace - ds.Summary.Capacity = int64(stat.Blocks * uint64(stat.Bsize)) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/simulator/os_windows.go b/vendor/github.com/vmware/govmomi/simulator/os_windows.go deleted file mode 100644 index 55cf2ab07..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/os_windows.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import "os" - -func (ds *Datastore) stat() error { - info := ds.Info.GetDatastoreInfo() - - _, err := os.Stat(info.Url) - return err -} diff --git a/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go b/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go deleted file mode 100644 index 1540b4038..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go +++ /dev/null @@ -1,292 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 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] - - for _, net := range req.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 - } - - ds := ctx.Map.Get(req.Datastore).(*Datastore) - path := object.DatastorePath{Datastore: ds.Name} - spec := &types.VirtualMachineImportSpec{ - ConfigSpec: types.VirtualMachineConfigSpec{ - Name: req.Cisp.EntityName, - Version: esx.HardwareVersion, - GuestId: string(types.VirtualMachineGuestOsIdentifierOtherGuest), - Files: &types.VirtualMachineFileInfo{ - VmPathName: path.String(), - }, - NumCPUs: 1, - NumCoresPerSocket: 1, - MemoryMB: 32, - }, - ResPoolEntity: &req.ResourcePool, - } - - if req.Cisp.DeploymentOption == "" && env.DeploymentOption != nil { - for _, c := range env.DeploymentOption.Configuration { - if isTrue(c.Default) { - req.Cisp.DeploymentOption = c.ID - break - } - } - } - - if os := env.VirtualSystem.OperatingSystem; len(os) != 0 { - if id := os[0].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 { - spec.ConfigSpec.Version = *vmx - } - - ndisk := 0 - ndev := 0 - resources := make(map[string]types.BaseVirtualDevice) - - for _, item := range hw.Item { - if req.Cisp.DeploymentOption != "" && item.Configuration != nil { - if req.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", req.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", req.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", req.Cisp.EntityName, ndisk) - d := device.CreateDisk(c.(types.BaseVirtualController), ds.Reference(), path.String()) - 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 req.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/vendor/github.com/vmware/govmomi/simulator/performance_manager.go b/vendor/github.com/vmware/govmomi/simulator/performance_manager.go deleted file mode 100644 index d4f548edc..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/performance_manager.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "math/rand" - "strconv" - "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.hostMetrics = esx.HostMetrics - m.vmMetrics = esx.VmMetrics - m.rpMetrics = esx.ResourcePoolMetrics - m.metricData = esx.MetricData - } else { - m.PerfCounter = vpx.PerfCounter - 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.Req = req - body.Res.Returnval = make([]types.PerfCounterInfo, len(req.CounterId)) - for i, id := range req.CounterId { - if info, ok := p.perfCounterIndex[id]; !ok { - body.Fault_ = Fault("", &types.InvalidArgument{ - InvalidProperty: "CounterId", - }) - return body - } else { - body.Res.Returnval[i] = info - } - } - return body -} - -func (p *PerformanceManager) QueryPerfProviderSummary(ctx *Context, req *types.QueryPerfProviderSummary) soap.HasFault { - body := new(methods.QueryPerfProviderSummaryBody) - body.Req = req - body.Res = new(types.QueryPerfProviderSummaryResponse) - - // The entity must exist - if 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}) - } - } - return r -} - -func (p *PerformanceManager) queryAvailablePerfMetric(entity types.ManagedObjectReference, interval int32) *types.QueryAvailablePerfMetricResponse { - switch entity.Type { - case "VirtualMachine": - vm := Map.Get(entity).(*VirtualMachine) - return p.buildAvailablePerfMetricsQueryResponse(p.vmMetrics, int(vm.Summary.Config.NumCpu), vm.Datastore[0].Value) - case "HostSystem": - host := 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.Req = req - body.Res = p.queryAvailablePerfMetric(req.Entity, req.IntervalId) - - return body -} - -func (p *PerformanceManager) QueryPerf(ctx *Context, req *types.QueryPerf) soap.HasFault { - body := new(methods.QueryPerfBody) - body.Req = req - body.Res = new(types.QueryPerfResponse) - body.Res.Returnval = make([]types.BasePerfEntityMetricBase, len(req.QuerySpec)) - - for i, qs := range req.QuerySpec { - metrics := new(types.PerfEntityMetric) - metrics.Entity = qs.Entity - - // 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 n > qs.MaxSample { - n = qs.MaxSample - } - - // 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} - } - - for j, mid := range qs.MetricId { - // Create list of metrics for this tick - series := &types.PerfMetricIntSeries{Value: make([]int64, n)} - series.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.Value[tick] = p - } - metrics.Value[j] = series - } - body.Res.Returnval[i] = metrics - } - return body -} diff --git a/vendor/github.com/vmware/govmomi/simulator/portgroup.go b/vendor/github.com/vmware/govmomi/simulator/portgroup.go deleted file mode 100644 index 17832742e..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/portgroup.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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 (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(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(), - }, - } -} - -func (s *DistributedVirtualPortgroup) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { - task := CreateTask(s, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { - vswitch := Map.Get(*s.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) - Map.RemoveReference(vswitch, &vswitch.Portgroup, s.Reference()) - Map.removeString(vswitch, &vswitch.Summary.PortgroupName, s.Name) - - f := Map.getEntityParent(vswitch, "Folder").(*Folder) - folderRemoveChild(ctx, &f.Folder, s.Reference()) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } - -} diff --git a/vendor/github.com/vmware/govmomi/simulator/property_collector.go b/vendor/github.com/vmware/govmomi/simulator/property_collector.go deleted file mode 100644 index 3ca1c96b4..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/property_collector.go +++ /dev/null @@ -1,841 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "context" - "errors" - "log" - "path" - "reflect" - "strings" - "sync" - "time" - - "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 - 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") - -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 = 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() - } - - return rval -} - -// wrapValue converts slice types to the appropriate ArrayOf type used in property collector responses. -func wrapValue(rval reflect.Value, rtype reflect.Type) interface{} { - 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 []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) interface{} { - if rval.Kind() == reflect.Ptr { - rval = rval.Elem() - } - - return wrapValue(rval, f.Type) -} - -func fieldValue(rval reflect.Value, p string) (interface{}, error) { - var value interface{} - 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() - } - - 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) - break - } - - rval = val - } - - return value, nil -} - -func fieldRefs(f interface{}) []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 lcFirst(s string) string { - return strings.ToLower(s[:1]) + s[1:] -} - -func ucFirst(s string) string { - 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 - - val, err := fieldValue(rval, name) - - 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, - }}, - }) - } - } -} - -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 Map.Remove instead of Destroy_Task - log.Printf("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 { - // 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 { - rr.Objects = append(rr.Objects, content) - } - - 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 (pc *PropertyCollector) 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 { - var rval reflect.Value - ok := false - ctx.WithLock(o.Obj, func() { rval, ok = getObject(ctx, o.Obj) }) - if !ok { - if isFalse(spec.ReportMissingObjectsInResults) { - return nil, &types.ManagedObjectNotFound{Obj: o.Obj} - } - continue - } - - if o.SelectSet == nil || isFalse(o.Skip) { - refs = append(refs, o.Obj) - } - - if err := rr.selectSet(ctx, rval, o.SelectSet, &refs); 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, - } - - 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 { - filter := ctx.Session.Get(ref).(*PropertyFilter) - filter.DestroyPropertyFilter(ctx, &types.DestroyPropertyFilter{This: ref}) - } - - ctx.Session.Remove(c.This) - ctx.Map.Remove(c.This) - - body.Res = &types.DestroyPropertyCollectorResponse{} - - return body -} - -func (pc *PropertyCollector) RetrievePropertiesEx(ctx *Context, r *types.RetrievePropertiesEx) soap.HasFault { - body := &methods.RetrievePropertiesExBody{} - - res, fault := pc.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] - for _, o := range res.Objects { - 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(o mo.Reference) { - pc.update(types.ObjectUpdate{ - Obj: o.Reference(), - Kind: types.ObjectUpdateKindEnter, - ChangeSet: nil, - }) -} - -func (pc *PropertyCollector) UpdateObject(o mo.Reference, changes []types.PropertyChange) { - pc.update(types.ObjectUpdate{ - Obj: o.Reference(), - Kind: types.ObjectUpdateKindModify, - ChangeSet: changes, - }) -} - -func (pc *PropertyCollector) RemoveObject(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 := ctx.Session.Get(ref).(*PropertyFilter) - - r := &types.RetrievePropertiesEx{} - r.SpecSet = append(r.SpecSet, filter.Spec) - - res, fault := pc.collect(ctx, r) - 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 -} - -func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpdatesEx) soap.HasFault { - wait, cancel := context.WithCancel(context.Background()) - oneUpdate := false - 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)) - } - } - } - pc.mu.Lock() - pc.cancel = cancel - pc.mu.Unlock() - - body := &methods.WaitForUpdatesExBody{} - - set := &types.UpdateSet{ - Version: r.Version, - } - - body.Res = &types.WaitForUpdatesExResponse{ - Returnval: set, - } - - 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 == "" { - apply() // Collect current state - set.Version = "-" // Next request with Version set will wait via loop below - ctx.Map.AddHandler(pc) // Listen for create, update, delete of managed objects - return body - } - - ticker := time.NewTicker(250 * 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: - log.Printf("%s: WaitForUpdates canceled", pc.Self) - body.Fault_ = Fault("", new(types.RequestCanceled)) // CancelWaitForUpdates was called - body.Res = nil - case context.DeadlineExceeded: - log.Printf("%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 - } - - log.Printf("%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) - fu := types.PropertyFilterUpdate{Filter: f} - - for _, update := range updates { - switch update.Kind { - case types.ObjectUpdateKindEnter: // Create - if !apply() { - return body - } - case types.ObjectUpdateKindModify: // Update - log.Printf("%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 { - 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 { - fault := obj.MissingSet[0].Fault - body.Fault_ = Fault(fault.LocalizedMessage, fault.Fault) - return body - } - - body.Res = &internal.FetchResponse{ - Returnval: obj.PropSet[0].Val, - } - return body -} diff --git a/vendor/github.com/vmware/govmomi/simulator/property_filter.go b/vendor/github.com/vmware/govmomi/simulator/property_filter.go deleted file mode 100644 index b7a4af5da..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/property_filter.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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{} -} - -func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPropertyFilter) soap.HasFault { - body := &methods.DestroyPropertyFilterBody{} - - RemoveReference(&f.pc.Filter, c.This) - - ctx.Session.Remove(c.This) - - body.Res = &types.DestroyPropertyFilterResponse{} - - return body -} - -// 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 { - kind = getManagedObject(ctx.Map.Get(ref)).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 - } - - // 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/vendor/github.com/vmware/govmomi/simulator/registry.go b/vendor/github.com/vmware/govmomi/simulator/registry.go deleted file mode 100644 index 22d419e60..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/registry.go +++ /dev/null @@ -1,558 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "encoding/json" - "fmt" - "os" - "reflect" - "strings" - "sync" - "sync/atomic" - - "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", - "VirtualMachine": "vm", - "VirtualMachineSnapshot": "snapshot", - "VmwareDistributedVirtualSwitch": "dvs", - "DistributedVirtualSwitch": "dvs", -} - -// Map is the default Registry instance. -var Map = NewRegistry() - -// RegisterObject interface supports callbacks when objects are created, updated and deleted from the Registry -type RegisterObject interface { - mo.Reference - PutObject(mo.Reference) - UpdateObject(mo.Reference, []types.PropertyChange) - RemoveObject(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]sync.Locker - - Namespace string - Path 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]sync.Locker), - - 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 { - if v, ok := refValueMap[typeName]; ok { - return v - } - - return strings.ToLower(typeName) -} - -// 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() -} - -// 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 -} - -// 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]) - } -} - -// 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() - - ref := item.Reference() - if ref.Type == "" || ref.Value == "" { - ref = r.newReference(item) - r.setReference(item, ref) - } - - 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[ref] = item - - r.m.Unlock() - - r.applyHandlers(func(o RegisterObject) { - o.PutObject(item) - }) - - return item -} - -// Remove removes an object from the Registry. -func (r *Registry) Remove(item types.ManagedObjectReference) { - r.applyHandlers(func(o RegisterObject) { - o.RemoveObject(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(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(val, 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 := Map.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(Map.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 - } - } -} - -// 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 == e.Entity().Name { - 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(obj mo.Reference, field *[]types.ManagedObjectReference, ref ...types.ManagedObjectReference) { - r.WithLock(obj, func() { - *field = append(*field, ref...) - }) -} - -// AddReference appends ref to field if not already in the given field. -func (r *Registry) AddReference(obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { - r.WithLock(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(obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { - r.WithLock(obj, func() { - RemoveReference(field, ref) - }) -} - -func (r *Registry) removeString(obj mo.Reference, field *[]string, val string) { - r.WithLock(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).(*ServiceInstance).Content -} - -// 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) -} - -// 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) -} - -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) -} - -func (r *Registry) MarshalJSON() ([]byte, error) { - r.m.Lock() - defer r.m.Unlock() - - vars := struct { - Objects int - Locks int - }{ - len(r.objects), - len(r.locks), - } - - return json.Marshal(vars) -} - -func (r *Registry) locker(obj mo.Reference) sync.Locker { - 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: - ref = obj.Reference() - } - - if mu, ok := obj.(sync.Locker); ok { - return mu - } - - r.m.Lock() - mu, ok := r.locks[ref] - if !ok { - mu = 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(obj mo.Reference, f func()) { - if enableLocker { - mu := r.locker(obj) - mu.Lock() - defer mu.Unlock() - } - f() -} - -// 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/vendor/github.com/vmware/govmomi/simulator/resource_pool.go b/vendor/github.com/vmware/govmomi/simulator/resource_pool.go deleted file mode 100644 index aefe9b7c5..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/resource_pool.go +++ /dev/null @@ -1,402 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "fmt" - "net/url" - "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 NewResourcePool() *ResourcePool { - pool := &ResourcePool{ - ResourcePool: esx.ResourcePool, - } - - if 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(name string, spec types.ResourceConfigSpec) (*ResourcePool, *soap.Fault) { - if e := 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() - - 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(c *types.CreateResourcePool) soap.HasFault { - body := &methods.CreateResourcePoolBody{} - - child, err := p.createChild(c.Name, c.Spec) - if err != nil { - body.Fault_ = err - return body - } - - Map.PutEntity(p, 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(c *types.UpdateConfig) soap.HasFault { - body := &methods.UpdateConfigBody{} - - if c.Name != "" { - if e := 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) - } - - res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ - This: folder.Self, - Config: spec.ConfigSpec, - Pool: p.Self, - Host: req.Host, - }) - - ctask := Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) - if ctask.Info.Error != nil { - body.Fault_ = Fault("", ctask.Info.Error.Fault) - return body - } - - lease := NewHttpNfcLease(ctx, ctask.Info.Result.(types.ManagedObjectReference)) - ref := lease.Reference() - lease.Info.Lease = ref - - vm := ctx.Map.Get(lease.Info.Entity).(*VirtualMachine) - device := object.VirtualDeviceList(vm.Config.Hardware.Device) - ndevice := make(map[string]int) - 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(file.Datastore) - lease.files[name] = path.Join(ds.Info.GetDatastoreInfo().Url, file.Path) - - _, disk := d.(*types.VirtualDisk) - kind := device.Type(d) - n := ndevice[kind] - ndevice[kind]++ - - lease.Info.DeviceUrl = append(lease.Info.DeviceUrl, types.HttpNfcLeaseDeviceUrl{ - Key: fmt.Sprintf("/%s/%s:%d", vm.Self.Value, kind, n), - ImportKey: fmt.Sprintf("/%s/%s:%d", vm.Name, kind, n), - Url: (&url.URL{ - Scheme: "https", - Host: "*", - Path: nfcPrefix + path.Join(ref.Value, name), - }).String(), - SslThumbprint: "", - Disk: types.NewBool(disk), - TargetId: name, - DatastoreKey: "", - FileSize: 0, - }) - } - - 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(req *types.CreateVApp) soap.HasFault { - body := &methods.CreateVAppBody{} - - pool, err := p.createChild(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 := 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) - } - - Map.PutEntity(p, 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 := 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) DestroyTask(req *types.Destroy_Task) soap.HasFault { - return (&ResourcePool{ResourcePool: a.ResourcePool}).DestroyTask(req) -} - -func (p *ResourcePool) DestroyTask(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(Map.Get(*p.Parent)) - - // Remove child reference from rp - Map.RemoveReference(parent, &parent.ResourcePool, req.This) - - // The grandchildren become children of the parent (rp) - Map.AppendReference(parent, &parent.ResourcePool, p.ResourcePool.ResourcePool...) - - // And VMs move to the parent - vms := p.ResourcePool.Vm - for _, ref := range vms { - vm := Map.Get(ref).(*VirtualMachine) - Map.WithLock(vm, func() { vm.ResourcePool = &parent.Self }) - } - - Map.AppendReference(parent, &parent.Vm, vms...) - - Map.Remove(req.This) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/search_index.go b/vendor/github.com/vmware/govmomi/simulator/search_index.go deleted file mode 100644 index d89259d53..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/search_index.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(r *types.FindByDatastorePath) soap.HasFault { - res := &methods.FindByDatastorePathBody{Res: new(types.FindByDatastorePathResponse)} - - for ref, obj := range 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(req *types.FindByInventoryPath) soap.HasFault { - body := &methods.FindByInventoryPathBody{Res: new(types.FindByInventoryPathResponse)} - - split := func(c rune) bool { - return c == '/' - } - path := strings.FieldsFunc(req.InventoryPath, split) - if len(path) < 1 { - return body - } - - root := Map.content().RootFolder - o := &root - - for _, name := range path { - f := s.FindChild(&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(req *types.FindChild) soap.HasFault { - body := &methods.FindChildBody{} - - obj := 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 := Map.FindByName(req.Name, children) - - if match != nil { - ref := match.Reference() - body.Res.Returnval = &ref - } - - return body -} - -func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault { - body := &methods.FindByUuidBody{Res: new(types.FindByUuidResponse)} - - if req.VmSearch { - // Find Virtual Machine using UUID - for ref, obj := range 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 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(req *types.FindByDnsName) soap.HasFault { - body := &methods.FindByDnsNameBody{Res: new(types.FindByDnsNameResponse)} - - all := types.FindAllByDnsName(*req) - - switch r := s.FindAllByDnsName(&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(req *types.FindAllByDnsName) soap.HasFault { - body := &methods.FindAllByDnsNameBody{Res: new(types.FindAllByDnsNameResponse)} - - if req.VmSearch { - // Find Virtual Machine using DNS name - for ref, obj := range 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 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(req *types.FindByIp) soap.HasFault { - body := &methods.FindByIpBody{Res: new(types.FindByIpResponse)} - - all := types.FindAllByIp(*req) - - switch r := s.FindAllByIp(&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(req *types.FindAllByIp) soap.HasFault { - body := &methods.FindAllByIpBody{Res: new(types.FindAllByIpResponse)} - - if req.VmSearch { - // Find Virtual Machine using IP - for ref, obj := range 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 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/vendor/github.com/vmware/govmomi/simulator/service_instance.go b/vendor/github.com/vmware/govmomi/simulator/service_instance.go deleted file mode 100644 index 391456429..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/service_instance.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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(content types.ServiceContent, folder mo.Folder) *ServiceInstance { - Map = NewRegistry() - - s := &ServiceInstance{} - - s.Self = vim25.ServiceInstance - s.Content = content - - Map.Put(s) - - f := &Folder{Folder: folder} - Map.Put(f) - - if content.About.ApiType == "HostAgent" { - CreateDefaultESX(internalContext, f) - } else { - content.About.InstanceUuid = uuid.New().String() - } - - refs := mo.References(content) - - for i := range refs { - if Map.Get(refs[i]) != nil { - continue - } - content := types.ObjectContent{Obj: refs[i]} - o, err := loadObject(content) - if err != nil { - panic(err) - } - Map.Put(o) - } - - return s -} - -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/vendor/github.com/vmware/govmomi/simulator/session_manager.go b/vendor/github.com/vmware/govmomi/simulator/session_manager.go deleted file mode 100644 index 3689226ec..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/session_manager.go +++ /dev/null @@ -1,454 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "context" - "fmt" - "net/http" - "reflect" - "strings" - "sync" - "time" - - "github.com/google/uuid" - "github.com/vmware/govmomi/session" - "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 - TLSCert func() string - - sessions map[string]Session -} - -func (m *SessionManager) init(*Registry) { - m.sessions = make(map[string]Session) -} - -var ( - // SessionIdleTimeout duration used to expire idle sessions - SessionIdleTimeout time.Duration - - sessionMutex sync.Mutex -) - -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(), - } - - 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) 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) validLogin(ctx *Context, req *types.Login) bool { - if ctx.Session != nil { - return false - } - user := ctx.svc.Listen.User - if user == nil || user == DefaultLogin { - return req.UserName != "" && req.Password != "" - } - pass, _ := user.Password() - return req.UserName == user.Username() && req.Password == pass -} - -func (s *SessionManager) Login(ctx *Context, req *types.Login) soap.HasFault { - body := new(methods.LoginBody) - - if s.validLogin(ctx, 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 := Map.content().PropertyCollector - - 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(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) AcquireGenericServiceTicket(ticket *types.AcquireGenericServiceTicket) soap.HasFault { - return &methods.AcquireGenericServiceTicketBody{ - Res: &types.AcquireGenericServiceTicketResponse{ - Returnval: types.SessionManagerGenericServiceTicket{ - Id: uuid.New().String(), - HostName: s.ServiceHostName, - }, - }, - } -} - -// internalContext is the session for use by the in-memory client (Service.RoundTrip) -var internalContext = &Context{ - Context: context.Background(), - Session: &Session{ - UserSession: types.UserSession{ - Key: uuid.New().String(), - }, - Registry: NewRegistry(), - }, - Map: Map, -} - -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 -} - -// mapSession maps an HTTP cookie to a Session. -func (c *Context) mapSession() { - if cookie, err := c.req.Cookie(soap.SessionCookieName); err == nil { - if val, ok := c.svc.sm.getSession(cookie.Value); ok { - c.SetSession(val, false) - } - } -} - -func (m *SessionManager) expiredSession(id string, now time.Time) bool { - expired := true - - s, ok := m.getSession(id) - if ok { - expired = now.Sub(s.LastActiveTime) > SessionIdleTimeout - if expired { - m.delSession(id) - } - } - - return expired -} - -// SessionIdleWatch starts a goroutine that calls func expired() at SessionIdleTimeout intervals. -// The goroutine exits if the func returns true. -func SessionIdleWatch(ctx context.Context, id string, expired func(string, time.Time) bool) { - if SessionIdleTimeout == 0 { - return - } - - go func() { - for t := time.NewTimer(SessionIdleTimeout); ; { - select { - case <-ctx.Done(): - return - case now := <-t.C: - if expired(id, now) { - return - } - t.Reset(SessionIdleTimeout) - } - } - }() -} - -// 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++ - - c.svc.sm.putSession(session) - c.Session = &session - - if login { - http.SetCookie(c.res, &http.Cookie{ - Name: soap.SessionCookieName, - Value: session.Key, - }) - - c.postEvent(&types.UserLoginSessionEvent{ - SessionId: session.Key, - IpAddress: session.IpAddress, - UserAgent: session.UserAgent, - Locale: session.Locale, - }) - - SessionIdleWatch(c.Context, session.Key, c.svc.sm.expiredSession) - } -} - -// WithLock holds a lock for the given object while then given function is run. -func (c *Context) WithLock(obj mo.Reference, f func()) { - if c.Caller != nil && *c.Caller == obj.Reference() { - // Internal method invocation, obj is already locked - f() - return - } - Map.WithLock(obj, f) -} - -// postEvent wraps EventManager.PostEvent for internal use, with a lock on the EventManager. -func (c *Context) postEvent(events ...types.BaseEvent) { - m := 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 -} - -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 := *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 == Map.content().PropertyCollector { - // Per-session instance of the PropertyCollector singleton. - // Using reflection here as PropertyCollector might be wrapped with a custom type. - obj = 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 Map.Get(ref) -} diff --git a/vendor/github.com/vmware/govmomi/simulator/simulator.go b/vendor/github.com/vmware/govmomi/simulator/simulator.go deleted file mode 100644 index 418c966d1..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/simulator.go +++ /dev/null @@ -1,920 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "bytes" - "context" - "crypto/tls" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io" - "io/ioutil" - "log" - "math/rand" - "net" - "net/http" - "net/url" - "os" - "path" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "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 { - client *vim25.Client - sm *SessionManager - sdk map[string]*Registry - funcs []handleFunc - delay *DelayConfig - - readAll func(io.Reader) ([]byte, error) - - 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(instance *ServiceInstance) *Service { - s := &Service{ - readAll: ioutil.ReadAll, - sm: Map.SessionManager(), - sdk: make(map[string]*Registry), - } - - s.client, _ = vim25.NewClient(context.Background(), s) - - return s -} - -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 (s *Service) call(ctx *Context, method *Method) soap.HasFault { - handler := ctx.Map.Get(method.This) - session := ctx.Session - ctx.Caller = &method.This - - if session == nil { - switch method.Name { - case "RetrieveServiceContent", "PbmRetrieveServiceContent", "Fetch", "List", "Login", "LoginByToken", "LoginExtensionByCertificate", "RetrieveProperties", "RetrievePropertiesEx", "CloneSession": - // 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 { - d := 0 - if s.delay.Delay > 0 { - d = s.delay.Delay - } - if md, ok := s.delay.MethodDelay[method.Name]; ok { - d += md - } - if s.delay.DelayJitter > 0 { - d += int(rand.NormFloat64() * s.delay.DelayJitter * float64(d)) - } - if d > 0 { - //fmt.Printf("Delaying method %s %d ms\n", name, d) - time.Sleep(time.Duration(d) * time.Millisecond) - } - } - - 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(handler, func() { - res = m.Call(args) - }) - - return res[0].Interface().(soap.HasFault) -} - -// 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") - - method := &Method{ - Name: req.Elem().Type().Name(), - This: this.Interface().(types.ManagedObjectReference), - Body: req.Interface(), - } - - res := s.call(&Context{ - Map: Map, - Context: ctx, - Session: internalContext.Session, - }, 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 interface{} `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 { - val := reflect.ValueOf(r.Body).Elem().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) - } - res := xml.StartElement{ - Name: xml.Name{ - Space: "urn:" + r.Namespace, - 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 - Types []string - } - - seen := make(map[string]bool) - - f := reflect.TypeOf((*soap.HasFault)(nil)).Elem() - - for _, obj := range Map.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. -func (s *Service) RegisterSDK(r *Registry) { - if s.ServeMux == nil { - s.ServeMux = http.NewServeMux() - } - - s.sdk[r.Path] = r - s.ServeMux.HandleFunc(r.Path, 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(), - } - ctx.Map.WithLock(s.sm, ctx.mapSession) - - var res soap.HasFault - var soapBody interface{} - - 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 - } - 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 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 - } - - r.URL.Path = strings.TrimPrefix(r.URL.Path, folderPrefix) - p := path.Join(ds.Info.GetDatastoreInfo().Url, 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: - fs := http.FileServer(http.Dir(ds.Info.GetDatastoreInfo().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 + `<namespaces version="1.0"> - <namespace> - <name>urn:vim25</name> - <version>%s</version> - <priorVersions> - <version>6.0</version> - <version>5.5</version> - </priorVersions> - </namespace> -</namespaces> -` - fmt.Fprintf(w, versions, s.client.ServiceContent.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 { - s.RegisterSDK(Map) - - mux := s.ServeMux - vim := Map.Path + "/vimService" - s.sdk[vim] = s.sdk[vim25.Path] - mux.HandleFunc(vim, s.ServeSDK) - mux.HandleFunc(Map.Path+"/vimServiceVersions.xml", s.ServiceVersions) - 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: Map.Path, - } - if s.TLS != nil { - u.Scheme += "s" - } - - // Redirect clients to this http server, rather than HostSystem.Name - Map.SessionManager().ServiceHostName = u.Host - - // Add vcsim config to OptionManager for use by SDK handlers (see lookup/simulator for example) - m := 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.Setting = append(m.Setting, - &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, 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 - Map.SessionManager().TLSCert = func() string { - return base64.StdEncoding.EncodeToString(ts.TLS.Certificates[0].Certificate[0]) - } - 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 := ioutil.TempFile("", "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 interface{}) 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 -} diff --git a/vendor/github.com/vmware/govmomi/simulator/snapshot.go b/vendor/github.com/vmware/govmomi/simulator/snapshot.go deleted file mode 100644 index 0001e2894..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/snapshot.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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 -} - -func (v *VirtualMachineSnapshot) createSnapshotFiles() types.BaseMethodFault { - vm := 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(snapshotDirectory, fileName, false) - if err != nil { - switch err.(type) { - case *types.FileAlreadyExists: - index++ - continue - default: - return err - } - } - - _ = f.Close() - - p, _ := parseDatastorePath(snapshotDirectory) - vm.useDatastore(p.Datastore) - datastorePath := object.DatastorePath{ - Datastore: p.Datastore, - Path: path.Join(p.Path, fileName), - } - - dataLayoutKey := vm.addFileLayoutEx(datastorePath, 0) - vm.addSnapshotLayout(v.Self, dataLayoutKey) - vm.addSnapshotLayoutEx(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 := 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 := Map.Get(*vm.Runtime.Host).(*HostSystem) - datastore := Map.FindByName(p.Datastore, host.Datastore).(*Datastore) - dFilePath := path.Join(datastore.Info.GetDatastoreInfo().Url, 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, "removeSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { - var changes []types.PropertyChange - - vm := Map.Get(v.Vm).(*VirtualMachine) - Map.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}) - - if len(rootSnapshots) == 0 { - changes = []types.PropertyChange{ - {Name: "snapshot", Val: nil}, - } - } - - Map.Get(req.This).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) - - Map.Update(vm, changes) - }) - - Map.Remove(req.This) - - return nil, nil - }) - - return &methods.RemoveSnapshot_TaskBody{ - Res: &types.RemoveSnapshot_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (v *VirtualMachineSnapshot) RevertToSnapshotTask(req *types.RevertToSnapshot_Task) soap.HasFault { - task := CreateTask(v, "revertToSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { - vm := Map.Get(v.Vm).(*VirtualMachine) - - Map.WithLock(vm, func() { - Map.Update(vm, []types.PropertyChange{ - {Name: "snapshot.currentSnapshot", Val: v.Self}, - }) - }) - - return nil, nil - }) - - return &methods.RevertToSnapshot_TaskBody{ - Res: &types.RevertToSnapshot_TaskResponse{ - Returnval: task.Run(), - }, - } -} diff --git a/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go b/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go deleted file mode 100644 index 4d53173c1..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 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(req *types.ConfigureStorageDrsForPod_Task) soap.HasFault { - task := CreateTask(m, "configureStorageDrsForPod", func(*Task) (types.AnyType, types.BaseMethodFault) { - cluster := 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(), - }, - } -} - -func (m *StorageResourceManager) pod(ref *types.ManagedObjectReference) *StoragePod { - if ref == nil { - return nil - } - cluster := 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(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(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(&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/vendor/github.com/vmware/govmomi/simulator/task.go b/vendor/github.com/vmware/govmomi/simulator/task.go deleted file mode 100644 index 3b5939c55..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/task.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "fmt" - "reflect" - "strings" - "time" - - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -const vTaskSuffix = "_Task" // vmomi suffix -const sTaskSuffix = "Task" // simulator suffix (avoiding golint warning) - -type Task struct { - mo.Task - - 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.Self = Map.newReference(task) - task.Info.Key = task.Self.Value - task.Info.Task = task.Self - 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 - - Map.Put(task) - - return task -} - -type TaskRunner interface { - mo.Reference - - Run(*Task) (types.AnyType, types.BaseMethodFault) -} - -func (t *Task) Run() types.ManagedObjectReference { - now := time.Now() - - Map.Update(t, []types.PropertyChange{ - {Name: "info.startTime", Val: now}, - {Name: "info.state", Val: types.TaskInfoStateRunning}, - }) - - res, err := t.Execute(t) - state := types.TaskInfoStateSuccess - var fault interface{} - if err != nil { - state = types.TaskInfoStateError - fault = types.LocalizedMethodFault{ - Fault: err, - LocalizedMessage: fmt.Sprintf("%T", err), - } - } - - now = time.Now() - - Map.Update(t, []types.PropertyChange{ - {Name: "info.completeTime", Val: now}, - {Name: "info.state", Val: state}, - {Name: "info.result", Val: res}, - {Name: "info.error", Val: fault}, - }) - - return t.Self -} diff --git a/vendor/github.com/vmware/govmomi/simulator/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/task_manager.go deleted file mode 100644 index a1b036f41..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/task_manager.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "sync" - - "github.com/vmware/govmomi/simulator/esx" - "github.com/vmware/govmomi/simulator/vpx" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -var recentTaskMax = 200 // the VC limit - -type TaskManager struct { - mo.TaskManager - sync.Mutex -} - -func (m *TaskManager) init(r *Registry) { - if len(m.Description.MethodInfo) == 0 { - if r.IsVPX() { - m.Description = vpx.Description - } else { - m.Description = esx.Description - } - } - r.AddHandler(m) -} - -func (m *TaskManager) PutObject(obj mo.Reference) { - ref := obj.Reference() - if ref.Type != "Task" { - return - } - - m.Lock() - recent := append(m.RecentTask, ref) - if len(recent) > recentTaskMax { - recent = recent[1:] - } - - Map.Update(m, []types.PropertyChange{{Name: "recentTask", Val: recent}}) - m.Unlock() -} - -func (*TaskManager) RemoveObject(types.ManagedObjectReference) {} - -func (*TaskManager) UpdateObject(mo.Reference, []types.PropertyChange) {} diff --git a/vendor/github.com/vmware/govmomi/simulator/user_directory.go b/vendor/github.com/vmware/govmomi/simulator/user_directory.go deleted file mode 100644 index 929409b0f..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/user_directory.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/view_manager.go b/vendor/github.com/vmware/govmomi/simulator/view_manager.go deleted file mode 100644 index 001e2f9a9..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/view_manager.go +++ /dev/null @@ -1,267 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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 := 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, - }, - 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(root, seen) - - ctx.Session.Registry.Put(container) - - return body -} - -type ContainerView struct { - mo.ContainerView - - types map[string]bool -} - -func (v *ContainerView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { - ctx.Session.Remove(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.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(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(Map.Get(child), seen) - } - }) -} - -func (m *ViewManager) CreateListView(ctx *Context, req *types.CreateListView) soap.HasFault { - body := new(methods.CreateListViewBody) - list := new(ListView) - - if err := list.add(req.Obj); err != nil { - body.Fault_ = Fault("", err) - return body - } - - ctx.Session.Put(list) - - body.Res = &types.CreateListViewResponse{ - Returnval: list.Self, - } - - return body -} - -type ListView struct { - mo.ListView -} - -func (v *ListView) update() { - Map.Update(v, []types.PropertyChange{{Name: "view", Val: v.View}}) -} - -func (v *ListView) add(refs []types.ManagedObjectReference) *types.ManagedObjectNotFound { - for _, ref := range refs { - obj := Map.Get(ref) - if obj == nil { - return &types.ManagedObjectNotFound{Obj: ref} - } - v.View = append(v.View, ref) - } - return nil -} - -func (v *ListView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { - ctx.Session.Remove(c.This) - return destroyView(c.This) -} - -func (v *ListView) ModifyListView(req *types.ModifyListView) soap.HasFault { - body := new(methods.ModifyListViewBody) - - for _, ref := range req.Remove { - RemoveReference(&v.View, ref) - } - - if err := v.add(req.Add); err != nil { - body.Fault_ = Fault("", err) - return body - } - - body.Res = new(types.ModifyListViewResponse) - - if len(req.Remove) != 0 || len(req.Add) != 0 { - v.update() - } - - return body -} - -func (v *ListView) ResetListView(req *types.ResetListView) soap.HasFault { - body := new(methods.ResetListViewBody) - - v.View = nil - - if err := v.add(req.Obj); err != nil { - body.Fault_ = Fault("", err) - return body - } - - body.Res = new(types.ResetListViewResponse) - - v.update() - - return body -} diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go b/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go deleted file mode 100644 index 52e3c702b..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go +++ /dev/null @@ -1,220 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "fmt" - "os" - "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 VirtualDiskManager struct { - mo.VirtualDiskManager -} - -func (m *VirtualDiskManager) MO() mo.VirtualDiskManager { - return m.VirtualDiskManager -} - -func vdmNames(name string) []string { - return []string{ - strings.Replace(name, ".vmdk", "-flat.vmdk", 1), - name, - } -} - -func vdmCreateVirtualDisk(op types.VirtualDeviceConfigSpecFileOperation, req *types.CreateVirtualDisk_Task) types.BaseMethodFault { - fm := Map.FileManager() - - file, fault := fm.resolve(req.Datacenter, req.Name) - if fault != nil { - return fault - } - - shouldReplace := op == types.VirtualDeviceConfigSpecFileOperationReplace - shouldExist := op == "" - for _, name := range vdmNames(file) { - _, err := os.Stat(name) - if err == nil { - if shouldExist { - return nil - } - if shouldReplace { - if err = os.Truncate(file, 0); err != nil { - return fm.fault(name, err, new(types.CannotCreateFile)) - } - return nil - } - return fm.fault(name, nil, new(types.FileAlreadyExists)) - } else if shouldExist { - return fm.fault(name, nil, new(types.FileNotFound)) - } - - f, err := os.Create(name) - if err != nil { - return fm.fault(name, err, new(types.CannotCreateFile)) - } - - _ = f.Close() - } - - return nil -} - -func (m *VirtualDiskManager) CreateVirtualDiskTask(_ *Context, req *types.CreateVirtualDisk_Task) soap.HasFault { - task := CreateTask(m, "createVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - if err := vdmCreateVirtualDisk(types.VirtualDeviceConfigSpecFileOperationCreate, req); err != nil { - return "", err - } - return req.Name, nil - }) - - return &methods.CreateVirtualDisk_TaskBody{ - Res: &types.CreateVirtualDisk_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (m *VirtualDiskManager) DeleteVirtualDiskTask(_ *Context, req *types.DeleteVirtualDisk_Task) soap.HasFault { - task := CreateTask(m, "deleteVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - fm := Map.FileManager() - - for _, name := range vdmNames(req.Name) { - err := fm.deleteDatastoreFile(&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(), - }, - } -} - -func (m *VirtualDiskManager) MoveVirtualDiskTask(_ *Context, req *types.MoveVirtualDisk_Task) soap.HasFault { - task := CreateTask(m, "moveVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - fm := Map.FileManager() - - dest := vdmNames(req.DestName) - - for i, name := range vdmNames(req.SourceName) { - err := fm.moveDatastoreFile(&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(), - }, - } -} - -func (m *VirtualDiskManager) CopyVirtualDiskTask(_ *Context, req *types.CopyVirtualDisk_Task) soap.HasFault { - task := CreateTask(m, "copyVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - if req.DestSpec != nil { - if Map.IsVPX() { - return nil, new(types.NotImplemented) - } - } - - fm := Map.FileManager() - - dest := vdmNames(req.DestName) - - for i, name := range vdmNames(req.SourceName) { - err := fm.copyDatastoreFile(&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(), - }, - } -} - -func (m *VirtualDiskManager) QueryVirtualDiskUuid(_ *Context, req *types.QueryVirtualDiskUuid) soap.HasFault { - body := new(methods.QueryVirtualDiskUuidBody) - - fm := Map.FileManager() - - file, fault := fm.resolve(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: uuid.NewSHA1(uuid.NameSpaceOID, []byte(file)).String(), - } - - 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 -} diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go b/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go deleted file mode 100644 index 9068d25ed..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go +++ /dev/null @@ -1,2122 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "bytes" - "fmt" - "io/ioutil" - "log" - "net" - "os" - "path" - "path/filepath" - "reflect" - "strconv" - "strings" - "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 VirtualMachine struct { - mo.VirtualMachine - - log string - sid int32 - run container - 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 - - folder := Map.Get(parent) - f, _ := asFolderMO(folder) - folderPutChild(ctx, f, vm) - - 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}, - } - 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 := Map.getEntityDatacenter(folder.(mo.Entity)) - ds := Map.FindByName(vmx.Datastore, dc.Datastore).(*Datastore) - dir := path.Join(ds.Info.GetDatastoreInfo().Url, 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 = sha1UUID(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, - 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(&defaults) - if err != nil { - return vm, err - } - - vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff - vm.Runtime.ConnectionState = types.VirtualMachineConnectionStateConnected - vm.Summary.Runtime = vm.Runtime - - vm.Summary.QuickStats.GuestHeartbeatStatus = types.ManagedEntityStatusGray - vm.Summary.OverallStatus = types.ManagedEntityStatusGreen - vm.ConfigStatus = types.ManagedEntityStatusGreen - - return vm, nil -} - -func (o *VirtualMachine) RenameTask(r *types.Rename_Task) soap.HasFault { - return RenameTask(o, r) -} - -func (vm *VirtualMachine) event() types.VmEvent { - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - - return types.VmEvent{ - Event: types.Event{ - Datacenter: datacenterEventArgument(host), - ComputeResource: host.eventArgumentParent(), - Host: host.eventArgument(), - Vm: &types.VmEventArgument{ - EntityEventArgument: types.EntityEventArgument{Name: vm.Name}, - Vm: vm.Self, - }, - }, - } -} - -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.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}, - } - - 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 { - vm.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() -} - -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(spec *types.VirtualMachineConfigSpec) { - var changes []types.PropertyChange - for _, c := range spec.ExtraConfig { - val := c.GetOptionValue() - key := strings.TrimPrefix(extraConfigKey(val.Key), "SET.") - if key == val.Key { - vm.Config.ExtraConfig = append(vm.Config.ExtraConfig, c) - 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}, - ) - } - } - if len(changes) != 0 { - Map.Update(vm, changes) - } -} - -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(spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { - 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 - } - } - - return vm.configureDevices(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(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: - vm.addConfigLayout(datastorePath.Path) - case types.VirtualMachineFileLayoutExFileTypeLog: - vm.addLogLayout(datastorePath.Path) - case types.VirtualMachineFileLayoutExFileTypeSwap: - vm.addSwapLayout(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() - - return newKey -} - -func (vm *VirtualMachine) addConfigLayout(name string) { - for _, config := range vm.Layout.ConfigFile { - if config == name { - return - } - } - - vm.Layout.ConfigFile = append(vm.Layout.ConfigFile, name) - - vm.updateStorage() -} - -func (vm *VirtualMachine) addLogLayout(name string) { - for _, log := range vm.Layout.LogFile { - if log == name { - return - } - } - - vm.Layout.LogFile = append(vm.Layout.LogFile, name) - - vm.updateStorage() -} - -func (vm *VirtualMachine) addSwapLayout(name string) { - vm.Layout.SwapFile = name - - vm.updateStorage() -} - -func (vm *VirtualMachine) addSnapshotLayout(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, - }) - - vm.updateStorage() -} - -func (vm *VirtualMachine) addSnapshotLayoutEx(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() -} - -// Updates both vm.Layout.Disk and vm.LayoutEx.Disk -func (vm *VirtualMachine) updateDiskLayouts() 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(p.Datastore) - dFilePath := path.Join(datastore.Info.GetDatastoreInfo().Url, 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(*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() - - return nil -} - -func (vm *VirtualMachine) updateStorage() 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(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 _, usage := range datastoresUsage { - 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:]...) - } - } - - // Directories will be used to locate VM files. - // Does not include information about virtual disk file locations. - locations := []string{ - vm.Config.Files.VmPathName, - vm.Config.Files.SnapshotDirectory, - vm.Config.Files.LogDirectory, - vm.Config.Files.SuspendDirectory, - vm.Config.Files.FtMetadataDirectory, - } - - for _, directory := range locations { - if directory == "" { - continue - } - - p, fault := parseDatastorePath(directory) - if fault != nil { - body.Fault_ = Fault("", fault) - return body - } - - datastore := vm.useDatastore(p.Datastore) - directory := path.Join(datastore.Info.GetDatastoreInfo().Url, p.Path) - - if path.Ext(p.Path) == ".vmx" { - directory = path.Dir(directory) // vm.Config.Files.VmPathName can be a directory or full path to .vmx - } - - if _, err := os.Stat(directory); err != nil { - // Can not access the directory - continue - } - - files, err := ioutil.ReadDir(directory) - if err != nil { - body.Fault_ = soap.ToSoapFault(err) - return body - } - - for _, file := range files { - datastorePath := object.DatastorePath{ - Datastore: p.Datastore, - Path: strings.TrimPrefix(file.Name(), datastore.Info.GetDatastoreInfo().Url), - } - - vm.addFileLayoutEx(datastorePath, file.Size()) - } - } - - fault := vm.updateDiskLayouts() - 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(name string) *Datastore { - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - - return Map.FindByName(name, host.Datastore).(*Datastore) -} - -func (vm *VirtualMachine) useDatastore(name string) *Datastore { - ds := vm.findDatastore(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(spec string, name string, register bool) (*os.File, types.BaseMethodFault) { - p, fault := parseDatastorePath(spec) - if fault != nil { - return nil, fault - } - - ds := vm.useDatastore(p.Datastore) - - file := path.Join(ds.Info.GetDatastoreInfo().Url, 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 ...interface{}) { - 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(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(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(spec) -} - -var vmwOUI = net.HardwareAddr([]byte{0x0, 0xc, 0x29}) - -// From http://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.vsphere.networking.doc%2FGUID-DC7478FF-DC44-4625-9AD7-38208C56A552.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 (vm *VirtualMachine) validateSwitchMembers(id string) types.BaseMethodFault { - var dswitch *DistributedVirtualSwitch - - var find func(types.ManagedObjectReference) - find = func(child types.ManagedObjectReference) { - s, ok := Map.Get(child).(*DistributedVirtualSwitch) - if ok && s.Uuid == id { - dswitch = s - return - } - walk(Map.Get(child), find) - } - f := Map.getEntityDatacenter(vm).NetworkFolder - walk(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 := Map.Get(*vm.Runtime.Host).(*HostSystem) - c := hostParent(&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(devices object.VirtualDeviceList, spec *types.VirtualDeviceConfigSpec) types.BaseMethodFault { - device := spec.Device - d := device.GetVirtualDevice() - var controller types.BaseVirtualController - - if d.Key <= 0 { - // Keys can't be negative; Key 0 is reserved - d.Key = devices.NewKey() - d.Key *= -1 - } - - // Choose a unique key - for { - if devices.FindByKey(d.Key) == nil { - break - } - d.Key++ - } - - label := devices.Name(device) - summary := label - dc := Map.getEntityDatacenter(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 = 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(b.Port.SwitchUuid); err != nil { - return err - } - } - - Map.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 - } - - if spec.Operation == types.VirtualDeviceConfigSpecOperationAdd { - vm.Guest.Net = append(vm.Guest.Net, types.GuestNicInfo{ - Network: name, - IpAddress: nil, - MacAddress: c.MacAddress, - Connected: true, - DeviceConfigId: c.Key, - }) - } - case *types.VirtualDisk: - summary = fmt.Sprintf("%s KB", numberToString(x.CapacityInKB, ',')) - switch b := d.Backing.(type) { - case types.BaseVirtualDeviceFileBackingInfo: - info := b.GetVirtualDeviceFileBackingInfo() - var path object.DatastorePath - path.FromString(info.FileName) - - if path.Path == "" { - filename, err := vm.genVmdkPath(path) - if err != nil { - return err - } - - info.FileName = filename - } - - err := vdmCreateVirtualDisk(spec.FileOperation, &types.CreateVirtualDisk_Task{ - Datacenter: &dc.Self, - Name: info.FileName, - }) - if err != nil { - return err - } - - Map.Update(vm, []types.PropertyChange{ - {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks + 1}, - }) - - p, _ := parseDatastorePath(info.FileName) - ds := vm.findDatastore(p.Datastore) - info.Datastore = &ds.Self - - // XXX: compare disk size and free space until windows stat is supported - Map.WithLock(ds, func() { - ds.Summary.FreeSpace -= getDiskSize(x) - ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace - }) - - vm.updateDiskLayouts() - } - case *types.VirtualCdrom: - if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { - summary = "ISO " + b.GetVirtualDeviceFileBackingInfo().FileName - } - } - - 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 - } - } - - return nil -} - -func (vm *VirtualMachine) removeDevice(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(p.Datastore) - - Map.WithLock(ds, func() { - ds.Summary.FreeSpace += getDiskSize(device) - ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace - }) - } - - if file != "" { - dc := Map.getEntityDatacenter(vm) - dm := Map.VirtualDiskManager() - if dc == nil { - continue // parent was destroyed - } - dm.DeleteVirtualDiskTask(internalContext, &types.DeleteVirtualDisk_Task{ - Name: file, - Datacenter: &dc.Self, - }) - } - } - Map.Update(vm, []types.PropertyChange{ - {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks - 1}, - }) - - vm.updateDiskLayouts() - 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 - } - - networks := vm.Network - RemoveReference(&networks, net) - Map.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(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(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 - } -} - -func (vm *VirtualMachine) configureDevices(spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { - devices := object.VirtualDeviceList(vm.Config.Hardware.Device) - - for i, change := range spec.DeviceChange { - dspec := change.GetVirtualDeviceConfigSpec() - device := dspec.Device.GetVirtualDevice() - invalid := &types.InvalidDeviceSpec{DeviceIndex: int32(i)} - - 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: - 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(devices, dspec) - if err != nil { - return err - } - - devices = append(devices, 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 - rspec.Device = devices.FindByKey(device.Key) - if rspec.Device == nil { - return invalid - } - devices = vm.removeDevice(devices, &rspec) - device.DeviceInfo.GetDescription().Summary = "" // regenerate summary - - err := vm.configureDevice(devices, dspec) - if err != nil { - return err - } - - devices = append(devices, dspec.Device) - case types.VirtualDeviceConfigSpecOperationRemove: - devices = vm.removeDevice(devices, dspec) - } - } - - Map.Update(vm, []types.PropertyChange{ - {Name: "config.hardware.device", Val: []types.BaseVirtualDevice(devices)}, - }) - - vm.updateDiskLayouts() - - vm.applyExtraConfig(spec) // Do this after device config, as some may apply to the devices themselves (e.g. ethernet -> guest.net) - - 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() - switch c.state { - case types.VirtualMachinePowerStatePoweredOn: - c.run.start(c.VirtualMachine) - c.ctx.postEvent( - &types.VmStartingEvent{VmEvent: event}, - &types.VmPoweredOnEvent{VmEvent: event}, - ) - c.customize() - case types.VirtualMachinePowerStatePoweredOff: - c.run.stop(c.VirtualMachine) - c.ctx.postEvent( - &types.VmStoppingEvent{VmEvent: event}, - &types.VmPoweredOffEvent{VmEvent: event}, - ) - case types.VirtualMachinePowerStateSuspended: - c.run.pause(c.VirtualMachine) - c.ctx.postEvent( - &types.VmSuspendingEvent{VmEvent: event}, - &types.VmSuspendedEvent{VmEvent: event}, - ) - } - - Map.Update(c.VirtualMachine, []types.PropertyChange{ - {Name: "runtime.powerState", Val: c.state}, - {Name: "summary.runtime.powerState", Val: c.state}, - {Name: "summary.runtime.bootTime", Val: boot}, - }) - - 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(), - }, - } -} - -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(), - }, - } -} - -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(), - }, - } -} - -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 := Map.Get(res.(*methods.PowerOffVM_TaskBody).Res.Returnval).(*Task) - if ctask.Info.Error != nil { - return nil, ctask.Info.Error.Fault - } - - _ = vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{This: vm.Self}) - - return nil, nil - }) - - return &methods.ResetVM_TaskBody{ - Res: &types.ResetVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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(), - 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(&req.Spec) - - return nil, err - }) - - return &methods.ReconfigVM_TaskBody{ - Res: &types.ReconfigVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (vm *VirtualMachine) UpgradeVMTask(req *types.UpgradeVM_Task) soap.HasFault { - body := &methods.UpgradeVM_TaskBody{} - - task := CreateTask(vm, "upgradeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { - if vm.Config.Version != esx.HardwareVersion { - Map.Update(vm, []types.PropertyChange{{ - Name: "config.version", Val: esx.HardwareVersion, - }}) - } - return nil, nil - }) - - body.Res = &types.UpgradeVM_TaskResponse{ - Returnval: task.Run(), - } - - 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. - } - - 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(&types.VirtualMachineConfigSpec{DeviceChange: spec}) - - // Delete VM files from the datastore (ignoring result for now) - m := Map.FileManager() - - _ = m.DeleteDatastoreFileTask(&types.DeleteDatastoreFile_Task{ - This: m.Reference(), - Name: vm.Config.Files.LogDirectory, - Datacenter: &dc.Self, - }) - - vm.run.remove(vm) - - return nil, nil - }) - - return &methods.Destroy_TaskBody{ - Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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 := Map.Get(*vm.Runtime.Host).(*HostSystem) - Map.RemoveReference(host, &host.Vm, vm.Self) - - if vm.ResourcePool != nil { - switch pool := Map.Get(*vm.ResourcePool).(type) { - case *ResourcePool: - Map.RemoveReference(pool, &pool.Vm, vm.Self) - case *VirtualApp: - Map.RemoveReference(pool, &pool.Vm, vm.Self) - } - } - - for i := range vm.Datastore { - ds := Map.Get(vm.Datastore[i]).(*Datastore) - Map.RemoveReference(ds, &ds.Vm, vm.Self) - } - - ctx.postEvent(&types.VmRemovedEvent{VmEvent: vm.event()}) - if f, ok := asFolderMO(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) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soap.HasFault { - pool := req.Spec.Location.Pool - if pool == nil { - if !vm.Config.Template { - pool = vm.ResourcePool - } - } - folder, _ := asFolderMO(Map.Get(req.Folder)) - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - event := vm.event() - - 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 := 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"} - } - config := types.VirtualMachineConfigSpec{ - Name: req.Name, - GuestId: vm.Config.GuestId, - Files: &types.VirtualMachineFileInfo{ - VmPathName: vmx.String(), - }, - } - if req.Spec.Config != nil { - config.ExtraConfig = req.Spec.Config.ExtraConfig - } - - defaultDevices := object.VirtualDeviceList(esx.VirtualDevice) - devices := vm.Config.Hardware.Device - 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, - }) - } - - res := Map.Get(req.Folder).(vmFolder).CreateVMTask(ctx, &types.CreateVM_Task{ - This: folder.Self, - Config: config, - Pool: *pool, - Host: vm.Runtime.Host, - }) - - ctask := Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) - if ctask.Info.Error != nil { - return nil, ctask.Info.Error.Fault - } - - ref := ctask.Info.Result.(types.ManagedObjectReference) - clone := Map.Get(ref).(*VirtualMachine) - clone.configureDevices(&types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Location.DeviceChange}) - if req.Spec.Config != nil && req.Spec.Config.DeviceChange != nil { - clone.configureDevices(&types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Config.DeviceChange}) - } - - if req.Spec.Template { - _ = clone.MarkAsTemplate(&types.MarkAsTemplate{This: clone.Self}) - } - - ctx.postEvent(&types.VmClonedEvent{ - VmCloneEvent: types.VmCloneEvent{VmEvent: clone.event()}, - SourceVm: *event.Vm, - }) - - return ref, nil - }) - - return &methods.CloneVM_TaskBody{ - Res: &types.CloneVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -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 := Map.Get(*ref).(*Datastore) - Map.RemoveReference(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 := Map.Get(*ref).(*ResourcePool) - Map.RemoveReference(pool, &pool.Vm, *ref) - - changes = append(changes, types.PropertyChange{Name: "resourcePool", Val: ref}) - } - - if ref := req.Spec.Host; ref != nil { - host := Map.Get(*ref).(*HostSystem) - Map.RemoveReference(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 := Map.Get(*ref).(*Folder) - folder.MoveIntoFolderTask(ctx, &types.MoveIntoFolder_Task{ - List: []types.ManagedObjectReference{vm.Self}, - }) - } - - Map.Update(vm, changes) - - return nil, nil - }) - - return &methods.RelocateVM_TaskBody{ - Res: &types.RelocateVM_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (vm *VirtualMachine) customize() { - if vm.imc == nil { - return - } - - 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) - } - - for i, s := range vm.imc.NicSettingMap { - nic := &vm.Guest.Net[i] - if s.MacAddress != "" { - nic.MacAddress = s.MacAddress - } - 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}) - } - if address != "" { - changes = append(changes, types.PropertyChange{Name: "guest.ipAddress", Val: address}) - } - - vm.imc = nil - Map.Update(vm, changes) -} - -func (vm *VirtualMachine) CustomizeVMTask(req *types.CustomizeVM_Task) soap.HasFault { - task := CreateTask(vm, "customizeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { - 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(), - }, - } -} - -func (vm *VirtualMachine) CreateSnapshotTask(req *types.CreateSnapshot_Task) soap.HasFault { - task := CreateTask(vm, "createSnapshot", 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 - - Map.Put(snapshot) - - 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: req.Quiesce, - BackupManifest: "", - ReplaySupported: types.NewBool(false), - } - - cur := vm.Snapshot.CurrentSnapshot - if cur != nil { - parent := 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), - }) - } - - snapshot.createSnapshotFiles() - - changes = append(changes, types.PropertyChange{Name: "snapshot.currentSnapshot", Val: snapshot.Self}) - Map.Update(vm, changes) - - return snapshot.Self, nil - }) - - return &methods.CreateSnapshot_TaskBody{ - Res: &types.CreateSnapshot_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (vm *VirtualMachine) RevertToCurrentSnapshotTask(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 - } - - task := CreateTask(vm, "revertSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { - return nil, nil - }) - - body.Res = &types.RevertToCurrentSnapshot_TaskResponse{ - Returnval: task.Run(), - } - - 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) - - Map.Update(vm, []types.PropertyChange{ - {Name: "snapshot", Val: nil}, - }) - - for _, ref := range refs { - Map.Get(ref).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) - Map.Remove(ref) - } - - return nil, nil - }) - - return &methods.RemoveAllSnapshots_TaskBody{ - Res: &types.RemoveAllSnapshots_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) soap.HasFault { - r := &methods.ShutdownGuestBody{} - // should be poweron - if vm.Runtime.PowerState == types.VirtualMachinePowerStatePoweredOff { - r.Fault_ = Fault("", &types.InvalidPowerState{ - RequestedState: types.VirtualMachinePowerStatePoweredOn, - ExistingState: vm.Runtime.PowerState, - }) - - return r - } - // change state - vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff - vm.Summary.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff - - event := vm.event() - ctx.postEvent( - &types.VmGuestShutdownEvent{VmEvent: event}, - &types.VmPoweredOffEvent{VmEvent: event}, - ) - vm.run.stop(vm) - - Map.Update(vm, []types.PropertyChange{ - {Name: "runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, - {Name: "summary.runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, - }) - - r.Res = new(types.ShutdownGuestResponse) - - 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 -} diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go b/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go deleted file mode 100644 index 176588702..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 vpx contains SOAP responses from a vCenter server, captured using `govc ... -dump`. -*/ -package vpx diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go b/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go deleted file mode 100644 index 11ca6839d..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go +++ /dev/null @@ -1,21801 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 vpx - -import "github.com/vmware/govmomi/vim25/types" - -// 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/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go b/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go deleted file mode 100644 index 3c42c5350..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager_data.go +++ /dev/null @@ -1,1877 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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{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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }, - 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 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}, - 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/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go b/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go deleted file mode 100644 index a1cce0d8d..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/root_folder.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 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/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go b/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go deleted file mode 100644 index 90b93cc14..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 vpx - -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: "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: "dbed6e0c-bd88-4ef6-b594-21283e1c677f", - 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"}, -} diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go b/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go deleted file mode 100644 index 7bbf0c02d..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/setting.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -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 vpx - -import "github.com/vmware/govmomi/vim25/types" - -// 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/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go deleted file mode 100644 index dee36ff71..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go +++ /dev/null @@ -1,11133 +0,0 @@ -/* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. - -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 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: "<internal>", - Summary: "<internal>", - }, - 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: "<internal>", - Summary: "<internal>", - }, - 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/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go b/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go deleted file mode 100644 index 3c4107f01..000000000 --- a/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go +++ /dev/null @@ -1,451 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 simulator - -import ( - "log" - "net/url" - "os" - "path/filepath" - "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 -} - -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) 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(&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(), - }, - } -} - -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(filepath.Join(ds.Info.GetDatastoreInfo().Url, 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(creq, true) - if fault != nil { - body.Fault_ = Fault("", fault) - return body - } - - body.Res = &types.RegisterDiskResponse{ - Returnval: *obj, - } - - return body -} - -func (m *VcenterVStorageObjectManager) createObject(req *types.CreateDisk_Task, register bool) (*types.VStorageObject, types.BaseMethodFault) { - dir := "fcd" - ref := req.Spec.BackingSpec.GetVslmCreateSpecBackingSpec().Datastore - ds := Map.Get(ref).(*Datastore) - dc := Map.getEntityDatacenter(ds) - - objects, ok := m.objects[ds.Self] - if !ok { - objects = make(map[types.ID]*VStorageObject) - m.objects[ds.Self] = objects - _ = os.Mkdir(filepath.Join(ds.Info.GetDatastoreInfo().Url, 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(types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ - Datacenter: &dc.Self, - Name: path.String(), - }) - 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(req *types.CreateDisk_Task) soap.HasFault { - task := CreateTask(m, "createDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - return m.createObject(req, false) - }) - - return &methods.CreateDisk_TaskBody{ - Res: &types.CreateDisk_TaskResponse{ - Returnval: task.Run(), - }, - } -} - -func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(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{} - } - - backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) - ds := Map.Get(req.Datastore).(*Datastore) - dc := Map.getEntityDatacenter(ds) - dm := Map.VirtualDiskManager() - dm.DeleteVirtualDiskTask(internalContext, &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(), - }, - } -} - -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(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(), - }, - } -} - -func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(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(), - }, - } -} - -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 -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library.go b/vendor/github.com/vmware/govmomi/vapi/library/library.go deleted file mode 100644 index 7611af27a..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library.go +++ /dev/null @@ -1,308 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/rest" -) - -// StorageBackings for Content Libraries -type StorageBackings struct { - DatastoreID string `json:"datastore_id,omitempty"` - Type string `json:"type,omitempty"` -} - -// Library provides methods to create, read, update, delete, and enumerate libraries. -type Library struct { - CreationTime *time.Time `json:"creation_time,omitempty"` - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` - LastSyncTime *time.Time `json:"last_sync_time,omitempty"` - Name string `json:"name,omitempty"` - Storage []StorageBackings `json:"storage_backings,omitempty"` - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` - Subscription *Subscription `json:"subscription_info,omitempty"` - Publication *Publication `json:"publish_info,omitempty"` -} - -// Subscription info -type Subscription struct { - AuthenticationMethod string `json:"authentication_method"` - AutomaticSyncEnabled *bool `json:"automatic_sync_enabled,omitempty"` - OnDemand *bool `json:"on_demand,omitempty"` - Password string `json:"password,omitempty"` - SslThumbprint string `json:"ssl_thumbprint,omitempty"` - SubscriptionURL string `json:"subscription_url,omitempty"` - UserName string `json:"user_name,omitempty"` -} - -// Publication info -type Publication struct { - AuthenticationMethod string `json:"authentication_method"` - UserName string `json:"user_name,omitempty"` - Password string `json:"password,omitempty"` - CurrentPassword string `json:"current_password,omitempty"` - PersistJSON *bool `json:"persist_json_enabled,omitempty"` - Published *bool `json:"published,omitempty"` - PublishURL string `json:"publish_url,omitempty"` -} - -// SubscriberSummary as returned by ListSubscribers -type SubscriberSummary struct { - LibraryID string `json:"subscribed_library"` - LibraryName string `json:"subscribed_library_name"` - SubscriptionID string `json:"subscription"` - LibraryVcenterHostname string `json:"subscribed_library_vcenter_hostname,omitempty"` -} - -// Placement information used to place a virtual machine template -type Placement struct { - ResourcePool string `json:"resource_pool,omitempty"` - Host string `json:"host,omitempty"` - Folder string `json:"folder,omitempty"` - Cluster string `json:"cluster,omitempty"` - Network string `json:"network,omitempty"` -} - -// Vcenter contains information about the vCenter Server instance where a subscribed library associated with a subscription exists. -type Vcenter struct { - Hostname string `json:"hostname"` - Port int `json:"https_port,omitempty"` - ServerGUID string `json:"server_guid"` -} - -// Subscriber contains the detailed info for a library subscriber. -type Subscriber struct { - LibraryID string `json:"subscribed_library"` - LibraryName string `json:"subscribed_library_name"` - LibraryLocation string `json:"subscribed_library_location"` - Placement *Placement `json:"subscribed_library_placement,omitempty"` - Vcenter *Vcenter `json:"subscribed_library_vcenter,omitempty"` -} - -// SubscriberLibrary is the specification for a subscribed library to be associated with a subscription. -type SubscriberLibrary struct { - Target string `json:"target"` - LibraryID string `json:"subscribed_library,omitempty"` - Location string `json:"location"` - Vcenter *Vcenter `json:"vcenter,omitempty"` - Placement *Placement `json:"placement,omitempty"` -} - -// Patch merges updates from the given src. -func (l *Library) Patch(src *Library) { - if src.Name != "" { - l.Name = src.Name - } - if src.Description != "" { - l.Description = src.Description - } - if src.Version != "" { - l.Version = src.Version - } -} - -// Manager extends rest.Client, adding content library related methods. -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, - } -} - -// Find is the search criteria for finding libraries. -type Find struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` -} - -// FindLibrary returns one or more libraries that match the provided search -// criteria. -// -// The provided name is case-insensitive. -// -// Either the name or type of library may be set to empty values in order -// to search for all libraries, all libraries with a specific name, regardless -// of type, or all libraries of a specified type. -func (c *Manager) FindLibrary(ctx context.Context, search Find) ([]string, error) { - url := c.Resource(internal.LibraryPath).WithAction("find") - spec := struct { - Spec Find `json:"spec"` - }{search} - var res []string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// CreateLibrary creates a new library with the given Type, Name, -// Description, and CategoryID. -func (c *Manager) CreateLibrary(ctx context.Context, library Library) (string, error) { - spec := struct { - Library Library `json:"create_spec"` - }{library} - path := internal.LocalLibraryPath - if library.Type == "SUBSCRIBED" { - path = internal.SubscribedLibraryPath - sub := library.Subscription - u, err := url.Parse(sub.SubscriptionURL) - if err != nil { - return "", err - } - if u.Scheme == "https" && sub.SslThumbprint == "" { - thumbprint := c.Thumbprint(u.Host) - if thumbprint == "" { - t := c.DefaultTransport() - if t.TLSClientConfig.InsecureSkipVerify { - var info object.HostCertificateInfo - _ = info.FromURL(u, t.TLSClientConfig) - thumbprint = info.ThumbprintSHA1 - } - sub.SslThumbprint = thumbprint - } - } - } - url := c.Resource(path) - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// SyncLibrary syncs a subscribed library. -func (c *Manager) SyncLibrary(ctx context.Context, library *Library) error { - path := internal.SubscribedLibraryPath - url := c.Resource(path).WithID(library.ID).WithAction("sync") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// PublishLibrary publishes the library to specified subscriptions. -// If no subscriptions are specified, then publishes the library to all subscriptions. -func (c *Manager) PublishLibrary(ctx context.Context, library *Library, subscriptions []string) error { - path := internal.LocalLibraryPath - var spec internal.SubscriptionDestinationSpec - for i := range subscriptions { - spec.Subscriptions = append(spec.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) - } - url := c.Resource(path).WithID(library.ID).WithAction("publish") - return c.Do(ctx, url.Request(http.MethodPost, spec), nil) -} - -// DeleteLibrary deletes an existing library. -func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error { - path := internal.LocalLibraryPath - if library.Type == "SUBSCRIBED" { - path = internal.SubscribedLibraryPath - } - url := c.Resource(path).WithID(library.ID) - return c.Do(ctx, url.Request(http.MethodDelete), nil) -} - -// ListLibraries returns a list of all content library IDs in the system. -func (c *Manager) ListLibraries(ctx context.Context) ([]string, error) { - url := c.Resource(internal.LibraryPath) - var res []string - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// GetLibraryByID returns information on a library for the given ID. -func (c *Manager) GetLibraryByID(ctx context.Context, id string) (*Library, error) { - url := c.Resource(internal.LibraryPath).WithID(id) - var res Library - return &res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// GetLibraryByName returns information on a library for the given name. -func (c *Manager) GetLibraryByName(ctx context.Context, name string) (*Library, error) { - // Lookup by name - libraries, err := c.GetLibraries(ctx) - if err != nil { - return nil, err - } - for i := range libraries { - if libraries[i].Name == name { - return &libraries[i], nil - } - } - return nil, fmt.Errorf("library name (%s) not found", name) -} - -// GetLibraries returns a list of all content library details in the system. -func (c *Manager) GetLibraries(ctx context.Context) ([]Library, error) { - ids, err := c.ListLibraries(ctx) - if err != nil { - return nil, fmt.Errorf("get libraries failed for: %s", err) - } - - var libraries []Library - for _, id := range ids { - library, err := c.GetLibraryByID(ctx, id) - if err != nil { - return nil, fmt.Errorf("get library %s failed for %s", id, err) - } - - libraries = append(libraries, *library) - - } - return libraries, nil -} - -// ListSubscribers lists the subscriptions of the published library. -func (c *Manager) ListSubscribers(ctx context.Context, library *Library) ([]SubscriberSummary, error) { - url := c.Resource(internal.Subscriptions).WithParam("library", library.ID) - var res []SubscriberSummary - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// CreateSubscriber creates a subscription of the published library. -func (c *Manager) CreateSubscriber(ctx context.Context, library *Library, s SubscriberLibrary) (string, error) { - var spec struct { - Sub struct { - SubscriberLibrary SubscriberLibrary `json:"subscribed_library"` - } `json:"spec"` - } - spec.Sub.SubscriberLibrary = s - url := c.Resource(internal.Subscriptions).WithID(library.ID) - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, &spec), &res) -} - -// GetSubscriber returns information about the specified subscriber of the published library. -func (c *Manager) GetSubscriber(ctx context.Context, library *Library, subscriber string) (*Subscriber, error) { - id := internal.SubscriptionDestination{ID: subscriber} - url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("get") - var res Subscriber - return &res, c.Do(ctx, url.Request(http.MethodPost, &id), &res) -} - -// DeleteSubscriber deletes the specified subscription of the published library. -// The subscribed library associated with the subscription will not be deleted. -func (c *Manager) DeleteSubscriber(ctx context.Context, library *Library, subscriber string) error { - id := internal.SubscriptionDestination{ID: subscriber} - url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("delete") - return c.Do(ctx, url.Request(http.MethodPost, &id), nil) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_file.go deleted file mode 100644 index ba71d72d2..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_file.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "context" - "net/http" - - "github.com/vmware/govmomi/vapi/internal" -) - -// Checksum provides checksum information on library item files. -type Checksum struct { - Algorithm string `json:"algorithm,omitempty"` - Checksum string `json:"checksum"` -} - -// File provides methods to get information on library item files. -type File struct { - Cached *bool `json:"cached,omitempty"` - Checksum *Checksum `json:"checksum_info,omitempty"` - Name string `json:"name,omitempty"` - Size *int64 `json:"size,omitempty"` - Version string `json:"version,omitempty"` -} - -// ListLibraryItemFiles returns a list of all the files for a library item. -func (c *Manager) ListLibraryItemFiles(ctx context.Context, id string) ([]File, error) { - url := c.Resource(internal.LibraryItemFilePath).WithParam("library_item_id", id) - var res []File - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// GetLibraryItemFile returns a file with the provided name for a library item. -func (c *Manager) GetLibraryItemFile(ctx context.Context, id, fileName string) (*File, error) { - url := c.Resource(internal.LibraryItemFilePath).WithID(id).WithAction("get") - spec := struct { - Name string `json:"name"` - }{fileName} - var res File - return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go deleted file mode 100644 index 57914ad6c..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/vmware/govmomi/vapi/internal" -) - -const ( - ItemTypeISO = "iso" - ItemTypeOVF = "ovf" - ItemTypeVMTX = "vm-template" -) - -// Item provides methods to create, read, update, delete, and enumerate library items. -type Item struct { - Cached bool `json:"cached,omitempty"` - ContentVersion string `json:"content_version,omitempty"` - CreationTime *time.Time `json:"creation_time,omitempty"` - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` - LastSyncTime *time.Time `json:"last_sync_time,omitempty"` - LibraryID string `json:"library_id,omitempty"` - MetadataVersion string `json:"metadata_version,omitempty"` - Name string `json:"name,omitempty"` - Size int64 `json:"size,omitempty"` - SourceID string `json:"source_id,omitempty"` - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` -} - -// Patch merges updates from the given src. -func (i *Item) Patch(src *Item) { - if src.Name != "" { - i.Name = src.Name - } - if src.Description != "" { - i.Description = src.Description - } - if src.Type != "" { - i.Type = src.Type - } - if src.Version != "" { - i.Version = src.Version - } -} - -// CreateLibraryItem creates a new library item -func (c *Manager) CreateLibraryItem(ctx context.Context, item Item) (string, error) { - type createItemSpec struct { - Name string `json:"name"` - Description string `json:"description"` - LibraryID string `json:"library_id,omitempty"` - Type string `json:"type"` - } - spec := struct { - Item createItemSpec `json:"create_spec"` - }{ - Item: createItemSpec{ - Name: item.Name, - Description: item.Description, - LibraryID: item.LibraryID, - Type: item.Type, - }, - } - url := c.Resource(internal.LibraryItemPath) - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// CopyLibraryItem copies a library item -func (c *Manager) CopyLibraryItem(ctx context.Context, src *Item, dst Item) (string, error) { - body := struct { - Item `json:"destination_create_spec"` - }{dst} - url := c.Resource(internal.LibraryItemPath).WithID(src.ID).WithAction("copy") - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, body), &res) -} - -// SyncLibraryItem syncs a subscribed library item -func (c *Manager) SyncLibraryItem(ctx context.Context, item *Item, force bool) error { - body := struct { - Force bool `json:"force_sync_content"` - }{force} - url := c.Resource(internal.SubscribedLibraryItem).WithID(item.ID).WithAction("sync") - return c.Do(ctx, url.Request(http.MethodPost, body), nil) -} - -// PublishLibraryItem publishes a library item to specified subscriptions. -// If no subscriptions are specified, then publishes the library item to all subscriptions. -func (c *Manager) PublishLibraryItem(ctx context.Context, item *Item, force bool, subscriptions []string) error { - body := internal.SubscriptionItemDestinationSpec{ - Force: force, - } - for i := range subscriptions { - body.Subscriptions = append(body.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) - } - url := c.Resource(internal.LibraryItemPath).WithID(item.ID).WithAction("publish") - return c.Do(ctx, url.Request(http.MethodPost, body), nil) -} - -// DeleteLibraryItem deletes an existing library item. -func (c *Manager) DeleteLibraryItem(ctx context.Context, item *Item) error { - url := c.Resource(internal.LibraryItemPath).WithID(item.ID) - return c.Do(ctx, url.Request(http.MethodDelete), nil) -} - -// ListLibraryItems returns a list of all items in a content library. -func (c *Manager) ListLibraryItems(ctx context.Context, id string) ([]string, error) { - url := c.Resource(internal.LibraryItemPath).WithParam("library_id", id) - var res []string - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// GetLibraryItem returns information on a library item for the given ID. -func (c *Manager) GetLibraryItem(ctx context.Context, id string) (*Item, error) { - url := c.Resource(internal.LibraryItemPath).WithID(id) - var res Item - return &res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// GetLibraryItems returns a list of all the library items for the specified library. -func (c *Manager) GetLibraryItems(ctx context.Context, libraryID string) ([]Item, error) { - ids, err := c.ListLibraryItems(ctx, libraryID) - if err != nil { - return nil, fmt.Errorf("get library items failed for: %s", err) - } - var items []Item - for _, id := range ids { - item, err := c.GetLibraryItem(ctx, id) - if err != nil { - return nil, fmt.Errorf("get library item for %s failed for %s", id, err) - } - items = append(items, *item) - } - return items, nil -} - -// FindItem is the search criteria for finding library items. -type FindItem struct { - Cached *bool `json:"cached,omitempty"` - LibraryID string `json:"library_id,omitempty"` - Name string `json:"name,omitempty"` - SourceID string `json:"source_id,omitempty"` - Type string `json:"type,omitempty"` -} - -// FindLibraryItems returns the IDs of all the library items that match the -// search criteria. -func (c *Manager) FindLibraryItems( - ctx context.Context, search FindItem) ([]string, error) { - - url := c.Resource(internal.LibraryItemPath).WithAction("find") - spec := struct { - Spec FindItem `json:"spec"` - }{search} - var res []string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go deleted file mode 100644 index 6f432f727..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "context" - "net/http" - - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/rest" -) - -// DownloadFile is the specification for the downloadsession -// operations file:add, file:get, and file:list. -type DownloadFile struct { - BytesTransferred int64 `json:"bytes_transferred"` - Checksum *Checksum `json:"checksum_info,omitempty"` - DownloadEndpoint *TransferEndpoint `json:"download_endpoint,omitempty"` - ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` - Name string `json:"name"` - Size int64 `json:"size,omitempty"` - Status string `json:"status"` -} - -// GetLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. -func (c *Manager) GetLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { - url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("get") - spec := struct { - Name string `json:"file_name"` - }{name} - var res DownloadFile - err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) - if err != nil { - return nil, err - } - if res.Status == "ERROR" { - return nil, res.ErrorMessage - } - return &res, nil -} - -// ListLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. -func (c *Manager) ListLibraryItemDownloadSessionFile(ctx context.Context, sessionID string) ([]DownloadFile, error) { - url := c.Resource(internal.LibraryItemDownloadSessionFile).WithParam("download_session_id", sessionID) - var res []DownloadFile - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// PrepareLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. -func (c *Manager) PrepareLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { - url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("prepare") - spec := struct { - Name string `json:"file_name"` - }{name} - var res DownloadFile - return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go deleted file mode 100644 index df66a87b3..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "context" - "net/http" - "time" - - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/rest" -) - -// Session is used to create an initial update or download session -type Session struct { - ClientProgress int64 `json:"client_progress,omitempty"` - ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` - ExpirationTime *time.Time `json:"expiration_time,omitempty"` - ID string `json:"id,omitempty"` - LibraryItemContentVersion string `json:"library_item_content_version,omitempty"` - LibraryItemID string `json:"library_item_id,omitempty"` - State string `json:"state,omitempty"` -} - -// CreateLibraryItemUpdateSession creates a new library item -func (c *Manager) CreateLibraryItemUpdateSession(ctx context.Context, session Session) (string, error) { - url := c.Resource(internal.LibraryItemUpdateSession) - spec := struct { - CreateSpec Session `json:"create_spec"` - }{session} - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// GetLibraryItemUpdateSession gets the update session information with status -func (c *Manager) GetLibraryItemUpdateSession(ctx context.Context, id string) (*Session, error) { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) - var res Session - return &res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// ListLibraryItemUpdateSession gets the list of update sessions -func (c *Manager) ListLibraryItemUpdateSession(ctx context.Context) ([]string, error) { - url := c.Resource(internal.LibraryItemUpdateSession) - var res []string - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// CancelLibraryItemUpdateSession cancels an update session -func (c *Manager) CancelLibraryItemUpdateSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("cancel") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// CompleteLibraryItemUpdateSession completes an update session -func (c *Manager) CompleteLibraryItemUpdateSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("complete") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// DeleteLibraryItemUpdateSession deletes an update session -func (c *Manager) DeleteLibraryItemUpdateSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) - return c.Do(ctx, url.Request(http.MethodDelete), nil) -} - -// FailLibraryItemUpdateSession fails an update session -func (c *Manager) FailLibraryItemUpdateSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("fail") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// KeepAliveLibraryItemUpdateSession keeps an inactive update session alive. -func (c *Manager) KeepAliveLibraryItemUpdateSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("keep-alive") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// WaitOnLibraryItemUpdateSession blocks until the update session is no longer -// in the ACTIVE state. -func (c *Manager) WaitOnLibraryItemUpdateSession( - ctx context.Context, sessionID string, - interval time.Duration, intervalCallback func()) error { - - // Wait until the upload operation is complete to return. - for { - session, err := c.GetLibraryItemUpdateSession(ctx, sessionID) - if err != nil { - return err - } - - if session.State != "ACTIVE" { - if session.State == "ERROR" { - return session.ErrorMessage - } - return nil - } - time.Sleep(interval) - if intervalCallback != nil { - intervalCallback() - } - } -} - -// CreateLibraryItemDownloadSession creates a new library item -func (c *Manager) CreateLibraryItemDownloadSession(ctx context.Context, session Session) (string, error) { - url := c.Resource(internal.LibraryItemDownloadSession) - spec := struct { - CreateSpec Session `json:"create_spec"` - }{session} - var res string - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// GetLibraryItemDownloadSession gets the download session information with status -func (c *Manager) GetLibraryItemDownloadSession(ctx context.Context, id string) (*Session, error) { - url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) - var res Session - return &res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// ListLibraryItemDownloadSession gets the list of download sessions -func (c *Manager) ListLibraryItemDownloadSession(ctx context.Context) ([]string, error) { - url := c.Resource(internal.LibraryItemDownloadSession) - var res []string - return res, c.Do(ctx, url.Request(http.MethodGet), &res) -} - -// CancelLibraryItemDownloadSession cancels an download session -func (c *Manager) CancelLibraryItemDownloadSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("cancel") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// DeleteLibraryItemDownloadSession deletes an download session -func (c *Manager) DeleteLibraryItemDownloadSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) - return c.Do(ctx, url.Request(http.MethodDelete), nil) -} - -// FailLibraryItemDownloadSession fails an download session -func (c *Manager) FailLibraryItemDownloadSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("fail") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} - -// KeepAliveLibraryItemDownloadSession keeps an inactive download session alive. -func (c *Manager) KeepAliveLibraryItemDownloadSession(ctx context.Context, id string) error { - url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("keep-alive") - return c.Do(ctx, url.Request(http.MethodPost), nil) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go deleted file mode 100644 index e34331cfa..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 library - -import ( - "bufio" - "context" - "io" - "net/http" - "strings" - - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/rest" - "github.com/vmware/govmomi/vim25/soap" -) - -// TransferEndpoint provides information on the source of a library item file. -type TransferEndpoint struct { - URI string `json:"uri,omitempty"` - SSLCertificateThumbprint string `json:"ssl_certificate_thumbprint,omitempty"` -} - -// UpdateFile is the specification for the updatesession -// operations file:add, file:get, and file:list. -type UpdateFile struct { - BytesTransferred int64 `json:"bytes_transferred,omitempty"` - Checksum *Checksum `json:"checksum_info,omitempty"` - ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` - Name string `json:"name"` - Size int64 `json:"size,omitempty"` - SourceEndpoint *TransferEndpoint `json:"source_endpoint,omitempty"` - SourceType string `json:"source_type"` - Status string `json:"status,omitempty"` - UploadEndpoint *TransferEndpoint `json:"upload_endpoint,omitempty"` -} - -// AddLibraryItemFile adds a file -func (c *Manager) AddLibraryItemFile(ctx context.Context, sessionID string, updateFile UpdateFile) (*UpdateFile, error) { - url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("add") - spec := struct { - FileSpec UpdateFile `json:"file_spec"` - }{updateFile} - var res UpdateFile - err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) - if err != nil { - return nil, err - } - if res.Status == "ERROR" { - return nil, res.ErrorMessage - } - return &res, nil -} - -// AddLibraryItemFileFromURI adds a file from a remote URI. -func (c *Manager) AddLibraryItemFileFromURI( - ctx context.Context, - sessionID, fileName, uri string) (*UpdateFile, error) { - - n, fingerprint, err := c.getContentLengthAndFingerprint(ctx, uri) - if err != nil { - return nil, err - } - - info, err := c.AddLibraryItemFile(ctx, sessionID, UpdateFile{ - Name: fileName, - SourceType: "PULL", - Size: n, - SourceEndpoint: &TransferEndpoint{ - URI: uri, - SSLCertificateThumbprint: fingerprint, - }, - }) - if err != nil { - return nil, err - } - - return info, c.CompleteLibraryItemUpdateSession(ctx, sessionID) -} - -// GetLibraryItemUpdateSessionFile retrieves information about a specific file -// that is a part of an update session. -func (c *Manager) GetLibraryItemUpdateSessionFile(ctx context.Context, sessionID string, fileName string) (*UpdateFile, error) { - url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("get") - spec := struct { - Name string `json:"file_name"` - }{fileName} - var res UpdateFile - return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// getContentLengthAndFingerprint gets the number of bytes returned -// by the URI as well as the SHA1 fingerprint of the peer certificate -// if the URI's scheme is https. -func (c *Manager) getContentLengthAndFingerprint( - ctx context.Context, uri string) (int64, string, error) { - resp, err := c.Head(uri) - if err != nil { - return 0, "", err - } - if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 { - return resp.ContentLength, "", nil - } - fingerprint := c.Thumbprint(resp.Request.URL.Host) - if fingerprint == "" { - if c.DefaultTransport().TLSClientConfig.InsecureSkipVerify { - fingerprint = soap.ThumbprintSHA1(resp.TLS.PeerCertificates[0]) - } - } - return resp.ContentLength, fingerprint, nil -} - -// ReadManifest converts an ovf manifest to a map of file name -> Checksum. -func ReadManifest(m io.Reader) (map[string]*Checksum, error) { - // expected format: openssl sha1 *.{ovf,vmdk} - c := make(map[string]*Checksum) - - scanner := bufio.NewScanner(m) - for scanner.Scan() { - line := strings.SplitN(scanner.Text(), ")=", 2) - if len(line) != 2 { - continue - } - name := strings.SplitN(line[0], "(", 2) - if len(name) != 2 { - continue - } - sum := &Checksum{ - Algorithm: strings.TrimSpace(name[0]), - Checksum: strings.TrimSpace(line[1]), - } - c[name[1]] = sum - } - - return c, scanner.Err() -} diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go deleted file mode 100644 index 3eaaa6431..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go +++ /dev/null @@ -1,304 +0,0 @@ -/* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. - -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 vcenter - -import ( - "context" - "fmt" - "net/http" - - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/rest" - "github.com/vmware/govmomi/vim25/types" -) - -// AdditionalParams are additional OVF parameters which can be specified for a deployment target. -// This structure is a union where based on Type, only one of each commented section will be set. -type AdditionalParams struct { - Class string `json:"@class"` - Type string `json:"type"` - - // DeploymentOptionParams - SelectedKey string `json:"selected_key,omitempty"` - DeploymentOptions []DeploymentOption `json:"deployment_options,omitempty"` - - // ExtraConfigs - ExtraConfig []ExtraConfig `json:"extra_configs,omitempty"` - - // PropertyParams - Properties []Property `json:"properties,omitempty"` - - // SizeParams - ApproximateSparseDeploymentSize int64 `json:"approximate_sparse_deployment_size,omitempty"` - VariableDiskSize bool `json:"variable_disk_size,omitempty"` - ApproximateDownloadSize int64 `json:"approximate_download_size,omitempty"` - ApproximateFlatDeploymentSize int64 `json:"approximate_flat_deployment_size,omitempty"` - - // IpAllocationParams - SupportedAllocationScheme []string `json:"supported_allocation_scheme,omitempty"` - SupportedIPProtocol []string `json:"supported_ip_protocol,omitempty"` - SupportedIPAllocationPolicy []string `json:"supported_ip_allocation_policy,omitempty"` - IPAllocationPolicy string `json:"ip_allocation_policy,omitempty"` - IPProtocol string `json:"ip_protocol,omitempty"` - - // UnknownSections - UnknownSections []UnknownSection `json:"unknown_sections,omitempty"` -} - -const ( - ClassDeploymentOptionParams = "com.vmware.vcenter.ovf.deployment_option_params" - ClassPropertyParams = "com.vmware.vcenter.ovf.property_params" - TypeDeploymentOptionParams = "DeploymentOptionParams" - TypeExtraConfigParams = "ExtraConfigParams" - TypeIPAllocationParams = "IpAllocationParams" - TypePropertyParams = "PropertyParams" - TypeSizeParams = "SizeParams" -) - -// DeploymentOption contains the information about a deployment option as defined in the OVF specification -type DeploymentOption struct { - Key string `json:"key,omitempty"` - Label string `json:"label,omitempty"` - Description string `json:"description,omitempty"` - DefaultChoice bool `json:"default_choice,omitempty"` -} - -// ExtraConfig contains information about a vmw:ExtraConfig OVF element -type ExtraConfig struct { - Key string `json:"key,omitempty"` - Value string `json:"value,omitempty"` - VirtualSystemID string `json:"virtual_system_id,omitempty"` -} - -// Property contains information about a property in an OVF package -type Property struct { - Category string `json:"category,omitempty"` - ClassID string `json:"class_id,omitempty"` - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - InstanceID string `json:"instance_id,omitempty"` - Label string `json:"label,omitempty"` - Type string `json:"type,omitempty"` - UIOptional bool `json:"ui_optional,omitempty"` - Value string `json:"value,omitempty"` -} - -// UnknownSection contains information about an unknown section in an OVF package -type UnknownSection struct { - Tag string `json:"tag,omitempty"` - Info string `json:"info,omitempty"` -} - -// NetworkMapping specifies the target network to use for sections of type ovf:NetworkSection in the OVF descriptor -type NetworkMapping struct { - Key string `json:"key"` - Value string `json:"value"` -} - -// StorageGroupMapping defines the storage deployment target and storage provisioning type for a section of type vmw:StorageGroupSection in the OVF descriptor -type StorageGroupMapping struct { - Type string `json:"type"` - StorageProfileID string `json:"storage_profile_id,omitempty"` - DatastoreID string `json:"datastore_id,omitempty"` - Provisioning string `json:"provisioning,omitempty"` -} - -// StorageMapping specifies the target storage to use for sections of type vmw:StorageGroupSection in the OVF descriptor -type StorageMapping struct { - Key string `json:"key"` - Value StorageGroupMapping `json:"value"` -} - -// DeploymentSpec is the deployment specification for the deployment -type DeploymentSpec struct { - Name string `json:"name,omitempty"` - Annotation string `json:"annotation,omitempty"` - AcceptAllEULA bool `json:"accept_all_EULA,omitempty"` - NetworkMappings []NetworkMapping `json:"network_mappings,omitempty"` - StorageMappings []StorageMapping `json:"storage_mappings,omitempty"` - StorageProvisioning string `json:"storage_provisioning,omitempty"` - StorageProfileID string `json:"storage_profile_id,omitempty"` - Locale string `json:"locale,omitempty"` - Flags []string `json:"flags,omitempty"` - AdditionalParams []AdditionalParams `json:"additional_parameters,omitempty"` - DefaultDatastoreID string `json:"default_datastore_id,omitempty"` -} - -// Target is the target for the deployment -type Target struct { - ResourcePoolID string `json:"resource_pool_id,omitempty"` - HostID string `json:"host_id,omitempty"` - FolderID string `json:"folder_id,omitempty"` -} - -// Deploy contains the information to start the deployment of a library OVF -type Deploy struct { - DeploymentSpec `json:"deployment_spec,omitempty"` - Target `json:"target,omitempty"` -} - -// Error is a SERVER error -type Error struct { - Class string `json:"@class,omitempty"` - Messages []rest.LocalizableMessage `json:"messages,omitempty"` -} - -// ParseIssue is a parse issue struct -type ParseIssue struct { - Category string `json:"@classcategory,omitempty"` - File string `json:"file,omitempty"` - LineNumber int64 `json:"line_number,omitempty"` - ColumnNumber int64 `json:"column_number,omitempty"` - Message rest.LocalizableMessage `json:"message,omitempty"` -} - -// OVFError is a list of errors from create or deploy -type OVFError struct { - Category string `json:"category,omitempty"` - Error *Error `json:"error,omitempty"` - Issues []ParseIssue `json:"issues,omitempty"` - Message *rest.LocalizableMessage `json:"message,omitempty"` -} - -// ResourceID is a managed object reference for a deployed resource. -type ResourceID struct { - Type string `json:"type,omitempty"` - Value string `json:"id,omitempty"` -} - -// DeploymentError is an error that occurs when deploying and OVF from -// a library item. -type DeploymentError struct { - Errors []OVFError `json:"errors,omitempty"` -} - -// Error implements the error interface -func (e *DeploymentError) Error() string { - msg := "" - if len(e.Errors) != 0 { - err := e.Errors[0] - if err.Message != nil { - msg = err.Message.DefaultMessage - } else if err.Error != nil && len(err.Error.Messages) != 0 { - msg = err.Error.Messages[0].DefaultMessage - } - } - if msg == "" { - msg = fmt.Sprintf("%#v", e) - } - return "deploy error: " + msg -} - -// LibraryTarget specifies a Library or Library item -type LibraryTarget struct { - LibraryID string `json:"library_id,omitempty"` - LibraryItemID string `json:"library_item_id,omitempty"` -} - -// CreateSpec info used to create an OVF package from a VM -type CreateSpec struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Flags []string `json:"flags,omitempty"` -} - -// OVF data used by CreateOVF -type OVF struct { - Spec CreateSpec `json:"create_spec"` - Source ResourceID `json:"source"` - Target LibraryTarget `json:"target"` -} - -// CreateResult used for decoded a CreateOVF response -type CreateResult struct { - Succeeded bool `json:"succeeded,omitempty"` - ID string `json:"ovf_library_item_id,omitempty"` - Error *DeploymentError `json:"error,omitempty"` -} - -// Deployment is the results from issuing a library OVF deployment -type Deployment struct { - Succeeded bool `json:"succeeded,omitempty"` - ResourceID *ResourceID `json:"resource_id,omitempty"` - Error *DeploymentError `json:"error,omitempty"` -} - -// FilterRequest contains the information to start a vcenter filter call -type FilterRequest struct { - Target `json:"target,omitempty"` -} - -// FilterResponse returns information from the vcenter filter call -type FilterResponse struct { - EULAs []string `json:"EULAs,omitempty"` - AdditionalParams []AdditionalParams `json:"additional_params,omitempty"` - Annotation string `json:"Annotation,omitempty"` - Name string `json:"name,omitempty"` - Networks []string `json:"Networks,omitempty"` - StorageGroups []string `json:"storage_groups,omitempty"` -} - -// Manager extends rest.Client, adding content library related methods. -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, - } -} - -// CreateOVF creates a library OVF item in content library from an existing VM -func (c *Manager) CreateOVF(ctx context.Context, ovf OVF) (string, error) { - if ovf.Source.Type == "" { - ovf.Source.Type = "VirtualMachine" - } - url := c.Resource(internal.VCenterOVFLibraryItem) - var res CreateResult - err := c.Do(ctx, url.Request(http.MethodPost, ovf), &res) - if err != nil { - return "", err - } - if res.Succeeded { - return res.ID, nil - } - return "", res.Error -} - -// DeployLibraryItem deploys a library OVF -func (c *Manager) DeployLibraryItem(ctx context.Context, libraryItemID string, deploy Deploy) (*types.ManagedObjectReference, error) { - url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("deploy") - var res Deployment - err := c.Do(ctx, url.Request(http.MethodPost, deploy), &res) - if err != nil { - return nil, err - } - if res.Succeeded { - ref := types.ManagedObjectReference(*res.ResourceID) - return &ref, nil - } - return nil, res.Error -} - -// FilterLibraryItem deploys a library OVF -func (c *Manager) FilterLibraryItem(ctx context.Context, libraryItemID string, filter FilterRequest) (FilterResponse, error) { - url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("filter") - var res FilterResponse - return res, c.Do(ctx, url.Request(http.MethodPost, filter), &res) -} diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go deleted file mode 100644 index a71d4a061..000000000 --- a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go +++ /dev/null @@ -1,285 +0,0 @@ -/* -Copyright (c) 2019 VMware, Inc. All Rights Reserved. - -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 vcenter - -import ( - "context" - "crypto/sha1" - "fmt" - "log" - "net/http" - "path" - - "github.com/vmware/govmomi/vapi/internal" - "github.com/vmware/govmomi/vapi/library" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -// vcenter vm template -// The vcenter.vm_template API provides structures and services that will let its client manage VMTX template in Content Library. -// http://vmware.github.io/vsphere-automation-sdk-rest/6.7.1/index.html#SVC_com.vmware.vcenter.vm_template.library_items - -// Template create spec -type Template struct { - Description string `json:"description,omitempty"` - DiskStorage *DiskStorage `json:"disk_storage,omitempty"` - DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` - Library string `json:"library,omitempty"` - Name string `json:"name,omitempty"` - Placement *Placement `json:"placement,omitempty"` - SourceVM string `json:"source_vm,omitempty"` - VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` -} - -// TemplateInfo for a VM template contained in an existing library item -type TemplateInfo struct { - GuestOS string `json:"guest_OS,omitempty"` - // TODO... -} - -// Placement information used to place the virtual machine template -type Placement = library.Placement - -// StoragePolicy for DiskStorage -type StoragePolicy struct { - Policy string `json:"policy,omitempty"` - Type string `json:"type"` -} - -// DiskStorage defines the storage specification for VM files -type DiskStorage struct { - Datastore string `json:"datastore,omitempty"` - StoragePolicy *StoragePolicy `json:"storage_policy,omitempty"` -} - -// DiskStorageOverride storage specification for individual disks in the virtual machine template -type DiskStorageOverride struct { - Key string `json:"key"` - Value DiskStorage `json:"value"` -} - -// GuestCustomization spec to apply to the deployed VM -type GuestCustomization struct { - Name string `json:"name,omitempty"` -} - -// HardwareCustomization spec which specifies updates to the deployed VM -type HardwareCustomization struct { - // TODO -} - -// DeployTemplate specification of how a library VM template clone should be deployed. -type DeployTemplate struct { - Description string `json:"description,omitempty"` - DiskStorage *DiskStorage `json:"disk_storage,omitempty"` - DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` - GuestCustomization *GuestCustomization `json:"guest_customization,omitempty"` - HardwareCustomization *HardwareCustomization `json:"hardware_customization,omitempty"` - Name string `json:"name,omitempty"` - Placement *Placement `json:"placement,omitempty"` - PoweredOn bool `json:"powered_on"` - VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` -} - -// CheckOut specification -type CheckOut struct { - Name string `json:"name,omitempty"` - Placement *Placement `json:"placement,omitempty"` - PoweredOn bool `json:"powered_on,omitempty"` -} - -// CheckIn specification -type CheckIn struct { - Message string `json:"message"` -} - -// CreateTemplate creates a library VMTX item in content library from an existing VM -func (c *Manager) CreateTemplate(ctx context.Context, vmtx Template) (string, error) { - url := c.Resource(internal.VCenterVMTXLibraryItem) - var res string - spec := struct { - Template `json:"spec"` - }{vmtx} - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// DeployTemplateLibraryItem deploys a VM as a copy of the source VM template contained in the given library item -func (c *Manager) DeployTemplateLibraryItem(ctx context.Context, libraryItemID string, deploy DeployTemplate) (*types.ManagedObjectReference, error) { - url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID)).WithParam("action", "deploy") - var res string - spec := struct { - DeployTemplate `json:"spec"` - }{deploy} - err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) - if err != nil { - return nil, err - } - return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil -} - -// CheckOut a library item containing a VM template. -func (c *Manager) CheckOut(ctx context.Context, libraryItemID string, checkout *CheckOut) (*types.ManagedObjectReference, error) { - url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs")).WithParam("action", "check-out") - var res string - spec := struct { - *CheckOut `json:"spec"` - }{checkout} - err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) - if err != nil { - return nil, err - } - return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil -} - -// CheckIn a VM into the library item. -func (c *Manager) CheckIn(ctx context.Context, libraryItemID string, vm mo.Reference, checkin *CheckIn) (string, error) { - p := path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs", vm.Reference().Value) - url := c.Resource(p).WithParam("action", "check-in") - var res string - spec := struct { - *CheckIn `json:"spec"` - }{checkin} - return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) -} - -// TemplateLibrary params for synchronizing subscription library OVF items to VM Template items -type TemplateLibrary struct { - Source library.Library - Destination library.Library - Placement Target - Include func(library.Item, *library.Item) bool - SyncItem func(context.Context, library.Item, *Deploy, *Template) error -} - -func (c *Manager) includeTemplateLibraryItem(src library.Item, dst *library.Item) bool { - return dst == nil -} - -// SyncTemplateLibraryItem deploys an Library OVF item from which a VM template (vmtx) Library item is created. -// The deployed VM is deleted after being converted to a Library vmtx item. -func (c *Manager) SyncTemplateLibraryItem(ctx context.Context, item library.Item, deploy *Deploy, spec *Template) error { - destroy := false - if spec.SourceVM == "" { - ref, err := c.DeployLibraryItem(ctx, item.ID, *deploy) - if err != nil { - return err - } - - destroy = true - spec.SourceVM = ref.Value - } - - _, err := c.CreateTemplate(ctx, *spec) - - if destroy { - // Delete source VM regardless of CreateTemplate result - url := c.Resource("/vcenter/vm/" + spec.SourceVM) - derr := c.Do(ctx, url.Request(http.MethodDelete), nil) - if derr != nil { - if err == nil { - // Return Delete error if CreateTemplate was successful - return derr - } - // Return CreateTemplate error and just log Delete error - log.Printf("destroy %s: %s", spec.SourceVM, derr) - } - } - - return err -} - -func vmtxSourceName(l library.Library, item library.Item) string { - sum := sha1.Sum([]byte(path.Join(l.Name, item.Name))) - return fmt.Sprintf("vmtx-src-%x", sum) -} - -// SyncTemplateLibrary converts TemplateLibrary.Source OVF items to VM Template items within TemplateLibrary.Destination -// The optional TemplateLibrary.Include func can be used to filter which items are synced. -// By default all items that don't exist in the Destination library are synced. -// The optional TemplateLibrary.SyncItem func can be used to change how the item is synced, by default SyncTemplateLibraryItem is used. -func (c *Manager) SyncTemplateLibrary(ctx context.Context, l TemplateLibrary, items ...library.Item) error { - m := library.NewManager(c.Client) - var err error - if len(items) == 0 { - items, err = m.GetLibraryItems(ctx, l.Source.ID) - if err != nil { - return err - } - } - - templates, err := m.GetLibraryItems(ctx, l.Destination.ID) - if err != nil { - return err - } - - existing := make(map[string]*library.Item) - for i := range templates { - existing[templates[i].Name] = &templates[i] - } - - include := l.Include - if include == nil { - include = c.includeTemplateLibraryItem - } - - sync := l.SyncItem - if sync == nil { - sync = c.SyncTemplateLibraryItem - } - - for _, item := range items { - if item.Type != library.ItemTypeOVF { - continue - } - - // Deploy source VM from library ovf item - deploy := Deploy{ - DeploymentSpec: DeploymentSpec{ - Name: vmtxSourceName(l.Destination, item), - DefaultDatastoreID: l.Destination.Storage[0].DatastoreID, - AcceptAllEULA: true, - }, - Target: l.Placement, - } - - // Create library vmtx item from source VM - storage := &DiskStorage{ - Datastore: deploy.DeploymentSpec.DefaultDatastoreID, - } - spec := Template{ - Name: item.Name, - Library: l.Destination.ID, - DiskStorage: storage, - VMHomeStorage: storage, - Placement: &Placement{ - Folder: deploy.Target.FolderID, - ResourcePool: deploy.Target.ResourcePoolID, - }, - } - - if !l.Include(item, existing[item.Name]) { - continue - } - - if err = sync(ctx, item, &deploy, &spec); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 00fc91405..37bc0452a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -796,19 +796,12 @@ github.com/vmware/govmomi/find github.com/vmware/govmomi/list github.com/vmware/govmomi/nfc github.com/vmware/govmomi/object -github.com/vmware/govmomi/ovf github.com/vmware/govmomi/property github.com/vmware/govmomi/session 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/vapi/internal -github.com/vmware/govmomi/vapi/library github.com/vmware/govmomi/vapi/rest -github.com/vmware/govmomi/vapi/vcenter github.com/vmware/govmomi/vim25 github.com/vmware/govmomi/vim25/debug github.com/vmware/govmomi/vim25/methods @@ -955,7 +948,6 @@ golang.org/x/crypto/ssh/terminal golang.org/x/lint golang.org/x/lint/golint # golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2 -## explicit golang.org/x/mobile/event/key # golang.org/x/mod v0.3.0 ## explicit From 41c66d69357be5c2bef039cd79e01bd79fc1fee5 Mon Sep 17 00:00:00 2001 From: sylviamoss <moss@hashicorp.com> Date: Fri, 9 Apr 2021 17:58:56 +0200 Subject: [PATCH 3/7] vendor vsphere plugin --- command/vendored_plugins.go | 20 +- go.mod | 4 +- go.sum | 8 +- .../hashicorp/packer-plugin-vsphere/LICENSE | 373 ++++++ .../builder/vsphere/clone/builder.go | 175 +++ .../builder/vsphere/clone/config.go | 104 ++ .../builder/vsphere/clone/config.hcl2spec.go | 282 +++++ .../builder/vsphere/clone/step_clone.go | 136 ++ .../vsphere/clone/step_clone.hcl2spec.go | 71 ++ .../builder/vsphere/clone/step_customize.go | 276 +++++ .../vsphere/clone/step_customize.hcl2spec.go | 155 +++ .../builder/vsphere/common/artifact.go | 50 + .../builder/vsphere/common/cleanup_vm.go | 30 + .../builder/vsphere/common/config_location.go | 53 + .../common/config_location.hcl2spec.go | 43 + .../builder/vsphere/common/config_ssh.go | 15 + .../builder/vsphere/common/output_config.go | 59 + .../vsphere/common/output_config.hcl2spec.go | 35 + .../builder/vsphere/common/step_add_cdrom.go | 81 ++ .../vsphere/common/step_add_cdrom.hcl2spec.go | 33 + .../builder/vsphere/common/step_add_floppy.go | 111 ++ .../common/step_add_floppy.hcl2spec.go | 37 + .../vsphere/common/step_boot_command.go | 152 +++ .../vsphere/common/step_config_params.go | 65 + .../common/step_config_params.hcl2spec.go | 35 + .../builder/vsphere/common/step_connect.go | 64 + .../vsphere/common/step_connect.hcl2spec.go | 39 + .../builder/vsphere/common/step_download.go | 68 + .../builder/vsphere/common/step_export.go | 338 +++++ .../vsphere/common/step_export.hcl2spec.go | 45 + .../builder/vsphere/common/step_hardware.go | 98 ++ .../vsphere/common/step_hardware.hcl2spec.go | 57 + .../vsphere/common/step_http_ip_discover.go | 68 + .../common/step_import_to_content_library.go | 180 +++ ...step_import_to_content_library.hcl2spec.go | 49 + .../vsphere/common/step_remote_upload.go | 117 ++ .../vsphere/common/step_remove_cdrom.go | 46 + .../common/step_remove_cdrom.hcl2spec.go | 31 + .../vsphere/common/step_remove_floppy.go | 49 + .../builder/vsphere/common/step_run.go | 80 ++ .../vsphere/common/step_run.hcl2spec.go | 31 + .../builder/vsphere/common/step_shutdown.go | 109 ++ .../vsphere/common/step_shutdown.hcl2spec.go | 35 + .../builder/vsphere/common/step_snapshot.go | 32 + .../vsphere/common/step_ssh_key_pair.go | 115 ++ .../builder/vsphere/common/step_template.go | 31 + .../vsphere/common/step_wait_for_ip.go | 182 +++ .../common/step_wait_for_ip.hcl2spec.go | 35 + .../builder/vsphere/common/storage_config.go | 118 ++ .../vsphere/common/storage_config.hcl2spec.go | 62 + .../builder/vsphere/driver/cluster.go | 19 + .../builder/vsphere/driver/datastore.go | 235 ++++ .../builder/vsphere/driver/datastore_mock.go | 81 ++ .../builder/vsphere/driver/disk.go | 85 ++ .../builder/vsphere/driver/driver.go | 129 ++ .../builder/vsphere/driver/driver_mock.go | 119 ++ .../builder/vsphere/driver/folder.go | 93 ++ .../builder/vsphere/driver/host.go | 45 + .../builder/vsphere/driver/library.go | 113 ++ .../builder/vsphere/driver/network.go | 77 ++ .../builder/vsphere/driver/resource_pool.go | 91 ++ .../builder/vsphere/driver/vm.go | 1102 +++++++++++++++++ .../builder/vsphere/driver/vm_cdrom.go | 89 ++ .../builder/vsphere/driver/vm_keyboard.go | 39 + .../builder/vsphere/driver/vm_mock.go | 235 ++++ .../builder/vsphere/iso/builder.go | 179 +++ .../builder/vsphere/iso/config.go | 107 ++ .../builder/vsphere/iso/config.hcl2spec.go | 286 +++++ .../builder/vsphere/iso/step_create.go | 188 +++ .../vsphere/iso/step_create.hcl2spec.go | 73 ++ .../vsphere-template/post-processor.go | 160 +++ .../post-processor.hcl2spec.go | 65 + .../step_choose_datacenter.go | 35 + .../vsphere-template/step_create_folder.go | 86 ++ .../vsphere-template/step_create_snapshot.go | 76 ++ .../vsphere-template/step_mark_as_template.go | 186 +++ .../post-processor/vsphere/artifact.go | 47 + .../post-processor/vsphere/post-processor.go | 280 +++++ .../vsphere/post-processor.hcl2spec.go | 75 ++ .../github.com/vmware/govmomi/.goreleaser.yml | 2 + vendor/github.com/vmware/govmomi/.mailmap | 3 + vendor/github.com/vmware/govmomi/.travis.yml | 11 +- vendor/github.com/vmware/govmomi/CHANGELOG.md | 14 + vendor/github.com/vmware/govmomi/CONTRIBUTORS | 32 +- vendor/github.com/vmware/govmomi/README.md | 2 + .../github.com/vmware/govmomi/find/finder.go | 35 +- .../vmware/govmomi/internal/helpers.go | 38 + .../vmware/govmomi/internal/methods.go | 123 ++ .../vmware/govmomi/internal/types.go | 270 ++++ .../govmomi/object/authorization_manager.go | 47 + .../vmware/govmomi/object/virtual_app.go | 16 + .../govmomi/object/virtual_device_list.go | 8 +- .../vmware/govmomi/object/virtual_machine.go | 136 +- vendor/github.com/vmware/govmomi/ovf/cim.go | 128 ++ vendor/github.com/vmware/govmomi/ovf/doc.go | 25 + vendor/github.com/vmware/govmomi/ovf/env.go | 99 ++ .../github.com/vmware/govmomi/ovf/envelope.go | 208 ++++ .../github.com/vmware/govmomi/ovf/manager.go | 103 ++ vendor/github.com/vmware/govmomi/ovf/ovf.go | 35 + .../vmware/govmomi/session/manager.go | 11 + .../vmware/govmomi/vapi/library/library.go | 308 +++++ .../govmomi/vapi/library/library_file.go | 56 + .../govmomi/vapi/library/library_item.go | 180 +++ .../library_item_downloadsession_file.go | 71 ++ .../library/library_item_updatesession.go | 165 +++ .../library_item_updatesession_file.go | 149 +++ .../vmware/govmomi/vapi/rest/client.go | 23 +- .../vmware/govmomi/vapi/rest/resource.go | 9 +- .../govmomi/vapi/vcenter/vcenter_ovf.go | 304 +++++ .../govmomi/vapi/vcenter/vcenter_vmtx.go | 285 +++++ .../vmware/govmomi/vim25/methods/methods.go | 40 + .../github.com/vmware/govmomi/vim25/retry.go | 72 +- .../vmware/govmomi/vim25/soap/client.go | 23 +- .../vmware/govmomi/vim25/soap/error.go | 10 + .../vmware/govmomi/vim25/types/enum.go | 388 +++--- .../vmware/govmomi/vim25/types/helpers.go | 6 + .../vmware/govmomi/vim25/types/if.go | 20 +- .../vmware/govmomi/vim25/types/types.go | 281 ++++- .../vmware/govmomi/vim25/xml/marshal.go | 18 +- .../vmware/govmomi/vim25/xml/read.go | 18 +- .../vmware/govmomi/vim25/xml/typeinfo.go | 24 +- .../vmware/govmomi/vim25/xml/xml.go | 9 +- vendor/modules.txt | 16 +- 123 files changed, 12354 insertions(+), 344 deletions(-) create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/LICENSE create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/builder.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/artifact.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/cleanup_vm.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_ssh.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_boot_command.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_download.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_http_ip_discover.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remote_upload.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_floppy.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_snapshot.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_ssh_key_pair.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_template.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/cluster.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore_mock.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/disk.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver_mock.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/folder.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/host.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/library.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/network.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/resource_pool.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_cdrom.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_keyboard.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_mock.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/builder.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.hcl2spec.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_choose_datacenter.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_folder.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_snapshot.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_mark_as_template.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/artifact.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.go create mode 100644 vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.hcl2spec.go create mode 100644 vendor/github.com/vmware/govmomi/internal/helpers.go create mode 100644 vendor/github.com/vmware/govmomi/internal/methods.go create mode 100644 vendor/github.com/vmware/govmomi/internal/types.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/cim.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/doc.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/env.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/envelope.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/manager.go create mode 100644 vendor/github.com/vmware/govmomi/ovf/ovf.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_file.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index eea52e9d5..092bd4b90 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -20,6 +20,10 @@ import ( dockerpushpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-push" dockersavepostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-save" dockertagpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag" + vsphereclonebuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone" + vsphereisobuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso" + vspherepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" + vspheretemplatepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template" ) // VendoredDatasources are datasource components that were once bundled with the @@ -38,6 +42,8 @@ var VendoredBuilders = map[string]packersdk.Builder{ "amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder), "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), "amazon-instance": new(amazoninstancebuilder.Builder), + "vsphere-clone": new(vsphereclonebuilder.Builder), + "vsphere-iso": new(vsphereisobuilder.Builder), } // VendoredProvisioners are provisioner components that were once bundled with the @@ -47,12 +53,14 @@ var VendoredProvisioners = map[string]packersdk.Provisioner{} // VendoredPostProcessors are post-processor components that were once bundled with the // Packer core, but are now being imported from their counterpart plugin repos var VendoredPostProcessors = map[string]packersdk.PostProcessor{ - "docker-import": new(dockerimportpostprocessor.PostProcessor), - "docker-push": new(dockerpushpostprocessor.PostProcessor), - "docker-save": new(dockersavepostprocessor.PostProcessor), - "docker-tag": new(dockertagpostprocessor.PostProcessor), - "exoscale-import": new(exoscaleimportpostprocessor.PostProcessor), - "amazon-import": new(anazibimportpostprocessor.PostProcessor), + "docker-import": new(dockerimportpostprocessor.PostProcessor), + "docker-push": new(dockerpushpostprocessor.PostProcessor), + "docker-save": new(dockersavepostprocessor.PostProcessor), + "docker-tag": new(dockertagpostprocessor.PostProcessor), + "exoscale-import": new(exoscaleimportpostprocessor.PostProcessor), + "amazon-import": new(anazibimportpostprocessor.PostProcessor), + "vsphere": new(vspherepostprocessor.PostProcessor), + "vsphere-template": new(vspheretemplatepostprocessor.PostProcessor), } // Upon init lets load up any plugins that were vendored manually into the default diff --git a/go.mod b/go.mod index 797690093..d59a5cfe8 100644 --- a/go.mod +++ b/go.mod @@ -53,6 +53,7 @@ require ( github.com/hashicorp/packer-plugin-amazon v0.0.1 github.com/hashicorp/packer-plugin-docker v0.0.7 github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf + github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe github.com/hashicorp/vault/api v1.0.4 github.com/hetznercloud/hcloud-go v1.15.1 github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 @@ -83,7 +84,8 @@ require ( github.com/ucloud/ucloud-sdk-go v0.16.3 github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6 github.com/ulikunitz/xz v0.5.6 - github.com/vmware/govmomi v0.23.1 + github.com/ulikunitz/xz v0.5.5 + github.com/vmware/govmomi v0.24.1 github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd github.com/yandex-cloud/go-sdk v0.0.0-20200921111412-ef15ded2014c diff --git a/go.sum b/go.sum index e1e5eed6e..df88fba60 100644 --- a/go.sum +++ b/go.sum @@ -450,6 +450,8 @@ github.com/hashicorp/packer-plugin-sdk v0.1.1/go.mod h1:1d3nqB9LUsXMQaNUiL67Q+WY github.com/hashicorp/packer-plugin-sdk v0.1.2/go.mod h1:KRjczE1/c9NV5Re+PXt3myJsVTI/FxEHpZjRjOH0Fug= github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf h1:0DBlIExTDefzbfkOl213QtgJsVJXWdgW/aIQIvYUMzs= github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf/go.mod h1:xePpgQgQYv/bamiypx3hH9ukidxDdcN8q0R0wLi8IEQ= +github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe h1:qUU0ctLV5Pjq+RqxaKlVmKhE1BQtWZvqV4a05cF93PY= +github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe/go.mod h1:ZmA5O2CDiIOGW/hvHbhxNzq2hEXDYyUVj+knuoxyWu0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.2 h1:yJoyfZXo4Pk2p/M/viW+YLibBFiIbKoP79gu7kDAFP0= github.com/hashicorp/serf v0.9.2/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= @@ -695,8 +697,9 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmware/govmomi v0.23.1 h1:vU09hxnNR/I7e+4zCJvW+5vHu5dO64Aoe2Lw7Yi/KRg= github.com/vmware/govmomi v0.23.1/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= +github.com/vmware/govmomi v0.24.1 h1:ecVvrxF28/5g738gLTiYgc62fpGfIPRKheQ1Dj1p35w= +github.com/vmware/govmomi v0.24.1/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk= github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 h1:NJrcIkdzq0C3I8ypAZwFE9RHtGbfp+mJvqIcoFATZuk= github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0/go.mod h1:sBh287mCRwCz6zyXHMmw7sSZGPohVpnx+o+OY4M+i3A= @@ -773,8 +776,9 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20191130191448-5c0e7e404af8/go.mod h1:p895TfNkDgPEmEQrNiOtIl3j98d/tGU95djDj7NfyjQ= -golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2 h1:3HADozU50HyrJ2jklLtr3xr0itFkz9u4LxCJhqKVdjI= golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 h1:h+GZ3ubjuWaQjGe8owMGcmMVCqs0xYJtRG5y2bpHaqU= +golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/LICENSE b/vendor/github.com/hashicorp/packer-plugin-vsphere/LICENSE new file mode 100644 index 000000000..a612ad981 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/builder.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/builder.go new file mode 100644 index 000000000..f7e4e8063 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/builder.go @@ -0,0 +1,175 @@ +package clone + +import ( + "context" + "fmt" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/multistep" + "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type Builder struct { + config Config + runner multistep.Runner +} + +func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } + +func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { + warnings, errs := b.config.Prepare(raws...) + if errs != nil { + return nil, warnings, errs + } + + return nil, warnings, nil +} + +func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { + state := new(multistep.BasicStateBag) + state.Put("debug", b.config.PackerDebug) + state.Put("hook", hook) + state.Put("ui", ui) + + var steps []multistep.Step + + steps = append(steps, + &common.StepConnect{ + Config: &b.config.ConnectConfig, + }, + &commonsteps.StepCreateCD{ + Files: b.config.CDConfig.CDFiles, + Label: b.config.CDConfig.CDLabel, + }, + &common.StepRemoteUpload{ + Datastore: b.config.Datastore, + Host: b.config.Host, + SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, + }, + &StepCloneVM{ + Config: &b.config.CloneConfig, + Location: &b.config.LocationConfig, + Force: b.config.PackerConfig.PackerForce, + }, + &common.StepConfigureHardware{ + Config: &b.config.HardwareConfig, + }, + &common.StepAddCDRom{ + Config: &b.config.CDRomConfig, + }, + &common.StepConfigParams{ + Config: &b.config.ConfigParamsConfig, + }, + ) + + if b.config.CustomizeConfig != nil { + steps = append(steps, &StepCustomize{ + Config: b.config.CustomizeConfig, + }) + } + + if b.config.Comm.Type != "none" { + steps = append(steps, + &commonsteps.StepCreateFloppy{ + Files: b.config.FloppyFiles, + Directories: b.config.FloppyDirectories, + Label: b.config.FloppyLabel, + }, + &common.StepAddFloppy{ + Config: &b.config.FloppyConfig, + Datastore: b.config.Datastore, + Host: b.config.Host, + SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, + }, + &common.StepHTTPIPDiscover{ + HTTPIP: b.config.BootConfig.HTTPIP, + Network: b.config.WaitIpConfig.GetIPNet(), + }, + commonsteps.HTTPServerFromHTTPConfig(&b.config.HTTPConfig), + &common.StepSshKeyPair{ + Debug: b.config.PackerDebug, + DebugKeyPath: fmt.Sprintf("%s.pem", b.config.PackerBuildName), + Comm: &b.config.Comm, + }, + &common.StepRun{ + Config: &b.config.RunConfig, + SetOrder: false, + }, + &common.StepBootCommand{ + Config: &b.config.BootConfig, + Ctx: b.config.ctx, + VMName: b.config.VMName, + }, + &common.StepWaitForIp{ + Config: &b.config.WaitIpConfig, + }, + &communicator.StepConnect{ + Config: &b.config.Comm, + Host: common.CommHost(b.config.Comm.Host()), + SSHConfig: b.config.Comm.SSHConfigFunc(), + }, + &commonsteps.StepProvision{}, + &common.StepShutdown{ + Config: &b.config.ShutdownConfig, + }, + &common.StepRemoveFloppy{ + Datastore: b.config.Datastore, + Host: b.config.Host, + }, + ) + } + + steps = append(steps, + &common.StepRemoveCDRom{ + Config: &b.config.RemoveCDRomConfig, + }, + &common.StepCreateSnapshot{ + CreateSnapshot: b.config.CreateSnapshot, + }, + &common.StepConvertToTemplate{ + ConvertToTemplate: b.config.ConvertToTemplate, + }, + ) + + if b.config.ContentLibraryDestinationConfig != nil { + steps = append(steps, &common.StepImportToContentLibrary{ + ContentLibConfig: b.config.ContentLibraryDestinationConfig, + }) + } + + if b.config.Export != nil { + steps = append(steps, &common.StepExport{ + Name: b.config.Export.Name, + Force: b.config.Export.Force, + Images: b.config.Export.Images, + Manifest: b.config.Export.Manifest, + OutputDir: b.config.Export.OutputDir.OutputDir, + Options: b.config.Export.Options, + }) + } + + b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) + b.runner.Run(ctx, state) + + if rawErr, ok := state.GetOk("error"); ok { + return nil, rawErr.(error) + } + + if _, ok := state.GetOk("vm"); !ok { + return nil, nil + } + artifact := &common.Artifact{ + Name: b.config.VMName, + VM: state.Get("vm").(*driver.VirtualMachineDriver), + StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, + } + if b.config.Export != nil { + artifact.Outconfig = &b.config.Export.OutputDir + } + + return artifact, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.go new file mode 100644 index 000000000..900e901f7 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.go @@ -0,0 +1,104 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type Config + +package clone + +import ( + packerCommon "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" +) + +type Config struct { + packerCommon.PackerConfig `mapstructure:",squash"` + commonsteps.HTTPConfig `mapstructure:",squash"` + commonsteps.CDConfig `mapstructure:",squash"` + + common.ConnectConfig `mapstructure:",squash"` + CloneConfig `mapstructure:",squash"` + common.LocationConfig `mapstructure:",squash"` + common.HardwareConfig `mapstructure:",squash"` + common.ConfigParamsConfig `mapstructure:",squash"` + + common.CDRomConfig `mapstructure:",squash"` + common.RemoveCDRomConfig `mapstructure:",squash"` + common.FloppyConfig `mapstructure:",squash"` + common.RunConfig `mapstructure:",squash"` + common.BootConfig `mapstructure:",squash"` + common.WaitIpConfig `mapstructure:",squash"` + Comm communicator.Config `mapstructure:",squash"` + common.ShutdownConfig `mapstructure:",squash"` + + // Create a snapshot when set to `true`, so the VM can be used as a base + // for linked clones. Defaults to `false`. + CreateSnapshot bool `mapstructure:"create_snapshot"` + // Convert VM to a template. Defaults to `false`. + ConvertToTemplate bool `mapstructure:"convert_to_template"` + // Configuration for exporting VM to an ovf file. + // The VM will not be exported if no [Export Configuration](#export-configuration) is specified. + Export *common.ExportConfig `mapstructure:"export"` + // Configuration for importing a VM template or OVF template to a Content Library. + // The template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. + // The import doesn't work if [convert_to_template](#convert_to_template) is set to true. + ContentLibraryDestinationConfig *common.ContentLibraryDestinationConfig `mapstructure:"content_library_destination"` + // Customize the cloned VM to configure host, network, or licensing settings. See the [customization options](#customization). + CustomizeConfig *CustomizeConfig `mapstructure:"customize"` + + ctx interpolate.Context +} + +func (c *Config) Prepare(raws ...interface{}) ([]string, error) { + err := config.Decode(c, &config.DecodeOpts{ + PluginType: common.BuilderId, + Interpolate: true, + InterpolateContext: &c.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{ + "boot_command", + }, + }, + }, raws...) + if err != nil { + return nil, err + } + + // warnings := make([]string, 0) + errs := new(packersdk.MultiError) + + errs = packersdk.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.CloneConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.LocationConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.HTTPConfig.Prepare(&c.ctx)...) + + errs = packersdk.MultiErrorAppend(errs, c.CDRomConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.CDConfig.Prepare(&c.ctx)...) + errs = packersdk.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) + errs = packersdk.MultiErrorAppend(errs, c.WaitIpConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) + + _, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) + // shutdownWarnings, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) + // warnings = append(warnings, shutdownWarnings...) + errs = packersdk.MultiErrorAppend(errs, shutdownErrs...) + + if c.Export != nil { + errs = packersdk.MultiErrorAppend(errs, c.Export.Prepare(&c.ctx, &c.LocationConfig, &c.PackerConfig)...) + } + if c.ContentLibraryDestinationConfig != nil { + errs = packersdk.MultiErrorAppend(errs, c.ContentLibraryDestinationConfig.Prepare(&c.LocationConfig)...) + } + if c.CustomizeConfig != nil { + errs = packersdk.MultiErrorAppend(errs, c.CustomizeConfig.Prepare()...) + } + + if len(errs.Errors) > 0 { + return nil, errs + } + + return nil, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.hcl2spec.go new file mode 100644 index 000000000..4ca2c4fb9 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/config.hcl2spec.go @@ -0,0 +1,282 @@ +// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. + +package clone + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + HTTPDir *string `mapstructure:"http_directory" cty:"http_directory" hcl:"http_directory"` + HTTPContent map[string]string `mapstructure:"http_content" cty:"http_content" hcl:"http_content"` + HTTPPortMin *int `mapstructure:"http_port_min" cty:"http_port_min" hcl:"http_port_min"` + HTTPPortMax *int `mapstructure:"http_port_max" cty:"http_port_max" hcl:"http_port_max"` + HTTPAddress *string `mapstructure:"http_bind_address" cty:"http_bind_address" hcl:"http_bind_address"` + HTTPInterface *string `mapstructure:"http_interface" undocumented:"true" cty:"http_interface" hcl:"http_interface"` + CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"` + CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"` + VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` + Username *string `mapstructure:"username" cty:"username" hcl:"username"` + Password *string `mapstructure:"password" cty:"password" hcl:"password"` + InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` + Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` + Template *string `mapstructure:"template" cty:"template" hcl:"template"` + DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` + LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` + Network *string `mapstructure:"network" cty:"network" hcl:"network"` + MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` + Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` + DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` + Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` + VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` + Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` + Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` + Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` + SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` + CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` + CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` + CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` + CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` + CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` + RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` + RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` + RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` + MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` + VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` + VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` + NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` + Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` + ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` + ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` + ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` + ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` + CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` + ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` + RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` + FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` + FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` + FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` + FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` + BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` + BootGroupInterval *string `mapstructure:"boot_keygroup_interval" cty:"boot_keygroup_interval" hcl:"boot_keygroup_interval"` + BootWait *string `mapstructure:"boot_wait" cty:"boot_wait" hcl:"boot_wait"` + BootCommand []string `mapstructure:"boot_command" cty:"boot_command" hcl:"boot_command"` + HTTPIP *string `mapstructure:"http_ip" cty:"http_ip" hcl:"http_ip"` + WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` + SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` + WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` + Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` + PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` + SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` + SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` + SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` + SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` + SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` + SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` + SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` + SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` + SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` + SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` + SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` + SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` + SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` + SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` + SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` + SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` + SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` + SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` + SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` + SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` + SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` + SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` + SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` + SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` + SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` + SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` + SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` + SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` + SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` + WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` + WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` + WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` + WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` + WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` + WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` + WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` + WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` + WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` + Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` + Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` + DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` + CreateSnapshot *bool `mapstructure:"create_snapshot" cty:"create_snapshot" hcl:"create_snapshot"` + ConvertToTemplate *bool `mapstructure:"convert_to_template" cty:"convert_to_template" hcl:"convert_to_template"` + Export *common.FlatExportConfig `mapstructure:"export" cty:"export" hcl:"export"` + ContentLibraryDestinationConfig *common.FlatContentLibraryDestinationConfig `mapstructure:"content_library_destination" cty:"content_library_destination" hcl:"content_library_destination"` + CustomizeConfig *FlatCustomizeConfig `mapstructure:"customize" cty:"customize" hcl:"customize"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "http_directory": &hcldec.AttrSpec{Name: "http_directory", Type: cty.String, Required: false}, + "http_content": &hcldec.AttrSpec{Name: "http_content", Type: cty.Map(cty.String), Required: false}, + "http_port_min": &hcldec.AttrSpec{Name: "http_port_min", Type: cty.Number, Required: false}, + "http_port_max": &hcldec.AttrSpec{Name: "http_port_max", Type: cty.Number, Required: false}, + "http_bind_address": &hcldec.AttrSpec{Name: "http_bind_address", Type: cty.String, Required: false}, + "http_interface": &hcldec.AttrSpec{Name: "http_interface", Type: cty.String, Required: false}, + "cd_files": &hcldec.AttrSpec{Name: "cd_files", Type: cty.List(cty.String), Required: false}, + "cd_label": &hcldec.AttrSpec{Name: "cd_label", Type: cty.String, Required: false}, + "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, + "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, + "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, + "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, + "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, + "template": &hcldec.AttrSpec{Name: "template", Type: cty.String, Required: false}, + "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, + "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, + "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, + "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, + "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, + "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, + "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, + "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, + "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, + "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, + "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, + "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, + "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, + "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, + "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, + "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, + "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, + "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, + "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, + "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, + "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, + "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, + "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, + "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, + "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, + "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, + "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, + "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, + "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, + "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, + "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, + "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, + "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, + "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, + "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, + "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, + "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, + "boot_keygroup_interval": &hcldec.AttrSpec{Name: "boot_keygroup_interval", Type: cty.String, Required: false}, + "boot_wait": &hcldec.AttrSpec{Name: "boot_wait", Type: cty.String, Required: false}, + "boot_command": &hcldec.AttrSpec{Name: "boot_command", Type: cty.List(cty.String), Required: false}, + "http_ip": &hcldec.AttrSpec{Name: "http_ip", Type: cty.String, Required: false}, + "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, + "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, + "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, + "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, + "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, + "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, + "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, + "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, + "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, + "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, + "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, + "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, + "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, + "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, + "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, + "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, + "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, + "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, + "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, + "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, + "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, + "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, + "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, + "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, + "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, + "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, + "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, + "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, + "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, + "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, + "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, + "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, + "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, + "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, + "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, + "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, + "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, + "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, + "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, + "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, + "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, + "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, + "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, + "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, + "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, + "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, + "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, + "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, + "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, + "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, + "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, + "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, + "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, + "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, + "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, + "create_snapshot": &hcldec.AttrSpec{Name: "create_snapshot", Type: cty.Bool, Required: false}, + "convert_to_template": &hcldec.AttrSpec{Name: "convert_to_template", Type: cty.Bool, Required: false}, + "export": &hcldec.BlockSpec{TypeName: "export", Nested: hcldec.ObjectSpec((*common.FlatExportConfig)(nil).HCL2Spec())}, + "content_library_destination": &hcldec.BlockSpec{TypeName: "content_library_destination", Nested: hcldec.ObjectSpec((*common.FlatContentLibraryDestinationConfig)(nil).HCL2Spec())}, + "customize": &hcldec.BlockSpec{TypeName: "customize", Nested: hcldec.ObjectSpec((*FlatCustomizeConfig)(nil).HCL2Spec())}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.go new file mode 100644 index 000000000..3d6021f83 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.go @@ -0,0 +1,136 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type CloneConfig,vAppConfig + +package clone + +import ( + "context" + "fmt" + "path" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type vAppConfig struct { + // Set values for the available vApp Properties to supply configuration parameters to a virtual machine cloned from + // a template that came from an imported OVF or OVA file. + // + // -> **Note:** The only supported usage path for vApp properties is for existing user-configurable keys. + // These generally come from an existing template that was created from an imported OVF or OVA file. + // You cannot set values for vApp properties on virtual machines created from scratch, + // virtual machines lacking a vApp configuration, or on property keys that do not exist. + Properties map[string]string `mapstructure:"properties"` +} + +type CloneConfig struct { + // Name of source VM. Path is optional. + Template string `mapstructure:"template"` + // The size of the disk in MB. + DiskSize int64 `mapstructure:"disk_size"` + // Create VM as a linked clone from latest snapshot. Defaults to `false`. + LinkedClone bool `mapstructure:"linked_clone"` + // Set the network in which the VM will be connected to. If no network is + // specified, `host` must be specified to allow Packer to look for the + // available network. If the network is inside a network folder in vCenter, + // you need to provide the full path to the network. + Network string `mapstructure:"network"` + // Sets a custom Mac Address to the network adapter. If set, the [network](#network) must be also specified. + MacAddress string `mapstructure:"mac_address"` + // VM notes. + Notes string `mapstructure:"notes"` + // Set the vApp Options to a virtual machine. + // See the [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) + // to know the available options and how to use it. + VAppConfig vAppConfig `mapstructure:"vapp"` + StorageConfig common.StorageConfig `mapstructure:",squash"` +} + +func (c *CloneConfig) Prepare() []error { + var errs []error + errs = append(errs, c.StorageConfig.Prepare()...) + + if c.Template == "" { + errs = append(errs, fmt.Errorf("'template' is required")) + } + + if c.LinkedClone == true && c.DiskSize != 0 { + errs = append(errs, fmt.Errorf("'linked_clone' and 'disk_size' cannot be used together")) + } + + if c.MacAddress != "" && c.Network == "" { + errs = append(errs, fmt.Errorf("'network' is required when 'mac_address' is specified")) + } + + return errs +} + +type StepCloneVM struct { + Config *CloneConfig + Location *common.LocationConfig + Force bool +} + +func (s *StepCloneVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + d := state.Get("driver").(driver.Driver) + vmPath := path.Join(s.Location.Folder, s.Location.VMName) + + err := d.PreCleanVM(ui, vmPath, s.Force) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + ui.Say("Cloning VM...") + template, err := d.FindVM(s.Config.Template) + if err != nil { + state.Put("error", fmt.Errorf("Error finding vm to clone: %s", err)) + return multistep.ActionHalt + } + + var disks []driver.Disk + for _, disk := range s.Config.StorageConfig.Storage { + disks = append(disks, driver.Disk{ + DiskSize: disk.DiskSize, + DiskEagerlyScrub: disk.DiskEagerlyScrub, + DiskThinProvisioned: disk.DiskThinProvisioned, + ControllerIndex: disk.DiskControllerIndex, + }) + } + + vm, err := template.Clone(ctx, &driver.CloneConfig{ + Name: s.Location.VMName, + Folder: s.Location.Folder, + Cluster: s.Location.Cluster, + Host: s.Location.Host, + ResourcePool: s.Location.ResourcePool, + Datastore: s.Location.Datastore, + LinkedClone: s.Config.LinkedClone, + Network: s.Config.Network, + MacAddress: s.Config.MacAddress, + Annotation: s.Config.Notes, + VAppProperties: s.Config.VAppConfig.Properties, + PrimaryDiskSize: s.Config.DiskSize, + StorageConfig: driver.StorageConfig{ + DiskControllerType: s.Config.StorageConfig.DiskControllerType, + Storage: disks, + }, + }) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + if vm == nil { + return multistep.ActionHalt + } + state.Put("vm", vm) + + return multistep.ActionContinue +} + +func (s *StepCloneVM) Cleanup(state multistep.StateBag) { + common.CleanupVM(state) +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.hcl2spec.go new file mode 100644 index 000000000..e02a3c174 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_clone.hcl2spec.go @@ -0,0 +1,71 @@ +// Code generated by "mapstructure-to-hcl2 -type CloneConfig,vAppConfig"; DO NOT EDIT. + +package clone + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/zclconf/go-cty/cty" +) + +// FlatCloneConfig is an auto-generated flat version of CloneConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatCloneConfig struct { + Template *string `mapstructure:"template" cty:"template" hcl:"template"` + DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` + LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` + Network *string `mapstructure:"network" cty:"network" hcl:"network"` + MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` + Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` + DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` + Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` +} + +// FlatMapstructure returns a new FlatCloneConfig. +// FlatCloneConfig is an auto-generated flat version of CloneConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*CloneConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatCloneConfig) +} + +// HCL2Spec returns the hcl spec of a CloneConfig. +// This spec is used by HCL to read the fields of CloneConfig. +// The decoded values from this spec will then be applied to a FlatCloneConfig. +func (*FlatCloneConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "template": &hcldec.AttrSpec{Name: "template", Type: cty.String, Required: false}, + "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, + "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, + "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, + "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, + "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, + "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, + "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, + } + return s +} + +// FlatvAppConfig is an auto-generated flat version of vAppConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatvAppConfig struct { + Properties map[string]string `mapstructure:"properties" cty:"properties" hcl:"properties"` +} + +// FlatMapstructure returns a new FlatvAppConfig. +// FlatvAppConfig is an auto-generated flat version of vAppConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*vAppConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatvAppConfig) +} + +// HCL2Spec returns the hcl spec of a vAppConfig. +// This spec is used by HCL to read the fields of vAppConfig. +// The decoded values from this spec will then be applied to a FlatvAppConfig. +func (*FlatvAppConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "properties": &hcldec.AttrSpec{Name: "properties", Type: cty.Map(cty.String), Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.go new file mode 100644 index 000000000..86714317a --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.go @@ -0,0 +1,276 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type CustomizeConfig,LinuxOptions,NetworkInterfaces,NetworkInterface,GlobalDnsSettings,GlobalRoutingSettings +package clone + +import ( + "context" + "fmt" + "io/ioutil" + "net" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" + "github.com/vmware/govmomi/vim25/types" +) + +// A cloned virtual machine can be [customized](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-58E346FF-83AE-42B8-BE58-253641D257BC.html) +// to configure host, network, or licensing settings. +// +// To perform virtual machine customization as a part of the clone process, specify the customize block with the +// respective customization options. Windows guests are customized using Sysprep, which will result in the machine SID being reset. +// Before using customization, check that your source VM meets the [requirements](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-E63B6FAA-8D35-428D-B40C-744769845906.html) +// for guest OS customization on vSphere. +// See the [customization example](#customization-example) for a usage synopsis. +// +// The settings for customize are as follows: +type CustomizeConfig struct { + // Settings to Linux guest OS customization. See [Linux customization settings](#linux-customization-settings). + LinuxOptions *LinuxOptions `mapstructure:"linux_options"` + // Supply your own sysprep.xml file to allow full control of the customization process out-of-band of vSphere. + WindowsSysPrepFile string `mapstructure:"windows_sysprep_file"` + // Configure network interfaces on a per-interface basis that should matched up to the network adapters present in the VM. + // To use DHCP, declare an empty network_interface for each adapter being configured. This field is required. + // See [Network interface settings](#network-interface-settings). + NetworkInterfaces NetworkInterfaces `mapstructure:"network_interface"` + GlobalRoutingSettings `mapstructure:",squash"` + GlobalDnsSettings `mapstructure:",squash"` +} + +type LinuxOptions struct { + // The domain name for this machine. This, along with [host_name](#host_name), make up the FQDN of this virtual machine. + Domain string `mapstructure:"domain"` + // The host name for this machine. This, along with [domain](#domain), make up the FQDN of this virtual machine. + Hostname string `mapstructure:"host_name"` + // Tells the operating system that the hardware clock is set to UTC. Default: true. + HWClockUTC config.Trilean `mapstructure:"hw_clock_utc"` + // Sets the time zone. The default is UTC. + Timezone string `mapstructure:"time_zone"` +} + +type NetworkInterface struct { + // Network interface-specific DNS server settings for Windows operating systems. + // Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. + DnsServerList []string `mapstructure:"dns_server_list"` + // Network interface-specific DNS search domain for Windows operating systems. + // Ignored on Linux and possibly other operating systems - for those systems, please see the [global DNS settings](#global-dns-settings) section. + DnsDomain string `mapstructure:"dns_domain"` + // The IPv4 address assigned to this network adapter. If left blank or not included, DHCP is used. + Ipv4Address string `mapstructure:"ipv4_address"` + // The IPv4 subnet mask, in bits (example: 24 for 255.255.255.0). + Ipv4NetMask int `mapstructure:"ipv4_netmask"` + // The IPv6 address assigned to this network adapter. If left blank or not included, auto-configuration is used. + Ipv6Address string `mapstructure:"ipv6_address"` + // The IPv6 subnet mask, in bits (example: 32). + Ipv6NetMask int `mapstructure:"ipv6_netmask"` +} + +type NetworkInterfaces []NetworkInterface + +// The settings here must match the IP/mask of at least one network_interface supplied to customization. +type GlobalRoutingSettings struct { + // The IPv4 default gateway when using network_interface customization on the virtual machine. + Ipv4Gateway string `mapstructure:"ipv4_gateway"` + // The IPv6 default gateway when using network_interface customization on the virtual machine. + Ipv6Gateway string `mapstructure:"ipv6_gateway"` +} + +// The following settings configure DNS globally, generally for Linux systems. For Windows systems, +// this is done per-interface, see [network interface](#network_interface) settings. +type GlobalDnsSettings struct { + // The list of DNS servers to configure on a virtual machine. + DnsServerList []string `mapstructure:"dns_server_list"` + // A list of DNS search domains to add to the DNS configuration on the virtual machine. + DnsSuffixList []string `mapstructure:"dns_suffix_list"` +} + +type StepCustomize struct { + Config *CustomizeConfig +} + +func (c *CustomizeConfig) Prepare() []error { + var errs []error + + if c.LinuxOptions == nil && c.WindowsSysPrepFile == "" { + errs = append(errs, fmt.Errorf("customize is empty")) + } + if c.LinuxOptions != nil && c.WindowsSysPrepFile != "" { + errs = append(errs, fmt.Errorf("`linux_options` and `windows_sysprep_text` both set - one must not be included if the other is specified")) + } + + if c.LinuxOptions != nil { + if c.LinuxOptions.Hostname == "" { + errs = append(errs, fmt.Errorf("linux options `host_name` is empty")) + } + if c.LinuxOptions.Domain == "" { + errs = append(errs, fmt.Errorf("linux options `domain` is empty")) + } + + if c.LinuxOptions.HWClockUTC == config.TriUnset { + c.LinuxOptions.HWClockUTC = config.TriTrue + } + if c.LinuxOptions.Timezone == "" { + c.LinuxOptions.Timezone = "UTC" + } + } + + if len(c.NetworkInterfaces) == 0 { + errs = append(errs, fmt.Errorf("one or more `network_interface` must be provided")) + } + + return errs +} + +func (s *StepCustomize) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + vm := state.Get("vm").(*driver.VirtualMachineDriver) + ui := state.Get("ui").(packersdk.Ui) + + identity, err := s.identitySettings() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + nicSettingsMap := s.nicSettingsMap() + globalIpSettings := s.globalIpSettings() + + spec := types.CustomizationSpec{ + Identity: identity, + NicSettingMap: nicSettingsMap, + GlobalIPSettings: globalIpSettings, + } + ui.Say("Customizing VM...") + err = vm.Customize(spec) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *StepCustomize) identitySettings() (types.BaseCustomizationIdentitySettings, error) { + if s.Config.LinuxOptions != nil { + return &types.CustomizationLinuxPrep{ + HostName: &types.CustomizationFixedName{ + Name: s.Config.LinuxOptions.Hostname, + }, + Domain: s.Config.LinuxOptions.Domain, + TimeZone: s.Config.LinuxOptions.Timezone, + HwClockUTC: s.Config.LinuxOptions.HWClockUTC.ToBoolPointer(), + }, nil + } + + if s.Config.WindowsSysPrepFile != "" { + sysPrep, err := ioutil.ReadFile(s.Config.WindowsSysPrepFile) + if err != nil { + return nil, fmt.Errorf("error on reading %s: %s", s.Config.WindowsSysPrepFile, err) + } + return &types.CustomizationSysprepText{ + Value: string(sysPrep), + }, nil + } + + return nil, fmt.Errorf("no customization identity found") +} + +func (s *StepCustomize) nicSettingsMap() []types.CustomizationAdapterMapping { + result := make([]types.CustomizationAdapterMapping, len(s.Config.NetworkInterfaces)) + var ipv4gwFound, ipv6gwFound bool + for i := range s.Config.NetworkInterfaces { + var adapter types.CustomizationIPSettings + adapter, ipv4gwFound, ipv6gwFound = s.ipSettings(i, !ipv4gwFound, !ipv6gwFound) + obj := types.CustomizationAdapterMapping{ + Adapter: adapter, + } + result[i] = obj + } + return result +} + +func (s *StepCustomize) ipSettings(n int, ipv4gwAdd bool, ipv6gwAdd bool) (types.CustomizationIPSettings, bool, bool) { + var v4gwFound, v6gwFound bool + var obj types.CustomizationIPSettings + + ipv4Address := s.Config.NetworkInterfaces[n].Ipv4Address + if ipv4Address != "" { + ipv4mask := s.Config.NetworkInterfaces[n].Ipv4NetMask + ipv4Gateway := s.Config.Ipv4Gateway + obj.Ip = &types.CustomizationFixedIp{ + IpAddress: ipv4Address, + } + obj.SubnetMask = v4CIDRMaskToDotted(ipv4mask) + // Check for the gateway + if ipv4gwAdd && ipv4Gateway != "" && matchGateway(ipv4Address, ipv4mask, ipv4Gateway) { + obj.Gateway = []string{ipv4Gateway} + v4gwFound = true + } + } else { + obj.Ip = &types.CustomizationDhcpIpGenerator{} + } + + obj.DnsServerList = s.Config.NetworkInterfaces[n].DnsServerList + obj.DnsDomain = s.Config.NetworkInterfaces[n].DnsDomain + obj.IpV6Spec, v6gwFound = s.IPSettingsIPV6Address(n, ipv6gwAdd) + + return obj, v4gwFound, v6gwFound +} + +func v4CIDRMaskToDotted(mask int) string { + m := net.CIDRMask(mask, 32) + a := int(m[0]) + b := int(m[1]) + c := int(m[2]) + d := int(m[3]) + return fmt.Sprintf("%d.%d.%d.%d", a, b, c, d) +} + +func (s *StepCustomize) IPSettingsIPV6Address(n int, gwAdd bool) (*types.CustomizationIPSettingsIpV6AddressSpec, bool) { + addr := s.Config.NetworkInterfaces[n].Ipv6Address + var gwFound bool + if addr == "" { + return nil, gwFound + } + mask := s.Config.NetworkInterfaces[n].Ipv6NetMask + gw := s.Config.Ipv6Gateway + obj := &types.CustomizationIPSettingsIpV6AddressSpec{ + Ip: []types.BaseCustomizationIpV6Generator{ + &types.CustomizationFixedIpV6{ + IpAddress: addr, + SubnetMask: int32(mask), + }, + }, + } + if gwAdd && gw != "" && matchGateway(addr, mask, gw) { + obj.Gateway = []string{gw} + gwFound = true + } + return obj, gwFound +} + +// matchGateway take an IP, mask, and gateway, and checks to see if the gateway +// is reachable from the IP address. +func matchGateway(a string, m int, g string) bool { + ip := net.ParseIP(a) + gw := net.ParseIP(g) + var mask net.IPMask + if ip.To4() != nil { + mask = net.CIDRMask(m, 32) + } else { + mask = net.CIDRMask(m, 128) + } + if ip.Mask(mask).Equal(gw.Mask(mask)) { + return true + } + return false +} + +func (s *StepCustomize) globalIpSettings() types.CustomizationGlobalIPSettings { + return types.CustomizationGlobalIPSettings{ + DnsServerList: s.Config.DnsServerList, + DnsSuffixList: s.Config.DnsSuffixList, + } +} + +func (s *StepCustomize) Cleanup(_ multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.hcl2spec.go new file mode 100644 index 000000000..0634474a3 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone/step_customize.hcl2spec.go @@ -0,0 +1,155 @@ +// Code generated by "mapstructure-to-hcl2 -type CustomizeConfig,LinuxOptions,NetworkInterfaces,NetworkInterface,GlobalDnsSettings,GlobalRoutingSettings"; DO NOT EDIT. + +package clone + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatCustomizeConfig is an auto-generated flat version of CustomizeConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatCustomizeConfig struct { + LinuxOptions *FlatLinuxOptions `mapstructure:"linux_options" cty:"linux_options" hcl:"linux_options"` + WindowsSysPrepFile *string `mapstructure:"windows_sysprep_file" cty:"windows_sysprep_file" hcl:"windows_sysprep_file"` + NetworkInterfaces []FlatNetworkInterface `mapstructure:"network_interface" cty:"network_interface" hcl:"network_interface"` + Ipv4Gateway *string `mapstructure:"ipv4_gateway" cty:"ipv4_gateway" hcl:"ipv4_gateway"` + Ipv6Gateway *string `mapstructure:"ipv6_gateway" cty:"ipv6_gateway" hcl:"ipv6_gateway"` + DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` + DnsSuffixList []string `mapstructure:"dns_suffix_list" cty:"dns_suffix_list" hcl:"dns_suffix_list"` +} + +// FlatMapstructure returns a new FlatCustomizeConfig. +// FlatCustomizeConfig is an auto-generated flat version of CustomizeConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*CustomizeConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatCustomizeConfig) +} + +// HCL2Spec returns the hcl spec of a CustomizeConfig. +// This spec is used by HCL to read the fields of CustomizeConfig. +// The decoded values from this spec will then be applied to a FlatCustomizeConfig. +func (*FlatCustomizeConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "linux_options": &hcldec.BlockSpec{TypeName: "linux_options", Nested: hcldec.ObjectSpec((*FlatLinuxOptions)(nil).HCL2Spec())}, + "windows_sysprep_file": &hcldec.AttrSpec{Name: "windows_sysprep_file", Type: cty.String, Required: false}, + "network_interface": &hcldec.BlockListSpec{TypeName: "network_interface", Nested: hcldec.ObjectSpec((*FlatNetworkInterface)(nil).HCL2Spec())}, + "ipv4_gateway": &hcldec.AttrSpec{Name: "ipv4_gateway", Type: cty.String, Required: false}, + "ipv6_gateway": &hcldec.AttrSpec{Name: "ipv6_gateway", Type: cty.String, Required: false}, + "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, + "dns_suffix_list": &hcldec.AttrSpec{Name: "dns_suffix_list", Type: cty.List(cty.String), Required: false}, + } + return s +} + +// FlatGlobalDnsSettings is an auto-generated flat version of GlobalDnsSettings. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatGlobalDnsSettings struct { + DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` + DnsSuffixList []string `mapstructure:"dns_suffix_list" cty:"dns_suffix_list" hcl:"dns_suffix_list"` +} + +// FlatMapstructure returns a new FlatGlobalDnsSettings. +// FlatGlobalDnsSettings is an auto-generated flat version of GlobalDnsSettings. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*GlobalDnsSettings) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatGlobalDnsSettings) +} + +// HCL2Spec returns the hcl spec of a GlobalDnsSettings. +// This spec is used by HCL to read the fields of GlobalDnsSettings. +// The decoded values from this spec will then be applied to a FlatGlobalDnsSettings. +func (*FlatGlobalDnsSettings) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, + "dns_suffix_list": &hcldec.AttrSpec{Name: "dns_suffix_list", Type: cty.List(cty.String), Required: false}, + } + return s +} + +// FlatGlobalRoutingSettings is an auto-generated flat version of GlobalRoutingSettings. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatGlobalRoutingSettings struct { + Ipv4Gateway *string `mapstructure:"ipv4_gateway" cty:"ipv4_gateway" hcl:"ipv4_gateway"` + Ipv6Gateway *string `mapstructure:"ipv6_gateway" cty:"ipv6_gateway" hcl:"ipv6_gateway"` +} + +// FlatMapstructure returns a new FlatGlobalRoutingSettings. +// FlatGlobalRoutingSettings is an auto-generated flat version of GlobalRoutingSettings. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*GlobalRoutingSettings) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatGlobalRoutingSettings) +} + +// HCL2Spec returns the hcl spec of a GlobalRoutingSettings. +// This spec is used by HCL to read the fields of GlobalRoutingSettings. +// The decoded values from this spec will then be applied to a FlatGlobalRoutingSettings. +func (*FlatGlobalRoutingSettings) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "ipv4_gateway": &hcldec.AttrSpec{Name: "ipv4_gateway", Type: cty.String, Required: false}, + "ipv6_gateway": &hcldec.AttrSpec{Name: "ipv6_gateway", Type: cty.String, Required: false}, + } + return s +} + +// FlatLinuxOptions is an auto-generated flat version of LinuxOptions. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatLinuxOptions struct { + Domain *string `mapstructure:"domain" cty:"domain" hcl:"domain"` + Hostname *string `mapstructure:"host_name" cty:"host_name" hcl:"host_name"` + HWClockUTC *bool `mapstructure:"hw_clock_utc" cty:"hw_clock_utc" hcl:"hw_clock_utc"` + Timezone *string `mapstructure:"time_zone" cty:"time_zone" hcl:"time_zone"` +} + +// FlatMapstructure returns a new FlatLinuxOptions. +// FlatLinuxOptions is an auto-generated flat version of LinuxOptions. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*LinuxOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatLinuxOptions) +} + +// HCL2Spec returns the hcl spec of a LinuxOptions. +// This spec is used by HCL to read the fields of LinuxOptions. +// The decoded values from this spec will then be applied to a FlatLinuxOptions. +func (*FlatLinuxOptions) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "domain": &hcldec.AttrSpec{Name: "domain", Type: cty.String, Required: false}, + "host_name": &hcldec.AttrSpec{Name: "host_name", Type: cty.String, Required: false}, + "hw_clock_utc": &hcldec.AttrSpec{Name: "hw_clock_utc", Type: cty.Bool, Required: false}, + "time_zone": &hcldec.AttrSpec{Name: "time_zone", Type: cty.String, Required: false}, + } + return s +} + +// FlatNetworkInterface is an auto-generated flat version of NetworkInterface. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatNetworkInterface struct { + DnsServerList []string `mapstructure:"dns_server_list" cty:"dns_server_list" hcl:"dns_server_list"` + DnsDomain *string `mapstructure:"dns_domain" cty:"dns_domain" hcl:"dns_domain"` + Ipv4Address *string `mapstructure:"ipv4_address" cty:"ipv4_address" hcl:"ipv4_address"` + Ipv4NetMask *int `mapstructure:"ipv4_netmask" cty:"ipv4_netmask" hcl:"ipv4_netmask"` + Ipv6Address *string `mapstructure:"ipv6_address" cty:"ipv6_address" hcl:"ipv6_address"` + Ipv6NetMask *int `mapstructure:"ipv6_netmask" cty:"ipv6_netmask" hcl:"ipv6_netmask"` +} + +// FlatMapstructure returns a new FlatNetworkInterface. +// FlatNetworkInterface is an auto-generated flat version of NetworkInterface. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*NetworkInterface) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatNetworkInterface) +} + +// HCL2Spec returns the hcl spec of a NetworkInterface. +// This spec is used by HCL to read the fields of NetworkInterface. +// The decoded values from this spec will then be applied to a FlatNetworkInterface. +func (*FlatNetworkInterface) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "dns_server_list": &hcldec.AttrSpec{Name: "dns_server_list", Type: cty.List(cty.String), Required: false}, + "dns_domain": &hcldec.AttrSpec{Name: "dns_domain", Type: cty.String, Required: false}, + "ipv4_address": &hcldec.AttrSpec{Name: "ipv4_address", Type: cty.String, Required: false}, + "ipv4_netmask": &hcldec.AttrSpec{Name: "ipv4_netmask", Type: cty.Number, Required: false}, + "ipv6_address": &hcldec.AttrSpec{Name: "ipv6_address", Type: cty.String, Required: false}, + "ipv6_netmask": &hcldec.AttrSpec{Name: "ipv6_netmask", Type: cty.Number, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/artifact.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/artifact.go new file mode 100644 index 000000000..208e6b526 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/artifact.go @@ -0,0 +1,50 @@ +package common + +import ( + "os" + + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +const BuilderId = "jetbrains.vsphere" + +type Artifact struct { + Outconfig *OutputConfig + Name string + VM *driver.VirtualMachineDriver + + // StateData should store data such as GeneratedData + // to be shared with post-processors + StateData map[string]interface{} +} + +func (a *Artifact) BuilderId() string { + return BuilderId +} + +func (a *Artifact) Files() []string { + if a.Outconfig != nil { + files, _ := a.Outconfig.ListFiles() + return files + } + return []string{} +} + +func (a *Artifact) Id() string { + return a.Name +} + +func (a *Artifact) String() string { + return a.Name +} + +func (a *Artifact) State(name string) interface{} { + return a.StateData[name] +} + +func (a *Artifact) Destroy() error { + if a.Outconfig != nil { + os.RemoveAll(a.Outconfig.OutputDir) + } + return a.VM.Destroy() +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/cleanup_vm.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/cleanup_vm.go new file mode 100644 index 000000000..6e6636d03 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/cleanup_vm.go @@ -0,0 +1,30 @@ +package common + +import ( + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +func CleanupVM(state multistep.StateBag) { + _, cancelled := state.GetOk(multistep.StateCancelled) + _, halted := state.GetOk(multistep.StateHalted) + _, destroy := state.GetOk("destroy_vm") + if !cancelled && !halted && !destroy { + return + } + + ui := state.Get("ui").(packersdk.Ui) + + st := state.Get("vm") + if st == nil { + return + } + vm := st.(driver.VirtualMachine) + + ui.Say("Destroying VM...") + err := vm.Destroy() + if err != nil { + ui.Error(err.Error()) + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.go new file mode 100644 index 000000000..06c651a10 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.go @@ -0,0 +1,53 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type LocationConfig + +package common + +import ( + "fmt" + "path" + "strings" +) + +type LocationConfig struct { + // Name of the new VM to create. + VMName string `mapstructure:"vm_name"` + // VM folder to create the VM in. + Folder string `mapstructure:"folder"` + // ESXi cluster where target VM is created. See the + // [Working With Clusters And Hosts](#working-with-clusters-and-hosts) + // section above for more details. + Cluster string `mapstructure:"cluster"` + // ESXi host where target VM is created. A full path must be specified if + // the host is in a folder. For example `folder/host`. See the + // [Working With Clusters And Hosts](#working-with-clusters-and-hosts) + // section above for more details. + Host string `mapstructure:"host"` + // VMWare resource pool. If not set, it will look for the root resource + // pool of the `host` or `cluster`. If a root resource is not found, it + // will then look for a default resource pool. + ResourcePool string `mapstructure:"resource_pool"` + // VMWare datastore. Required if `host` is a cluster, or if `host` has + // multiple datastores. + Datastore string `mapstructure:"datastore"` + // Set this to true if packer should use the host for uploading files + // to the datastore. Defaults to false. + SetHostForDatastoreUploads bool `mapstructure:"set_host_for_datastore_uploads"` +} + +func (c *LocationConfig) Prepare() []error { + var errs []error + + if c.VMName == "" { + errs = append(errs, fmt.Errorf("'vm_name' is required")) + } + if c.Cluster == "" && c.Host == "" { + errs = append(errs, fmt.Errorf("'host' or 'cluster' is required")) + } + + // clean Folder path and remove leading slash as folders are relative within vsphere + c.Folder = path.Clean(c.Folder) + c.Folder = strings.TrimLeft(c.Folder, "/") + + return errs +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.hcl2spec.go new file mode 100644 index 000000000..c55712475 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_location.hcl2spec.go @@ -0,0 +1,43 @@ +// Code generated by "mapstructure-to-hcl2 -type LocationConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatLocationConfig is an auto-generated flat version of LocationConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatLocationConfig struct { + VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` + Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` + Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` + Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` + SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` +} + +// FlatMapstructure returns a new FlatLocationConfig. +// FlatLocationConfig is an auto-generated flat version of LocationConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*LocationConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatLocationConfig) +} + +// HCL2Spec returns the hcl spec of a LocationConfig. +// This spec is used by HCL to read the fields of LocationConfig. +// The decoded values from this spec will then be applied to a FlatLocationConfig. +func (*FlatLocationConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, + "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, + "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, + "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, + "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_ssh.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_ssh.go new file mode 100644 index 000000000..bb967a45f --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/config_ssh.go @@ -0,0 +1,15 @@ +package common + +import ( + "github.com/hashicorp/packer-plugin-sdk/multistep" +) + +func CommHost(host string) func(multistep.StateBag) (string, error) { + return func(state multistep.StateBag) (string, error) { + if host != "" { + return host, nil + } else { + return state.Get("ip").(string), nil + } + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.go new file mode 100644 index 000000000..1aef6cc30 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.go @@ -0,0 +1,59 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type OutputConfig + +package common + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" +) + +type OutputConfig struct { + // This setting specifies the directory that + // artifacts from the build, such as the virtual machine files and disks, + // will be output to. The path to the directory may be relative or + // absolute. If relative, the path is relative to the working directory + // packer is executed from. This directory must not exist or, if + // created, must be empty prior to running the builder. By default this is + // "output-BUILDNAME" where "BUILDNAME" is the name of the build. + OutputDir string `mapstructure:"output_directory" required:"false"` + // The permissions to apply to the "output_directory", and to any parent + // directories that get created for output_directory. By default this is + // "0750". You should express the permission as quoted string with a + // leading zero such as "0755" in JSON file, because JSON does not support + // octal value. In Unix-like OS, the actual permission may differ from + // this value because of umask. + DirPerm os.FileMode `mapstructure:"directory_permission" required:"false"` +} + +func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error { + if c.OutputDir == "" { + c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName) + } + if c.DirPerm == 0 { + c.DirPerm = 0750 + } + + return nil +} + +// Stolen from output_dir_local.go in vmware builder. +func (c *OutputConfig) ListFiles() ([]string, error) { + files := make([]string, 0, 10) + + visit := func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + files = append(files, path) + } + return nil + } + + return files, filepath.Walk(c.OutputDir, visit) +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.hcl2spec.go new file mode 100644 index 000000000..0cec88325 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/output_config.hcl2spec.go @@ -0,0 +1,35 @@ +// Code generated by "mapstructure-to-hcl2 -type OutputConfig"; DO NOT EDIT. + +package common + +import ( + "io/fs" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatOutputConfig is an auto-generated flat version of OutputConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatOutputConfig struct { + OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` + DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` +} + +// FlatMapstructure returns a new FlatOutputConfig. +// FlatOutputConfig is an auto-generated flat version of OutputConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*OutputConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatOutputConfig) +} + +// HCL2Spec returns the hcl spec of a OutputConfig. +// This spec is used by HCL to read the fields of OutputConfig. +// The decoded values from this spec will then be applied to a FlatOutputConfig. +func (*FlatOutputConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "output_directory": &hcldec.AttrSpec{Name: "output_directory", Type: cty.String, Required: false}, + "directory_permission": &hcldec.AttrSpec{Name: "directory_permission", Type: cty.Number, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.go new file mode 100644 index 000000000..fe1dfd2fb --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.go @@ -0,0 +1,81 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type CDRomConfig + +package common + +import ( + "context" + "fmt" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type CDRomConfig struct { + // Which controller to use. Example: `sata`. Defaults to `ide`. + CdromType string `mapstructure:"cdrom_type"` + // List of Datastore or Content Library paths to ISO files that will be mounted to the VM. + // Here's an HCL2 example: + // ```hcl + // iso_paths = [ + // "[datastore1] ISO/ubuntu.iso", + // "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" + // ] + // ``` + ISOPaths []string `mapstructure:"iso_paths"` +} + +type StepAddCDRom struct { + Config *CDRomConfig +} + +func (c *CDRomConfig) Prepare() []error { + var errs []error + + if c.CdromType != "" && c.CdromType != "ide" && c.CdromType != "sata" { + errs = append(errs, fmt.Errorf("'cdrom_type' must be 'ide' or 'sata'")) + } + + return errs +} + +func (s *StepAddCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(driver.VirtualMachine) + + if s.Config.CdromType == "sata" { + if _, err := vm.FindSATAController(); err == driver.ErrNoSataController { + ui.Say("Adding SATA controller...") + if err := vm.AddSATAController(); err != nil { + state.Put("error", fmt.Errorf("error adding SATA controller: %v", err)) + return multistep.ActionHalt + } + } + } + + ui.Say("Mounting ISO images...") + if path, ok := state.GetOk("iso_remote_path"); ok { + if err := vm.AddCdrom(s.Config.CdromType, path.(string)); err != nil { + state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err)) + return multistep.ActionHalt + } + } + + // Add our custom CD, if it exists + if cd_path, _ := state.Get("cd_path").(string); cd_path != "" { + s.Config.ISOPaths = append(s.Config.ISOPaths, cd_path) + } + + if len(s.Config.ISOPaths) > 0 { + for _, path := range s.Config.ISOPaths { + if err := vm.AddCdrom(s.Config.CdromType, path); err != nil { + state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err)) + return multistep.ActionHalt + } + } + } + return multistep.ActionContinue +} + +func (s *StepAddCDRom) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.hcl2spec.go new file mode 100644 index 000000000..205232829 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_cdrom.hcl2spec.go @@ -0,0 +1,33 @@ +// Code generated by "mapstructure-to-hcl2 -type CDRomConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatCDRomConfig is an auto-generated flat version of CDRomConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatCDRomConfig struct { + CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` + ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` +} + +// FlatMapstructure returns a new FlatCDRomConfig. +// FlatCDRomConfig is an auto-generated flat version of CDRomConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*CDRomConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatCDRomConfig) +} + +// HCL2Spec returns the hcl spec of a CDRomConfig. +// This spec is used by HCL to read the fields of CDRomConfig. +// The decoded values from this spec will then be applied to a FlatCDRomConfig. +func (*FlatCDRomConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, + "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.go new file mode 100644 index 000000000..41b3b09ee --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.go @@ -0,0 +1,111 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type FloppyConfig + +package common + +import ( + "context" + "fmt" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type FloppyConfig struct { + // Datastore path to a floppy image that will be mounted to the VM. + // Example: `[datastore1] ISO/pvscsi-Windows8.flp`. + FloppyIMGPath string `mapstructure:"floppy_img_path"` + // List of local files to be mounted to the VM floppy drive. Can be used to + // make Debian preseed or RHEL kickstart files available to the VM. + FloppyFiles []string `mapstructure:"floppy_files"` + // List of directories to copy files from. + FloppyDirectories []string `mapstructure:"floppy_dirs"` + // The label to use for the floppy disk that + // is attached when the VM is booted. This is most useful for cloud-init, + // Kickstart or other early initialization tools, which can benefit from labelled floppy disks. + // By default, the floppy label will be 'packer'. + FloppyLabel string `mapstructure:"floppy_label"` +} + +type StepAddFloppy struct { + Config *FloppyConfig + Datastore string + Host string + SetHostForDatastoreUploads bool +} + +func (s *StepAddFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(driver.VirtualMachine) + d := state.Get("driver").(driver.Driver) + + if floppyPath, ok := state.GetOk("floppy_path"); ok { + ui.Say("Uploading created floppy image") + + ds, err := d.FindDatastore(s.Datastore, s.Host) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + vmDir, err := vm.GetDir() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + uploadPath := fmt.Sprintf("%v/packer-tmp-created-floppy.flp", vmDir) + if err := ds.UploadFile(floppyPath.(string), uploadPath, s.Host, s.SetHostForDatastoreUploads); err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Put("uploaded_floppy_path", uploadPath) + + ui.Say("Adding generated Floppy...") + floppyIMGPath := ds.ResolvePath(uploadPath) + err = vm.AddFloppy(floppyIMGPath) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + if s.Config.FloppyIMGPath != "" { + ui.Say("Adding Floppy image...") + err := vm.AddFloppy(s.Config.FloppyIMGPath) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepAddFloppy) Cleanup(state multistep.StateBag) { + _, cancelled := state.GetOk(multistep.StateCancelled) + _, halted := state.GetOk(multistep.StateHalted) + if !cancelled && !halted { + return + } + + ui := state.Get("ui").(packersdk.Ui) + d := state.Get("driver").(driver.Driver) + + if UploadedFloppyPath, ok := state.GetOk("uploaded_floppy_path"); ok { + ui.Say("Deleting Floppy image ...") + + ds, err := d.FindDatastore(s.Datastore, s.Host) + if err != nil { + state.Put("error", err) + return + } + + err = ds.Delete(UploadedFloppyPath.(string)) + if err != nil { + state.Put("error", err) + return + } + + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.hcl2spec.go new file mode 100644 index 000000000..a42511314 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_add_floppy.hcl2spec.go @@ -0,0 +1,37 @@ +// Code generated by "mapstructure-to-hcl2 -type FloppyConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatFloppyConfig is an auto-generated flat version of FloppyConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatFloppyConfig struct { + FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` + FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` + FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` + FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` +} + +// FlatMapstructure returns a new FlatFloppyConfig. +// FlatFloppyConfig is an auto-generated flat version of FloppyConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*FloppyConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatFloppyConfig) +} + +// HCL2Spec returns the hcl spec of a FloppyConfig. +// This spec is used by HCL to read the fields of FloppyConfig. +// The decoded values from this spec will then be applied to a FlatFloppyConfig. +func (*FlatFloppyConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, + "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, + "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, + "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_boot_command.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_boot_command.go new file mode 100644 index 000000000..7de930748 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_boot_command.go @@ -0,0 +1,152 @@ +//go:generate struct-markdown +package common + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/packer-plugin-sdk/bootcommand" + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" + "golang.org/x/mobile/event/key" +) + +type BootConfig struct { + bootcommand.BootConfig `mapstructure:",squash"` + // The IP address to use for the HTTP server started to serve the `http_directory`. + // If unset, Packer will automatically discover and assign an IP. + HTTPIP string `mapstructure:"http_ip"` +} + +type bootCommandTemplateData struct { + HTTPIP string + HTTPPort int + Name string +} + +func (c *BootConfig) Prepare(ctx *interpolate.Context) []error { + if c.BootWait == 0 { + c.BootWait = 10 * time.Second + } + return c.BootConfig.Prepare(ctx) +} + +type StepBootCommand struct { + Config *BootConfig + VMName string + Ctx interpolate.Context +} + +func (s *StepBootCommand) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + debug := state.Get("debug").(bool) + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if s.Config.BootCommand == nil { + return multistep.ActionContinue + } + + // Wait the for the vm to boot. + if int64(s.Config.BootWait) > 0 { + ui.Say(fmt.Sprintf("Waiting %s for boot...", s.Config.BootWait.String())) + select { + case <-time.After(s.Config.BootWait): + break + case <-ctx.Done(): + return multistep.ActionHalt + } + } + + var pauseFn multistep.DebugPauseFn + if debug { + pauseFn = state.Get("pauseFn").(multistep.DebugPauseFn) + } + + port := state.Get("http_port").(int) + if port > 0 { + ip := state.Get("http_ip").(string) + s.Ctx.Data = &bootCommandTemplateData{ + ip, + port, + s.VMName, + } + ui.Say(fmt.Sprintf("HTTP server is working at http://%v:%v/", ip, port)) + } + + var keyAlt, keyCtrl, keyShift bool + sendCodes := func(code key.Code, down bool) error { + switch code { + case key.CodeLeftAlt: + keyAlt = down + case key.CodeLeftControl: + keyCtrl = down + case key.CodeLeftShift: + keyShift = down + } + + shift := down + if keyShift { + shift = keyShift + } + + _, err := vm.TypeOnKeyboard(driver.KeyInput{ + Scancode: code, + Ctrl: keyCtrl, + Alt: keyAlt, + Shift: shift, + }) + if err != nil { + // retry once if error + ui.Error(fmt.Errorf("error typing a boot command (code, down) `%d, %t`: %w", code, down, err).Error()) + ui.Say("trying key input again") + time.Sleep(s.Config.BootGroupInterval) + _, err = vm.TypeOnKeyboard(driver.KeyInput{ + Scancode: code, + Ctrl: keyCtrl, + Alt: keyAlt, + Shift: shift, + }) + if err != nil { + return fmt.Errorf("error typing a boot command (code, down) `%d, %t`: %w", code, down, err) + } + } + return nil + } + d := bootcommand.NewUSBDriver(sendCodes, s.Config.BootGroupInterval) + + ui.Say("Typing boot command...") + flatBootCommand := s.Config.FlatBootCommand() + command, err := interpolate.Render(flatBootCommand, &s.Ctx) + if err != nil { + err := fmt.Errorf("Error preparing boot command: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + seq, err := bootcommand.GenerateExpressionSequence(command) + if err != nil { + err := fmt.Errorf("Error generating boot command: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + if err := seq.Do(ctx, d); err != nil { + err := fmt.Errorf("Error running boot command: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + if pauseFn != nil { + pauseFn(multistep.DebugLocationAfterRun, fmt.Sprintf("boot_command: %s", command), state) + } + + return multistep.ActionContinue +} + +func (s *StepBootCommand) Cleanup(_ multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.go new file mode 100644 index 000000000..fc86d9816 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.go @@ -0,0 +1,65 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type ConfigParamsConfig + +package common + +import ( + "context" + "fmt" + + "github.com/vmware/govmomi/vim25/types" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type ConfigParamsConfig struct { + // configuration_parameters is a direct passthrough to the VSphere API's + // ConfigSpec: https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html + ConfigParams map[string]string `mapstructure:"configuration_parameters"` + + // Enables time synchronization with the host. Defaults to false. + ToolsSyncTime bool `mapstructure:"tools_sync_time"` + + // If sets to true, vSphere will automatically check and upgrade VMware Tools upon a system power cycle. + // If not set, defaults to manual upgrade. + ToolsUpgradePolicy bool `mapstructure:"tools_upgrade_policy"` +} + +type StepConfigParams struct { + Config *ConfigParamsConfig +} + +func (s *StepConfigParams) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + configParams := make(map[string]string) + + if s.Config.ConfigParams != nil { + configParams = s.Config.ConfigParams + } + + var info *types.ToolsConfigInfo + if s.Config.ToolsSyncTime || s.Config.ToolsUpgradePolicy { + info = &types.ToolsConfigInfo{} + + if s.Config.ToolsSyncTime { + info.SyncTimeWithHost = &s.Config.ToolsSyncTime + } + + if s.Config.ToolsUpgradePolicy { + info.ToolsUpgradePolicy = "UpgradeAtPowerCycle" + } + } + + ui.Say("Adding configuration parameters...") + if err := vm.AddConfigParams(configParams, info); err != nil { + state.Put("error", fmt.Errorf("error adding configuration parameters: %v", err)) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *StepConfigParams) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.hcl2spec.go new file mode 100644 index 000000000..a68cb3ad2 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_config_params.hcl2spec.go @@ -0,0 +1,35 @@ +// Code generated by "mapstructure-to-hcl2 -type ConfigParamsConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfigParamsConfig struct { + ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` + ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` + ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` +} + +// FlatMapstructure returns a new FlatConfigParamsConfig. +// FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*ConfigParamsConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfigParamsConfig) +} + +// HCL2Spec returns the hcl spec of a ConfigParamsConfig. +// This spec is used by HCL to read the fields of ConfigParamsConfig. +// The decoded values from this spec will then be applied to a FlatConfigParamsConfig. +func (*FlatConfigParamsConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, + "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, + "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.go new file mode 100644 index 000000000..0398c6997 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.go @@ -0,0 +1,64 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type ConnectConfig + +package common + +import ( + "context" + "fmt" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type ConnectConfig struct { + // vCenter server hostname. + VCenterServer string `mapstructure:"vcenter_server"` + // vSphere username. + Username string `mapstructure:"username"` + // vSphere password. + Password string `mapstructure:"password"` + // Do not validate vCenter server's TLS certificate. Defaults to `false`. + InsecureConnection bool `mapstructure:"insecure_connection"` + // VMware datacenter name. Required if there is more than one datacenter in vCenter. + Datacenter string `mapstructure:"datacenter"` +} + +func (c *ConnectConfig) Prepare() []error { + var errs []error + + if c.VCenterServer == "" { + errs = append(errs, fmt.Errorf("'vcenter_server' is required")) + } + if c.Username == "" { + errs = append(errs, fmt.Errorf("'username' is required")) + } + if c.Password == "" { + errs = append(errs, fmt.Errorf("'password' is required")) + } + + return errs +} + +type StepConnect struct { + Config *ConnectConfig +} + +func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + d, err := driver.NewDriver(&driver.ConnectConfig{ + VCenterServer: s.Config.VCenterServer, + Username: s.Config.Username, + Password: s.Config.Password, + InsecureConnection: s.Config.InsecureConnection, + Datacenter: s.Config.Datacenter, + }) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Put("driver", d) + + return multistep.ActionContinue +} + +func (s *StepConnect) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.hcl2spec.go new file mode 100644 index 000000000..fa5782e33 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_connect.hcl2spec.go @@ -0,0 +1,39 @@ +// Code generated by "mapstructure-to-hcl2 -type ConnectConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConnectConfig is an auto-generated flat version of ConnectConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConnectConfig struct { + VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` + Username *string `mapstructure:"username" cty:"username" hcl:"username"` + Password *string `mapstructure:"password" cty:"password" hcl:"password"` + InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` + Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` +} + +// FlatMapstructure returns a new FlatConnectConfig. +// FlatConnectConfig is an auto-generated flat version of ConnectConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*ConnectConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConnectConfig) +} + +// HCL2Spec returns the hcl spec of a ConnectConfig. +// This spec is used by HCL to read the fields of ConnectConfig. +// The decoded values from this spec will then be applied to a FlatConnectConfig. +func (*FlatConnectConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, + "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, + "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, + "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, + "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_download.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_download.go new file mode 100644 index 000000000..978e21a63 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_download.go @@ -0,0 +1,68 @@ +package common + +import ( + "context" + "fmt" + "net/url" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +// Defining this interface ensures that we use the common step download, or the +// mock created to test this wrapper +type DownloadStep interface { + Run(context.Context, multistep.StateBag) multistep.StepAction + Cleanup(multistep.StateBag) + UseSourceToFindCacheTarget(source string) (*url.URL, string, error) +} + +// VSphere has a specialized need -- before we waste time downloading an iso, +// we need to check whether that iso already exists on the remote datastore. +// if it does, we skip the download. This wrapping-step still uses the common +// StepDownload but only if the image isn't already present on the datastore. +type StepDownload struct { + DownloadStep DownloadStep + // These keys are VSphere-specific and used to check the remote datastore. + Url []string + ResultKey string + Datastore string + Host string +} + +func (s *StepDownload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + driver := state.Get("driver").(driver.Driver) + ui := state.Get("ui").(packersdk.Ui) + + // Check whether iso is present on remote datastore. + ds, err := driver.FindDatastore(s.Datastore, s.Host) + if err != nil { + state.Put("error", fmt.Errorf("datastore doesn't exist: %v", err)) + return multistep.ActionHalt + } + + // loop over URLs to see if any are already present. If they are, store that + // one instate and continue + for _, source := range s.Url { + _, targetPath, err := s.DownloadStep.UseSourceToFindCacheTarget(source) + if err != nil { + state.Put("error", fmt.Errorf("Error getting target path: %s", err)) + return multistep.ActionHalt + } + _, remotePath, _, _ := GetRemoteDirectoryAndPath(targetPath, ds) + + if exists := ds.FileExists(remotePath); exists { + ui.Say(fmt.Sprintf("File %s already uploaded; continuing", targetPath)) + state.Put(s.ResultKey, targetPath) + return multistep.ActionContinue + } + } + + // ISO is not present on datastore, so we need to download, then upload it. + // Pass through to the common download step. + return s.DownloadStep.Run(ctx, state) +} + +func (s *StepDownload) Cleanup(state multistep.StateBag) { +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.go new file mode 100644 index 000000000..4aafda86f --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.go @@ -0,0 +1,338 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type ExportConfig + +package common + +import ( + "bytes" + "context" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "fmt" + "hash" + "io" + "os" + "path/filepath" + "strings" + + "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" + "github.com/pkg/errors" + "github.com/vmware/govmomi/nfc" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// You may optionally export an ovf from VSphere to the instance running Packer. +// +// Example usage: +// +// In JSON: +// ```json +// ... +// "vm_name": "example-ubuntu", +// ... +// "export": { +// "force": true, +// "output_directory": "./output_vsphere" +// }, +// ``` +// In HCL2: +// ```hcl +// # ... +// vm_name = "example-ubuntu" +// # ... +// export { +// force = true +// output_directory = "./output_vsphere" +// } +// ``` +// The above configuration would create the following files: +// +// ```text +// ./output_vsphere/example-ubuntu-disk-0.vmdk +// ./output_vsphere/example-ubuntu.mf +// ./output_vsphere/example-ubuntu.ovf +// ``` +type ExportConfig struct { + // name of the ovf. defaults to the name of the VM + Name string `mapstructure:"name"` + // overwrite ovf if it exists + Force bool `mapstructure:"force"` + // include iso and img image files that are attached to the VM + Images bool `mapstructure:"images"` + // generate manifest using sha1, sha256, sha512. Defaults to 'sha256'. Use 'none' for no manifest. + Manifest string `mapstructure:"manifest"` + // Directory on the computer running Packer to export files to + OutputDir OutputConfig `mapstructure:",squash"` + // Advanced ovf export options. Options can include: + // * mac - MAC address is exported for all ethernet devices + // * uuid - UUID is exported for all virtual machines + // * extraconfig - all extra configuration options are exported for a virtual machine + // * nodevicesubtypes - resource subtypes for CD/DVD drives, floppy drives, and serial and parallel ports are not exported + // + // For example, adding the following export config option would output the mac addresses for all Ethernet devices in the ovf file: + // + // In JSON: + // ```json + // ... + // "export": { + // "options": ["mac"] + // }, + // ``` + // In HCL2: + // ```hcl + // ... + // export { + // options = ["mac"] + // } + // ``` + Options []string `mapstructure:"options"` +} + +var sha = map[string]func() hash.Hash{ + "none": nil, + "sha1": sha1.New, + "sha256": sha256.New, + "sha512": sha512.New, +} + +func (c *ExportConfig) Prepare(ctx *interpolate.Context, lc *LocationConfig, pc *common.PackerConfig) []error { + var errs *packersdk.MultiError + + errs = packersdk.MultiErrorAppend(errs, c.OutputDir.Prepare(ctx, pc)...) + + // manifest should default to sha256 + if c.Manifest == "" { + c.Manifest = "sha256" + } + if _, ok := sha[c.Manifest]; !ok { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("unknown hash: %s. available options include available options being 'none', 'sha1', 'sha256', 'sha512'", c.Manifest)) + } + + if c.Name == "" { + c.Name = lc.VMName + } + target := getTarget(c.OutputDir.OutputDir, c.Name) + if !c.Force { + if _, err := os.Stat(target); err == nil { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("file already exists: %s", target)) + } + } + + if err := os.MkdirAll(c.OutputDir.OutputDir, c.OutputDir.DirPerm); err != nil { + errs = packersdk.MultiErrorAppend(errs, errors.Wrap(err, "unable to make directory for export")) + } + + if errs != nil && len(errs.Errors) > 0 { + return errs.Errors + } + + return nil +} + +func getTarget(dir string, name string) string { + return filepath.Join(dir, name+".ovf") +} + +type StepExport struct { + Name string + Force bool + Images bool + Manifest string + OutputDir string + Options []string + mf bytes.Buffer +} + +func (s *StepExport) Cleanup(multistep.StateBag) { +} + +func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + ui.Message("Starting export...") + lease, err := vm.Export() + if err != nil { + state.Put("error", errors.Wrap(err, "error exporting vm")) + return multistep.ActionHalt + } + + info, err := lease.Wait(ctx, nil) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + u := lease.StartUpdater(ctx, info) + defer u.Done() + + cdp := types.OvfCreateDescriptorParams{ + Name: s.Name, + } + + m := vm.NewOvfManager() + if len(s.Options) > 0 { + exportOptions, err := vm.GetOvfExportOptions(m) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + var unknown []string + for _, option := range s.Options { + found := false + for _, exportOpt := range exportOptions { + if exportOpt.Option == option { + found = true + break + } + } + if !found { + unknown = append(unknown, option) + } + cdp.ExportOption = append(cdp.ExportOption, option) + } + + // only printing error message because the unknown options are just ignored by vcenter + if len(unknown) > 0 { + ui.Error(fmt.Sprintf("unknown export options %s", strings.Join(unknown, ","))) + } + } + + for _, i := range info.Items { + if !s.include(&i) { + continue + } + + if !strings.HasPrefix(i.Path, s.Name) { + i.Path = s.Name + "-" + i.Path + } + + file := i.File() + + ui.Message("Downloading: " + file.Path) + size, err := s.Download(ctx, lease, i) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + // Fix file size descriptor + file.Size = size + + ui.Message("Exporting file: " + file.Path) + cdp.OvfFiles = append(cdp.OvfFiles, file) + } + + if err = lease.Complete(ctx); err != nil { + state.Put("error", errors.Wrap(err, "unable to complete lease")) + return multistep.ActionHalt + } + + desc, err := vm.CreateDescriptor(m, cdp) + if err != nil { + state.Put("error", errors.Wrap(err, "unable to create descriptor")) + return multistep.ActionHalt + } + + target := getTarget(s.OutputDir, s.Name) + file, err := os.Create(target) + if err != nil { + state.Put("error", errors.Wrap(err, "unable to create file: "+target)) + return multistep.ActionHalt + } + + var w io.Writer = file + h, ok := s.newHash() + if ok { + w = io.MultiWriter(file, h) + } + + ui.Message("Writing ovf...") + _, err = io.WriteString(w, desc.OvfDescriptor) + if err != nil { + state.Put("error", errors.Wrap(err, "unable to write descriptor")) + return multistep.ActionHalt + } + + if err = file.Close(); err != nil { + state.Put("error", errors.Wrap(err, "unable to close descriptor")) + return multistep.ActionHalt + } + + if s.Manifest == "none" { + // manifest does not need to be created, return + return multistep.ActionContinue + } + + ui.Message("Creating manifest...") + s.addHash(filepath.Base(target), h) + + file, err = os.Create(filepath.Join(s.OutputDir, s.Name+".mf")) + if err != nil { + state.Put("error", errors.Wrap(err, "unable to create manifest")) + return multistep.ActionHalt + } + + _, err = io.Copy(file, &s.mf) + if err != nil { + state.Put("error", errors.Wrap(err, "unable to write manifest")) + return multistep.ActionHalt + } + + err = file.Close() + if err != nil { + state.Put("error", errors.Wrap(err, "unable to close file")) + return multistep.ActionHalt + } + + ui.Message("Finished exporting...") + return multistep.ActionContinue +} + +func (s *StepExport) include(item *nfc.FileItem) bool { + if s.Images { + return true + } + + return filepath.Ext(item.Path) == ".vmdk" +} + +func (s *StepExport) newHash() (hash.Hash, bool) { + // check if function is nil to handle the 'none' case + if h, ok := sha[s.Manifest]; ok && h != nil { + return h(), true + } + + return nil, false +} + +func (s *StepExport) addHash(p string, h hash.Hash) { + _, _ = fmt.Fprintf(&s.mf, "%s(%s)= %x\n", strings.ToUpper(s.Manifest), p, h.Sum(nil)) +} + +func (s *StepExport) Download(ctx context.Context, lease *nfc.Lease, item nfc.FileItem) (int64, error) { + path := filepath.Join(s.OutputDir, item.Path) + opts := soap.Download{} + + if h, ok := s.newHash(); ok { + opts.Writer = h + defer s.addHash(item.Path, h) + } + + err := lease.DownloadFile(ctx, path, item, opts) + if err != nil { + return 0, err + } + + f, err := os.Stat(path) + if err != nil { + return 0, err + } + return f.Size(), err +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.hcl2spec.go new file mode 100644 index 000000000..21824d5d5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_export.hcl2spec.go @@ -0,0 +1,45 @@ +// Code generated by "mapstructure-to-hcl2 -type ExportConfig"; DO NOT EDIT. + +package common + +import ( + "io/fs" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatExportConfig is an auto-generated flat version of ExportConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatExportConfig struct { + Name *string `mapstructure:"name" cty:"name" hcl:"name"` + Force *bool `mapstructure:"force" cty:"force" hcl:"force"` + Images *bool `mapstructure:"images" cty:"images" hcl:"images"` + Manifest *string `mapstructure:"manifest" cty:"manifest" hcl:"manifest"` + OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` + DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` + Options []string `mapstructure:"options" cty:"options" hcl:"options"` +} + +// FlatMapstructure returns a new FlatExportConfig. +// FlatExportConfig is an auto-generated flat version of ExportConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*ExportConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatExportConfig) +} + +// HCL2Spec returns the hcl spec of a ExportConfig. +// This spec is used by HCL to read the fields of ExportConfig. +// The decoded values from this spec will then be applied to a FlatExportConfig. +func (*FlatExportConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, + "force": &hcldec.AttrSpec{Name: "force", Type: cty.Bool, Required: false}, + "images": &hcldec.AttrSpec{Name: "images", Type: cty.Bool, Required: false}, + "manifest": &hcldec.AttrSpec{Name: "manifest", Type: cty.String, Required: false}, + "output_directory": &hcldec.AttrSpec{Name: "output_directory", Type: cty.String, Required: false}, + "directory_permission": &hcldec.AttrSpec{Name: "directory_permission", Type: cty.Number, Required: false}, + "options": &hcldec.AttrSpec{Name: "options", Type: cty.List(cty.String), Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.go new file mode 100644 index 000000000..edf0314eb --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.go @@ -0,0 +1,98 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type HardwareConfig + +package common + +import ( + "context" + "fmt" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type HardwareConfig struct { + // Number of CPU cores. + CPUs int32 `mapstructure:"CPUs"` + // Number of CPU cores per socket. + CpuCores int32 `mapstructure:"cpu_cores"` + // Amount of reserved CPU resources in MHz. + CPUReservation int64 `mapstructure:"CPU_reservation"` + // Upper limit of available CPU resources in MHz. + CPULimit int64 `mapstructure:"CPU_limit"` + // Enable CPU hot plug setting for virtual machine. Defaults to `false`. + CpuHotAddEnabled bool `mapstructure:"CPU_hot_plug"` + // Amount of RAM in MB. + RAM int64 `mapstructure:"RAM"` + // Amount of reserved RAM in MB. + RAMReservation int64 `mapstructure:"RAM_reservation"` + // Reserve all available RAM. Defaults to `false`. Cannot be used together + // with `RAM_reservation`. + RAMReserveAll bool `mapstructure:"RAM_reserve_all"` + // Enable RAM hot plug setting for virtual machine. Defaults to `false`. + MemoryHotAddEnabled bool `mapstructure:"RAM_hot_plug"` + // Amount of video memory in KB. + VideoRAM int64 `mapstructure:"video_ram"` + // vGPU profile for accelerated graphics. See [NVIDIA GRID vGPU documentation](https://docs.nvidia.com/grid/latest/grid-vgpu-user-guide/index.html#configure-vmware-vsphere-vm-with-vgpu) + // for examples of profile names. Defaults to none. + VGPUProfile string `mapstructure:"vgpu_profile"` + // Enable nested hardware virtualization for VM. Defaults to `false`. + NestedHV bool `mapstructure:"NestedHV"` + // Set the Firmware for virtual machine. Supported values: `bios`, `efi` or `efi-secure`. Defaults to `bios`. + Firmware string `mapstructure:"firmware"` + // During the boot, force entry into the BIOS setup screen. Defaults to `false`. + ForceBIOSSetup bool `mapstructure:"force_bios_setup"` +} + +func (c *HardwareConfig) Prepare() []error { + var errs []error + + if c.RAMReservation > 0 && c.RAMReserveAll != false { + errs = append(errs, fmt.Errorf("'RAM_reservation' and 'RAM_reserve_all' cannot be used together")) + } + + if c.Firmware != "" && c.Firmware != "bios" && c.Firmware != "efi" && c.Firmware != "efi-secure" { + errs = append(errs, fmt.Errorf("'firmware' must be '', 'bios', 'efi' or 'efi-secure'")) + } + + return errs +} + +type StepConfigureHardware struct { + Config *HardwareConfig +} + +func (s *StepConfigureHardware) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(driver.VirtualMachine) + + if *s.Config != (HardwareConfig{}) { + ui.Say("Customizing hardware...") + + err := vm.Configure(&driver.HardwareConfig{ + CPUs: s.Config.CPUs, + CpuCores: s.Config.CpuCores, + CPUReservation: s.Config.CPUReservation, + CPULimit: s.Config.CPULimit, + RAM: s.Config.RAM, + RAMReservation: s.Config.RAMReservation, + RAMReserveAll: s.Config.RAMReserveAll, + NestedHV: s.Config.NestedHV, + CpuHotAddEnabled: s.Config.CpuHotAddEnabled, + MemoryHotAddEnabled: s.Config.MemoryHotAddEnabled, + VideoRAM: s.Config.VideoRAM, + VGPUProfile: s.Config.VGPUProfile, + Firmware: s.Config.Firmware, + ForceBIOSSetup: s.Config.ForceBIOSSetup, + }) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepConfigureHardware) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.hcl2spec.go new file mode 100644 index 000000000..334e6a644 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_hardware.hcl2spec.go @@ -0,0 +1,57 @@ +// Code generated by "mapstructure-to-hcl2 -type HardwareConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatHardwareConfig is an auto-generated flat version of HardwareConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatHardwareConfig struct { + CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` + CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` + CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` + CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` + CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` + RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` + RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` + RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` + MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` + VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` + VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` + NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` + Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` + ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` +} + +// FlatMapstructure returns a new FlatHardwareConfig. +// FlatHardwareConfig is an auto-generated flat version of HardwareConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*HardwareConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatHardwareConfig) +} + +// HCL2Spec returns the hcl spec of a HardwareConfig. +// This spec is used by HCL to read the fields of HardwareConfig. +// The decoded values from this spec will then be applied to a FlatHardwareConfig. +func (*FlatHardwareConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, + "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, + "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, + "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, + "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, + "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, + "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, + "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, + "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, + "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, + "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, + "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, + "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, + "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_http_ip_discover.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_http_ip_discover.go new file mode 100644 index 000000000..933cdbfe7 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_http_ip_discover.go @@ -0,0 +1,68 @@ +package common + +import ( + "context" + "fmt" + "net" + + "github.com/hashicorp/packer-plugin-sdk/multistep" +) + +// Step to discover the http ip +// which guests use to reach the vm host +// To make sure the IP is set before boot command and http server steps +type StepHTTPIPDiscover struct { + HTTPIP string + Network *net.IPNet +} + +func (s *StepHTTPIPDiscover) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ip, err := getHostIP(s.HTTPIP, s.Network) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Put("http_ip", ip) + + return multistep.ActionContinue +} + +func (s *StepHTTPIPDiscover) Cleanup(state multistep.StateBag) {} + +func getHostIP(s string, network *net.IPNet) (string, error) { + if s != "" { + if net.ParseIP(s) != nil { + return s, nil + } else { + return "", fmt.Errorf("invalid IP address") + } + } + + addrs, err := net.InterfaceAddrs() + if err != nil { + return "", err + } + + // look for an IP that is contained in the ip_wait_address range + if network != nil { + for _, a := range addrs { + ipnet, ok := a.(*net.IPNet) + if ok && !ipnet.IP.IsLoopback() { + if network.Contains(ipnet.IP) { + return ipnet.IP.String(), nil + } + } + } + } + + // fallback to an ipv4 address if an IP is not found in the range + for _, a := range addrs { + ipnet, ok := a.(*net.IPNet) + if ok && !ipnet.IP.IsLoopback() { + if ipnet.IP.To4() != nil { + return ipnet.IP.String(), nil + } + } + } + return "", fmt.Errorf("IP not found") +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.go new file mode 100644 index 000000000..2e2350f6a --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.go @@ -0,0 +1,180 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type ContentLibraryDestinationConfig +package common + +import ( + "context" + "fmt" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" + "github.com/vmware/govmomi/vapi/vcenter" +) + +// With this configuration Packer creates a library item in a content library whose content is a VM template +// or an OVF template created from the just built VM. +// The template is stored in a existing or newly created library item. +type ContentLibraryDestinationConfig struct { + // Name of the library in which the new library item containing the template should be created/updated. + // The Content Library should be of type Local to allow deploying virtual machines. + Library string `mapstructure:"library"` + // Name of the library item that will be created or updated. + // For VM templates, the name of the item should be different from [vm_name](#vm_name) and + // the default is [vm_name](#vm_name) + timestamp when not set. VM templates will be always imported to a new library item. + // For OVF templates, the name defaults to [vm_name](#vm_name) when not set, and if an item with the same name already + // exists it will be then updated with the new OVF template, otherwise a new item will be created. + // + // ~> **Note**: It's not possible to update existing library items with a new VM template. If updating an existing library + // item is necessary, use an OVF template instead by setting the [ovf](#ovf) option as `true`. + // + Name string `mapstructure:"name"` + // Description of the library item that will be created. + // This option is not used when importing OVF templates. + // Defaults to "Packer imported [vm_name](#vm_name) VM template". + Description string `mapstructure:"description"` + // Cluster onto which the virtual machine template should be placed. + // If cluster and resource_pool are both specified, resource_pool must belong to cluster. + // If cluster and host are both specified, host must be a member of cluster. + // This option is not used when importing OVF templates. + // Defaults to [cluster](#cluster). + Cluster string `mapstructure:"cluster"` + // Virtual machine folder into which the virtual machine template should be placed. + // This option is not used when importing OVF templates. + // Defaults to the same folder as the source virtual machine. + Folder string `mapstructure:"folder"` + // Host onto which the virtual machine template should be placed. + // If host and resource_pool are both specified, resource_pool must belong to host. + // If host and cluster are both specified, host must be a member of cluster. + // This option is not used when importing OVF templates. + // Defaults to [host](#host). + Host string `mapstructure:"host"` + // Resource pool into which the virtual machine template should be placed. + // Defaults to [resource_pool](#resource_pool). if [resource_pool](#resource_pool) is also unset, + // the system will attempt to choose a suitable resource pool for the virtual machine template. + ResourcePool string `mapstructure:"resource_pool"` + // The datastore for the virtual machine template's configuration and log files. + // This option is not used when importing OVF templates. + // Defaults to the storage backing associated with the library specified by library. + Datastore string `mapstructure:"datastore"` + // If set to true, the VM will be destroyed after deploying the template to the Content Library. + // Defaults to `false`. + Destroy bool `mapstructure:"destroy"` + // When set to true, Packer will import and OVF template to the content library item. Defaults to `false`. + Ovf bool `mapstructure:"ovf"` +} + +func (c *ContentLibraryDestinationConfig) Prepare(lc *LocationConfig) []error { + var errs *packersdk.MultiError + + if c.Library == "" { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("a library name must be provided")) + } + + if c.Ovf { + if c.Name == "" { + c.Name = lc.VMName + } + } else { + if c.Name == lc.VMName { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("the content library destination name must be different from the VM name")) + } + + if c.Name == "" { + // Add timestamp to the name to differentiate from the original VM + // otherwise vSphere won't be able to create the template which will be imported + name, err := interpolate.Render(lc.VMName+"{{timestamp}}", nil) + if err != nil { + errs = packersdk.MultiErrorAppend(errs, + fmt.Errorf("unable to parse content library VM template name: %s", err)) + } + c.Name = name + } + if c.Cluster == "" { + c.Cluster = lc.Cluster + } + if c.Host == "" { + c.Host = lc.Host + } + if c.ResourcePool == "" { + c.ResourcePool = lc.ResourcePool + } + if c.Description == "" { + c.Description = fmt.Sprintf("Packer imported %s VM template", lc.VMName) + } + } + + if errs != nil && len(errs.Errors) > 0 { + return errs.Errors + } + + return nil +} + +type StepImportToContentLibrary struct { + ContentLibConfig *ContentLibraryDestinationConfig +} + +func (s *StepImportToContentLibrary) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + var err error + + if s.ContentLibConfig.Ovf { + ui.Say(fmt.Sprintf("Importing VM OVF template %s to Content Library...", s.ContentLibConfig.Name)) + err = s.importOvfTemplate(vm) + } else { + ui.Say(fmt.Sprintf("Importing VM template %s to Content Library...", s.ContentLibConfig.Name)) + err = s.importVmTemplate(vm) + } + + if err != nil { + ui.Error(fmt.Sprintf("Failed to import template %s: %s", s.ContentLibConfig.Name, err.Error())) + state.Put("error", err) + return multistep.ActionHalt + } + + if s.ContentLibConfig.Destroy { + state.Put("destroy_vm", s.ContentLibConfig.Destroy) + } + + return multistep.ActionContinue +} + +func (s *StepImportToContentLibrary) importOvfTemplate(vm *driver.VirtualMachineDriver) error { + ovf := vcenter.OVF{ + Spec: vcenter.CreateSpec{ + Name: s.ContentLibConfig.Name, + }, + Target: vcenter.LibraryTarget{ + LibraryID: s.ContentLibConfig.Library, + }, + } + return vm.ImportOvfToContentLibrary(ovf) +} + +func (s *StepImportToContentLibrary) importVmTemplate(vm *driver.VirtualMachineDriver) error { + template := vcenter.Template{ + Name: s.ContentLibConfig.Name, + Description: s.ContentLibConfig.Description, + Library: s.ContentLibConfig.Library, + Placement: &vcenter.Placement{ + Cluster: s.ContentLibConfig.Cluster, + Folder: s.ContentLibConfig.Folder, + Host: s.ContentLibConfig.Host, + ResourcePool: s.ContentLibConfig.ResourcePool, + }, + } + + if s.ContentLibConfig.Datastore != "" { + template.VMHomeStorage = &vcenter.DiskStorage{ + Datastore: s.ContentLibConfig.Datastore, + } + } + + return vm.ImportToContentLibrary(template) +} + +func (s *StepImportToContentLibrary) Cleanup(multistep.StateBag) { +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.hcl2spec.go new file mode 100644 index 000000000..2c42538fb --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_import_to_content_library.hcl2spec.go @@ -0,0 +1,49 @@ +// Code generated by "mapstructure-to-hcl2 -type ContentLibraryDestinationConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatContentLibraryDestinationConfig is an auto-generated flat version of ContentLibraryDestinationConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatContentLibraryDestinationConfig struct { + Library *string `mapstructure:"library" cty:"library" hcl:"library"` + Name *string `mapstructure:"name" cty:"name" hcl:"name"` + Description *string `mapstructure:"description" cty:"description" hcl:"description"` + Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` + Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` + Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` + Destroy *bool `mapstructure:"destroy" cty:"destroy" hcl:"destroy"` + Ovf *bool `mapstructure:"ovf" cty:"ovf" hcl:"ovf"` +} + +// FlatMapstructure returns a new FlatContentLibraryDestinationConfig. +// FlatContentLibraryDestinationConfig is an auto-generated flat version of ContentLibraryDestinationConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*ContentLibraryDestinationConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatContentLibraryDestinationConfig) +} + +// HCL2Spec returns the hcl spec of a ContentLibraryDestinationConfig. +// This spec is used by HCL to read the fields of ContentLibraryDestinationConfig. +// The decoded values from this spec will then be applied to a FlatContentLibraryDestinationConfig. +func (*FlatContentLibraryDestinationConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "library": &hcldec.AttrSpec{Name: "library", Type: cty.String, Required: false}, + "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, + "description": &hcldec.AttrSpec{Name: "description", Type: cty.String, Required: false}, + "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, + "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, + "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, + "destroy": &hcldec.AttrSpec{Name: "destroy", Type: cty.Bool, Required: false}, + "ovf": &hcldec.AttrSpec{Name: "ovf", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remote_upload.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remote_upload.go new file mode 100644 index 000000000..2d44235fb --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remote_upload.go @@ -0,0 +1,117 @@ +package common + +import ( + "context" + "fmt" + "log" + "path/filepath" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type StepRemoteUpload struct { + Datastore string + Host string + SetHostForDatastoreUploads bool + UploadedCustomCD bool +} + +func (s *StepRemoteUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + d := state.Get("driver").(driver.Driver) + + if path, ok := state.GetOk("iso_path"); ok { + // user-supplied boot iso + fullRemotePath, err := s.uploadFile(path.(string), d, ui) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Put("iso_remote_path", fullRemotePath) + } + if cdPath, ok := state.GetOk("cd_path"); ok { + // Packer-created cd_files disk + fullRemotePath, err := s.uploadFile(cdPath.(string), d, ui) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + s.UploadedCustomCD = true + state.Put("cd_path", fullRemotePath) + } + + return multistep.ActionContinue +} + +func GetRemoteDirectoryAndPath(path string, ds driver.Datastore) (string, string, string, string) { + filename := filepath.Base(path) + remotePath := fmt.Sprintf("packer_cache/%s", filename) + remoteDirectory := fmt.Sprintf("[%s] packer_cache/", ds.Name()) + fullRemotePath := fmt.Sprintf("%s/%s", remoteDirectory, filename) + + return filename, remotePath, remoteDirectory, fullRemotePath + +} +func (s *StepRemoteUpload) uploadFile(path string, d driver.Driver, ui packersdk.Ui) (string, error) { + ds, err := d.FindDatastore(s.Datastore, s.Host) + if err != nil { + return "", fmt.Errorf("datastore doesn't exist: %v", err) + } + + filename, remotePath, remoteDirectory, fullRemotePath := GetRemoteDirectoryAndPath(path, ds) + + if exists := ds.FileExists(remotePath); exists == true { + ui.Say(fmt.Sprintf("File %s already exists; skipping upload.", fullRemotePath)) + return fullRemotePath, nil + } + + ui.Say(fmt.Sprintf("Uploading %s to %s", filename, remotePath)) + + if exists := ds.DirExists(remotePath); exists == false { + log.Printf("Remote directory doesn't exist; creating...") + if err := ds.MakeDirectory(remoteDirectory); err != nil { + return "", err + } + } + + if err := ds.UploadFile(path, remotePath, s.Host, s.SetHostForDatastoreUploads); err != nil { + return "", err + } + return fullRemotePath, nil +} + +func (s *StepRemoteUpload) Cleanup(state multistep.StateBag) { + _, cancelled := state.GetOk(multistep.StateCancelled) + _, halted := state.GetOk(multistep.StateHalted) + if !cancelled && !halted { + return + } + + if !s.UploadedCustomCD { + return + } + + UploadedCDPath, ok := state.GetOk("cd_path") + if !ok { + return + } + + ui := state.Get("ui").(packersdk.Ui) + d := state.Get("driver").(*driver.VCenterDriver) + ui.Say("Deleting cd_files image from remote datastore ...") + + ds, err := d.FindDatastore(s.Datastore, s.Host) + if err != nil { + log.Printf("Error finding datastore to delete custom CD; please delete manually: %s", err) + return + } + + err = ds.Delete(UploadedCDPath.(string)) + if err != nil { + log.Printf("Error deleting custom CD from remote datastore; please delete manually: %s", err) + return + + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.go new file mode 100644 index 000000000..f3a104ddf --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.go @@ -0,0 +1,46 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type RemoveCDRomConfig + +package common + +import ( + "context" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type RemoveCDRomConfig struct { + // Remove CD-ROM devices from template. Defaults to `false`. + RemoveCdrom bool `mapstructure:"remove_cdrom"` +} + +type StepRemoveCDRom struct { + Config *RemoveCDRomConfig +} + +func (s *StepRemoveCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(driver.VirtualMachine) + + ui.Say("Eject CD-ROM drives...") + err := vm.EjectCdroms() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + if s.Config.RemoveCdrom == true { + ui.Say("Deleting CD-ROM drives...") + err := vm.RemoveCdroms() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepRemoveCDRom) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.hcl2spec.go new file mode 100644 index 000000000..826cacdf4 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_cdrom.hcl2spec.go @@ -0,0 +1,31 @@ +// Code generated by "mapstructure-to-hcl2 -type RemoveCDRomConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatRemoveCDRomConfig struct { + RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` +} + +// FlatMapstructure returns a new FlatRemoveCDRomConfig. +// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*RemoveCDRomConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatRemoveCDRomConfig) +} + +// HCL2Spec returns the hcl spec of a RemoveCDRomConfig. +// This spec is used by HCL to read the fields of RemoveCDRomConfig. +// The decoded values from this spec will then be applied to a FlatRemoveCDRomConfig. +func (*FlatRemoveCDRomConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_floppy.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_floppy.go new file mode 100644 index 000000000..01966953c --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_remove_floppy.go @@ -0,0 +1,49 @@ +package common + +import ( + "context" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type StepRemoveFloppy struct { + Datastore string + Host string +} + +func (s *StepRemoveFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(driver.VirtualMachine) + d := state.Get("driver").(driver.Driver) + + ui.Say("Deleting Floppy drives...") + floppies, err := vm.FloppyDevices() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + if err = vm.RemoveDevice(true, floppies...); err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + if UploadedFloppyPath, ok := state.GetOk("uploaded_floppy_path"); ok { + ui.Say("Deleting Floppy image...") + ds, err := d.FindDatastore(s.Datastore, s.Host) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + if err := ds.Delete(UploadedFloppyPath.(string)); err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Remove("uploaded_floppy_path") + } + + return multistep.ActionContinue +} + +func (s *StepRemoveFloppy) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.go new file mode 100644 index 000000000..dff47eda4 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.go @@ -0,0 +1,80 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type RunConfig + +package common + +import ( + "context" + "strings" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type RunConfig struct { + // Priority of boot devices. Defaults to `disk,cdrom` + BootOrder string `mapstructure:"boot_order"` // example: "floppy,cdrom,ethernet,disk" +} + +type StepRun struct { + Config *RunConfig + SetOrder bool +} + +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if s.Config.BootOrder != "" { + ui.Say("Set boot order...") + order := strings.Split(s.Config.BootOrder, ",") + if err := vm.SetBootOrder(order); err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } else { + if s.SetOrder { + ui.Say("Set boot order temporary...") + if err := vm.SetBootOrder([]string{"disk", "cdrom"}); err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + } + + ui.Say("Power on VM...") + err := vm.PowerOn() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *StepRun) Cleanup(state multistep.StateBag) { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if s.Config.BootOrder == "" && s.SetOrder { + ui.Say("Clear boot order...") + if err := vm.SetBootOrder([]string{"-"}); err != nil { + state.Put("error", err) + return + } + } + + _, cancelled := state.GetOk(multistep.StateCancelled) + _, halted := state.GetOk(multistep.StateHalted) + if !cancelled && !halted { + return + } + + ui.Say("Power off VM...") + + err := vm.PowerOff() + if err != nil { + ui.Error(err.Error()) + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.hcl2spec.go new file mode 100644 index 000000000..5ecc99cae --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_run.hcl2spec.go @@ -0,0 +1,31 @@ +// Code generated by "mapstructure-to-hcl2 -type RunConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatRunConfig is an auto-generated flat version of RunConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatRunConfig struct { + BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` +} + +// FlatMapstructure returns a new FlatRunConfig. +// FlatRunConfig is an auto-generated flat version of RunConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*RunConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatRunConfig) +} + +// HCL2Spec returns the hcl spec of a RunConfig. +// This spec is used by HCL to read the fields of RunConfig. +// The decoded values from this spec will then be applied to a FlatRunConfig. +func (*FlatRunConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.go new file mode 100644 index 000000000..6d99929c5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.go @@ -0,0 +1,109 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type ShutdownConfig + +package common + +import ( + "bytes" + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type ShutdownConfig struct { + // Specify a VM guest shutdown command. This command will be executed using + // the `communicator`. Otherwise the VMware guest tools are used to gracefully + // shutdown the VM guest. + Command string `mapstructure:"shutdown_command"` + // Amount of time to wait for graceful VM shutdown. + // Defaults to 5m or five minutes. + // This will likely need to be modified if the `communicator` is 'none'. + Timeout time.Duration `mapstructure:"shutdown_timeout"` + // Packer normally halts the virtual machine after all provisioners have + // run when no `shutdown_command` is defined. If this is set to `true`, Packer + // *will not* halt the virtual machine but will assume that you will send the stop + // signal yourself through a preseed.cfg, a script or the final provisioner. + // Packer will wait for a default of five minutes until the virtual machine is shutdown. + // The timeout can be changed using `shutdown_timeout` option. + DisableShutdown bool `mapstructure:"disable_shutdown"` +} + +func (c *ShutdownConfig) Prepare(comm communicator.Config) (warnings []string, errs []error) { + + if c.Timeout == 0 { + c.Timeout = 5 * time.Minute + } + + if comm.Type == "none" && c.Command != "" { + warnings = append(warnings, "The parameter `shutdown_command` is ignored as it requires a `communicator`.") + } + + return +} + +type StepShutdown struct { + Config *ShutdownConfig +} + +func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if off, _ := vm.IsPoweredOff(); off { + // Probably power off initiated by last provisioner, though disable_shutdown is not set + ui.Say("VM is already powered off") + return multistep.ActionContinue + } + + comm, _ := state.Get("communicator").(packersdk.Communicator) + if comm == nil { + + msg := fmt.Sprintf("Please shutdown virtual machine within %s.", s.Config.Timeout) + ui.Message(msg) + + } else if s.Config.DisableShutdown { + ui.Say("Automatic shutdown disabled. Please shutdown virtual machine.") + } else if s.Config.Command != "" { + // Communicator is not needed unless shutdown_command is populated + + ui.Say("Executing shutdown command...") + log.Printf("Shutdown command: %s", s.Config.Command) + + var stdout, stderr bytes.Buffer + cmd := &packersdk.RemoteCmd{ + Command: s.Config.Command, + Stdout: &stdout, + Stderr: &stderr, + } + err := comm.Start(ctx, cmd) + if err != nil { + state.Put("error", fmt.Errorf("Failed to send shutdown command: %s", err)) + return multistep.ActionHalt + } + } else { + ui.Say("Shutting down VM...") + + err := vm.StartShutdown() + if err != nil { + state.Put("error", fmt.Errorf("Cannot shut down VM: %v", err)) + return multistep.ActionHalt + } + } + + log.Printf("Waiting max %s for shutdown to complete", s.Config.Timeout) + err := vm.WaitForShutdown(ctx, s.Config.Timeout) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *StepShutdown) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.hcl2spec.go new file mode 100644 index 000000000..323e771c8 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_shutdown.hcl2spec.go @@ -0,0 +1,35 @@ +// Code generated by "mapstructure-to-hcl2 -type ShutdownConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatShutdownConfig struct { + Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` + Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` + DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` +} + +// FlatMapstructure returns a new FlatShutdownConfig. +// FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*ShutdownConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatShutdownConfig) +} + +// HCL2Spec returns the hcl spec of a ShutdownConfig. +// This spec is used by HCL to read the fields of ShutdownConfig. +// The decoded values from this spec will then be applied to a FlatShutdownConfig. +func (*FlatShutdownConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, + "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, + "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_snapshot.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_snapshot.go new file mode 100644 index 000000000..8d30543d1 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_snapshot.go @@ -0,0 +1,32 @@ +package common + +import ( + "context" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type StepCreateSnapshot struct { + CreateSnapshot bool +} + +func (s *StepCreateSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if s.CreateSnapshot { + ui.Say("Creating snapshot...") + + err := vm.CreateSnapshot("Created by Packer") + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepCreateSnapshot) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_ssh_key_pair.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_ssh_key_pair.go new file mode 100644 index 000000000..01dfe20b3 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_ssh_key_pair.go @@ -0,0 +1,115 @@ +package common + +import ( + "context" + "fmt" + "io/ioutil" + "os" + + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/communicator/ssh" + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/uuid" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +// StepSshKeyPair executes the business logic for setting the SSH key pair in +// the specified communicator.Config. +type StepSshKeyPair struct { + Debug bool + DebugKeyPath string + Comm *communicator.Config +} + +func (s *StepSshKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + if s.Comm.Type != "ssh" || s.Comm.SSHPassword != "" { + return multistep.ActionContinue + } + + ui := state.Get("ui").(packersdk.Ui) + + comment := fmt.Sprintf("packer_%s", uuid.TimeOrderedUUID()) + if s.Comm.SSHPrivateKeyFile != "" { + ui.Say("Using existing SSH private key for the communicator...") + privateKeyBytes, err := s.Comm.ReadSSHPrivateKeyFile() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + kp, err := ssh.KeyPairFromPrivateKey(ssh.FromPrivateKeyConfig{ + RawPrivateKeyPemBlock: privateKeyBytes, + Comment: comment, + }) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + s.Comm.SSHPrivateKey = privateKeyBytes + s.Comm.SSHKeyPairName = kp.Comment + s.Comm.SSHTemporaryKeyPairName = kp.Comment + s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine + + return multistep.ActionContinue + } + + if s.Comm.SSHAgentAuth { + ui.Say("Using local SSH Agent to authenticate connections for the communicator...") + return multistep.ActionContinue + } + + ui.Say("Creating ephemeral key pair for SSH communicator...") + + if s.Comm.SSHTemporaryKeyPairName != "" { + comment = s.Comm.SSHTemporaryKeyPairName + } + + kp, err := ssh.NewKeyPair(ssh.CreateKeyPairConfig{ + Comment: comment, + Type: ssh.Rsa, + }) + if err != nil { + state.Put("error", fmt.Errorf("Error creating temporary keypair: %s", err)) + return multistep.ActionHalt + } + + s.Comm.SSHKeyPairName = kp.Comment + s.Comm.SSHTemporaryKeyPairName = kp.Comment + s.Comm.SSHPrivateKey = kp.PrivateKeyPemBlock + s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine + s.Comm.SSHClearAuthorizedKeys = true + + vm := state.Get("vm").(*driver.VirtualMachineDriver) + err = vm.AddPublicKeys(ctx, string(s.Comm.SSHPublicKey)) + if err != nil { + state.Put("error", fmt.Errorf("error saving temporary keypair in the vm: %s", err)) + return multistep.ActionHalt + } + + ui.Say("Created ephemeral SSH key pair for communicator") + + // If we're in debug mode, output the private key to the working + // directory. + if s.Debug { + ui.Message(fmt.Sprintf("Saving communicator private key for debug purposes: %s", s.DebugKeyPath)) + // Write the key out + if err := ioutil.WriteFile(s.DebugKeyPath, kp.PrivateKeyPemBlock, 0600); err != nil { + state.Put("error", fmt.Errorf("Error saving debug key: %s", err)) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepSshKeyPair) Cleanup(state multistep.StateBag) { + if s.Debug { + if err := os.Remove(s.DebugKeyPath); err != nil { + ui := state.Get("ui").(packersdk.Ui) + ui.Error(fmt.Sprintf( + "Error removing debug key '%s': %s", s.DebugKeyPath, err)) + } + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_template.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_template.go new file mode 100644 index 000000000..12ca50047 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_template.go @@ -0,0 +1,31 @@ +package common + +import ( + "context" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type StepConvertToTemplate struct { + ConvertToTemplate bool +} + +func (s *StepConvertToTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + if s.ConvertToTemplate { + ui.Say("Convert VM into template...") + err := vm.ConvertToTemplate() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepConvertToTemplate) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.go new file mode 100644 index 000000000..2fb183bde --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.go @@ -0,0 +1,182 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type WaitIpConfig + +package common + +import ( + "context" + "fmt" + "log" + "net" + "time" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type WaitIpConfig struct { + // Amount of time to wait for VM's IP, similar to 'ssh_timeout'. + // Defaults to 30m (30 minutes). See the Golang + // [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation + // for full details. + WaitTimeout time.Duration `mapstructure:"ip_wait_timeout"` + // Amount of time to wait for VM's IP to settle down, sometimes VM may + // report incorrect IP initially, then its recommended to set that + // parameter to apx. 2 minutes. Examples 45s and 10m. Defaults to + // 5s(5 seconds). See the Golang + // [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation + // for full details. + SettleTimeout time.Duration `mapstructure:"ip_settle_timeout"` + // Set this to a CIDR address to cause the service to wait for an address that is contained in + // this network range. Defaults to "0.0.0.0/0" for any ipv4 address. Examples include: + // + // * empty string ("") - remove all filters + // * `0:0:0:0:0:0:0:0/0` - allow only ipv6 addresses + // * `192.168.1.0/24` - only allow ipv4 addresses from 192.168.1.1 to 192.168.1.254 + WaitAddress *string `mapstructure:"ip_wait_address"` + ipnet *net.IPNet + + // WaitTimeout is a total timeout, so even if VM changes IP frequently and it doesn't settle down we will end waiting. +} + +type StepWaitForIp struct { + Config *WaitIpConfig +} + +func (c *WaitIpConfig) Prepare() []error { + var errs []error + + if c.SettleTimeout == 0 { + c.SettleTimeout = 5 * time.Second + } + if c.WaitTimeout == 0 { + c.WaitTimeout = 30 * time.Minute + } + if c.WaitAddress == nil { + addr := "0.0.0.0/0" + c.WaitAddress = &addr + } + + if *c.WaitAddress != "" { + var err error + _, c.ipnet, err = net.ParseCIDR(*c.WaitAddress) + if err != nil { + errs = append(errs, fmt.Errorf("unable to parse \"ip_wait_address\": %w", err)) + } + } + + return errs +} + +func (c *WaitIpConfig) GetIPNet() *net.IPNet { + return c.ipnet +} + +func (s *StepWaitForIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + vm := state.Get("vm").(*driver.VirtualMachineDriver) + + var ip string + var err error + + sub, cancel := context.WithCancel(ctx) + waitDone := make(chan bool, 1) + defer func() { + cancel() + }() + + go func() { + ui.Say("Waiting for IP...") + ip, err = doGetIp(vm, sub, s.Config) + waitDone <- true + }() + + log.Printf("[INFO] Waiting for IP, up to total timeout: %s, settle timeout: %s", s.Config.WaitTimeout, s.Config.SettleTimeout) + timeout := time.After(s.Config.WaitTimeout) + for { + select { + case <-timeout: + cancel() + <-waitDone + if ip != "" { + state.Put("ip", ip) + log.Printf("[WARN] API timeout waiting for IP but one IP was found. Using IP: %s", ip) + return multistep.ActionContinue + } + err := fmt.Errorf("Timeout waiting for IP.") + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + case <-ctx.Done(): + cancel() + log.Println("[WARN] Interrupt detected, quitting waiting for IP.") + return multistep.ActionHalt + case <-waitDone: + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + state.Put("ip", ip) + ui.Say(fmt.Sprintf("IP address: %v", ip)) + return multistep.ActionContinue + case <-time.After(1 * time.Second): + if _, ok := state.GetOk(multistep.StateCancelled); ok { + return multistep.ActionHalt + } + } + } +} + +func doGetIp(vm *driver.VirtualMachineDriver, ctx context.Context, c *WaitIpConfig) (string, error) { + var prevIp = "" + var stopTime time.Time + var interval time.Duration + if c.SettleTimeout.Seconds() >= 120 { + interval = 30 * time.Second + } else if c.SettleTimeout.Seconds() >= 60 { + interval = 15 * time.Second + } else if c.SettleTimeout.Seconds() >= 10 { + interval = 5 * time.Second + } else { + interval = 1 * time.Second + } +loop: + ip, err := vm.WaitForIP(ctx, c.ipnet) + if err != nil { + return "", err + } + + // Check for ctx cancellation to avoid printing any IP logs at the timeout + select { + case <-ctx.Done(): + return ip, fmt.Errorf("IP wait cancelled.") + default: + } + + if prevIp == "" || prevIp != ip { + if prevIp == "" { + log.Printf("VM IP aquired: %s", ip) + } else { + log.Printf("VM IP changed from %s to %s", prevIp, ip) + } + prevIp = ip + stopTime = time.Now().Add(c.SettleTimeout) + goto loop + } else { + log.Printf("VM IP is still the same: %s", prevIp) + if time.Now().After(stopTime) { + log.Printf("VM IP seems stable enough: %s", ip) + return ip, nil + } + select { + case <-ctx.Done(): + return "", fmt.Errorf("IP wait cancelled") + case <-time.After(interval): + goto loop + } + } + +} + +func (s *StepWaitForIp) Cleanup(state multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.hcl2spec.go new file mode 100644 index 000000000..c65302f31 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/step_wait_for_ip.hcl2spec.go @@ -0,0 +1,35 @@ +// Code generated by "mapstructure-to-hcl2 -type WaitIpConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatWaitIpConfig struct { + WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` + SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` + WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` +} + +// FlatMapstructure returns a new FlatWaitIpConfig. +// FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*WaitIpConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatWaitIpConfig) +} + +// HCL2Spec returns the hcl spec of a WaitIpConfig. +// This spec is used by HCL to read the fields of WaitIpConfig. +// The decoded values from this spec will then be applied to a FlatWaitIpConfig. +func (*FlatWaitIpConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, + "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, + "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.go new file mode 100644 index 000000000..6650616d5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.go @@ -0,0 +1,118 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type StorageConfig,DiskConfig + +package common + +import ( + "fmt" +) + +// Defines the disk storage for a VM. +// +// Example that will create a 15GB and a 20GB disk on the VM. The second disk will be thin provisioned: +// +// In JSON: +// ```json +// "storage": [ +// { +// "disk_size": 15000 +// }, +// { +// "disk_size": 20000, +// "disk_thin_provisioned": true +// } +// ], +// ``` +// In HCL2: +// ```hcl +// storage { +// disk_size = 15000 +// } +// storage { +// disk_size = 20000 +// disk_thin_provisioned = true +// } +// ``` +// +// Example that creates 2 pvscsi controllers and adds 2 disks to each one: +// +// In JSON: +// ```json +// "disk_controller_type": ["pvscsi", "pvscsi"], +// "storage": [ +// { +// "disk_size": 15000, +// "disk_controller_index": 0 +// }, +// { +// "disk_size": 15000, +// "disk_controller_index": 0 +// }, +// { +// "disk_size": 15000, +// "disk_controller_index": 1 +// }, +// { +// "disk_size": 15000, +// "disk_controller_index": 1 +// } +// ], +// ``` +// +// In HCL2: +// ```hcl +// disk_controller_type = ["pvscsi", "pvscsi"] +// storage { +// disk_size = 15000, +// disk_controller_index = 0 +// } +// storage { +// disk_size = 15000 +// disk_controller_index = 0 +// } +// storage { +// disk_size = 15000 +// disk_controller_index = 1 +// } +// storage { +// disk_size = 15000 +// disk_controller_index = 1 +// } +// ``` +type DiskConfig struct { + // The size of the disk in MB. + DiskSize int64 `mapstructure:"disk_size" required:"true"` + // Enable VMDK thin provisioning for VM. Defaults to `false`. + DiskThinProvisioned bool `mapstructure:"disk_thin_provisioned"` + // Enable VMDK eager scrubbing for VM. Defaults to `false`. + DiskEagerlyScrub bool `mapstructure:"disk_eagerly_scrub"` + // The assigned disk controller. Defaults to the first one (0) + DiskControllerIndex int `mapstructure:"disk_controller_index"` +} + +type StorageConfig struct { + // Set VM disk controller type. Example `lsilogic`, `pvscsi`, `nvme`, or `scsi`. Use a list to define additional controllers. + // Defaults to `lsilogic`. See + // [SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html#GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362) + // for additional details. + DiskControllerType []string `mapstructure:"disk_controller_type"` + // Configures a collection of one or more disks to be provisioned along with the VM. See the [Storage Configuration](#storage-configuration). + Storage []DiskConfig `mapstructure:"storage"` +} + +func (c *StorageConfig) Prepare() []error { + var errs []error + + if len(c.Storage) > 0 { + for i, storage := range c.Storage { + if storage.DiskSize == 0 { + errs = append(errs, fmt.Errorf("storage[%d].'disk_size' is required", i)) + } + if storage.DiskControllerIndex >= len(c.DiskControllerType) { + errs = append(errs, fmt.Errorf("storage[%d].'disk_controller_index' references an unknown disk controller", i)) + } + } + } + + return errs +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.hcl2spec.go new file mode 100644 index 000000000..1d8fbd8c5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/storage_config.hcl2spec.go @@ -0,0 +1,62 @@ +// Code generated by "mapstructure-to-hcl2 -type StorageConfig,DiskConfig"; DO NOT EDIT. + +package common + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatDiskConfig is an auto-generated flat version of DiskConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatDiskConfig struct { + DiskSize *int64 `mapstructure:"disk_size" required:"true" cty:"disk_size" hcl:"disk_size"` + DiskThinProvisioned *bool `mapstructure:"disk_thin_provisioned" cty:"disk_thin_provisioned" hcl:"disk_thin_provisioned"` + DiskEagerlyScrub *bool `mapstructure:"disk_eagerly_scrub" cty:"disk_eagerly_scrub" hcl:"disk_eagerly_scrub"` + DiskControllerIndex *int `mapstructure:"disk_controller_index" cty:"disk_controller_index" hcl:"disk_controller_index"` +} + +// FlatMapstructure returns a new FlatDiskConfig. +// FlatDiskConfig is an auto-generated flat version of DiskConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*DiskConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatDiskConfig) +} + +// HCL2Spec returns the hcl spec of a DiskConfig. +// This spec is used by HCL to read the fields of DiskConfig. +// The decoded values from this spec will then be applied to a FlatDiskConfig. +func (*FlatDiskConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, + "disk_thin_provisioned": &hcldec.AttrSpec{Name: "disk_thin_provisioned", Type: cty.Bool, Required: false}, + "disk_eagerly_scrub": &hcldec.AttrSpec{Name: "disk_eagerly_scrub", Type: cty.Bool, Required: false}, + "disk_controller_index": &hcldec.AttrSpec{Name: "disk_controller_index", Type: cty.Number, Required: false}, + } + return s +} + +// FlatStorageConfig is an auto-generated flat version of StorageConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatStorageConfig struct { + DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` + Storage []FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` +} + +// FlatMapstructure returns a new FlatStorageConfig. +// FlatStorageConfig is an auto-generated flat version of StorageConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*StorageConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatStorageConfig) +} + +// HCL2Spec returns the hcl spec of a StorageConfig. +// This spec is used by HCL to read the fields of StorageConfig. +// The decoded values from this spec will then be applied to a FlatStorageConfig. +func (*FlatStorageConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, + "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*FlatDiskConfig)(nil).HCL2Spec())}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/cluster.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/cluster.go new file mode 100644 index 000000000..d17031b82 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/cluster.go @@ -0,0 +1,19 @@ +package driver + +import "github.com/vmware/govmomi/object" + +type Cluster struct { + driver *VCenterDriver + cluster *object.ClusterComputeResource +} + +func (d *VCenterDriver) FindCluster(name string) (*Cluster, error) { + c, err := d.finder.ClusterComputeResource(d.ctx, name) + if err != nil { + return nil, err + } + return &Cluster{ + cluster: c, + driver: d, + }, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore.go new file mode 100644 index 000000000..ae371b79f --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore.go @@ -0,0 +1,235 @@ +package driver + +import ( + "fmt" + "path" + "regexp" + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type Datastore interface { + Info(params ...string) (*mo.Datastore, error) + FileExists(path string) bool + DirExists(path string) bool + Name() string + ResolvePath(path string) string + UploadFile(src, dst, host string, setHost bool) error + Delete(path string) error + MakeDirectory(path string) error + Reference() types.ManagedObjectReference +} + +type DatastoreDriver struct { + ds *object.Datastore + driver *VCenterDriver +} + +func (d *VCenterDriver) NewDatastore(ref *types.ManagedObjectReference) Datastore { + return &DatastoreDriver{ + ds: object.NewDatastore(d.client.Client, *ref), + driver: d, + } +} + +// If name is an empty string, then resolve host's one +func (d *VCenterDriver) FindDatastore(name string, host string) (Datastore, error) { + if name == "" { + h, err := d.FindHost(host) + if err != nil { + return nil, fmt.Errorf("Error finding host for to get datastore: %s", err) + } + + i, err := h.Info("datastore") + if err != nil { + return nil, fmt.Errorf("Error getting datastore info from host: %s", err) + } + + if len(i.Datastore) > 1 { + return nil, fmt.Errorf("Host has multiple datastores. Specify it explicitly") + } + + ds := d.NewDatastore(&i.Datastore[0]) + inf, err := ds.Info("name") + if err != nil { + return nil, fmt.Errorf("Error getting datastore name: %s", err) + } + name = inf.Name + } + + ds, err := d.finder.Datastore(d.ctx, name) + if err != nil { + return nil, fmt.Errorf("Error finding datastore with name %s: %s", name, err) + } + + return &DatastoreDriver{ + ds: ds, + driver: d, + }, nil +} + +func (d *VCenterDriver) GetDatastoreName(id string) (string, error) { + obj := types.ManagedObjectReference{ + Type: "Datastore", + Value: id, + } + pc := property.DefaultCollector(d.vimClient) + var me mo.ManagedEntity + + err := pc.RetrieveOne(d.ctx, obj, []string{"name"}, &me) + if err != nil { + return id, err + } + return me.Name, nil +} + +func (ds *DatastoreDriver) Info(params ...string) (*mo.Datastore, error) { + var p []string + if len(params) == 0 { + p = []string{"*"} + } else { + p = params + } + var info mo.Datastore + err := ds.ds.Properties(ds.driver.ctx, ds.ds.Reference(), p, &info) + if err != nil { + return nil, err + } + return &info, nil +} + +func (ds *DatastoreDriver) DirExists(filepath string) bool { + _, err := ds.ds.Stat(ds.driver.ctx, filepath) + if _, ok := err.(object.DatastoreNoSuchDirectoryError); ok { + return false + } + return true +} + +func (ds *DatastoreDriver) FileExists(path string) bool { + _, err := ds.ds.Stat(ds.driver.ctx, path) + return err == nil +} + +func (ds *DatastoreDriver) Name() string { + return ds.ds.Name() +} + +func (ds *DatastoreDriver) Reference() types.ManagedObjectReference { + return ds.ds.Reference() +} + +func (ds *DatastoreDriver) ResolvePath(path string) string { + return ds.ds.Path(path) +} + +// The file ID isn't available via the API, so we use DatastoreBrowser to search +func (d *VCenterDriver) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) { + ref := types.ManagedObjectReference{Type: "Datastore", Value: datastoreID} + ds := object.NewDatastore(d.vimClient, ref) + + b, err := ds.Browser(d.ctx) + if err != nil { + return filename, err + } + ext := path.Ext(filename) + pat := strings.Replace(filename, ext, "*"+ext, 1) + spec := types.HostDatastoreBrowserSearchSpec{ + MatchPattern: []string{pat}, + } + + task, err := b.SearchDatastore(d.ctx, dir, &spec) + if err != nil { + return filename, err + } + + info, err := task.WaitForResult(d.ctx, nil) + if err != nil { + return filename, err + } + + res, ok := info.Result.(types.HostDatastoreBrowserSearchResults) + if !ok { + return filename, fmt.Errorf("search(%s) result type=%T", pat, info.Result) + } + + if len(res.File) != 1 { + return filename, fmt.Errorf("search(%s) result files=%d", pat, len(res.File)) + } + return res.File[0].GetFileInfo().Path, nil +} + +func (ds *DatastoreDriver) UploadFile(src, dst, host string, setHost bool) error { + p := soap.DefaultUpload + ctx := ds.driver.ctx + + if setHost && host != "" { + h, err := ds.driver.FindHost(host) + if err != nil { + return err + } + ctx = ds.ds.HostContext(ctx, h.host) + } + + return ds.ds.UploadFile(ctx, src, dst, &p) +} + +func (ds *DatastoreDriver) Delete(path string) error { + dc, err := ds.driver.finder.Datacenter(ds.driver.ctx, ds.ds.DatacenterPath) + if err != nil { + return err + } + fm := ds.ds.NewFileManager(dc, false) + return fm.Delete(ds.driver.ctx, path) +} + +func (ds *DatastoreDriver) MakeDirectory(path string) error { + dc, err := ds.driver.finder.Datacenter(ds.driver.ctx, ds.ds.DatacenterPath) + if err != nil { + return err + } + fm := ds.ds.NewFileManager(dc, false) + return fm.FileManager.MakeDirectory(ds.driver.ctx, path, dc, true) +} + +// Cuts out the datastore prefix +// Example: "[datastore1] file.ext" --> "file.ext" +func RemoveDatastorePrefix(path string) string { + res := object.DatastorePath{} + if hadPrefix := res.FromString(path); hadPrefix { + return res.Path + } else { + return path + } +} + +type DatastoreIsoPath struct { + path string +} + +func (d *DatastoreIsoPath) Validate() bool { + // Matches: + // [datastore] /dir/subdir/file + // [datastore] dir/subdir/file + // [] /dir/subdir/file + // [data-store] /dir/subdir/file + // dir/subdir/file or dir/subdir/file + matched, _ := regexp.MatchString(`^\s*(\[[^\[\]\/]*\])?\s*[^\[\]]+\s*$`, d.path) + return matched +} + +func (d *DatastoreIsoPath) GetFilePath() string { + filePath := d.path + parts := strings.Split(d.path, "]") + if len(parts) > 1 { + // removes datastore name from path + filePath = parts[1] + filePath = strings.TrimSpace(filePath) + } + return filePath +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore_mock.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore_mock.go new file mode 100644 index 000000000..9330d9227 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/datastore_mock.go @@ -0,0 +1,81 @@ +package driver + +import ( + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type DatastoreMock struct { + FileExistsCalled bool + FileExistsReturn bool + + DirExistsCalled bool + DirExistsReturn bool + + NameReturn string + + MakeDirectoryCalled bool + + ResolvePathCalled bool + ResolvePathReturn string + + DeleteCalled bool + DeletePath string + DeleteErr error + + UploadFileCalled bool + UploadFileSrc string + UploadFileDst string + UploadFileHost string + UploadFileSetHost bool + UploadFileErr error +} + +func (ds *DatastoreMock) Info(params ...string) (*mo.Datastore, error) { + return nil, nil +} + +func (ds *DatastoreMock) FileExists(path string) bool { + ds.FileExistsCalled = true + return ds.FileExistsReturn +} + +func (ds *DatastoreMock) DirExists(path string) bool { + ds.DirExistsCalled = true + return ds.DirExistsReturn +} +func (ds *DatastoreMock) Name() string { + if ds.NameReturn == "" { + return "datastore-mock" + } + return ds.NameReturn +} + +func (ds *DatastoreMock) Reference() types.ManagedObjectReference { + return types.ManagedObjectReference{} +} + +func (ds *DatastoreMock) ResolvePath(path string) string { + ds.ResolvePathCalled = true + return ds.ResolvePathReturn +} + +func (ds *DatastoreMock) UploadFile(src, dst, host string, setHost bool) error { + ds.UploadFileCalled = true + ds.UploadFileSrc = src + ds.UploadFileDst = dst + ds.UploadFileHost = host + ds.UploadFileSetHost = setHost + return ds.UploadFileErr +} + +func (ds *DatastoreMock) Delete(path string) error { + ds.DeleteCalled = true + ds.DeletePath = path + return ds.DeleteErr +} + +func (ds *DatastoreMock) MakeDirectory(path string) error { + ds.MakeDirectoryCalled = true + return nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/disk.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/disk.go new file mode 100644 index 000000000..a51201992 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/disk.go @@ -0,0 +1,85 @@ +package driver + +import ( + "errors" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type Disk struct { + DiskSize int64 + DiskEagerlyScrub bool + DiskThinProvisioned bool + ControllerIndex int +} + +type StorageConfig struct { + DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic" + Storage []Disk +} + +func (c *StorageConfig) AddStorageDevices(existingDevices object.VirtualDeviceList) ([]types.BaseVirtualDeviceConfigSpec, error) { + newDevices := object.VirtualDeviceList{} + + // Create new controller based on existing devices list and add it to the new devices list + // to confirm creation + var controllers []types.BaseVirtualController + for _, controllerType := range c.DiskControllerType { + var device types.BaseVirtualDevice + var err error + if controllerType == "nvme" { + device, err = existingDevices.CreateNVMEController() + } else { + device, err = existingDevices.CreateSCSIController(controllerType) + } + if err != nil { + return nil, err + } + existingDevices = append(existingDevices, device) + newDevices = append(newDevices, device) + controller, err := existingDevices.FindDiskController(existingDevices.Name(device)) + if err != nil { + return nil, err + } + controllers = append(controllers, controller) + } + + for _, dc := range c.Storage { + disk := &types.VirtualDisk{ + VirtualDevice: types.VirtualDevice{ + Key: existingDevices.NewKey(), + Backing: &types.VirtualDiskFlatVer2BackingInfo{ + DiskMode: string(types.VirtualDiskModePersistent), + ThinProvisioned: types.NewBool(dc.DiskThinProvisioned), + EagerlyScrub: types.NewBool(dc.DiskEagerlyScrub), + }, + }, + CapacityInKB: dc.DiskSize * 1024, + } + + existingDevices.AssignController(disk, controllers[dc.ControllerIndex]) + existingDevices = append(existingDevices, disk) + newDevices = append(newDevices, disk) + } + + return newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) +} + +func findDisk(devices object.VirtualDeviceList) (*types.VirtualDisk, error) { + var disks []*types.VirtualDisk + for _, device := range devices { + switch d := device.(type) { + case *types.VirtualDisk: + disks = append(disks, d) + } + } + + switch len(disks) { + case 0: + return nil, errors.New("VM has no disks") + case 1: + return disks[0], nil + } + return nil, errors.New("VM has multiple disks") +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver.go new file mode 100644 index 000000000..8fbab96e5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver.go @@ -0,0 +1,129 @@ +package driver + +import ( + "context" + "fmt" + "net/url" + "time" + + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/session" + "github.com/vmware/govmomi/vapi/library" + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type Driver interface { + NewVM(ref *types.ManagedObjectReference) VirtualMachine + FindVM(name string) (VirtualMachine, error) + FindCluster(name string) (*Cluster, error) + PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error + CreateVM(config *CreateConfig) (VirtualMachine, error) + + NewDatastore(ref *types.ManagedObjectReference) Datastore + FindDatastore(name string, host string) (Datastore, error) + GetDatastoreName(id string) (string, error) + GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) + + NewFolder(ref *types.ManagedObjectReference) *Folder + FindFolder(name string) (*Folder, error) + NewHost(ref *types.ManagedObjectReference) *Host + FindHost(name string) (*Host, error) + NewNetwork(ref *types.ManagedObjectReference) *Network + FindNetwork(name string) (*Network, error) + FindNetworks(name string) ([]*Network, error) + NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool + FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) + + FindContentLibraryByName(name string) (*Library, error) + FindContentLibraryItem(libraryId string, name string) (*library.Item, error) + FindContentLibraryFileDatastorePath(isoPath string) (string, error) +} + +type VCenterDriver struct { + // context that controls the authenticated sessions used to run the VM commands + ctx context.Context + client *govmomi.Client + vimClient *vim25.Client + restClient *RestClient + finder *find.Finder + datacenter *object.Datacenter +} + +type ConnectConfig struct { + VCenterServer string + Username string + Password string + InsecureConnection bool + Datacenter string +} + +func NewDriver(config *ConnectConfig) (Driver, error) { + ctx := context.TODO() + + vcenterUrl, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer)) + if err != nil { + return nil, err + } + credentials := url.UserPassword(config.Username, config.Password) + vcenterUrl.User = credentials + + soapClient := soap.NewClient(vcenterUrl, config.InsecureConnection) + vimClient, err := vim25.NewClient(ctx, soapClient) + if err != nil { + return nil, err + } + + vimClient.RoundTripper = session.KeepAlive(vimClient.RoundTripper, 10*time.Minute) + client := &govmomi.Client{ + Client: vimClient, + SessionManager: session.NewManager(vimClient), + } + + err = client.SessionManager.Login(ctx, credentials) + if err != nil { + return nil, err + } + + finder := find.NewFinder(client.Client, false) + datacenter, err := finder.DatacenterOrDefault(ctx, config.Datacenter) + if err != nil { + return nil, err + } + finder.SetDatacenter(datacenter) + + d := &VCenterDriver{ + ctx: ctx, + client: client, + vimClient: vimClient, + restClient: &RestClient{ + client: rest.NewClient(vimClient), + credentials: credentials, + }, + datacenter: datacenter, + finder: finder, + } + return d, nil +} + +// The rest.Client requires vCenter. +// RestClient is to modularize the rest.Client session and use it only when is necessary. +// This will allow users without vCenter to use the other features that doesn't use the rest.Client. +// To use the client login/logout must be done to create an authenticated session. +type RestClient struct { + client *rest.Client + credentials *url.Userinfo +} + +func (r *RestClient) Login(ctx context.Context) error { + return r.client.Login(ctx, r.credentials) +} + +func (r *RestClient) Logout(ctx context.Context) error { + return r.client.Logout(ctx) +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver_mock.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver_mock.go new file mode 100644 index 000000000..03fa736fb --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/driver_mock.go @@ -0,0 +1,119 @@ +package driver + +import ( + "fmt" + + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/vmware/govmomi/vapi/library" + "github.com/vmware/govmomi/vim25/types" +) + +type DriverMock struct { + FindDatastoreCalled bool + DatastoreMock *DatastoreMock + FindDatastoreName string + FindDatastoreHost string + FindDatastoreErr error + + PreCleanShouldFail bool + PreCleanVMCalled bool + PreCleanForce bool + PreCleanVMPath string + + CreateVMShouldFail bool + CreateVMCalled bool + CreateConfig *CreateConfig + VM VirtualMachine + + FindVMCalled bool + FindVMName string +} + +func NewDriverMock() *DriverMock { + return new(DriverMock) +} + +func (d *DriverMock) FindDatastore(name string, host string) (Datastore, error) { + d.FindDatastoreCalled = true + if d.DatastoreMock == nil { + d.DatastoreMock = new(DatastoreMock) + } + d.FindDatastoreName = name + d.FindDatastoreHost = host + return d.DatastoreMock, d.FindDatastoreErr +} + +func (d *DriverMock) NewVM(ref *types.ManagedObjectReference) VirtualMachine { + return nil +} + +func (d *DriverMock) FindVM(name string) (VirtualMachine, error) { + d.FindVMCalled = true + if d.VM == nil { + d.VM = new(VirtualMachineMock) + } + d.FindVMName = name + return d.VM, d.FindDatastoreErr +} + +func (d *DriverMock) FindCluster(name string) (*Cluster, error) { + return nil, nil +} + +func (d *DriverMock) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { + d.PreCleanVMCalled = true + if d.PreCleanShouldFail { + return fmt.Errorf("pre clean failed") + } + d.PreCleanForce = true + d.PreCleanVMPath = vmPath + return nil +} + +func (d *DriverMock) CreateVM(config *CreateConfig) (VirtualMachine, error) { + d.CreateVMCalled = true + if d.CreateVMShouldFail { + return nil, fmt.Errorf("create vm failed") + } + d.CreateConfig = config + d.VM = new(VirtualMachineDriver) + return d.VM, nil +} + +func (d *DriverMock) NewDatastore(ref *types.ManagedObjectReference) Datastore { return nil } + +func (d *DriverMock) GetDatastoreName(id string) (string, error) { return "", nil } + +func (d *DriverMock) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) { + return "", nil +} + +func (d *DriverMock) NewFolder(ref *types.ManagedObjectReference) *Folder { return nil } + +func (d *DriverMock) FindFolder(name string) (*Folder, error) { return nil, nil } + +func (d *DriverMock) NewHost(ref *types.ManagedObjectReference) *Host { return nil } + +func (d *DriverMock) FindHost(name string) (*Host, error) { return nil, nil } + +func (d *DriverMock) NewNetwork(ref *types.ManagedObjectReference) *Network { return nil } + +func (d *DriverMock) FindNetwork(name string) (*Network, error) { return nil, nil } + +func (d *DriverMock) FindNetworks(name string) ([]*Network, error) { return nil, nil } + +func (d *DriverMock) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { return nil } + +func (d *DriverMock) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { + return nil, nil +} + +func (d *DriverMock) FindContentLibraryByName(name string) (*Library, error) { return nil, nil } + +func (d *DriverMock) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { + return nil, nil +} + +func (d *DriverMock) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { + return "", nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/folder.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/folder.go new file mode 100644 index 000000000..75e07e594 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/folder.go @@ -0,0 +1,93 @@ +package driver + +import ( + "fmt" + "path" + "strings" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type Folder struct { + driver *VCenterDriver + folder *object.Folder +} + +func (d *VCenterDriver) NewFolder(ref *types.ManagedObjectReference) *Folder { + return &Folder{ + folder: object.NewFolder(d.client.Client, *ref), + driver: d, + } +} + +func (d *VCenterDriver) FindFolder(name string) (*Folder, error) { + if name != "" { + // create folders if they don't exist + parent := "" + parentFolder, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm")) + if err != nil { + return nil, err + } + folders := strings.Split(name, "/") + for _, folder := range folders { + parent = path.Join(parent, folder) + f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", parent)) + if _, ok := err.(*find.NotFoundError); ok { + f, err = parentFolder.CreateFolder(d.ctx, folder) + } + if err != nil { + return nil, err + } + parentFolder = f + } + } + + f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", name)) + if err != nil { + return nil, err + } + + return &Folder{ + folder: f, + driver: d, + }, nil +} + +func (f *Folder) Info(params ...string) (*mo.Folder, error) { + var p []string + if len(params) == 0 { + p = []string{"*"} + } else { + p = params + } + var info mo.Folder + err := f.folder.Properties(f.driver.ctx, f.folder.Reference(), p, &info) + if err != nil { + return nil, err + } + return &info, nil +} + +func (f *Folder) Path() (string, error) { + info, err := f.Info("name", "parent") + if err != nil { + return "", err + } + if info.Parent.Type == "Datacenter" { + return "", nil + } else { + parent := f.driver.NewFolder(info.Parent) + path, err := parent.Path() + if err != nil { + return "", err + } + if path == "" { + return info.Name, nil + } else { + return fmt.Sprintf("%v/%v", path, info.Name), nil + } + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/host.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/host.go new file mode 100644 index 000000000..31c193589 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/host.go @@ -0,0 +1,45 @@ +package driver + +import ( + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type Host struct { + driver *VCenterDriver + host *object.HostSystem +} + +func (d *VCenterDriver) NewHost(ref *types.ManagedObjectReference) *Host { + return &Host{ + host: object.NewHostSystem(d.client.Client, *ref), + driver: d, + } +} + +func (d *VCenterDriver) FindHost(name string) (*Host, error) { + h, err := d.finder.HostSystem(d.ctx, name) + if err != nil { + return nil, err + } + return &Host{ + host: h, + driver: d, + }, nil +} + +func (h *Host) Info(params ...string) (*mo.HostSystem, error) { + var p []string + if len(params) == 0 { + p = []string{"*"} + } else { + p = params + } + var info mo.HostSystem + err := h.host.Properties(h.driver.ctx, h.host.Reference(), p, &info) + if err != nil { + return nil, err + } + return &info, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/library.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/library.go new file mode 100644 index 000000000..25d7d6880 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/library.go @@ -0,0 +1,113 @@ +package driver + +import ( + "fmt" + "log" + "path" + "strings" + + "github.com/vmware/govmomi/vapi/library" +) + +type Library struct { + driver *VCenterDriver + library *library.Library +} + +func (d *VCenterDriver) FindContentLibraryByName(name string) (*Library, error) { + lm := library.NewManager(d.restClient.client) + l, err := lm.GetLibraryByName(d.ctx, name) + if err != nil { + return nil, err + } + return &Library{ + library: l, + driver: d, + }, nil +} + +func (d *VCenterDriver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { + lm := library.NewManager(d.restClient.client) + items, err := lm.GetLibraryItems(d.ctx, libraryId) + if err != nil { + return nil, err + } + for _, item := range items { + if item.Name == name { + return &item, nil + } + } + return nil, fmt.Errorf("Item %s not found", name) +} + +func (d *VCenterDriver) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { + log.Printf("Check if ISO path is a Content Library path") + err := d.restClient.Login(d.ctx) + if err != nil { + log.Printf("vCenter client not available. ISO path not identified as a Content Library path") + return isoPath, err + } + + libraryFilePath := &LibraryFilePath{path: isoPath} + err = libraryFilePath.Validate() + if err != nil { + log.Printf("ISO path not identified as a Content Library path") + return isoPath, err + } + libraryName := libraryFilePath.GetLibraryName() + itemName := libraryFilePath.GetLibraryItemName() + isoFile := libraryFilePath.GetFileName() + + lib, err := d.FindContentLibraryByName(libraryName) + if err != nil { + log.Printf("ISO path not identified as a Content Library path") + return isoPath, err + } + log.Printf("ISO path identified as a Content Library path") + log.Printf("Finding the equivalent datastore path for the Content Library ISO file path") + libItem, err := d.FindContentLibraryItem(lib.library.ID, itemName) + if err != nil { + log.Printf("[WARN] Couldn't find item %s: %s", itemName, err.Error()) + return isoPath, err + } + datastoreName, err := d.GetDatastoreName(lib.library.Storage[0].DatastoreID) + if err != nil { + log.Printf("[WARN] Couldn't find datastore name for library %s", libraryName) + return isoPath, err + } + libItemDir := fmt.Sprintf("[%s] contentlib-%s/%s", datastoreName, lib.library.ID, libItem.ID) + + isoFilePath, err := d.GetDatastoreFilePath(lib.library.Storage[0].DatastoreID, libItemDir, isoFile) + if err != nil { + log.Printf("[WARN] Couldn't find datastore ID path for %s", isoFile) + return isoPath, err + } + + _ = d.restClient.Logout(d.ctx) + return path.Join(libItemDir, isoFilePath), nil +} + +type LibraryFilePath struct { + path string +} + +func (l *LibraryFilePath) Validate() error { + l.path = strings.TrimLeft(l.path, "/") + parts := strings.Split(l.path, "/") + if len(parts) != 3 { + return fmt.Errorf("Not a valid Content Library File path. The path must contain the nanmes for the library, item and file.") + } + return nil +} + +func (l *LibraryFilePath) GetLibraryName() string { + return strings.Split(l.path, "/")[0] +} + +func (l *LibraryFilePath) GetLibraryItemName() string { + return strings.Split(l.path, "/")[1] +} + +func (l *LibraryFilePath) GetFileName() string { + return strings.Split(l.path, "/")[2] +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/network.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/network.go new file mode 100644 index 000000000..f2d90d187 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/network.go @@ -0,0 +1,77 @@ +package driver + +import ( + "fmt" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type Network struct { + driver *VCenterDriver + network object.NetworkReference +} + +func (d *VCenterDriver) NewNetwork(ref *types.ManagedObjectReference) *Network { + return &Network{ + network: object.NewNetwork(d.client.Client, *ref), + driver: d, + } +} + +func (d *VCenterDriver) FindNetwork(name string) (*Network, error) { + n, err := d.finder.Network(d.ctx, name) + if err != nil { + return nil, err + } + return &Network{ + network: n, + driver: d, + }, nil +} + +func (d *VCenterDriver) FindNetworks(name string) ([]*Network, error) { + ns, err := d.finder.NetworkList(d.ctx, name) + if err != nil { + return nil, err + } + var networks []*Network + for _, n := range ns { + networks = append(networks, &Network{ + network: n, + driver: d, + }) + } + return networks, nil +} + +func (n *Network) Info(params ...string) (*mo.Network, error) { + var p []string + if len(params) == 0 { + p = []string{"*"} + } else { + p = params + } + var info mo.Network + + network, ok := n.network.(*object.Network) + if !ok { + return nil, fmt.Errorf("unexpected %t network object type", n.network) + } + + err := network.Properties(n.driver.ctx, network.Reference(), p, &info) + if err != nil { + return nil, err + } + return &info, nil +} + +type MultipleNetworkFoundError struct { + path string + append string +} + +func (e *MultipleNetworkFoundError) Error() string { + return fmt.Sprintf("path '%s' resolves to multiple networks. %s", e.path, e.append) +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/resource_pool.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/resource_pool.go new file mode 100644 index 000000000..c982078b0 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/resource_pool.go @@ -0,0 +1,91 @@ +package driver + +import ( + "fmt" + "log" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type ResourcePool struct { + pool *object.ResourcePool + driver *VCenterDriver +} + +func (d *VCenterDriver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { + return &ResourcePool{ + pool: object.NewResourcePool(d.client.Client, *ref), + driver: d, + } +} + +func (d *VCenterDriver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { + var res string + if cluster != "" { + res = cluster + } else { + res = host + } + + resourcePath := fmt.Sprintf("%v/Resources/%v", res, name) + p, err := d.finder.ResourcePool(d.ctx, resourcePath) + if err != nil { + log.Printf("[WARN] %s not found. Looking for default resource pool.", resourcePath) + dp, dperr := d.finder.DefaultResourcePool(d.ctx) + if _, ok := dperr.(*find.NotFoundError); ok { + // VirtualApp extends ResourcePool, so it should support VirtualApp types. + vapp, verr := d.finder.VirtualApp(d.ctx, name) + if verr != nil { + return nil, err + } + dp = vapp.ResourcePool + } else if dperr != nil { + return nil, err + } + p = dp + } + + return &ResourcePool{ + pool: p, + driver: d, + }, nil +} + +func (p *ResourcePool) Info(params ...string) (*mo.ResourcePool, error) { + var params2 []string + if len(params) == 0 { + params2 = []string{"*"} + } else { + params2 = params + } + var info mo.ResourcePool + err := p.pool.Properties(p.driver.ctx, p.pool.Reference(), params2, &info) + if err != nil { + return nil, err + } + return &info, nil +} + +func (p *ResourcePool) Path() (string, error) { + poolInfo, err := p.Info("name", "parent") + if err != nil { + return "", err + } + if poolInfo.Parent.Type == "ComputeResource" { + return "", nil + } else { + parent := p.driver.NewResourcePool(poolInfo.Parent) + parentPath, err := parent.Path() + if err != nil { + return "", err + } + if parentPath == "" { + return poolInfo.Name, nil + } else { + return fmt.Sprintf("%v/%v", parentPath, poolInfo.Name), nil + } + } +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm.go new file mode 100644 index 000000000..0c739d108 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm.go @@ -0,0 +1,1102 @@ +package driver + +import ( + "context" + "errors" + "fmt" + "log" + "net" + "reflect" + "strings" + "time" + + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/nfc" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vapi/vcenter" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type VirtualMachine interface { + Info(params ...string) (*mo.VirtualMachine, error) + Devices() (object.VirtualDeviceList, error) + FloppyDevices() (object.VirtualDeviceList, error) + Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) + updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) + AddPublicKeys(ctx context.Context, publicKeys string) error + Properties(ctx context.Context) (*mo.VirtualMachine, error) + Destroy() error + Configure(config *HardwareConfig) error + Customize(spec types.CustomizationSpec) error + ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) + WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) + PowerOn() error + PowerOff() error + IsPoweredOff() (bool, error) + StartShutdown() error + WaitForShutdown(ctx context.Context, timeout time.Duration) error + CreateSnapshot(name string) error + ConvertToTemplate() error + ImportOvfToContentLibrary(ovf vcenter.OVF) error + ImportToContentLibrary(template vcenter.Template) error + GetDir() (string, error) + AddFloppy(imgPath string) error + SetBootOrder(order []string) error + RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error + addDevice(device types.BaseVirtualDevice) error + AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error + Export() (*nfc.Lease, error) + CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) + NewOvfManager() *ovf.Manager + GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) + + AddCdrom(controllerType string, datastoreIsoPath string) error + CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) + RemoveCdroms() error + EjectCdroms() error + AddSATAController() error + FindSATAController() (*types.VirtualAHCIController, error) +} + +type VirtualMachineDriver struct { + vm *object.VirtualMachine + driver *VCenterDriver +} + +type CloneConfig struct { + Name string + Folder string + Cluster string + Host string + ResourcePool string + Datastore string + LinkedClone bool + Network string + MacAddress string + Annotation string + VAppProperties map[string]string + PrimaryDiskSize int64 + StorageConfig StorageConfig +} + +type HardwareConfig struct { + CPUs int32 + CpuCores int32 + CPUReservation int64 + CPULimit int64 + RAM int64 + RAMReservation int64 + RAMReserveAll bool + NestedHV bool + CpuHotAddEnabled bool + MemoryHotAddEnabled bool + VideoRAM int64 + VGPUProfile string + Firmware string + ForceBIOSSetup bool +} + +type NIC struct { + Network string // "" for default network + NetworkCard string // example: vmxnet3 + MacAddress string // set mac if want specific address + Passthrough *bool // direct path i/o +} + +type CreateConfig struct { + Annotation string + Name string + Folder string + Cluster string + Host string + ResourcePool string + Datastore string + GuestOS string // example: otherGuest + NICs []NIC + USBController []string + Version uint // example: 10 + StorageConfig StorageConfig +} + +func (d *VCenterDriver) NewVM(ref *types.ManagedObjectReference) VirtualMachine { + return &VirtualMachineDriver{ + vm: object.NewVirtualMachine(d.client.Client, *ref), + driver: d, + } +} + +func (d *VCenterDriver) FindVM(name string) (VirtualMachine, error) { + vm, err := d.finder.VirtualMachine(d.ctx, name) + if err != nil { + return nil, err + } + return &VirtualMachineDriver{ + vm: vm, + driver: d, + }, nil +} + +func (d *VCenterDriver) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { + vm, err := d.FindVM(vmPath) + if err != nil { + if _, ok := err.(*find.NotFoundError); !ok { + return fmt.Errorf("error looking up old vm: %v", err) + } + } + if force && vm != nil { + ui.Say(fmt.Sprintf("the vm/template %s already exists, but deleting it due to -force flag", vmPath)) + + // power off just in case it is still on + vm.PowerOff() + + err := vm.Destroy() + if err != nil { + return fmt.Errorf("error destroying %s: %v", vmPath, err) + } + } + if !force && vm != nil { + return fmt.Errorf("%s already exists, you can use -force flag to destroy it: %v", vmPath, err) + } + + return nil +} + +func (d *VCenterDriver) CreateVM(config *CreateConfig) (VirtualMachine, error) { + createSpec := types.VirtualMachineConfigSpec{ + Name: config.Name, + Annotation: config.Annotation, + GuestId: config.GuestOS, + } + if config.Version != 0 { + createSpec.Version = fmt.Sprintf("%s%d", "vmx-", config.Version) + } + + folder, err := d.FindFolder(config.Folder) + if err != nil { + return nil, err + } + + resourcePool, err := d.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) + if err != nil { + return nil, err + } + + var host *object.HostSystem + if config.Cluster != "" && config.Host != "" { + h, err := d.FindHost(config.Host) + if err != nil { + return nil, err + } + host = h.host + } + + datastore, err := d.FindDatastore(config.Datastore, config.Host) + if err != nil { + return nil, err + } + + devices := object.VirtualDeviceList{} + storageConfigSpec, err := config.StorageConfig.AddStorageDevices(devices) + if err != nil { + return nil, err + } + createSpec.DeviceChange = append(createSpec.DeviceChange, storageConfigSpec...) + + devices, err = addNetwork(d, devices, config) + if err != nil { + return nil, err + } + + t := true + for _, usbType := range config.USBController { + var usb types.BaseVirtualDevice + switch usbType { + // handle "true" and "1" for backwards compatibility + case "usb", "true", "1": + usb = &types.VirtualUSBController{ + EhciEnabled: &t, + } + case "xhci": + usb = new(types.VirtualUSBXHCIController) + default: + continue + } + + devices = append(devices, usb) + } + + devicesConfigSpec, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + if err != nil { + return nil, err + } + createSpec.DeviceChange = append(createSpec.DeviceChange, devicesConfigSpec...) + + createSpec.Files = &types.VirtualMachineFileInfo{ + VmPathName: fmt.Sprintf("[%s]", datastore.Name()), + } + + task, err := folder.folder.CreateVM(d.ctx, createSpec, resourcePool.pool, host) + if err != nil { + return nil, err + } + taskInfo, err := task.WaitForResult(d.ctx, nil) + if err != nil { + return nil, err + } + + vmRef, ok := taskInfo.Result.(types.ManagedObjectReference) + if !ok { + return nil, fmt.Errorf("something went wrong when creating the VM") + } + + return d.NewVM(&vmRef), nil +} + +func (vm *VirtualMachineDriver) Info(params ...string) (*mo.VirtualMachine, error) { + var p []string + if len(params) == 0 { + p = []string{"*"} + } else { + p = params + } + var info mo.VirtualMachine + err := vm.vm.Properties(vm.driver.ctx, vm.vm.Reference(), p, &info) + if err != nil { + return nil, err + } + return &info, nil +} + +func (vm *VirtualMachineDriver) Devices() (object.VirtualDeviceList, error) { + vmInfo, err := vm.Info("config.hardware.device") + if err != nil { + return nil, err + } + + return vmInfo.Config.Hardware.Device, nil +} + +func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error) { + device, err := vm.Devices() + if err != nil { + return device, err + } + floppies := device.SelectByType((*types.VirtualFloppy)(nil)) + return floppies, nil +} + +func (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { + folder, err := vm.driver.FindFolder(config.Folder) + if err != nil { + return nil, fmt.Errorf("Error finding filder: %s", err) + } + + var relocateSpec types.VirtualMachineRelocateSpec + + pool, err := vm.driver.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) + if err != nil { + return nil, fmt.Errorf("Error finding resource pool: %s", err) + } + poolRef := pool.pool.Reference() + relocateSpec.Pool = &poolRef + + datastore, err := vm.driver.FindDatastore(config.Datastore, config.Host) + if err != nil { + return nil, fmt.Errorf("Error finding datastore: %s", err) + } + datastoreRef := datastore.Reference() + relocateSpec.Datastore = &datastoreRef + + var cloneSpec types.VirtualMachineCloneSpec + cloneSpec.Location = relocateSpec + cloneSpec.PowerOn = false + + if config.LinkedClone == true { + cloneSpec.Location.DiskMoveType = "createNewChildDiskBacking" + + tpl, err := vm.Info("snapshot") + if err != nil { + return nil, fmt.Errorf("Error getting snapshot info for vm: %s", err) + } + if tpl.Snapshot == nil { + err = errors.New("`linked_clone=true`, but template has no snapshots") + return nil, err + } + cloneSpec.Snapshot = tpl.Snapshot.CurrentSnapshot + } + + var configSpec types.VirtualMachineConfigSpec + cloneSpec.Config = &configSpec + + if config.Annotation != "" { + configSpec.Annotation = config.Annotation + } + + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return nil, err + } + + if config.PrimaryDiskSize > 0 { + deviceResizeSpec, err := vm.ResizeDisk(config.PrimaryDiskSize) + if err != nil { + return nil, fmt.Errorf("failed to resize primary disk: %s", err.Error()) + } + configSpec.DeviceChange = append(configSpec.DeviceChange, deviceResizeSpec...) + } + + virtualDisks := devices.SelectByType((*types.VirtualDisk)(nil)) + virtualControllers := devices.SelectByType((*types.VirtualController)(nil)) + + // Use existing devices to avoid overlapping configuration + existingDevices := object.VirtualDeviceList{} + existingDevices = append(existingDevices, virtualDisks...) + existingDevices = append(existingDevices, virtualControllers...) + + storageConfigSpec, err := config.StorageConfig.AddStorageDevices(existingDevices) + if err != nil { + return nil, fmt.Errorf("failed to add storage devices: %s", err.Error()) + } + configSpec.DeviceChange = append(configSpec.DeviceChange, storageConfigSpec...) + + if config.Network != "" { + net, err := vm.driver.FindNetwork(config.Network) + if err != nil { + return nil, fmt.Errorf("Error finding network: %s", err) + } + backing, err := net.network.EthernetCardBackingInfo(ctx) + if err != nil { + return nil, fmt.Errorf("Error finding ethernet card backing info: %s", err) + } + + devices, err := vm.vm.Device(ctx) + if err != nil { + return nil, fmt.Errorf("Error finding vm devices: %s", err) + } + + adapter, err := findNetworkAdapter(devices) + if err != nil { + return nil, fmt.Errorf("Error finding network adapter: %s", err) + } + + current := adapter.GetVirtualEthernetCard() + current.Backing = backing + current.MacAddress = config.MacAddress + + config := &types.VirtualDeviceConfigSpec{ + Device: adapter.(types.BaseVirtualDevice), + Operation: types.VirtualDeviceConfigSpecOperationEdit, + } + + configSpec.DeviceChange = append(configSpec.DeviceChange, config) + } + + vAppConfig, err := vm.updateVAppConfig(ctx, config.VAppProperties) + if err != nil { + return nil, fmt.Errorf("Error updating VAppConfig: %s", err) + } + configSpec.VAppConfig = vAppConfig + + task, err := vm.vm.Clone(vm.driver.ctx, folder.folder, config.Name, cloneSpec) + if err != nil { + return nil, fmt.Errorf("Error calling vm.vm.Clone task: %s", err) + } + + info, err := task.WaitForResult(ctx, nil) + if err != nil { + if ctx.Err() == context.Canceled { + err = task.Cancel(context.TODO()) + return nil, err + } + + return nil, fmt.Errorf("Error waiting for vm Clone to complete: %s", err) + } + + vmRef, ok := info.Result.(types.ManagedObjectReference) + if !ok { + return nil, fmt.Errorf("something went wrong when cloning the VM") + } + + created := vm.driver.NewVM(&vmRef) + return created, nil +} + +func (vm *VirtualMachineDriver) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { + if len(newProps) == 0 { + return nil, nil + } + + vProps, _ := vm.Properties(ctx) + if vProps.Config.VAppConfig == nil { + return nil, fmt.Errorf("this VM lacks a vApp configuration and cannot have vApp properties set on it") + } + + allProperties := vProps.Config.VAppConfig.GetVmConfigInfo().Property + + var props []types.VAppPropertySpec + for _, p := range allProperties { + userValue, setByUser := newProps[p.Id] + if !setByUser { + continue + } + + if *p.UserConfigurable == false { + return nil, fmt.Errorf("vApp property with userConfigurable=false specified in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) + } + + prop := types.VAppPropertySpec{ + ArrayUpdateSpec: types.ArrayUpdateSpec{ + Operation: types.ArrayUpdateOperationEdit, + }, + Info: &types.VAppPropertyInfo{ + Key: p.Key, + Id: p.Id, + Value: userValue, + UserConfigurable: p.UserConfigurable, + }, + } + props = append(props, prop) + + delete(newProps, p.Id) + } + + if len(newProps) > 0 { + return nil, fmt.Errorf("unsupported vApp properties in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) + } + + return &types.VmConfigSpec{ + Property: props, + }, nil +} + +func (vm *VirtualMachineDriver) AddPublicKeys(ctx context.Context, publicKeys string) error { + newProps := map[string]string{"public-keys": publicKeys} + config, err := vm.updateVAppConfig(ctx, newProps) + if err != nil { + return fmt.Errorf("not possible to save temporary public key: %s", err.Error()) + } + + confSpec := types.VirtualMachineConfigSpec{VAppConfig: config} + task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) + if err != nil { + return err + } + + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) Properties(ctx context.Context) (*mo.VirtualMachine, error) { + log.Printf("fetching properties for VM %q", vm.vm.InventoryPath) + var props mo.VirtualMachine + if err := vm.vm.Properties(ctx, vm.vm.Reference(), nil, &props); err != nil { + return nil, err + } + return &props, nil +} + +func (vm *VirtualMachineDriver) Destroy() error { + task, err := vm.vm.Destroy(vm.driver.ctx) + if err != nil { + return err + } + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) Configure(config *HardwareConfig) error { + var confSpec types.VirtualMachineConfigSpec + confSpec.NumCPUs = config.CPUs + confSpec.NumCoresPerSocket = config.CpuCores + confSpec.MemoryMB = config.RAM + + var cpuSpec types.ResourceAllocationInfo + cpuSpec.Reservation = &config.CPUReservation + if config.CPULimit != 0 { + cpuSpec.Limit = &config.CPULimit + } + confSpec.CpuAllocation = &cpuSpec + + var ramSpec types.ResourceAllocationInfo + ramSpec.Reservation = &config.RAMReservation + confSpec.MemoryAllocation = &ramSpec + + confSpec.MemoryReservationLockedToMax = &config.RAMReserveAll + confSpec.NestedHVEnabled = &config.NestedHV + + confSpec.CpuHotAddEnabled = &config.CpuHotAddEnabled + confSpec.MemoryHotAddEnabled = &config.MemoryHotAddEnabled + + if config.VideoRAM != 0 { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return err + } + l := devices.SelectByType((*types.VirtualMachineVideoCard)(nil)) + if len(l) != 1 { + return err + } + card := l[0].(*types.VirtualMachineVideoCard) + + card.VideoRamSizeInKB = config.VideoRAM + + spec := &types.VirtualDeviceConfigSpec{ + Device: card, + Operation: types.VirtualDeviceConfigSpecOperationEdit, + } + confSpec.DeviceChange = append(confSpec.DeviceChange, spec) + } + if config.VGPUProfile != "" { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return err + } + + pciDevices := devices.SelectByType((*types.VirtualPCIPassthrough)(nil)) + vGPUDevices := pciDevices.SelectByBackingInfo((*types.VirtualPCIPassthroughVmiopBackingInfo)(nil)) + var operation types.VirtualDeviceConfigSpecOperation + if len(vGPUDevices) > 1 { + return err + } else if len(pciDevices) == 1 { + operation = types.VirtualDeviceConfigSpecOperationEdit + } else if len(pciDevices) == 0 { + operation = types.VirtualDeviceConfigSpecOperationAdd + } + + vGPUProfile := newVGPUProfile(config.VGPUProfile) + spec := &types.VirtualDeviceConfigSpec{ + Device: &vGPUProfile, + Operation: operation, + } + log.Printf("Adding vGPU device with profile '%s'", config.VGPUProfile) + confSpec.DeviceChange = append(confSpec.DeviceChange, spec) + } + + efiSecureBootEnabled := false + firmware := config.Firmware + + if firmware == "efi-secure" { + firmware = "efi" + efiSecureBootEnabled = true + } + + confSpec.Firmware = firmware + confSpec.BootOptions = &types.VirtualMachineBootOptions{ + EnterBIOSSetup: types.NewBool(config.ForceBIOSSetup), + EfiSecureBootEnabled: types.NewBool(efiSecureBootEnabled), + } + + task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) + if err != nil { + return err + } + + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) Customize(spec types.CustomizationSpec) error { + task, err := vm.vm.Customize(vm.driver.ctx, spec) + if err != nil { + return err + } + return task.Wait(vm.driver.ctx) +} + +func (vm *VirtualMachineDriver) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return nil, err + } + + disk, err := findDisk(devices) + if err != nil { + return nil, err + } + + disk.CapacityInKB = diskSize * 1024 + + return []types.BaseVirtualDeviceConfigSpec{ + &types.VirtualDeviceConfigSpec{ + Device: disk, + Operation: types.VirtualDeviceConfigSpecOperationEdit, + }, + }, nil +} + +func (vm *VirtualMachineDriver) PowerOn() error { + task, err := vm.vm.PowerOn(vm.driver.ctx) + if err != nil { + return err + } + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { + netIP, err := vm.vm.WaitForNetIP(ctx, false) + if err != nil { + return "", err + } + + for _, ips := range netIP { + for _, ip := range ips { + parseIP := net.ParseIP(ip) + if ipNet != nil && !ipNet.Contains(parseIP) { + // ip address is not in range + continue + } + // default to an ipv4 addresses if no ipNet is defined + if ipNet == nil && parseIP.To4() == nil { + continue + } + return ip, nil + } + } + + // unable to find an IP + return "", nil +} + +func (vm *VirtualMachineDriver) PowerOff() error { + state, err := vm.vm.PowerState(vm.driver.ctx) + if err != nil { + return err + } + + if state == types.VirtualMachinePowerStatePoweredOff { + return nil + } + + task, err := vm.vm.PowerOff(vm.driver.ctx) + if err != nil { + return err + } + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) IsPoweredOff() (bool, error) { + state, err := vm.vm.PowerState(vm.driver.ctx) + if err != nil { + return false, err + } + + return state == types.VirtualMachinePowerStatePoweredOff, nil +} + +func (vm *VirtualMachineDriver) StartShutdown() error { + err := vm.vm.ShutdownGuest(vm.driver.ctx) + return err +} + +func (vm *VirtualMachineDriver) WaitForShutdown(ctx context.Context, timeout time.Duration) error { + shutdownTimer := time.After(timeout) + for { + off, err := vm.IsPoweredOff() + if err != nil { + return err + } + if off { + break + } + + select { + case <-shutdownTimer: + err := errors.New("Timeout while waiting for machine to shut down.") + return err + case <-ctx.Done(): + return nil + default: + time.Sleep(1 * time.Second) + } + } + return nil +} + +func (vm *VirtualMachineDriver) CreateSnapshot(name string) error { + task, err := vm.vm.CreateSnapshot(vm.driver.ctx, name, "", false, false) + if err != nil { + return err + } + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) ConvertToTemplate() error { + return vm.vm.MarkAsTemplate(vm.driver.ctx) +} + +func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error { + err := vm.driver.restClient.Login(vm.driver.ctx) + if err != nil { + return err + } + + l, err := vm.driver.FindContentLibraryByName(ovf.Target.LibraryID) + if err != nil { + return err + } + if l.library.Type != "LOCAL" { + return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ + "the content library must be of type LOCAL", ovf.Target.LibraryID, l.library.Type) + } + + item, err := vm.driver.FindContentLibraryItem(l.library.ID, ovf.Spec.Name) + if err == nil { + // Updates existing library item + ovf.Target.LibraryItemID = item.ID + } + + ovf.Target.LibraryID = l.library.ID + ovf.Source.Value = vm.vm.Reference().Value + ovf.Source.Type = "VirtualMachine" + + vcm := vcenter.NewManager(vm.driver.restClient.client) + _, err = vcm.CreateOVF(vm.driver.ctx, ovf) + if err != nil { + return err + } + + return vm.driver.restClient.Logout(vm.driver.ctx) +} + +func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template) error { + err := vm.driver.restClient.Login(vm.driver.ctx) + if err != nil { + return err + } + + l, err := vm.driver.FindContentLibraryByName(template.Library) + if err != nil { + return err + } + if l.library.Type != "LOCAL" { + return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ + "the content library must be of type LOCAL", template.Library, l.library.Type) + } + + template.Library = l.library.ID + template.SourceVM = vm.vm.Reference().Value + + if template.Placement.Cluster != "" { + c, err := vm.driver.FindCluster(template.Placement.Cluster) + if err != nil { + return err + } + template.Placement.Cluster = c.cluster.Reference().Value + } + if template.Placement.Folder != "" { + f, err := vm.driver.FindFolder(template.Placement.Folder) + if err != nil { + return err + } + template.Placement.Folder = f.folder.Reference().Value + } + if template.Placement.Host != "" { + h, err := vm.driver.FindHost(template.Placement.Host) + if err != nil { + return err + } + template.Placement.Host = h.host.Reference().Value + } + if template.Placement.ResourcePool != "" { + rp, err := vm.driver.FindResourcePool(template.Placement.Cluster, template.Placement.Host, template.Placement.ResourcePool) + if err != nil { + return err + } + template.Placement.ResourcePool = rp.pool.Reference().Value + } + + if template.VMHomeStorage != nil { + d, err := vm.driver.FindDatastore(template.VMHomeStorage.Datastore, template.Placement.Host) + if err != nil { + return err + } + template.VMHomeStorage.Datastore = d.Reference().Value + } + + vcm := vcenter.NewManager(vm.driver.restClient.client) + _, err = vcm.CreateTemplate(vm.driver.ctx, template) + if err != nil { + return err + } + + return vm.driver.restClient.Logout(vm.driver.ctx) +} + +func (vm *VirtualMachineDriver) GetDir() (string, error) { + vmInfo, err := vm.Info("name", "layoutEx.file") + if err != nil { + return "", err + } + + vmxName := fmt.Sprintf("/%s.vmx", vmInfo.Name) + for _, file := range vmInfo.LayoutEx.File { + if strings.Contains(file.Name, vmInfo.Name) { + return RemoveDatastorePrefix(file.Name[:len(file.Name)-len(vmxName)]), nil + } + } + return "", fmt.Errorf("cannot find '%s'", vmxName) +} + +func addNetwork(d *VCenterDriver, devices object.VirtualDeviceList, config *CreateConfig) (object.VirtualDeviceList, error) { + if len(config.NICs) == 0 { + return nil, errors.New("no network adapters have been defined") + } + + for _, nic := range config.NICs { + network, err := findNetwork(nic.Network, config.Host, d) + if err != nil { + return nil, err + } + + backing, err := network.EthernetCardBackingInfo(d.ctx) + if err != nil { + return nil, err + } + + device, err := object.EthernetCardTypes().CreateEthernetCard(nic.NetworkCard, backing) + if err != nil { + return nil, err + } + + card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + if nic.MacAddress != "" { + card.AddressType = string(types.VirtualEthernetCardMacTypeManual) + card.MacAddress = nic.MacAddress + } + card.UptCompatibilityEnabled = nic.Passthrough + + devices = append(devices, device) + } + return devices, nil +} + +func findNetwork(network string, host string, d *VCenterDriver) (object.NetworkReference, error) { + if network != "" { + var err error + networks, err := d.FindNetworks(network) + if err != nil { + return nil, err + } + if len(networks) == 1 { + return networks[0].network, nil + } + + // If there are multiple networks then try to match the host + if host != "" { + h, err := d.FindHost(host) + if err != nil { + return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s: %s", host, err.Error())} + } + for _, n := range networks { + info, err := n.Info("host") + if err != nil { + continue + } + for _, host := range info.Host { + if h.host.Reference().Value == host.Reference().Value { + return n.network, nil + } + } + } + return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s", host)} + } + + return nil, &MultipleNetworkFoundError{network, "please provide a host to match or the network full path"} + } + + if host != "" { + h, err := d.FindHost(host) + if err != nil { + return nil, err + } + + i, err := h.Info("network") + if err != nil { + return nil, err + } + + if len(i.Network) > 1 { + return nil, fmt.Errorf("Host has multiple networks. Specify it explicitly") + } + + return object.NewNetwork(d.client.Client, i.Network[0]), nil + } + + return nil, fmt.Errorf("Couldn't find network; 'host' and 'network' not specified. At least one of the two must be specified.") +} + +func newVGPUProfile(vGPUProfile string) types.VirtualPCIPassthrough { + return types.VirtualPCIPassthrough{ + VirtualDevice: types.VirtualDevice{ + DeviceInfo: &types.Description{ + Summary: "", + Label: fmt.Sprintf("New vGPU %v PCI device", vGPUProfile), + }, + Backing: &types.VirtualPCIPassthroughVmiopBackingInfo{ + Vgpu: vGPUProfile, + }, + }, + } +} + +func (vm *VirtualMachineDriver) AddCdrom(controllerType string, datastoreIsoPath string) error { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return err + } + + var controller *types.VirtualController + if controllerType == "sata" { + c, err := vm.FindSATAController() + if err != nil { + return err + } + controller = c.GetVirtualController() + } else { + c, err := devices.FindIDEController("") + if err != nil { + return err + } + controller = c.GetVirtualController() + } + + cdrom, err := vm.CreateCdrom(controller) + if err != nil { + return err + } + + if datastoreIsoPath != "" { + ds := &DatastoreIsoPath{path: datastoreIsoPath} + if !ds.Validate() { + return fmt.Errorf("%s is not a valid iso path", datastoreIsoPath) + } + if libPath, err := vm.driver.FindContentLibraryFileDatastorePath(ds.GetFilePath()); err == nil { + datastoreIsoPath = libPath + } else { + log.Printf("Using %s as the datastore path", datastoreIsoPath) + } + + devices.InsertIso(cdrom, datastoreIsoPath) + } + + log.Printf("Creating CD-ROM on controller '%v' with iso '%v'", controller, datastoreIsoPath) + return vm.addDevice(cdrom) +} + +func (vm *VirtualMachineDriver) AddFloppy(imgPath string) error { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return err + } + + floppy, err := devices.CreateFloppy() + if err != nil { + return err + } + + if imgPath != "" { + floppy = devices.InsertImg(floppy, imgPath) + } + + return vm.addDevice(floppy) +} + +func (vm *VirtualMachineDriver) SetBootOrder(order []string) error { + devices, err := vm.vm.Device(vm.driver.ctx) + if err != nil { + return err + } + + bootOptions := types.VirtualMachineBootOptions{ + BootOrder: devices.BootOrder(order), + } + + return vm.vm.SetBootOptions(vm.driver.ctx, &bootOptions) +} + +func (vm *VirtualMachineDriver) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { + return vm.vm.RemoveDevice(vm.driver.ctx, keepFiles, device...) +} + +func (vm *VirtualMachineDriver) addDevice(device types.BaseVirtualDevice) error { + newDevices := object.VirtualDeviceList{device} + confSpec := types.VirtualMachineConfigSpec{} + var err error + confSpec.DeviceChange, err = newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + if err != nil { + return err + } + + task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) + if err != nil { + return err + } + + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachineDriver) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { + var confSpec types.VirtualMachineConfigSpec + + var ov []types.BaseOptionValue + for k, v := range params { + o := types.OptionValue{ + Key: k, + Value: v, + } + ov = append(ov, &o) + } + confSpec.ExtraConfig = ov + + confSpec.Tools = info + + if len(confSpec.ExtraConfig) > 0 || confSpec.Tools != nil { + task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) + if err != nil { + return err + } + + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err + } + + return nil +} + +func (vm *VirtualMachineDriver) Export() (*nfc.Lease, error) { + return vm.vm.Export(vm.driver.ctx) +} + +func (vm *VirtualMachineDriver) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { + return m.CreateDescriptor(vm.driver.ctx, vm.vm, cdp) +} + +func (vm *VirtualMachineDriver) NewOvfManager() *ovf.Manager { + return ovf.NewManager(vm.vm.Client()) +} + +func (vm *VirtualMachineDriver) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { + var mgr mo.OvfManager + err := property.DefaultCollector(vm.vm.Client()).RetrieveOne(vm.driver.ctx, m.Reference(), nil, &mgr) + if err != nil { + return nil, err + } + return mgr.OvfExportOption, nil +} + +func findNetworkAdapter(l object.VirtualDeviceList) (types.BaseVirtualEthernetCard, error) { + c := l.SelectByType((*types.VirtualEthernetCard)(nil)) + if len(c) == 0 { + return nil, errors.New("no network adapter device found") + } + + return c[0].(types.BaseVirtualEthernetCard), nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_cdrom.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_cdrom.go new file mode 100644 index 000000000..0eab0d196 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_cdrom.go @@ -0,0 +1,89 @@ +package driver + +import ( + "errors" + + "github.com/vmware/govmomi/vim25/types" +) + +var ( + ErrNoSataController = errors.New("no available SATA controller") +) + +func (vm *VirtualMachineDriver) AddSATAController() error { + sata := &types.VirtualAHCIController{} + return vm.addDevice(sata) +} + +func (vm *VirtualMachineDriver) FindSATAController() (*types.VirtualAHCIController, error) { + l, err := vm.Devices() + if err != nil { + return nil, err + } + + c := l.PickController((*types.VirtualAHCIController)(nil)) + if c == nil { + return nil, ErrNoSataController + } + + return c.(*types.VirtualAHCIController), nil +} + +func (vm *VirtualMachineDriver) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { + l, err := vm.Devices() + if err != nil { + return nil, err + } + + device := &types.VirtualCdrom{} + + l.AssignController(device, c) + + device.Backing = &types.VirtualCdromAtapiBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{}, + } + + device.Connectable = &types.VirtualDeviceConnectInfo{ + AllowGuestControl: true, + Connected: true, + StartConnected: true, + } + + return device, nil +} + +func (vm *VirtualMachineDriver) RemoveCdroms() error { + devices, err := vm.Devices() + if err != nil { + return err + } + cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) + if err = vm.RemoveDevice(true, cdroms...); err != nil { + return err + } + + sata := devices.SelectByType((*types.VirtualAHCIController)(nil)) + if err = vm.RemoveDevice(true, sata...); err != nil { + return err + } + return nil +} + +func (vm *VirtualMachineDriver) EjectCdroms() error { + devices, err := vm.Devices() + if err != nil { + return err + } + cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) + for _, cd := range cdroms { + c := cd.(*types.VirtualCdrom) + c.Backing = &types.VirtualCdromRemotePassthroughBackingInfo{} + c.Connectable = &types.VirtualDeviceConnectInfo{} + err := vm.vm.EditDevice(vm.driver.ctx, c) + if err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_keyboard.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_keyboard.go new file mode 100644 index 000000000..d50e66e07 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_keyboard.go @@ -0,0 +1,39 @@ +package driver + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/mobile/event/key" +) + +type KeyInput struct { + Scancode key.Code + Alt bool + Ctrl bool + Shift bool +} + +func (vm *VirtualMachineDriver) TypeOnKeyboard(input KeyInput) (int32, error) { + var spec types.UsbScanCodeSpec + + spec.KeyEvents = append(spec.KeyEvents, types.UsbScanCodeSpecKeyEvent{ + UsbHidCode: int32(input.Scancode)<<16 | 7, + Modifiers: &types.UsbScanCodeSpecModifierType{ + LeftControl: &input.Ctrl, + LeftAlt: &input.Alt, + LeftShift: &input.Shift, + }, + }) + + req := &types.PutUsbScanCodes{ + This: vm.vm.Reference(), + Spec: spec, + } + + resp, err := methods.PutUsbScanCodes(vm.driver.ctx, vm.driver.client.RoundTripper, req) + if err != nil { + return 0, err + } + + return resp.Returnval, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_mock.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_mock.go new file mode 100644 index 000000000..daf62b3c9 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver/vm_mock.go @@ -0,0 +1,235 @@ +package driver + +import ( + "context" + "net" + "time" + + "github.com/vmware/govmomi/nfc" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/vapi/vcenter" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type VirtualMachineMock struct { + DestroyError error + DestroyCalled bool + + ConfigureError error + ConfigureCalled bool + ConfigureHardwareConfig *HardwareConfig + + FindSATAControllerCalled bool + FindSATAControllerErr error + + AddSATAControllerCalled bool + AddSATAControllerErr error + + AddCdromCalled bool + AddCdromCalledTimes int + AddCdromErr error + AddCdromTypes []string + AddCdromPaths []string + + GetDirCalled bool + GetDirResponse string + GetDirErr error + + AddFloppyCalled bool + AddFloppyImagePath string + AddFloppyErr error + + FloppyDevicesErr error + FloppyDevicesReturn object.VirtualDeviceList + FloppyDevicesCalled bool + + RemoveDeviceErr error + RemoveDeviceCalled bool + RemoveDeviceKeepFiles bool + RemoveDeviceDevices []types.BaseVirtualDevice + + EjectCdromsCalled bool + EjectCdromsErr error + + RemoveCdromsCalled bool + RemoveCdromsErr error + CloneCalled bool + CloneConfig *CloneConfig + CloneError error +} + +func (vm *VirtualMachineMock) Info(params ...string) (*mo.VirtualMachine, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) Devices() (object.VirtualDeviceList, error) { + return object.VirtualDeviceList{}, nil +} + +func (vm *VirtualMachineMock) FloppyDevices() (object.VirtualDeviceList, error) { + vm.FloppyDevicesCalled = true + return vm.FloppyDevicesReturn, vm.FloppyDevicesErr +} + +func (vm *VirtualMachineMock) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { + vm.CloneCalled = true + vm.CloneConfig = config + return vm, vm.CloneError +} + +func (vm *VirtualMachineMock) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) AddPublicKeys(ctx context.Context, publicKeys string) error { + return nil +} + +func (vm *VirtualMachineMock) Properties(ctx context.Context) (*mo.VirtualMachine, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) Destroy() error { + vm.DestroyCalled = true + if vm.DestroyError != nil { + return vm.DestroyError + } + return nil +} + +func (vm *VirtualMachineMock) Configure(config *HardwareConfig) error { + vm.ConfigureCalled = true + vm.ConfigureHardwareConfig = config + if vm.ConfigureError != nil { + return vm.ConfigureError + } + return nil +} + +func (vm *VirtualMachineMock) Customize(spec types.CustomizationSpec) error { + return nil +} + +func (vm *VirtualMachineMock) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) PowerOn() error { + return nil +} + +func (vm *VirtualMachineMock) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { + return "", nil +} + +func (vm *VirtualMachineMock) PowerOff() error { + return nil +} + +func (vm *VirtualMachineMock) IsPoweredOff() (bool, error) { + return false, nil +} + +func (vm *VirtualMachineMock) StartShutdown() error { + return nil +} + +func (vm *VirtualMachineMock) WaitForShutdown(ctx context.Context, timeout time.Duration) error { + return nil +} + +func (vm *VirtualMachineMock) CreateSnapshot(name string) error { + return nil +} + +func (vm *VirtualMachineMock) ConvertToTemplate() error { + return nil +} + +func (vm *VirtualMachineMock) ImportOvfToContentLibrary(ovf vcenter.OVF) error { + return nil +} + +func (vm *VirtualMachineMock) ImportToContentLibrary(template vcenter.Template) error { + return nil +} + +func (vm *VirtualMachineMock) GetDir() (string, error) { + vm.GetDirCalled = true + return vm.GetDirResponse, vm.GetDirErr +} + +func (vm *VirtualMachineMock) AddCdrom(cdromType string, isoPath string) error { + vm.AddCdromCalledTimes++ + vm.AddCdromCalled = true + vm.AddCdromTypes = append(vm.AddCdromTypes, cdromType) + vm.AddCdromPaths = append(vm.AddCdromPaths, isoPath) + return vm.AddCdromErr +} + +func (vm *VirtualMachineMock) AddFloppy(imgPath string) error { + vm.AddFloppyCalled = true + vm.AddFloppyImagePath = imgPath + return vm.AddFloppyErr +} + +func (vm *VirtualMachineMock) SetBootOrder(order []string) error { + return nil +} + +func (vm *VirtualMachineMock) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { + vm.RemoveDeviceCalled = true + vm.RemoveDeviceKeepFiles = keepFiles + vm.RemoveDeviceDevices = device + return vm.RemoveDeviceErr +} + +func (vm *VirtualMachineMock) addDevice(device types.BaseVirtualDevice) error { + return nil +} + +func (vm *VirtualMachineMock) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { + return nil +} + +func (vm *VirtualMachineMock) Export() (*nfc.Lease, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) NewOvfManager() *ovf.Manager { + return nil +} + +func (vm *VirtualMachineMock) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) AddSATAController() error { + vm.AddSATAControllerCalled = true + return vm.AddSATAControllerErr +} + +func (vm *VirtualMachineMock) FindSATAController() (*types.VirtualAHCIController, error) { + vm.FindSATAControllerCalled = true + return nil, vm.FindSATAControllerErr +} + +func (vm *VirtualMachineMock) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { + return nil, nil +} + +func (vm *VirtualMachineMock) RemoveCdroms() error { + vm.RemoveCdromsCalled = true + return vm.RemoveCdromsErr +} + +func (vm *VirtualMachineMock) EjectCdroms() error { + vm.EjectCdromsCalled = true + return vm.EjectCdromsErr +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/builder.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/builder.go new file mode 100644 index 000000000..4255aebb7 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/builder.go @@ -0,0 +1,179 @@ +package iso + +import ( + "context" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/multistep" + "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +type Builder struct { + config Config + runner multistep.Runner +} + +func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } + +func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { + warnings, errs := b.config.Prepare(raws...) + if errs != nil { + return nil, warnings, errs + } + + return nil, warnings, nil +} + +func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { + state := new(multistep.BasicStateBag) + state.Put("debug", b.config.PackerDebug) + state.Put("hook", hook) + state.Put("ui", ui) + + var steps []multistep.Step + + steps = append(steps, + &common.StepConnect{ + Config: &b.config.ConnectConfig, + }, + &common.StepDownload{ + DownloadStep: &commonsteps.StepDownload{ + Checksum: b.config.ISOChecksum, + Description: "ISO", + Extension: b.config.TargetExtension, + ResultKey: "iso_path", + TargetPath: b.config.TargetPath, + Url: b.config.ISOUrls, + }, + Url: b.config.ISOUrls, + ResultKey: "iso_path", + Datastore: b.config.Datastore, + Host: b.config.Host, + }, + &commonsteps.StepCreateCD{ + Files: b.config.CDConfig.CDFiles, + Label: b.config.CDConfig.CDLabel, + }, + &common.StepRemoteUpload{ + Datastore: b.config.Datastore, + Host: b.config.Host, + SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, + }, + &StepCreateVM{ + Config: &b.config.CreateConfig, + Location: &b.config.LocationConfig, + Force: b.config.PackerConfig.PackerForce, + }, + &common.StepConfigureHardware{ + Config: &b.config.HardwareConfig, + }, + &common.StepAddCDRom{ + Config: &b.config.CDRomConfig, + }, + &common.StepConfigParams{ + Config: &b.config.ConfigParamsConfig, + }, + &commonsteps.StepCreateFloppy{ + Files: b.config.FloppyFiles, + Directories: b.config.FloppyDirectories, + Label: b.config.FloppyLabel, + }, + &common.StepAddFloppy{ + Config: &b.config.FloppyConfig, + Datastore: b.config.Datastore, + Host: b.config.Host, + SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, + }, + &common.StepHTTPIPDiscover{ + HTTPIP: b.config.BootConfig.HTTPIP, + Network: b.config.WaitIpConfig.GetIPNet(), + }, + commonsteps.HTTPServerFromHTTPConfig(&b.config.HTTPConfig), + &common.StepRun{ + Config: &b.config.RunConfig, + SetOrder: true, + }, + &common.StepBootCommand{ + Config: &b.config.BootConfig, + Ctx: b.config.ctx, + VMName: b.config.VMName, + }, + ) + + if b.config.Comm.Type != "none" { + steps = append(steps, + &common.StepWaitForIp{ + Config: &b.config.WaitIpConfig, + }, + &communicator.StepConnect{ + Config: &b.config.Comm, + Host: common.CommHost(b.config.Comm.Host()), + SSHConfig: b.config.Comm.SSHConfigFunc(), + }, + &commonsteps.StepProvision{}, + ) + } + + steps = append(steps, + &common.StepShutdown{ + Config: &b.config.ShutdownConfig, + }, + &common.StepRemoveFloppy{ + Datastore: b.config.Datastore, + Host: b.config.Host, + }, + &common.StepRemoveCDRom{ + Config: &b.config.RemoveCDRomConfig, + }, + &common.StepCreateSnapshot{ + CreateSnapshot: b.config.CreateSnapshot, + }, + &common.StepConvertToTemplate{ + ConvertToTemplate: b.config.ConvertToTemplate, + }, + ) + + if b.config.ContentLibraryDestinationConfig != nil { + steps = append(steps, &common.StepImportToContentLibrary{ + ContentLibConfig: b.config.ContentLibraryDestinationConfig, + }) + } + + if b.config.Export != nil { + steps = append(steps, &common.StepExport{ + Name: b.config.Export.Name, + Force: b.config.Export.Force, + Images: b.config.Export.Images, + Manifest: b.config.Export.Manifest, + OutputDir: b.config.Export.OutputDir.OutputDir, + Options: b.config.Export.Options, + }) + } + + b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) + b.runner.Run(ctx, state) + + if rawErr, ok := state.GetOk("error"); ok { + return nil, rawErr.(error) + } + + if _, ok := state.GetOk("vm"); !ok { + return nil, nil + } + + artifact := &common.Artifact{ + Name: b.config.VMName, + VM: state.Get("vm").(*driver.VirtualMachineDriver), + StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, + } + + if b.config.Export != nil { + artifact.Outconfig = &b.config.Export.OutputDir + } + + return artifact, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.go new file mode 100644 index 000000000..94a2d850c --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.go @@ -0,0 +1,107 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type Config + +package iso + +import ( + packerCommon "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/communicator" + "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" +) + +type Config struct { + packerCommon.PackerConfig `mapstructure:",squash"` + commonsteps.HTTPConfig `mapstructure:",squash"` + commonsteps.CDConfig `mapstructure:",squash"` + + common.ConnectConfig `mapstructure:",squash"` + CreateConfig `mapstructure:",squash"` + common.LocationConfig `mapstructure:",squash"` + common.HardwareConfig `mapstructure:",squash"` + common.ConfigParamsConfig `mapstructure:",squash"` + + commonsteps.ISOConfig `mapstructure:",squash"` + + common.CDRomConfig `mapstructure:",squash"` + common.RemoveCDRomConfig `mapstructure:",squash"` + common.FloppyConfig `mapstructure:",squash"` + common.RunConfig `mapstructure:",squash"` + common.BootConfig `mapstructure:",squash"` + common.WaitIpConfig `mapstructure:",squash"` + Comm communicator.Config `mapstructure:",squash"` + + common.ShutdownConfig `mapstructure:",squash"` + + // Create a snapshot when set to `true`, so the VM can be used as a base + // for linked clones. Defaults to `false`. + CreateSnapshot bool `mapstructure:"create_snapshot"` + // Convert VM to a template. Defaults to `false`. + ConvertToTemplate bool `mapstructure:"convert_to_template"` + // Configuration for exporting VM to an ovf file. + // The VM will not be exported if no [Export Configuration](#export-configuration) is specified. + Export *common.ExportConfig `mapstructure:"export"` + // Configuration for importing the VM template to a Content Library. + // The VM template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. + // The import doesn't work if [convert_to_template](#convert_to_template) is set to true. + ContentLibraryDestinationConfig *common.ContentLibraryDestinationConfig `mapstructure:"content_library_destination"` + + ctx interpolate.Context +} + +func (c *Config) Prepare(raws ...interface{}) ([]string, error) { + err := config.Decode(c, &config.DecodeOpts{ + PluginType: common.BuilderId, + Interpolate: true, + InterpolateContext: &c.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{ + "boot_command", + }, + }, + }, raws...) + if err != nil { + return nil, err + } + + warnings := make([]string, 0) + errs := new(packersdk.MultiError) + + if c.ISOUrls != nil || c.RawSingleISOUrl != "" { + isoWarnings, isoErrs := c.ISOConfig.Prepare(&c.ctx) + warnings = append(warnings, isoWarnings...) + errs = packersdk.MultiErrorAppend(errs, isoErrs...) + } + + errs = packersdk.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.CreateConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.LocationConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.HTTPConfig.Prepare(&c.ctx)...) + + errs = packersdk.MultiErrorAppend(errs, c.CDRomConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.CDConfig.Prepare(&c.ctx)...) + errs = packersdk.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) + errs = packersdk.MultiErrorAppend(errs, c.WaitIpConfig.Prepare()...) + errs = packersdk.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) + + shutdownWarnings, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) + warnings = append(warnings, shutdownWarnings...) + errs = packersdk.MultiErrorAppend(errs, shutdownErrs...) + + if c.Export != nil { + errs = packersdk.MultiErrorAppend(errs, c.Export.Prepare(&c.ctx, &c.LocationConfig, &c.PackerConfig)...) + } + if c.ContentLibraryDestinationConfig != nil { + errs = packersdk.MultiErrorAppend(errs, c.ContentLibraryDestinationConfig.Prepare(&c.LocationConfig)...) + } + + if len(errs.Errors) > 0 { + return warnings, errs + } + + return warnings, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.hcl2spec.go new file mode 100644 index 000000000..c502743b7 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/config.hcl2spec.go @@ -0,0 +1,286 @@ +// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. + +package iso + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + HTTPDir *string `mapstructure:"http_directory" cty:"http_directory" hcl:"http_directory"` + HTTPContent map[string]string `mapstructure:"http_content" cty:"http_content" hcl:"http_content"` + HTTPPortMin *int `mapstructure:"http_port_min" cty:"http_port_min" hcl:"http_port_min"` + HTTPPortMax *int `mapstructure:"http_port_max" cty:"http_port_max" hcl:"http_port_max"` + HTTPAddress *string `mapstructure:"http_bind_address" cty:"http_bind_address" hcl:"http_bind_address"` + HTTPInterface *string `mapstructure:"http_interface" undocumented:"true" cty:"http_interface" hcl:"http_interface"` + CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"` + CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"` + VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` + Username *string `mapstructure:"username" cty:"username" hcl:"username"` + Password *string `mapstructure:"password" cty:"password" hcl:"password"` + InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` + Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` + Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` + GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` + DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` + Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` + NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` + USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` + Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` + Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` + Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` + Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` + SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` + CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` + CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` + CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` + CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` + CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` + RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` + RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` + RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` + MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` + VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` + VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` + NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` + Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` + ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` + ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` + ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` + ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` + ISOChecksum *string `mapstructure:"iso_checksum" required:"true" cty:"iso_checksum" hcl:"iso_checksum"` + RawSingleISOUrl *string `mapstructure:"iso_url" required:"true" cty:"iso_url" hcl:"iso_url"` + ISOUrls []string `mapstructure:"iso_urls" cty:"iso_urls" hcl:"iso_urls"` + TargetPath *string `mapstructure:"iso_target_path" cty:"iso_target_path" hcl:"iso_target_path"` + TargetExtension *string `mapstructure:"iso_target_extension" cty:"iso_target_extension" hcl:"iso_target_extension"` + CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` + ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` + RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` + FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` + FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` + FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` + FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` + BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` + BootGroupInterval *string `mapstructure:"boot_keygroup_interval" cty:"boot_keygroup_interval" hcl:"boot_keygroup_interval"` + BootWait *string `mapstructure:"boot_wait" cty:"boot_wait" hcl:"boot_wait"` + BootCommand []string `mapstructure:"boot_command" cty:"boot_command" hcl:"boot_command"` + HTTPIP *string `mapstructure:"http_ip" cty:"http_ip" hcl:"http_ip"` + WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` + SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` + WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` + Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` + PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` + SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` + SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` + SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` + SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` + SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` + SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` + SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` + SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` + SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` + SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` + SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` + SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` + SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` + SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` + SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` + SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` + SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` + SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` + SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` + SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` + SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` + SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` + SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` + SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` + SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` + SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` + SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` + SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` + SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` + WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` + WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` + WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` + WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` + WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` + WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` + WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` + WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` + WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` + Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` + Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` + DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` + CreateSnapshot *bool `mapstructure:"create_snapshot" cty:"create_snapshot" hcl:"create_snapshot"` + ConvertToTemplate *bool `mapstructure:"convert_to_template" cty:"convert_to_template" hcl:"convert_to_template"` + Export *common.FlatExportConfig `mapstructure:"export" cty:"export" hcl:"export"` + ContentLibraryDestinationConfig *common.FlatContentLibraryDestinationConfig `mapstructure:"content_library_destination" cty:"content_library_destination" hcl:"content_library_destination"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "http_directory": &hcldec.AttrSpec{Name: "http_directory", Type: cty.String, Required: false}, + "http_content": &hcldec.AttrSpec{Name: "http_content", Type: cty.Map(cty.String), Required: false}, + "http_port_min": &hcldec.AttrSpec{Name: "http_port_min", Type: cty.Number, Required: false}, + "http_port_max": &hcldec.AttrSpec{Name: "http_port_max", Type: cty.Number, Required: false}, + "http_bind_address": &hcldec.AttrSpec{Name: "http_bind_address", Type: cty.String, Required: false}, + "http_interface": &hcldec.AttrSpec{Name: "http_interface", Type: cty.String, Required: false}, + "cd_files": &hcldec.AttrSpec{Name: "cd_files", Type: cty.List(cty.String), Required: false}, + "cd_label": &hcldec.AttrSpec{Name: "cd_label", Type: cty.String, Required: false}, + "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, + "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, + "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, + "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, + "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, + "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, + "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, + "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, + "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, + "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, + "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, + "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, + "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, + "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, + "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, + "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, + "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, + "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, + "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, + "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, + "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, + "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, + "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, + "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, + "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, + "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, + "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, + "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, + "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, + "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, + "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, + "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, + "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, + "iso_checksum": &hcldec.AttrSpec{Name: "iso_checksum", Type: cty.String, Required: false}, + "iso_url": &hcldec.AttrSpec{Name: "iso_url", Type: cty.String, Required: false}, + "iso_urls": &hcldec.AttrSpec{Name: "iso_urls", Type: cty.List(cty.String), Required: false}, + "iso_target_path": &hcldec.AttrSpec{Name: "iso_target_path", Type: cty.String, Required: false}, + "iso_target_extension": &hcldec.AttrSpec{Name: "iso_target_extension", Type: cty.String, Required: false}, + "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, + "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, + "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, + "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, + "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, + "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, + "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, + "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, + "boot_keygroup_interval": &hcldec.AttrSpec{Name: "boot_keygroup_interval", Type: cty.String, Required: false}, + "boot_wait": &hcldec.AttrSpec{Name: "boot_wait", Type: cty.String, Required: false}, + "boot_command": &hcldec.AttrSpec{Name: "boot_command", Type: cty.List(cty.String), Required: false}, + "http_ip": &hcldec.AttrSpec{Name: "http_ip", Type: cty.String, Required: false}, + "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, + "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, + "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, + "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, + "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, + "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, + "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, + "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, + "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, + "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, + "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, + "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, + "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, + "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, + "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, + "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, + "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, + "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, + "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, + "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, + "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, + "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, + "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, + "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, + "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, + "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, + "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, + "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, + "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, + "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, + "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, + "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, + "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, + "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, + "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, + "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, + "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, + "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, + "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, + "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, + "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, + "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, + "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, + "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, + "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, + "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, + "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, + "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, + "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, + "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, + "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, + "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, + "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, + "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, + "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, + "create_snapshot": &hcldec.AttrSpec{Name: "create_snapshot", Type: cty.Bool, Required: false}, + "convert_to_template": &hcldec.AttrSpec{Name: "convert_to_template", Type: cty.Bool, Required: false}, + "export": &hcldec.BlockSpec{TypeName: "export", Nested: hcldec.ObjectSpec((*common.FlatExportConfig)(nil).HCL2Spec())}, + "content_library_destination": &hcldec.BlockSpec{TypeName: "content_library_destination", Nested: hcldec.ObjectSpec((*common.FlatContentLibraryDestinationConfig)(nil).HCL2Spec())}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.go new file mode 100644 index 000000000..10ff39336 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.go @@ -0,0 +1,188 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type NIC,CreateConfig + +package iso + +import ( + "context" + "fmt" + "path" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver" +) + +// Defines a Network Adapter +// +// Example that creates two network adapters: +// +// In JSON: +// ```json +// "network_adapters": [ +// { +// "network": "VM Network", +// "network_card": "vmxnet3" +// }, +// { +// "network": "OtherNetwork", +// "network_card": "vmxnet3" +// } +// ], +// ``` +// In HCL2: +// ```hcl +// network_adapters { +// network = "VM Network" +// network_card = "vmxnet3" +// } +// network_adapters { +// network = "OtherNetwork" +// network_card = "vmxnet3" +// } +// ``` +type NIC struct { + // Set the network in which the VM will be connected to. If no network is + // specified, `host` must be specified to allow Packer to look for the + // available network. If the network is inside a network folder in vCenter, + // you need to provide the full path to the network. + Network string `mapstructure:"network"` + // Set VM network card type. Example `vmxnet3`. + NetworkCard string `mapstructure:"network_card" required:"true"` + // Set network card MAC address + MacAddress string `mapstructure:"mac_address"` + // Enable DirectPath I/O passthrough + Passthrough *bool `mapstructure:"passthrough"` +} + +type CreateConfig struct { + // Set VM hardware version. Defaults to the most current VM hardware + // version supported by vCenter. See + // [VMWare article 1003746](https://kb.vmware.com/s/article/1003746) for + // the full list of supported VM hardware versions. + Version uint `mapstructure:"vm_version"` + // Set VM OS type. Defaults to `otherGuest`. See [ + // here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) + // for a full list of possible values. + GuestOSType string `mapstructure:"guest_os_type"` + StorageConfig common.StorageConfig `mapstructure:",squash"` + // Network adapters + NICs []NIC `mapstructure:"network_adapters"` + // Create USB controllers for the virtual machine. "usb" for a usb 2.0 controller. "xhci" for a usb 3.0 controller. There can only be at most one of each. + USBController []string `mapstructure:"usb_controller"` + // VM notes. + Notes string `mapstructure:"notes"` +} + +func (c *CreateConfig) Prepare() []error { + var errs []error + + if len(c.StorageConfig.DiskControllerType) == 0 { + c.StorageConfig.DiskControllerType = append(c.StorageConfig.DiskControllerType, "") + } + + // there should be at least one + if len(c.StorageConfig.Storage) == 0 { + errs = append(errs, fmt.Errorf("no storage devices have been defined")) + } + errs = append(errs, c.StorageConfig.Prepare()...) + + if c.GuestOSType == "" { + c.GuestOSType = "otherGuest" + } + + usbCount := 0 + xhciCount := 0 + + for i, s := range c.USBController { + switch s { + // 1 and true for backwards compatibility + case "usb", "1", "true": + usbCount++ + case "xhci": + xhciCount++ + // 0 and false for backwards compatibility + case "false", "0": + continue + default: + errs = append(errs, fmt.Errorf("usb_controller[%d] references an unknown usb controller", i)) + } + } + if usbCount > 1 || xhciCount > 1 { + errs = append(errs, fmt.Errorf("there can only be one usb controller and one xhci controller")) + } + + return errs +} + +type StepCreateVM struct { + Config *CreateConfig + Location *common.LocationConfig + Force bool +} + +func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + d := state.Get("driver").(driver.Driver) + vmPath := path.Join(s.Location.Folder, s.Location.VMName) + + err := d.PreCleanVM(ui, vmPath, s.Force) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + ui.Say("Creating VM...") + + // add network/network card an the first nic for backwards compatibility in the type is defined + var networkCards []driver.NIC + for _, nic := range s.Config.NICs { + networkCards = append(networkCards, driver.NIC{ + Network: nic.Network, + NetworkCard: nic.NetworkCard, + MacAddress: nic.MacAddress, + Passthrough: nic.Passthrough, + }) + } + + // add disk as the first drive for backwards compatibility if the type is defined + var disks []driver.Disk + for _, disk := range s.Config.StorageConfig.Storage { + disks = append(disks, driver.Disk{ + DiskSize: disk.DiskSize, + DiskEagerlyScrub: disk.DiskEagerlyScrub, + DiskThinProvisioned: disk.DiskThinProvisioned, + ControllerIndex: disk.DiskControllerIndex, + }) + } + + vm, err := d.CreateVM(&driver.CreateConfig{ + StorageConfig: driver.StorageConfig{ + DiskControllerType: s.Config.StorageConfig.DiskControllerType, + Storage: disks, + }, + Annotation: s.Config.Notes, + Name: s.Location.VMName, + Folder: s.Location.Folder, + Cluster: s.Location.Cluster, + Host: s.Location.Host, + ResourcePool: s.Location.ResourcePool, + Datastore: s.Location.Datastore, + GuestOS: s.Config.GuestOSType, + NICs: networkCards, + USBController: s.Config.USBController, + Version: s.Config.Version, + }) + if err != nil { + state.Put("error", fmt.Errorf("error creating vm: %v", err)) + return multistep.ActionHalt + } + state.Put("vm", vm) + + return multistep.ActionContinue +} + +func (s *StepCreateVM) Cleanup(state multistep.StateBag) { + common.CleanupVM(state) +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.hcl2spec.go new file mode 100644 index 000000000..130cd6a1c --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso/step_create.hcl2spec.go @@ -0,0 +1,73 @@ +// Code generated by "mapstructure-to-hcl2 -type NIC,CreateConfig"; DO NOT EDIT. + +package iso + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + "github.com/zclconf/go-cty/cty" +) + +// FlatCreateConfig is an auto-generated flat version of CreateConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatCreateConfig struct { + Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` + GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` + DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` + Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` + NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` + USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` + Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` +} + +// FlatMapstructure returns a new FlatCreateConfig. +// FlatCreateConfig is an auto-generated flat version of CreateConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*CreateConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatCreateConfig) +} + +// HCL2Spec returns the hcl spec of a CreateConfig. +// This spec is used by HCL to read the fields of CreateConfig. +// The decoded values from this spec will then be applied to a FlatCreateConfig. +func (*FlatCreateConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, + "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, + "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, + "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, + "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, + "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, + "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + } + return s +} + +// FlatNIC is an auto-generated flat version of NIC. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatNIC struct { + Network *string `mapstructure:"network" cty:"network" hcl:"network"` + NetworkCard *string `mapstructure:"network_card" required:"true" cty:"network_card" hcl:"network_card"` + MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` + Passthrough *bool `mapstructure:"passthrough" cty:"passthrough" hcl:"passthrough"` +} + +// FlatMapstructure returns a new FlatNIC. +// FlatNIC is an auto-generated flat version of NIC. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*NIC) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatNIC) +} + +// HCL2Spec returns the hcl spec of a NIC. +// This spec is used by HCL to read the fields of NIC. +// The decoded values from this spec will then be applied to a FlatNIC. +func (*FlatNIC) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, + "network_card": &hcldec.AttrSpec{Name: "network_card", Type: cty.String, Required: false}, + "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, + "passthrough": &hcldec.AttrSpec{Name: "passthrough", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.go new file mode 100644 index 000000000..b7f885133 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.go @@ -0,0 +1,160 @@ +//go:generate mapstructure-to-hcl2 -type Config + +package vsphere_template + +import ( + "context" + "errors" + "fmt" + "net/url" + "strings" + "time" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/multistep" + "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" + vsphere "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" + vspherepost "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" + "github.com/vmware/govmomi" +) + +const ( + // BuilderId for the local artifacts + BuilderIdESX = "mitchellh.vmware-esx" + + ArtifactConfFormat = "artifact.conf.format" + ArtifactConfKeepRegistered = "artifact.conf.keep_registered" + ArtifactConfSkipExport = "artifact.conf.skip_export" +) + +var builtins = map[string]string{ + vspherepost.BuilderId: "vmware", + BuilderIdESX: "vmware", + vsphere.BuilderId: "vsphere", + "packer.post-processor.artifice": "artifice", +} + +type Config struct { + common.PackerConfig `mapstructure:",squash"` + Host string `mapstructure:"host"` + Insecure bool `mapstructure:"insecure"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + Datacenter string `mapstructure:"datacenter"` + Folder string `mapstructure:"folder"` + SnapshotEnable bool `mapstructure:"snapshot_enable"` + SnapshotName string `mapstructure:"snapshot_name"` + SnapshotDescription string `mapstructure:"snapshot_description"` + ReregisterVM config.Trilean `mapstructure:"reregister_vm"` + + ctx interpolate.Context +} + +type PostProcessor struct { + config Config + url *url.URL +} + +func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } + +func (p *PostProcessor) Configure(raws ...interface{}) error { + err := config.Decode(&p.config, &config.DecodeOpts{ + PluginType: vsphere.BuilderId, + Interpolate: true, + InterpolateContext: &p.config.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{}, + }, + }, raws...) + + if err != nil { + return err + } + + errs := new(packersdk.MultiError) + vc := map[string]*string{ + "host": &p.config.Host, + "username": &p.config.Username, + "password": &p.config.Password, + } + + for key, ptr := range vc { + if *ptr == "" { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("%s must be set", key)) + } + } + + if p.config.Folder != "" && !strings.HasPrefix(p.config.Folder, "/") { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("Folder must be bound to the root")) + } + + sdk, err := url.Parse(fmt.Sprintf("https://%v/sdk", p.config.Host)) + if err != nil { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("Error invalid vSphere sdk endpoint: %s", err)) + return errs + } + + sdk.User = url.UserPassword(p.config.Username, p.config.Password) + p.url = sdk + + if len(errs.Errors) > 0 { + return errs + } + return nil +} + +func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { + if _, ok := builtins[artifact.BuilderId()]; !ok { + return nil, false, false, fmt.Errorf("The Packer vSphere Template post-processor "+ + "can only take an artifact from the VMware-iso builder, built on "+ + "ESXi (i.e. remote) or an artifact from the vSphere post-processor. "+ + "Artifact type %s does not fit this requirement", artifact.BuilderId()) + } + + f := artifact.State(ArtifactConfFormat) + k := artifact.State(ArtifactConfKeepRegistered) + s := artifact.State(ArtifactConfSkipExport) + + if f != "" && k != "true" && s == "false" { + return nil, false, false, errors.New("To use this post-processor with exporting behavior you need set keep_registered as true") + } + + // In some occasions the VM state is powered on and if we immediately try to mark as template + // (after the ESXi creates it) it will fail. If vSphere is given a few seconds this behavior doesn't reappear. + ui.Message("Waiting 10s for VMware vSphere to start") + time.Sleep(10 * time.Second) + c, err := govmomi.NewClient(context.Background(), p.url, p.config.Insecure) + if err != nil { + return nil, false, false, fmt.Errorf("Error connecting to vSphere: %s", err) + } + + defer c.Logout(context.Background()) + + state := new(multistep.BasicStateBag) + state.Put("ui", ui) + state.Put("client", c) + + steps := []multistep.Step{ + &stepChooseDatacenter{ + Datacenter: p.config.Datacenter, + }, + &stepCreateFolder{ + Folder: p.config.Folder, + }, + NewStepCreateSnapshot(artifact, p), + NewStepMarkAsTemplate(artifact, p), + } + runner := commonsteps.NewRunnerWithPauseFn(steps, p.config.PackerConfig, ui, state) + runner.Run(ctx, state) + if rawErr, ok := state.GetOk("error"); ok { + return nil, false, false, rawErr.(error) + } + return artifact, true, true, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.hcl2spec.go new file mode 100644 index 000000000..214568087 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/post-processor.hcl2spec.go @@ -0,0 +1,65 @@ +// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. + +package vsphere_template + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` + Username *string `mapstructure:"username" cty:"username" hcl:"username"` + Password *string `mapstructure:"password" cty:"password" hcl:"password"` + Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` + Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` + SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable" hcl:"snapshot_enable"` + SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name" hcl:"snapshot_name"` + SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description" hcl:"snapshot_description"` + ReregisterVM *bool `mapstructure:"reregister_vm" cty:"reregister_vm" hcl:"reregister_vm"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, + "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, + "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, + "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, + "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, + "snapshot_enable": &hcldec.AttrSpec{Name: "snapshot_enable", Type: cty.Bool, Required: false}, + "snapshot_name": &hcldec.AttrSpec{Name: "snapshot_name", Type: cty.String, Required: false}, + "snapshot_description": &hcldec.AttrSpec{Name: "snapshot_description", Type: cty.String, Required: false}, + "reregister_vm": &hcldec.AttrSpec{Name: "reregister_vm", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_choose_datacenter.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_choose_datacenter.go new file mode 100644 index 000000000..6645c4dc5 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_choose_datacenter.go @@ -0,0 +1,35 @@ +package vsphere_template + +import ( + "context" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/find" +) + +type stepChooseDatacenter struct { + Datacenter string +} + +func (s *stepChooseDatacenter) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + cli := state.Get("client").(*govmomi.Client) + finder := find.NewFinder(cli.Client, false) + + ui.Message("Choosing datacenter...") + + dc, err := finder.DatacenterOrDefault(context.Background(), s.Datacenter) + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + state.Put("dcPath", dc.InventoryPath) + + return multistep.ActionContinue +} + +func (s *stepChooseDatacenter) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_folder.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_folder.go new file mode 100644 index 000000000..282848434 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_folder.go @@ -0,0 +1,86 @@ +package vsphere_template + +import ( + "context" + "fmt" + "path" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" +) + +type stepCreateFolder struct { + Folder string +} + +func (s *stepCreateFolder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + cli := state.Get("client").(*govmomi.Client) + dcPath := state.Get("dcPath").(string) + + ui.Message("Creating or checking destination folders...") + + base := path.Join(dcPath, "vm") + fullPath := path.Join(base, s.Folder) + si := object.NewSearchIndex(cli.Client) + + var folders []string + var err error + var ref object.Reference + + // We iterate over the path starting with full path + // If we don't find it, we save the folder name and continue with the previous path + // The iteration ends when we find an existing path otherwise it throws error + for { + ref, err = si.FindByInventoryPath(context.Background(), fullPath) + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + if ref == nil { + dir, folder := path.Split(fullPath) + fullPath = path.Clean(dir) + + if fullPath == dcPath { + err = fmt.Errorf("vSphere base path %s not found", base) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + folders = append(folders, folder) + } else { + break + } + } + + if root, ok := ref.(*object.Folder); ok { + for i := len(folders) - 1; i >= 0; i-- { + ui.Message(fmt.Sprintf("Creating folder: %v", folders[i])) + + root, err = root.CreateFolder(context.Background(), folders[i]) + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + fullPath = path.Join(fullPath, folders[i]) + } + root.SetInventoryPath(fullPath) + state.Put("folder", root) + } else { + err = fmt.Errorf("folder not found: '%v'", ref) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *stepCreateFolder) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_snapshot.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_snapshot.go new file mode 100644 index 000000000..0fd5eaedf --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_create_snapshot.go @@ -0,0 +1,76 @@ +package vsphere_template + +import ( + "context" + "strings" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" + "github.com/vmware/govmomi" +) + +type stepCreateSnapshot struct { + VMName string + RemoteFolder string + SnapshotName string + SnapshotDescription string + SnapshotEnable bool +} + +func NewStepCreateSnapshot(artifact packersdk.Artifact, p *PostProcessor) *stepCreateSnapshot { + remoteFolder := "Discovered virtual machine" + vmname := artifact.Id() + + if artifact.BuilderId() == vsphere.BuilderId { + id := strings.Split(artifact.Id(), "::") + remoteFolder = id[1] + vmname = id[2] + } + + return &stepCreateSnapshot{ + VMName: vmname, + RemoteFolder: remoteFolder, + SnapshotEnable: p.config.SnapshotEnable, + SnapshotName: p.config.SnapshotName, + SnapshotDescription: p.config.SnapshotDescription, + } +} + +func (s *stepCreateSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + cli := state.Get("client").(*govmomi.Client) + dcPath := state.Get("dcPath").(string) + + if !s.SnapshotEnable { + return multistep.ActionContinue + } + + ui.Message("Creating a Snapshot...") + + vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) + + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + task, err := vm.CreateSnapshot(context.Background(), s.SnapshotName, s.SnapshotDescription, false, false) + + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + if err = task.Wait(context.Background()); err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *stepCreateSnapshot) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_mark_as_template.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_mark_as_template.go new file mode 100644 index 000000000..730fc3600 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template/step_mark_as_template.go @@ -0,0 +1,186 @@ +package vsphere_template + +import ( + "context" + "fmt" + "path" + "regexp" + "strings" + + "github.com/hashicorp/packer-plugin-sdk/multistep" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type stepMarkAsTemplate struct { + VMName string + RemoteFolder string + ReregisterVM config.Trilean +} + +func NewStepMarkAsTemplate(artifact packersdk.Artifact, p *PostProcessor) *stepMarkAsTemplate { + remoteFolder := "Discovered virtual machine" + vmname := artifact.Id() + + if artifact.BuilderId() == vsphere.BuilderId { + id := strings.Split(artifact.Id(), "::") + remoteFolder = id[1] + vmname = id[2] + } + + return &stepMarkAsTemplate{ + VMName: vmname, + RemoteFolder: remoteFolder, + ReregisterVM: p.config.ReregisterVM, + } +} + +func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + ui := state.Get("ui").(packersdk.Ui) + cli := state.Get("client").(*govmomi.Client) + folder := state.Get("folder").(*object.Folder) + dcPath := state.Get("dcPath").(string) + + vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) + if err != nil { + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + // Use a simple "MarkAsTemplate" method unless `reregister_vm` is true + if s.ReregisterVM.False() { + ui.Message("Marking as a template...") + + if err := vm.MarkAsTemplate(context.Background()); err != nil { + state.Put("error", err) + ui.Error("vm.MarkAsTemplate:" + err.Error()) + return multistep.ActionHalt + } + return multistep.ActionContinue + } + + ui.Message("Re-register VM as a template...") + + dsPath, err := datastorePath(vm) + if err != nil { + state.Put("error", err) + ui.Error("datastorePath:" + err.Error()) + return multistep.ActionHalt + } + + host, err := vm.HostSystem(context.Background()) + if err != nil { + state.Put("error", err) + ui.Error("vm.HostSystem:" + err.Error()) + return multistep.ActionHalt + } + + if err := vm.Unregister(context.Background()); err != nil { + state.Put("error", err) + ui.Error("vm.Unregister:" + err.Error()) + return multistep.ActionHalt + } + + if err := unregisterPreviousVM(cli, folder, s.VMName); err != nil { + state.Put("error", err) + ui.Error("unregisterPreviousVM:" + err.Error()) + return multistep.ActionHalt + } + + task, err := folder.RegisterVM(context.Background(), dsPath.String(), s.VMName, true, nil, host) + if err != nil { + state.Put("error", err) + ui.Error("RegisterVM:" + err.Error()) + return multistep.ActionHalt + } + + if err = task.Wait(context.Background()); err != nil { + state.Put("error", err) + ui.Error("task.Wait:" + err.Error()) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func datastorePath(vm *object.VirtualMachine) (*object.DatastorePath, error) { + devices, err := vm.Device(context.Background()) + if err != nil { + return nil, err + } + + disk := "" + for _, device := range devices { + if d, ok := device.(*types.VirtualDisk); ok { + if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + disk = b.GetVirtualDeviceFileBackingInfo().FileName + } + break + } + } + + if disk == "" { + return nil, fmt.Errorf("disk not found in '%v'", vm.Name()) + } + + re := regexp.MustCompile("\\[(.*?)\\]") + + datastore := re.FindStringSubmatch(disk)[1] + vmxPath := path.Join("/", path.Dir(strings.Split(disk, " ")[1]), vm.Name()+".vmx") + + return &object.DatastorePath{ + Datastore: datastore, + Path: vmxPath, + }, nil +} + +func findRuntimeVM(cli *govmomi.Client, dcPath, name, remoteFolder string) (*object.VirtualMachine, error) { + si := object.NewSearchIndex(cli.Client) + fullPath := path.Join(dcPath, "vm", remoteFolder, name) + + ref, err := si.FindByInventoryPath(context.Background(), fullPath) + if err != nil { + return nil, err + } + + if ref == nil { + return nil, fmt.Errorf("VM at path %s not found", fullPath) + } + + vm := ref.(*object.VirtualMachine) + if vm.InventoryPath == "" { + vm.SetInventoryPath(fullPath) + } + + return vm, nil +} + +// If in the target folder a virtual machine or template already exists +// it will be removed to maintain consistency +func unregisterPreviousVM(cli *govmomi.Client, folder *object.Folder, name string) error { + si := object.NewSearchIndex(cli.Client) + fullPath := path.Join(folder.InventoryPath, name) + + ref, err := si.FindByInventoryPath(context.Background(), fullPath) + if err != nil { + return err + } + + if ref != nil { + if vm, ok := ref.(*object.VirtualMachine); ok { + return vm.Unregister(context.Background()) + } else { + return fmt.Errorf("an object name '%v' already exists", name) + } + + } + + return nil +} + +func (s *stepMarkAsTemplate) Cleanup(multistep.StateBag) {} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/artifact.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/artifact.go new file mode 100644 index 000000000..90e475a28 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/artifact.go @@ -0,0 +1,47 @@ +package vsphere + +import ( + "fmt" +) + +const BuilderId = "packer.post-processor.vsphere" + +type Artifact struct { + files []string + datastore string + vmfolder string + vmname string +} + +func NewArtifact(datastore, vmfolder, vmname string, files []string) *Artifact { + return &Artifact{ + files: files, + datastore: datastore, + vmfolder: vmfolder, + vmname: vmname, + } +} + +func (*Artifact) BuilderId() string { + return BuilderId +} + +func (a *Artifact) Files() []string { + return a.files +} + +func (a *Artifact) Id() string { + return fmt.Sprintf("%s::%s::%s", a.datastore, a.vmfolder, a.vmname) +} + +func (a *Artifact) String() string { + return fmt.Sprintf("VM: %s Folder: %s Datastore: %s", a.vmname, a.vmfolder, a.datastore) +} + +func (*Artifact) State(name string) interface{} { + return nil +} + +func (a *Artifact) Destroy() error { + return nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.go new file mode 100644 index 000000000..827ad7273 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.go @@ -0,0 +1,280 @@ +//go:generate mapstructure-to-hcl2 -type Config + +package vsphere + +import ( + "bytes" + "context" + "fmt" + "log" + "net/url" + "os/exec" + "regexp" + "runtime" + "strings" + "time" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-sdk/common" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + shelllocal "github.com/hashicorp/packer-plugin-sdk/shell-local" + "github.com/hashicorp/packer-plugin-sdk/template/config" + "github.com/hashicorp/packer-plugin-sdk/template/interpolate" +) + +var ovftool string = "ovftool" + +var ( + // Regular expression to validate RFC1035 hostnames from full fqdn or simple hostname. + // For example "packer-esxi1". Requires proper DNS setup and/or correct DNS search domain setting. + hostnameRegex = regexp.MustCompile(`^[[:alnum:]][[:alnum:]\-]{0,61}[[:alnum:]]|[[:alpha:]]$`) + + // Simple regular expression to validate IPv4 values. + // For example "192.168.1.1". + ipv4Regex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) +) + +type Config struct { + common.PackerConfig `mapstructure:",squash"` + + Cluster string `mapstructure:"cluster"` + Datacenter string `mapstructure:"datacenter"` + Datastore string `mapstructure:"datastore"` + DiskMode string `mapstructure:"disk_mode"` + Host string `mapstructure:"host"` + ESXiHost string `mapstructure:"esxi_host"` + Insecure bool `mapstructure:"insecure"` + Options []string `mapstructure:"options"` + Overwrite bool `mapstructure:"overwrite"` + Password string `mapstructure:"password"` + ResourcePool string `mapstructure:"resource_pool"` + Username string `mapstructure:"username"` + VMFolder string `mapstructure:"vm_folder"` + VMName string `mapstructure:"vm_name"` + VMNetwork string `mapstructure:"vm_network"` + + ctx interpolate.Context +} + +type PostProcessor struct { + config Config +} + +func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } + +func (p *PostProcessor) Configure(raws ...interface{}) error { + err := config.Decode(&p.config, &config.DecodeOpts{ + PluginType: BuilderId, + Interpolate: true, + InterpolateContext: &p.config.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{}, + }, + }, raws...) + if err != nil { + return err + } + + // Defaults + if p.config.DiskMode == "" { + p.config.DiskMode = "thick" + } + + // Accumulate any errors + errs := new(packersdk.MultiError) + + if runtime.GOOS == "windows" { + ovftool = "ovftool.exe" + } + + if _, err := exec.LookPath(ovftool); err != nil { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("ovftool not found: %s", err)) + } + + // First define all our templatable parameters that are _required_ + templates := map[string]*string{ + "cluster": &p.config.Cluster, + "datacenter": &p.config.Datacenter, + "diskmode": &p.config.DiskMode, + "host": &p.config.Host, + "password": &p.config.Password, + "username": &p.config.Username, + "vm_name": &p.config.VMName, + } + for key, ptr := range templates { + if *ptr == "" { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("%s must be set", key)) + } + } + + if len(errs.Errors) > 0 { + return errs + } + + return nil +} + +func (p *PostProcessor) generateURI() (*url.URL, error) { + // use net/url lib to encode and escape url elements + ovftool_uri := fmt.Sprintf("vi://%s/%s/host/%s", + p.config.Host, + p.config.Datacenter, + p.config.Cluster) + + if p.config.ResourcePool != "" { + ovftool_uri += "/Resources/" + p.config.ResourcePool + } + + u, err := url.Parse(ovftool_uri) + if err != nil { + return nil, fmt.Errorf("Couldn't generate uri for ovftool: %s", err) + } + u.User = url.UserPassword(p.config.Username, p.config.Password) + + if p.config.ESXiHost != "" { + q := u.Query() + if ipv4Regex.MatchString(p.config.ESXiHost) { + q.Add("ip", p.config.ESXiHost) + } else if hostnameRegex.MatchString(p.config.ESXiHost) { + q.Add("dns", p.config.ESXiHost) + } + u.RawQuery = q.Encode() + } + return u, nil +} + +func getEncodedPassword(u *url.URL) (string, bool) { + // filter password from all logging + password, passwordSet := u.User.Password() + if passwordSet && password != "" { + encodedPassword := strings.Split(u.User.String(), ":")[1] + return encodedPassword, true + } + return password, false +} + +func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { + source := "" + for _, path := range artifact.Files() { + if strings.HasSuffix(path, ".vmx") || strings.HasSuffix(path, ".ovf") || strings.HasSuffix(path, ".ova") { + source = path + break + } + } + + if source == "" { + return nil, false, false, fmt.Errorf("VMX, OVF or OVA file not found") + } + + ovftool_uri, err := p.generateURI() + if err != nil { + return nil, false, false, err + } + encodedPassword, isSet := getEncodedPassword(ovftool_uri) + if isSet { + packersdk.LogSecretFilter.Set(encodedPassword) + } + + args, err := p.BuildArgs(source, ovftool_uri.String()) + if err != nil { + ui.Message(fmt.Sprintf("Failed: %s\n", err)) + } + + ui.Message(fmt.Sprintf("Uploading %s to vSphere", source)) + + log.Printf("Starting ovftool with parameters: %s", strings.Join(args, " ")) + + ui.Message("Validating Username and Password with dry-run") + err = p.ValidateOvfTool(args, ovftool) + if err != nil { + return nil, false, false, err + } + + // Validation has passed, so run for real. + ui.Message("Calling OVFtool to upload vm") + commandAndArgs := []string{ovftool} + commandAndArgs = append(commandAndArgs, args...) + comm := &shelllocal.Communicator{ + ExecuteCommand: commandAndArgs, + } + flattenedCmd := strings.Join(commandAndArgs, " ") + cmd := &packersdk.RemoteCmd{Command: flattenedCmd} + log.Printf("[INFO] (vsphere): starting ovftool command: %s", flattenedCmd) + err = cmd.RunWithUi(ctx, comm, ui) + if err != nil || cmd.ExitStatus() != 0 { + return nil, false, false, fmt.Errorf( + "Error uploading virtual machine: Please see output above for more information.") + } + + artifact = NewArtifact(p.config.Datastore, p.config.VMFolder, p.config.VMName, artifact.Files()) + + return artifact, false, false, nil +} + +func (p *PostProcessor) ValidateOvfTool(args []string, ofvtool string) error { + args = append([]string{"--verifyOnly"}, args...) + var out bytes.Buffer + cmdCtx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + cmd := exec.CommandContext(cmdCtx, ovftool, args...) + cmd.Stdout = &out + + // Need to manually close stdin or else the ofvtool call will hang + // forever in a situation where the user has provided an invalid + // password or username + stdin, err := cmd.StdinPipe() + if err != nil { + return err + } + defer stdin.Close() + + if err := cmd.Run(); err != nil { + outString := out.String() + if strings.Contains(outString, "Enter login information for") { + err = fmt.Errorf("Error performing OVFtool dry run; the username " + + "or password you provided to ovftool is likely invalid.") + return err + } + return nil + } + return nil +} + +func (p *PostProcessor) BuildArgs(source, ovftool_uri string) ([]string, error) { + args := []string{ + "--acceptAllEulas", + fmt.Sprintf(`--name=%s`, p.config.VMName), + fmt.Sprintf(`--datastore=%s`, p.config.Datastore), + } + + if p.config.Insecure { + args = append(args, fmt.Sprintf(`--noSSLVerify=%t`, p.config.Insecure)) + } + + if p.config.DiskMode != "" { + args = append(args, fmt.Sprintf(`--diskMode=%s`, p.config.DiskMode)) + } + + if p.config.VMFolder != "" { + args = append(args, fmt.Sprintf(`--vmFolder=%s`, p.config.VMFolder)) + } + + if p.config.VMNetwork != "" { + args = append(args, fmt.Sprintf(`--network=%s`, p.config.VMNetwork)) + } + + if p.config.Overwrite == true { + args = append(args, "--overwrite") + } + + if len(p.config.Options) > 0 { + args = append(args, p.config.Options...) + } + + args = append(args, source) + args = append(args, ovftool_uri) + + return args, nil +} diff --git a/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.hcl2spec.go b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.hcl2spec.go new file mode 100644 index 000000000..da4d82973 --- /dev/null +++ b/vendor/github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere/post-processor.hcl2spec.go @@ -0,0 +1,75 @@ +// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. + +package vsphere + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` + Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` + Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` + DiskMode *string `mapstructure:"disk_mode" cty:"disk_mode" hcl:"disk_mode"` + Host *string `mapstructure:"host" cty:"host" hcl:"host"` + ESXiHost *string `mapstructure:"esxi_host" cty:"esxi_host" hcl:"esxi_host"` + Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` + Options []string `mapstructure:"options" cty:"options" hcl:"options"` + Overwrite *bool `mapstructure:"overwrite" cty:"overwrite" hcl:"overwrite"` + Password *string `mapstructure:"password" cty:"password" hcl:"password"` + ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` + Username *string `mapstructure:"username" cty:"username" hcl:"username"` + VMFolder *string `mapstructure:"vm_folder" cty:"vm_folder" hcl:"vm_folder"` + VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` + VMNetwork *string `mapstructure:"vm_network" cty:"vm_network" hcl:"vm_network"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, + "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, + "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, + "disk_mode": &hcldec.AttrSpec{Name: "disk_mode", Type: cty.String, Required: false}, + "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, + "esxi_host": &hcldec.AttrSpec{Name: "esxi_host", Type: cty.String, Required: false}, + "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, + "options": &hcldec.AttrSpec{Name: "options", Type: cty.List(cty.String), Required: false}, + "overwrite": &hcldec.AttrSpec{Name: "overwrite", Type: cty.Bool, Required: false}, + "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, + "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, + "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, + "vm_folder": &hcldec.AttrSpec{Name: "vm_folder", Type: cty.String, Required: false}, + "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, + "vm_network": &hcldec.AttrSpec{Name: "vm_network", Type: cty.String, Required: false}, + } + return s +} diff --git a/vendor/github.com/vmware/govmomi/.goreleaser.yml b/vendor/github.com/vmware/govmomi/.goreleaser.yml index 6a374cd9b..9e7edeb3c 100644 --- a/vendor/github.com/vmware/govmomi/.goreleaser.yml +++ b/vendor/github.com/vmware/govmomi/.goreleaser.yml @@ -11,6 +11,7 @@ builds: - amd64 - 386 - arm64 + - mips64le env: - CGO_ENABLED=0 main: ./govc/main.go @@ -27,6 +28,7 @@ builds: - amd64 - 386 - arm64 + - mips64le env: - CGO_ENABLED=0 main: ./vcsim/main.go diff --git a/vendor/github.com/vmware/govmomi/.mailmap b/vendor/github.com/vmware/govmomi/.mailmap index 9368b7a9d..057bc427c 100644 --- a/vendor/github.com/vmware/govmomi/.mailmap +++ b/vendor/github.com/vmware/govmomi/.mailmap @@ -33,3 +33,6 @@ Uwe Bessle <Uwe.Bessle@iteratec.de> Uwe Bessle <uwe.bessle@web.de> Vadim Egorov <vegorov@vmware.com> <egorovv@gmail.com> Zach Tucker <ztucker@vmware.com> <jzt@users.noreply.github.com> Zee Yang <zeey@vmware.com> <zee.yang@gmail.com> +Ian Eyberg <ian@deferpanic.com> <ian@opuler.com> +Parveen Chahal <parkuma@microsoft.com> <mail.chahal@gmail.com> +Yun Zhou <yunz@vmware.com> <41678287+gh05tn0va@users.noreply.github.com> diff --git a/vendor/github.com/vmware/govmomi/.travis.yml b/vendor/github.com/vmware/govmomi/.travis.yml index 1c55bc987..fc7006ae8 100644 --- a/vendor/github.com/vmware/govmomi/.travis.yml +++ b/vendor/github.com/vmware/govmomi/.travis.yml @@ -12,7 +12,7 @@ services: false # Set the version of Go. language: go -go: 1.14 +go: 1.15 # Always set the project's Go import path to ensure that forked # builds get cloned to the correct location. @@ -44,23 +44,14 @@ jobs: install: true script: make install - - <<: *build-stage - env: GOOS=linux GOARCH=386 - - <<: *build-stage env: GOOS=darwin GOARCH=amd64 - - <<: *build-stage - env: GOOS=darwin GOARCH=386 - <<: *build-stage env: GOOS=freebsd GOARCH=amd64 - - <<: *build-stage - env: GOOS=freebsd GOARCH=386 - <<: *build-stage env: GOOS=windows GOARCH=amd64 - - <<: *build-stage - env: GOOS=windows GOARCH=386 # The test stage executes the test target. - stage: test diff --git a/vendor/github.com/vmware/govmomi/CHANGELOG.md b/vendor/github.com/vmware/govmomi/CHANGELOG.md index 5bc962871..bdc547462 100644 --- a/vendor/github.com/vmware/govmomi/CHANGELOG.md +++ b/vendor/github.com/vmware/govmomi/CHANGELOG.md @@ -1,5 +1,19 @@ # changelog +### 0.24.0 (2020-12-20) + +* Update generated API bindings to vSphere 7.0U1 release + +* Add vSAN 7.0 API bindings + +* Add AuthorizationManager.HasUserPrivilegeOnEntities wrapper + +* Add sms generated types and methods + +* Add ExtendDisk and InflateDisk wrappers to vlsm.ObjectManager + +* Add vSAN Performance Data Collection API + ### 0.23.0 (2020-06-11) * Finder: support DistributedVirtualSwitch traversal diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTORS b/vendor/github.com/vmware/govmomi/CONTRIBUTORS index 4d4819fea..bf849d644 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTORS +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTORS @@ -8,9 +8,9 @@ abrarshivani <abrarshivani@users.noreply.github.com> Adam Shannon <adamkshannon@gmail.com> Al Biheiri <abiheiri@apple.com> Alessandro Cortiana <alessandro.cortiana@gmail.com> +Alex <puzo2002@gmail.com> Alex Bozhenko <alexbozhenko@fb.com> Alex Ellis (VMware) <alexellis2@gmail.com> -Alex <puzo2002@gmail.com> Alvaro Miranda <kikitux@gmail.com> Amanda H. L. de Andrade <amanda.andrade@serpro.gov.br> Amit Bathla <abathla@.vmware.com> @@ -31,27 +31,30 @@ Austin Parker <aparker@apprenda.com> Balu Dontu <bdontu@vmware.com> bastienbc <bastien.barbe.creuly@gmail.com> Ben Corrie <bcorrie@vmware.com> +Ben Vickers <bvickers@pivotal.io> Benjamin Davini <davinib@vmware.com> Benjamin Peterson <benjamin@python.org> +Bhavya Choudhary <bhavyac@vmware.com> Bob Killen <killen.bob@gmail.com> Brad Fitzpatrick <bradfitz@golang.org> +brian57860 <brian57860@users.noreply.github.com> Bruce Downs <bruceadowns@gmail.com> -Cédric Blomart <cblomart@gmail.com> Cheng Cheng <chengch@vmware.com> Chethan Venkatesh <chethanv@vmware.com> Chris Marchesi <chrism@vancluevertech.com> Christian Höltje <docwhat@gerf.org> Clint Greenwood <cgreenwood@vmware.com> CuiHaozhi <cuihaozhi@chinacloud.com.cn> -Daniel Mueller <deso@posteo.net> +Cédric Blomart <cblomart@gmail.com> Dan Ilan <danilan@google.com> +Daniel Mueller <deso@posteo.net> Danny Lockard <danny.lockard@banno.com> Dave Gress <gressd@vmware.com> Dave Smith-Uchida <dsmithuchida@vmware.com> Dave Tucker <dave@dtucker.co.uk> -Davide Agnello <dagnello@hp.com> David Gress <gressd@vmware.com> David Stark <dave@davidstark.name> +Davide Agnello <dagnello@hp.com> Davinder Kumar <davinderk@vmware.com> demarey <christophe.demarey@inria.fr> dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> @@ -82,6 +85,7 @@ Hasan Mahmood <mahmoodh@vmware.com> Henrik Hodne <henrik@travis-ci.com> hkumar <hkumar@vmware.com> hui luo <luoh@vmware.com> +Ian Eyberg <ian@deferpanic.com> Isaac Rodman <isaac@eyz.us> Ivan Mikushin <imikushin@vmware.com> Ivan Porto Carrero <icarrero@vmware.com> @@ -91,16 +95,18 @@ Jeremy Canady <jcanady@jackhenry.com> jeremy-clerc <jeremy@clerc.io> Jiatong Wang <wjiatong@vmware.com> jingyizPensando <jingyiz@pensando.io> -João Pereira <joaodrp@gmail.com> Jonas Ausevicius <jonas.ausevicius@virtustream.com> Jorge Sevilla <jorge.sevilla@rstor.io> +João Pereira <joaodrp@gmail.com> kayrus <kay.diam@gmail.com> Kevin George <georgek@vmware.com> +Leslie Wang <qiwa@pensando.io> leslie-qiwa <leslie.qiwa@gmail.com> Lintong Jiang <lintongj@vmware.com> Liping Xue <lipingx@vmware.com> Louie Jiang <jiangl@vmware.com> Luther Monson <luther.monson@gmail.com> +Madanagopal Arunachalam <marunachalam@vmware.com> maplain <fangyuanl@vmware.com> Marc Carmier <mcarmier@gmail.com> Marcus Tan <marcus.tan@rubrik.com> @@ -109,15 +115,17 @@ Marin Atanasov Nikolov <mnikolov@vmware.com> Mario Trangoni <mjtrangoni@gmail.com> Mark Peek <markpeek@vmware.com> Matt Clay <matt@mystile.com> -Matthew Cosgrove <matthew.cosgrove@dell.com> Matt Moore <mattmoor@vmware.com> Matt Moriarity <matt@mattmoriarity.com> +Matthew Cosgrove <matthew.cosgrove@dell.com> Mevan Samaratunga <mevansam@gmail.com> +Michael Gasch <mgasch@vmware.com> Michal Jankowski <mjankowski@vmware.com> mingwei <mingwei@smartx.com> Nicolas Lamirault <nicolas.lamirault@gmail.com> Omar Kohl <omarkohl@gmail.com> Parham Alvani <parham.alvani@gmail.com> +Parveen Chahal <parkuma@microsoft.com> Pierre Gronlier <pierre.gronlier@corp.ovh.com> Pieter Noordhuis <pnoordhuis@vmware.com> prydin <prydin@vmware.com> @@ -125,11 +133,12 @@ rHermes <teodor_spaeren@riseup.net> Rowan Jacobs <rojacobs@pivotal.io> rsikdar <rsikdar@berkeley.edu> runner.mei <runner.mei@gmail.com> -Sandeep Pissay Srinivasa Rao <ssrinivas@vmware.com> S.Çağlar Onur <conur@vmware.com> +Sandeep Pissay Srinivasa Rao <ssrinivas@vmware.com> Sergey Ignatov <sergey.ignatov@jetbrains.com> serokles <timbo.alexander@gmail.com> Shalini Bhaskara <sbhaskara@vmware.com> +Shaozhen Ding <dsz0111@gmail.com> Shawn Neal <sneal@sneal.net> shylasrinivas <sshyla@vmware.com> sky-joker <sky.jokerxx@gmail.com> @@ -157,12 +166,17 @@ Waldek Maleska <w.maleska@gmail.com> William Lam <info.virtuallyghetto@gmail.com> Witold Krecicki <wpk@culm.net> xing-yang <xingyang105@gmail.com> -yangxi <yangxi@vmware.com> Yang Yang <yangy@vmware.com> +yangxi <yangxi@vmware.com> Yann Hodique <yhodique@google.com> +Yash Nitin Desai <desaiy@vmware.com> +Yassine TIJANI <ytijani@vmware.com> +yiyingy <yiyingy@vmware.com> ykakarap <yuva2811@gmail.com> +Yogesh Sobale <6104071+ysobale@users.noreply.github.com> +Yun Zhou <yunz@vmware.com> Yuya Kusakabe <yuya.kusakabe@gmail.com> -Zacharias Taubert <zacharias.taubert@gmail.com> Zach Tucker <ztucker@vmware.com> +Zacharias Taubert <zacharias.taubert@gmail.com> Zee Yang <zeey@vmware.com> zyuxin <zyuxin@vmware.com> diff --git a/vendor/github.com/vmware/govmomi/README.md b/vendor/github.com/vmware/govmomi/README.md index db17cc664..2bc127e2b 100644 --- a/vendor/github.com/vmware/govmomi/README.md +++ b/vendor/github.com/vmware/govmomi/README.md @@ -89,6 +89,8 @@ Refer to the [CHANGELOG](CHANGELOG.md) for version to version changes. * [OPS](https://github.com/nanovms/ops) +* [VMware Event Broker Appliance](https://github.com/vmware-samples/vcenter-event-broker-appliance/tree/development/vmware-event-router) + ## Related projects * [rbvmomi](https://github.com/vmware/rbvmomi) diff --git a/vendor/github.com/vmware/govmomi/find/finder.go b/vendor/github.com/vmware/govmomi/find/finder.go index a46c70bf5..cd71d183b 100644 --- a/vendor/github.com/vmware/govmomi/find/finder.go +++ b/vendor/github.com/vmware/govmomi/find/finder.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2020 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import ( "path" "strings" + "github.com/vmware/govmomi/internal" "github.com/vmware/govmomi/list" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/property" @@ -67,6 +68,18 @@ func (f *Finder) SetDatacenter(dc *object.Datacenter) *Finder { return f } +// InventoryPath composes the given object's inventory path. +// There is no vSphere property or method that provides an inventory path directly. +// This method uses the ManagedEntity.Parent field to determine the ancestry tree of the object and +// the ManagedEntity.Name field for each ancestor to compose the path. +func InventoryPath(ctx context.Context, client *vim25.Client, obj types.ManagedObjectReference) (string, error) { + entities, err := mo.Ancestors(ctx, client, client.ServiceContent.PropertyCollector, obj) + if err != nil { + return "", err + } + return internal.InventoryPath(entities), nil +} + // findRoot makes it possible to use "find" mode with a different root path. // Example: ResourcePoolList("/dc1/host/cluster1/...") func (f *Finder) findRoot(ctx context.Context, root *list.Element, parts []string) bool { @@ -103,8 +116,8 @@ func (f *Finder) find(ctx context.Context, arg string, s *spec) ([]list.Element, isPath := strings.Contains(arg, "/") root := list.Element{ - Path: "/", Object: object.NewRootFolder(f.client), + Path: "/", } parts := list.ToParts(arg) @@ -119,19 +132,10 @@ func (f *Finder) find(ctx context.Context, arg string, s *spec) ([]list.Element, return nil, err } - mes, err := mo.Ancestors(ctx, f.client, f.client.ServiceContent.PropertyCollector, pivot.Reference()) + root.Path, err = InventoryPath(ctx, f.client, pivot.Reference()) if err != nil { return nil, err } - - for _, me := range mes { - // Skip root entity in building inventory path. - if me.Parent == nil { - continue - } - root.Path = path.Join(root.Path, me.Name) - } - root.Object = pivot parts = parts[1:] } @@ -281,8 +285,7 @@ func (f *Finder) managedObjectList(ctx context.Context, path string, tl bool, in return f.find(ctx, path, s) } -// Element returns an Element for the given ManagedObjectReference -// This method is only useful for looking up the InventoryPath of a ManagedObjectReference. +// Element is deprecated, use InventoryPath() instead. func (f *Finder) Element(ctx context.Context, ref types.ManagedObjectReference) (*list.Element, error) { rl := func(_ context.Context) (object.Reference, error) { return ref, nil @@ -311,7 +314,7 @@ func (f *Finder) Element(ctx context.Context, ref types.ManagedObjectReference) // ObjectReference converts the given ManagedObjectReference to a type from the object package via object.NewReference // with the object.Common.InventoryPath field set. func (f *Finder) ObjectReference(ctx context.Context, ref types.ManagedObjectReference) (object.Reference, error) { - e, err := f.Element(ctx, ref) + path, err := InventoryPath(ctx, f.client, ref) if err != nil { return nil, err } @@ -322,7 +325,7 @@ func (f *Finder) ObjectReference(ctx context.Context, ref types.ManagedObjectRef SetInventoryPath(string) } - r.(common).SetInventoryPath(e.Path) + r.(common).SetInventoryPath(path) if f.dc != nil { if ds, ok := r.(*object.Datastore); ok { diff --git a/vendor/github.com/vmware/govmomi/internal/helpers.go b/vendor/github.com/vmware/govmomi/internal/helpers.go new file mode 100644 index 000000000..945f1d474 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/helpers.go @@ -0,0 +1,38 @@ +/* +Copyright (c) 2020 VMware, Inc. All Rights Reserved. + +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 internal + +import ( + "path" + + "github.com/vmware/govmomi/vim25/mo" +) + +// InventoryPath composed of entities by Name +func InventoryPath(entities []mo.ManagedEntity) string { + val := "/" + + for _, entity := range entities { + // Skip root folder in building inventory path. + if entity.Parent == nil { + continue + } + val = path.Join(val, entity.Name) + } + + return val +} diff --git a/vendor/github.com/vmware/govmomi/internal/methods.go b/vendor/github.com/vmware/govmomi/internal/methods.go new file mode 100644 index 000000000..95ccee8d2 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/methods.go @@ -0,0 +1,123 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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 internal + +import ( + "context" + + "github.com/vmware/govmomi/vim25/soap" +) + +type RetrieveDynamicTypeManagerBody struct { + Req *RetrieveDynamicTypeManagerRequest `xml:"urn:vim25 RetrieveDynamicTypeManager"` + Res *RetrieveDynamicTypeManagerResponse `xml:"urn:vim25 RetrieveDynamicTypeManagerResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveDynamicTypeManagerBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDynamicTypeManager(ctx context.Context, r soap.RoundTripper, req *RetrieveDynamicTypeManagerRequest) (*RetrieveDynamicTypeManagerResponse, error) { + var reqBody, resBody RetrieveDynamicTypeManagerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveManagedMethodExecuterBody struct { + Req *RetrieveManagedMethodExecuterRequest `xml:"urn:vim25 RetrieveManagedMethodExecuter"` + Res *RetrieveManagedMethodExecuterResponse `xml:"urn:vim25 RetrieveManagedMethodExecuterResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveManagedMethodExecuterBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveManagedMethodExecuter(ctx context.Context, r soap.RoundTripper, req *RetrieveManagedMethodExecuterRequest) (*RetrieveManagedMethodExecuterResponse, error) { + var reqBody, resBody RetrieveManagedMethodExecuterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryMoInstancesBody struct { + Req *DynamicTypeMgrQueryMoInstancesRequest `xml:"urn:vim25 DynamicTypeMgrQueryMoInstances"` + Res *DynamicTypeMgrQueryMoInstancesResponse `xml:"urn:vim25 DynamicTypeMgrQueryMoInstancesResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryMoInstancesBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryMoInstances(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryMoInstancesRequest) (*DynamicTypeMgrQueryMoInstancesResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryMoInstancesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryTypeInfoBody struct { + Req *DynamicTypeMgrQueryTypeInfoRequest `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfo"` + Res *DynamicTypeMgrQueryTypeInfoResponse `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfoResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryTypeInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryTypeInfo(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryTypeInfoRequest) (*DynamicTypeMgrQueryTypeInfoResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryTypeInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExecuteSoapBody struct { + Req *ExecuteSoapRequest `xml:"urn:vim25 ExecuteSoap"` + Res *ExecuteSoapResponse `xml:"urn:vim25 ExecuteSoapResponse"` + Fault_ *soap.Fault +} + +func (b *ExecuteSoapBody) Fault() *soap.Fault { return b.Fault_ } + +func ExecuteSoap(ctx context.Context, r soap.RoundTripper, req *ExecuteSoapRequest) (*ExecuteSoapResponse, error) { + var reqBody, resBody ExecuteSoapBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/internal/types.go b/vendor/github.com/vmware/govmomi/internal/types.go new file mode 100644 index 000000000..b84103b89 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/types.go @@ -0,0 +1,270 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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 internal + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/types" +) + +type DynamicTypeMgrQueryMoInstancesRequest struct { + This types.ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryMoInstancesResponse struct { + Returnval []DynamicTypeMgrMoInstance `xml:"urn:vim25 returnval"` +} + +type DynamicTypeEnumTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Value []string `xml:"value,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeEnumTypeInfo", reflect.TypeOf((*DynamicTypeEnumTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrAllTypeInfoRequest struct { + types.DynamicData + + ManagedTypeInfo []DynamicTypeMgrManagedTypeInfo `xml:"managedTypeInfo,omitempty"` + EnumTypeInfo []DynamicTypeEnumTypeInfo `xml:"enumTypeInfo,omitempty"` + DataTypeInfo []DynamicTypeMgrDataTypeInfo `xml:"dataTypeInfo,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrAllTypeInfo", reflect.TypeOf((*DynamicTypeMgrAllTypeInfoRequest)(nil)).Elem()) +} + +type DynamicTypeMgrAnnotation struct { + types.DynamicData + + Name string `xml:"name"` + Parameter []string `xml:"parameter,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrAnnotation", reflect.TypeOf((*DynamicTypeMgrAnnotation)(nil)).Elem()) +} + +type DynamicTypeMgrDataTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrDataTypeInfo", reflect.TypeOf((*DynamicTypeMgrDataTypeInfo)(nil)).Elem()) +} + +func (b *DynamicTypeMgrFilterSpec) GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec { return b } + +type BaseDynamicTypeMgrFilterSpec interface { + GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec +} + +type DynamicTypeMgrFilterSpec struct { + types.DynamicData +} + +func init() { + types.Add("DynamicTypeMgrFilterSpec", reflect.TypeOf((*DynamicTypeMgrFilterSpec)(nil)).Elem()) +} + +type DynamicTypeMgrManagedTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Method []DynamicTypeMgrMethodTypeInfo `xml:"method,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrManagedTypeInfo", reflect.TypeOf((*DynamicTypeMgrManagedTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrMethodTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + ParamTypeInfo []DynamicTypeMgrParamTypeInfo `xml:"paramTypeInfo,omitempty"` + ReturnTypeInfo *DynamicTypeMgrParamTypeInfo `xml:"returnTypeInfo,omitempty"` + Fault []string `xml:"fault,omitempty"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrMethodTypeInfo", reflect.TypeOf((*DynamicTypeMgrMethodTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrMoFilterSpec struct { + DynamicTypeMgrFilterSpec + + Id string `xml:"id,omitempty"` + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrMoFilterSpec", reflect.TypeOf((*DynamicTypeMgrMoFilterSpec)(nil)).Elem()) +} + +type DynamicTypeMgrMoInstance struct { + types.DynamicData + + Id string `xml:"id"` + MoType string `xml:"moType"` +} + +func init() { + types.Add("DynamicTypeMgrMoInstance", reflect.TypeOf((*DynamicTypeMgrMoInstance)(nil)).Elem()) +} + +type DynamicTypeMgrParamTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrParamTypeInfo", reflect.TypeOf((*DynamicTypeMgrParamTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrPropertyTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + MsgIdFormat string `xml:"msgIdFormat,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +type DynamicTypeMgrQueryTypeInfoRequest struct { + This types.ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryTypeInfoResponse struct { + Returnval DynamicTypeMgrAllTypeInfoRequest `xml:"urn:vim25 returnval"` +} + +func init() { + types.Add("DynamicTypeMgrPropertyTypeInfo", reflect.TypeOf((*DynamicTypeMgrPropertyTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrTypeFilterSpec struct { + DynamicTypeMgrFilterSpec + + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrTypeFilterSpec", reflect.TypeOf((*DynamicTypeMgrTypeFilterSpec)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapArgument struct { + types.DynamicData + + Name string `xml:"name"` + Val string `xml:"val"` +} + +func init() { + types.Add("ReflectManagedMethodExecuterSoapArgument", reflect.TypeOf((*ReflectManagedMethodExecuterSoapArgument)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapFault struct { + types.DynamicData + + FaultMsg string `xml:"faultMsg"` + FaultDetail string `xml:"faultDetail,omitempty"` +} + +func init() { + types.Add("ReflectManagedMethodExecuterSoapFault", reflect.TypeOf((*ReflectManagedMethodExecuterSoapFault)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapResult struct { + types.DynamicData + + Response string `xml:"response,omitempty"` + Fault *ReflectManagedMethodExecuterSoapFault `xml:"fault,omitempty"` +} + +type RetrieveDynamicTypeManagerRequest struct { + This types.ManagedObjectReference `xml:"_this"` +} + +type RetrieveDynamicTypeManagerResponse struct { + Returnval *InternalDynamicTypeManager `xml:"urn:vim25 returnval"` +} + +type RetrieveManagedMethodExecuterRequest struct { + This types.ManagedObjectReference `xml:"_this"` +} + +func init() { + types.Add("RetrieveManagedMethodExecuter", reflect.TypeOf((*RetrieveManagedMethodExecuterRequest)(nil)).Elem()) +} + +type RetrieveManagedMethodExecuterResponse struct { + Returnval *ReflectManagedMethodExecuter `xml:"urn:vim25 returnval"` +} + +type InternalDynamicTypeManager struct { + types.ManagedObjectReference +} + +type ReflectManagedMethodExecuter struct { + types.ManagedObjectReference +} + +type ExecuteSoapRequest struct { + This types.ManagedObjectReference `xml:"_this"` + Moid string `xml:"moid"` + Version string `xml:"version"` + Method string `xml:"method"` + Argument []ReflectManagedMethodExecuterSoapArgument `xml:"argument,omitempty"` +} + +type ExecuteSoapResponse struct { + Returnval *ReflectManagedMethodExecuterSoapResult `xml:"urn:vim25 returnval"` +} diff --git a/vendor/github.com/vmware/govmomi/object/authorization_manager.go b/vendor/github.com/vmware/govmomi/object/authorization_manager.go index b703258fe..5cd6851a8 100644 --- a/vendor/github.com/vmware/govmomi/object/authorization_manager.go +++ b/vendor/github.com/vmware/govmomi/object/authorization_manager.go @@ -172,3 +172,50 @@ func (m AuthorizationManager) UpdateRole(ctx context.Context, id int32, name str _, err := methods.UpdateAuthorizationRole(ctx, m.Client(), &req) return err } + +func (m AuthorizationManager) HasUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string, privID []string) ([]types.EntityPrivilege, error) { + req := types.HasUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + PrivId: privID, + } + + res, err := methods.HasUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) HasPrivilegeOnEntity(ctx context.Context, entity types.ManagedObjectReference, sessionID string, privID []string) ([]bool, error) { + req := types.HasPrivilegeOnEntity{ + This: m.Reference(), + Entity: entity, + SessionId: sessionID, + PrivId: privID, + } + + res, err := methods.HasPrivilegeOnEntity(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) FetchUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string) ([]types.UserPrivilegeResult, error) { + req := types.FetchUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + } + + res, err := methods.FetchUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_app.go b/vendor/github.com/vmware/govmomi/object/virtual_app.go index 4811178f1..b7311b3e3 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_app.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_app.go @@ -103,3 +103,19 @@ func (p VirtualApp) Suspend(ctx context.Context) (*Task, error) { return NewTask(p.c, res.Returnval), nil } + +func (p VirtualApp) Clone(ctx context.Context, name string, target types.ManagedObjectReference, spec types.VAppCloneSpec) (*Task, error) { + req := types.CloneVApp_Task{ + This: p.Reference(), + Name: name, + Target: target, + Spec: spec, + } + + res, err := methods.CloneVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go index 58b61f5d5..f25f6f2c1 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go @@ -19,6 +19,7 @@ package object import ( "errors" "fmt" + "math/rand" "path/filepath" "reflect" "regexp" @@ -67,7 +68,7 @@ func EthernetCardTypes() VirtualDeviceList { &types.VirtualSriovEthernetCard{}, }).Select(func(device types.BaseVirtualDevice) bool { c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - c.GetVirtualDevice().Key = -1 + c.GetVirtualDevice().Key = int32(rand.Uint32()) * -1 return true }) } @@ -134,6 +135,9 @@ func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBa b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo) return a.Port.SwitchUuid == b.Port.SwitchUuid && a.Port.PortgroupKey == b.Port.PortgroupKey + case *types.VirtualEthernetCardOpaqueNetworkBackingInfo: + b := backing.(*types.VirtualEthernetCardOpaqueNetworkBackingInfo) + return a.OpaqueNetworkId == b.OpaqueNetworkId case *types.VirtualDiskFlatVer2BackingInfo: b := backing.(*types.VirtualDiskFlatVer2BackingInfo) if a.Parent != nil && b.Parent != nil { @@ -433,7 +437,7 @@ func (l VirtualDeviceList) AssignController(device types.BaseVirtualDevice, c ty d.UnitNumber = new(int32) *d.UnitNumber = l.newUnitNumber(c) if d.Key == 0 { - d.Key = -1 + d.Key = int32(rand.Uint32()) * -1 } } diff --git a/vendor/github.com/vmware/govmomi/object/virtual_machine.go b/vendor/github.com/vmware/govmomi/object/virtual_machine.go index ed86a3922..1d85047fc 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_machine.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -40,6 +40,34 @@ type VirtualMachine struct { Common } +// extractDiskLayoutFiles is a helper function used to extract file keys for +// all disk files attached to the virtual machine at the current point of +// running. +func extractDiskLayoutFiles(diskLayoutList []types.VirtualMachineFileLayoutExDiskLayout) []int { + var result []int + + for _, layoutExDisk := range diskLayoutList { + for _, link := range layoutExDisk.Chain { + for i := range link.FileKey { // diskDescriptor, diskExtent pairs + result = append(result, int(link.FileKey[i])) + } + } + } + + return result +} + +// removeKey is a helper function for removing a specific file key from a list +// of keys associated with disks attached to a virtual machine. +func removeKey(l *[]int, key int) { + for i, k := range *l { + if k == key { + *l = append((*l)[:i], (*l)[i+1:]...) + break + } + } +} + func NewVirtualMachine(c *vim25.Client, ref types.ManagedObjectReference) *VirtualMachine { return &VirtualMachine{ Common: NewCommon(c, ref), @@ -181,6 +209,20 @@ func (v VirtualMachine) Clone(ctx context.Context, folder *Folder, name string, return NewTask(v.c, res.Returnval), nil } +func (v VirtualMachine) InstantClone(ctx context.Context, config types.VirtualMachineInstantCloneSpec) (*Task, error) { + req := types.InstantClone_Task{ + This: v.Reference(), + Spec: config, + } + + res, err := methods.InstantClone_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + func (v VirtualMachine) Customize(ctx context.Context, spec types.CustomizationSpec) (*Task, error) { req := types.CustomizeVM_Task{ This: v.Reference(), @@ -469,6 +511,41 @@ func (v VirtualMachine) RemoveDevice(ctx context.Context, keepFiles bool, device return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationRemove, fop, device...) } +// AttachDisk attaches the given disk to the VirtualMachine +func (v VirtualMachine) AttachDisk(ctx context.Context, id string, datastore *Datastore, controllerKey int32, unitNumber int32) error { + req := types.AttachDisk_Task{ + This: v.Reference(), + DiskId: types.ID{Id: id}, + Datastore: datastore.Reference(), + ControllerKey: controllerKey, + UnitNumber: &unitNumber, + } + + res, err := methods.AttachDisk_Task(ctx, v.c, &req) + if err != nil { + return err + } + + task := NewTask(v.c, res.Returnval) + return task.Wait(ctx) +} + +// DetachDisk detaches the given disk from the VirtualMachine +func (v VirtualMachine) DetachDisk(ctx context.Context, id string) error { + req := types.DetachDisk_Task{ + This: v.Reference(), + DiskId: types.ID{Id: id}, + } + + res, err := methods.DetachDisk_Task(ctx, v.c, &req) + if err != nil { + return err + } + + task := NewTask(v.c, res.Returnval) + return task.Wait(ctx) +} + // BootOptions returns the VirtualMachine's config.bootOptions property. func (v VirtualMachine) BootOptions(ctx context.Context) (*types.VirtualMachineBootOptions, error) { var o mo.VirtualMachine @@ -579,6 +656,63 @@ func (m snapshotMap) add(parent string, tree []types.VirtualMachineSnapshotTree) } } +// SnapshotSize calculates the size of a given snapshot in bytes. If the +// snapshot is current, disk files not associated with any parent snapshot are +// included in size calculations. This allows for measuring and including the +// growth from the last fixed snapshot to the present state. +func SnapshotSize(info types.ManagedObjectReference, parent *types.ManagedObjectReference, vmlayout *types.VirtualMachineFileLayoutEx, isCurrent bool) int { + var fileKeyList []int + var parentFiles []int + var allSnapshotFiles []int + + diskFiles := extractDiskLayoutFiles(vmlayout.Disk) + + for _, layout := range vmlayout.Snapshot { + diskLayout := extractDiskLayoutFiles(layout.Disk) + allSnapshotFiles = append(allSnapshotFiles, diskLayout...) + + if layout.Key.Value == info.Value { + fileKeyList = append(fileKeyList, int(layout.DataKey)) // The .vmsn file + fileKeyList = append(fileKeyList, diskLayout...) // The .vmdk files + } else if parent != nil && layout.Key.Value == parent.Value { + parentFiles = append(parentFiles, diskLayout...) + } + } + + for _, parentFile := range parentFiles { + removeKey(&fileKeyList, parentFile) + } + + for _, file := range allSnapshotFiles { + removeKey(&diskFiles, file) + } + + fileKeyMap := make(map[int]types.VirtualMachineFileLayoutExFileInfo) + for _, file := range vmlayout.File { + fileKeyMap[int(file.Key)] = file + } + + size := 0 + + for _, fileKey := range fileKeyList { + file := fileKeyMap[fileKey] + if parent != nil || + (file.Type != string(types.VirtualMachineFileLayoutExFileTypeDiskDescriptor) && + file.Type != string(types.VirtualMachineFileLayoutExFileTypeDiskExtent)) { + size += int(file.Size) + } + } + + if isCurrent { + for _, diskFile := range diskFiles { + file := fileKeyMap[diskFile] + size += int(file.Size) + } + } + + return size +} + // FindSnapshot supports snapshot lookup by name, where name can be: // 1) snapshot ManagedObjectReference.Value (unique) // 2) snapshot name (may not be unique) diff --git a/vendor/github.com/vmware/govmomi/ovf/cim.go b/vendor/github.com/vmware/govmomi/ovf/cim.go new file mode 100644 index 000000000..427699954 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/cim.go @@ -0,0 +1,128 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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 ovf + +import ( + "github.com/vmware/govmomi/vim25/types" +) + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd +*/ + +type CIMVirtualSystemSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + AutomaticRecoveryAction *uint8 `xml:"AutomaticRecoveryAction"` + AutomaticShutdownAction *uint8 `xml:"AutomaticShutdownAction"` + AutomaticStartupAction *uint8 `xml:"AutomaticStartupAction"` + AutomaticStartupActionDelay *string `xml:"AutomaticStartupActionDelay>Interval"` + AutomaticStartupActionSequenceNumber *uint16 `xml:"AutomaticStartupActionSequenceNumber"` + Caption *string `xml:"Caption"` + ConfigurationDataRoot *string `xml:"ConfigurationDataRoot"` + ConfigurationFile *string `xml:"ConfigurationFile"` + ConfigurationID *string `xml:"ConfigurationID"` + CreationTime *string `xml:"CreationTime"` + Description *string `xml:"Description"` + LogDataRoot *string `xml:"LogDataRoot"` + Notes []string `xml:"Notes"` + RecoveryFile *string `xml:"RecoveryFile"` + SnapshotDataRoot *string `xml:"SnapshotDataRoot"` + SuspendDataRoot *string `xml:"SuspendDataRoot"` + SwapFileDataRoot *string `xml:"SwapFileDataRoot"` + VirtualSystemIdentifier *string `xml:"VirtualSystemIdentifier"` + VirtualSystemType *string `xml:"VirtualSystemType"` +} + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_ResourceAllocationSettingData.xsd +*/ + +type CIMResourceAllocationSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + ResourceType *uint16 `xml:"ResourceType"` + OtherResourceType *string `xml:"OtherResourceType"` + ResourceSubType *string `xml:"ResourceSubType"` + + AddressOnParent *string `xml:"AddressOnParent"` + Address *string `xml:"Address"` + AllocationUnits *string `xml:"AllocationUnits"` + AutomaticAllocation *bool `xml:"AutomaticAllocation"` + AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` + Caption *string `xml:"Caption"` + Connection []string `xml:"Connection"` + ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` + Description *string `xml:"Description"` + HostResource []string `xml:"HostResource"` + Limit *uint64 `xml:"Limit"` + MappingBehavior *uint `xml:"MappingBehavior"` + Parent *string `xml:"Parent"` + PoolID *string `xml:"PoolID"` + Reservation *uint64 `xml:"Reservation"` + VirtualQuantity *uint `xml:"VirtualQuantity"` + VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` + Weight *uint `xml:"Weight"` +} + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_StorageAllocationSettingData.xsd +*/ +type CIMStorageAllocationSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + ResourceType *uint16 `xml:"ResourceType"` + OtherResourceType *string `xml:"OtherResourceType"` + ResourceSubType *string `xml:"ResourceSubType"` + + Access *uint16 `xml:"Access"` + Address *string `xml:"Address"` + AddressOnParent *string `xml:"AddressOnParent"` + AllocationUnits *string `xml:"AllocationUnits"` + AutomaticAllocation *bool `xml:"AutomaticAllocation"` + AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` + Caption *string `xml:"Caption"` + ChangeableType *uint16 `xml:"ChangeableType"` + ComponentSetting []types.AnyType `xml:"ComponentSetting"` + ConfigurationName *string `xml:"ConfigurationName"` + Connection []string `xml:"Connection"` + ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` + Description *string `xml:"Description"` + Generation *uint64 `xml:"Generation"` + HostExtentName *string `xml:"HostExtentName"` + HostExtentNameFormat *uint16 `xml:"HostExtentNameFormat"` + HostExtentNameNamespace *uint16 `xml:"HostExtentNameNamespace"` + HostExtentStartingAddress *uint64 `xml:"HostExtentStartingAddress"` + HostResource []string `xml:"HostResource"` + HostResourceBlockSize *uint64 `xml:"HostResourceBlockSize"` + Limit *uint64 `xml:"Limit"` + MappingBehavior *uint `xml:"MappingBehavior"` + OtherHostExtentNameFormat *string `xml:"OtherHostExtentNameFormat"` + OtherHostExtentNameNamespace *string `xml:"OtherHostExtentNameNamespace"` + Parent *string `xml:"Parent"` + PoolID *string `xml:"PoolID"` + Reservation *uint64 `xml:"Reservation"` + SoID *string `xml:"SoID"` + SoOrgID *string `xml:"SoOrgID"` + VirtualQuantity *uint `xml:"VirtualQuantity"` + VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` + VirtualResourceBlockSize *uint64 `xml:"VirtualResourceBlockSize"` + Weight *uint `xml:"Weight"` +} diff --git a/vendor/github.com/vmware/govmomi/ovf/doc.go b/vendor/github.com/vmware/govmomi/ovf/doc.go new file mode 100644 index 000000000..6284b1ac5 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/doc.go @@ -0,0 +1,25 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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 ovf provides functionality to unmarshal and inspect the structure +of an OVF file. It is not a complete implementation of the specification and +is intended to be used to import virtual infrastructure into vSphere. + +For a complete specification of the OVF standard, refer to: +https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf +*/ +package ovf diff --git a/vendor/github.com/vmware/govmomi/ovf/env.go b/vendor/github.com/vmware/govmomi/ovf/env.go new file mode 100644 index 000000000..3ec1b99d0 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/env.go @@ -0,0 +1,99 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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 ovf + +import ( + "bytes" + "fmt" + + "github.com/vmware/govmomi/vim25/xml" +) + +const ( + ovfEnvHeader = `<Environment + xmlns="http://schemas.dmtf.org/ovf/environment/1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" + xmlns:ve="http://www.vmware.com/schema/ovfenv" + oe:id="" + ve:esxId="%s">` + ovfEnvPlatformSection = `<PlatformSection> + <Kind>%s</Kind> + <Version>%s</Version> + <Vendor>%s</Vendor> + <Locale>%s</Locale> + </PlatformSection>` + ovfEnvPropertyHeader = `<PropertySection>` + ovfEnvPropertyEntry = `<Property oe:key="%s" oe:value="%s"/>` + ovfEnvPropertyFooter = `</PropertySection>` + ovfEnvFooter = `</Environment>` +) + +type Env struct { + XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment"` + ID string `xml:"id,attr"` + EsxID string `xml:"http://www.vmware.com/schema/ovfenv esxId,attr"` + + Platform *PlatformSection `xml:"PlatformSection"` + Property *PropertySection `xml:"PropertySection"` +} + +type PlatformSection struct { + Kind string `xml:"Kind"` + Version string `xml:"Version"` + Vendor string `xml:"Vendor"` + Locale string `xml:"Locale"` +} + +type PropertySection struct { + Properties []EnvProperty `xml:"Property"` +} + +type EnvProperty struct { + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + +// Marshal marshals Env to xml by using xml.Marshal. +func (e Env) Marshal() (string, error) { + x, err := xml.Marshal(e) + if err != nil { + return "", err + } + + return fmt.Sprintf("%s%s", xml.Header, x), nil +} + +// MarshalManual manually marshals Env to xml suitable for a vApp guest. +// It exists to overcome the lack of expressiveness in Go's XML namespaces. +func (e Env) MarshalManual() string { + var buffer bytes.Buffer + + buffer.WriteString(xml.Header) + buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) + buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) + + buffer.WriteString(fmt.Sprint(ovfEnvPropertyHeader)) + for _, p := range e.Property.Properties { + buffer.WriteString(fmt.Sprintf(ovfEnvPropertyEntry, p.Key, p.Value)) + } + buffer.WriteString(fmt.Sprint(ovfEnvPropertyFooter)) + + buffer.WriteString(fmt.Sprint(ovfEnvFooter)) + + return buffer.String() +} diff --git a/vendor/github.com/vmware/govmomi/ovf/envelope.go b/vendor/github.com/vmware/govmomi/ovf/envelope.go new file mode 100644 index 000000000..274adb9df --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/envelope.go @@ -0,0 +1,208 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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 ovf + +type Envelope struct { + References []File `xml:"References>File"` + + // Package level meta-data + Annotation *AnnotationSection `xml:"AnnotationSection"` + Product *ProductSection `xml:"ProductSection"` + Network *NetworkSection `xml:"NetworkSection"` + Disk *DiskSection `xml:"DiskSection"` + OperatingSystem *OperatingSystemSection `xml:"OperatingSystemSection"` + Eula *EulaSection `xml:"EulaSection"` + VirtualHardware *VirtualHardwareSection `xml:"VirtualHardwareSection"` + ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection"` + DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection"` + + // Content: A VirtualSystem or a VirtualSystemCollection + VirtualSystem *VirtualSystem `xml:"VirtualSystem"` +} + +type VirtualSystem struct { + Content + + Annotation []AnnotationSection `xml:"AnnotationSection"` + Product []ProductSection `xml:"ProductSection"` + OperatingSystem []OperatingSystemSection `xml:"OperatingSystemSection"` + Eula []EulaSection `xml:"EulaSection"` + VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection"` +} + +type File struct { + ID string `xml:"id,attr"` + Href string `xml:"href,attr"` + Size uint `xml:"size,attr"` + Compression *string `xml:"compression,attr"` + ChunkSize *int `xml:"chunkSize,attr"` +} + +type Content struct { + ID string `xml:"id,attr"` + Info string `xml:"Info"` + Name *string `xml:"Name"` +} + +type Section struct { + Required *bool `xml:"required,attr"` + Info string `xml:"Info"` +} + +type AnnotationSection struct { + Section + + Annotation string `xml:"Annotation"` +} + +type ProductSection struct { + Section + + Class *string `xml:"class,attr"` + Instance *string `xml:"instance,attr"` + + Product string `xml:"Product"` + Vendor string `xml:"Vendor"` + Version string `xml:"Version"` + FullVersion string `xml:"FullVersion"` + ProductURL string `xml:"ProductUrl"` + VendorURL string `xml:"VendorUrl"` + AppURL string `xml:"AppUrl"` + Property []Property `xml:"Property"` +} + +type Property struct { + Key string `xml:"key,attr"` + Type string `xml:"type,attr"` + Qualifiers *string `xml:"qualifiers,attr"` + UserConfigurable *bool `xml:"userConfigurable,attr"` + Default *string `xml:"value,attr"` + Password *bool `xml:"password,attr"` + + Label *string `xml:"Label"` + Description *string `xml:"Description"` + + Values []PropertyConfigurationValue `xml:"Value"` +} + +type PropertyConfigurationValue struct { + Value string `xml:"value,attr"` + Configuration *string `xml:"configuration,attr"` +} + +type NetworkSection struct { + Section + + Networks []Network `xml:"Network"` +} + +type Network struct { + Name string `xml:"name,attr"` + + Description string `xml:"Description"` +} + +type DiskSection struct { + Section + + Disks []VirtualDiskDesc `xml:"Disk"` +} + +type VirtualDiskDesc struct { + DiskID string `xml:"diskId,attr"` + FileRef *string `xml:"fileRef,attr"` + Capacity string `xml:"capacity,attr"` + CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr"` + Format *string `xml:"format,attr"` + PopulatedSize *int `xml:"populatedSize,attr"` + ParentRef *string `xml:"parentRef,attr"` +} + +type OperatingSystemSection struct { + Section + + ID int16 `xml:"id,attr"` + Version *string `xml:"version,attr"` + OSType *string `xml:"osType,attr"` + + Description *string `xml:"Description"` +} + +type EulaSection struct { + Section + + License string `xml:"License"` +} + +type Config struct { + Required *bool `xml:"required,attr"` + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + +type VirtualHardwareSection struct { + Section + + ID *string `xml:"id,attr"` + Transport *string `xml:"transport,attr"` + + System *VirtualSystemSettingData `xml:"System"` + Item []ResourceAllocationSettingData `xml:"Item"` + StorageItem []StorageAllocationSettingData `xml:"StorageItem"` + Config []Config `xml:"Config"` + ExtraConfig []Config `xml:"ExtraConfig"` +} + +type VirtualSystemSettingData struct { + CIMVirtualSystemSettingData +} + +type ResourceAllocationSettingData struct { + CIMResourceAllocationSettingData + + Required *bool `xml:"required,attr"` + Configuration *string `xml:"configuration,attr"` + Bound *string `xml:"bound,attr"` +} + +type StorageAllocationSettingData struct { + CIMStorageAllocationSettingData + + Required *bool `xml:"required,attr"` + Configuration *string `xml:"configuration,attr"` + Bound *string `xml:"bound,attr"` +} + +type ResourceAllocationSection struct { + Section + + Item []ResourceAllocationSettingData `xml:"Item"` +} + +type DeploymentOptionSection struct { + Section + + Configuration []DeploymentOptionConfiguration `xml:"Configuration"` +} + +type DeploymentOptionConfiguration struct { + ID string `xml:"id,attr"` + Default *bool `xml:"default,attr"` + + Label string `xml:"Label"` + Description string `xml:"Description"` +} diff --git a/vendor/github.com/vmware/govmomi/ovf/manager.go b/vendor/github.com/vmware/govmomi/ovf/manager.go new file mode 100644 index 000000000..3ee2afdd4 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/manager.go @@ -0,0 +1,103 @@ +/* +Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. + +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 ovf + +import ( + "context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type Manager struct { + types.ManagedObjectReference + + c *vim25.Client +} + +func NewManager(c *vim25.Client) *Manager { + return &Manager{*c.ServiceContent.OvfManager, c} +} + +// CreateDescriptor wraps methods.CreateDescriptor +func (m *Manager) CreateDescriptor(ctx context.Context, obj mo.Reference, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { + req := types.CreateDescriptor{ + This: m.Reference(), + Obj: obj.Reference(), + Cdp: cdp, + } + + res, err := methods.CreateDescriptor(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// CreateImportSpec wraps methods.CreateImportSpec +func (m *Manager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool mo.Reference, datastore mo.Reference, cisp types.OvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error) { + req := types.CreateImportSpec{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + ResourcePool: resourcePool.Reference(), + Datastore: datastore.Reference(), + Cisp: cisp, + } + + res, err := methods.CreateImportSpec(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ParseDescriptor wraps methods.ParseDescriptor +func (m *Manager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error) { + req := types.ParseDescriptor{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + Pdp: pdp, + } + + res, err := methods.ParseDescriptor(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ValidateHost wraps methods.ValidateHost +func (m *Manager) ValidateHost(ctx context.Context, ovfDescriptor string, host mo.Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error) { + req := types.ValidateHost{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + Host: host.Reference(), + Vhp: vhp, + } + + res, err := methods.ValidateHost(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/ovf/ovf.go b/vendor/github.com/vmware/govmomi/ovf/ovf.go new file mode 100644 index 000000000..bd279e757 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/ovf.go @@ -0,0 +1,35 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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 ovf + +import ( + "io" + + "github.com/vmware/govmomi/vim25/xml" +) + +func Unmarshal(r io.Reader) (*Envelope, error) { + var e Envelope + + dec := xml.NewDecoder(r) + err := dec.Decode(&e) + if err != nil { + return nil, err + } + + return &e, nil +} diff --git a/vendor/github.com/vmware/govmomi/session/manager.go b/vendor/github.com/vmware/govmomi/session/manager.go index 24c6a2dbe..8689acd50 100644 --- a/vendor/github.com/vmware/govmomi/session/manager.go +++ b/vendor/github.com/vmware/govmomi/session/manager.go @@ -281,3 +281,14 @@ func (sm *Manager) CloneSession(ctx context.Context, ticket string) error { sm.userSession = &res.Returnval return nil } + +func (sm *Manager) UpdateServiceMessage(ctx context.Context, message string) error { + req := types.UpdateServiceMessage{ + This: sm.Reference(), + Message: message, + } + + _, err := methods.UpdateServiceMessage(ctx, sm.client, &req) + + return err +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library.go b/vendor/github.com/vmware/govmomi/vapi/library/library.go new file mode 100644 index 000000000..7611af27a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library.go @@ -0,0 +1,308 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "context" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// StorageBackings for Content Libraries +type StorageBackings struct { + DatastoreID string `json:"datastore_id,omitempty"` + Type string `json:"type,omitempty"` +} + +// Library provides methods to create, read, update, delete, and enumerate libraries. +type Library struct { + CreationTime *time.Time `json:"creation_time,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` + LastSyncTime *time.Time `json:"last_sync_time,omitempty"` + Name string `json:"name,omitempty"` + Storage []StorageBackings `json:"storage_backings,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` + Subscription *Subscription `json:"subscription_info,omitempty"` + Publication *Publication `json:"publish_info,omitempty"` +} + +// Subscription info +type Subscription struct { + AuthenticationMethod string `json:"authentication_method"` + AutomaticSyncEnabled *bool `json:"automatic_sync_enabled,omitempty"` + OnDemand *bool `json:"on_demand,omitempty"` + Password string `json:"password,omitempty"` + SslThumbprint string `json:"ssl_thumbprint,omitempty"` + SubscriptionURL string `json:"subscription_url,omitempty"` + UserName string `json:"user_name,omitempty"` +} + +// Publication info +type Publication struct { + AuthenticationMethod string `json:"authentication_method"` + UserName string `json:"user_name,omitempty"` + Password string `json:"password,omitempty"` + CurrentPassword string `json:"current_password,omitempty"` + PersistJSON *bool `json:"persist_json_enabled,omitempty"` + Published *bool `json:"published,omitempty"` + PublishURL string `json:"publish_url,omitempty"` +} + +// SubscriberSummary as returned by ListSubscribers +type SubscriberSummary struct { + LibraryID string `json:"subscribed_library"` + LibraryName string `json:"subscribed_library_name"` + SubscriptionID string `json:"subscription"` + LibraryVcenterHostname string `json:"subscribed_library_vcenter_hostname,omitempty"` +} + +// Placement information used to place a virtual machine template +type Placement struct { + ResourcePool string `json:"resource_pool,omitempty"` + Host string `json:"host,omitempty"` + Folder string `json:"folder,omitempty"` + Cluster string `json:"cluster,omitempty"` + Network string `json:"network,omitempty"` +} + +// Vcenter contains information about the vCenter Server instance where a subscribed library associated with a subscription exists. +type Vcenter struct { + Hostname string `json:"hostname"` + Port int `json:"https_port,omitempty"` + ServerGUID string `json:"server_guid"` +} + +// Subscriber contains the detailed info for a library subscriber. +type Subscriber struct { + LibraryID string `json:"subscribed_library"` + LibraryName string `json:"subscribed_library_name"` + LibraryLocation string `json:"subscribed_library_location"` + Placement *Placement `json:"subscribed_library_placement,omitempty"` + Vcenter *Vcenter `json:"subscribed_library_vcenter,omitempty"` +} + +// SubscriberLibrary is the specification for a subscribed library to be associated with a subscription. +type SubscriberLibrary struct { + Target string `json:"target"` + LibraryID string `json:"subscribed_library,omitempty"` + Location string `json:"location"` + Vcenter *Vcenter `json:"vcenter,omitempty"` + Placement *Placement `json:"placement,omitempty"` +} + +// Patch merges updates from the given src. +func (l *Library) Patch(src *Library) { + if src.Name != "" { + l.Name = src.Name + } + if src.Description != "" { + l.Description = src.Description + } + if src.Version != "" { + l.Version = src.Version + } +} + +// Manager extends rest.Client, adding content library related methods. +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, + } +} + +// Find is the search criteria for finding libraries. +type Find struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` +} + +// FindLibrary returns one or more libraries that match the provided search +// criteria. +// +// The provided name is case-insensitive. +// +// Either the name or type of library may be set to empty values in order +// to search for all libraries, all libraries with a specific name, regardless +// of type, or all libraries of a specified type. +func (c *Manager) FindLibrary(ctx context.Context, search Find) ([]string, error) { + url := c.Resource(internal.LibraryPath).WithAction("find") + spec := struct { + Spec Find `json:"spec"` + }{search} + var res []string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// CreateLibrary creates a new library with the given Type, Name, +// Description, and CategoryID. +func (c *Manager) CreateLibrary(ctx context.Context, library Library) (string, error) { + spec := struct { + Library Library `json:"create_spec"` + }{library} + path := internal.LocalLibraryPath + if library.Type == "SUBSCRIBED" { + path = internal.SubscribedLibraryPath + sub := library.Subscription + u, err := url.Parse(sub.SubscriptionURL) + if err != nil { + return "", err + } + if u.Scheme == "https" && sub.SslThumbprint == "" { + thumbprint := c.Thumbprint(u.Host) + if thumbprint == "" { + t := c.DefaultTransport() + if t.TLSClientConfig.InsecureSkipVerify { + var info object.HostCertificateInfo + _ = info.FromURL(u, t.TLSClientConfig) + thumbprint = info.ThumbprintSHA1 + } + sub.SslThumbprint = thumbprint + } + } + } + url := c.Resource(path) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// SyncLibrary syncs a subscribed library. +func (c *Manager) SyncLibrary(ctx context.Context, library *Library) error { + path := internal.SubscribedLibraryPath + url := c.Resource(path).WithID(library.ID).WithAction("sync") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// PublishLibrary publishes the library to specified subscriptions. +// If no subscriptions are specified, then publishes the library to all subscriptions. +func (c *Manager) PublishLibrary(ctx context.Context, library *Library, subscriptions []string) error { + path := internal.LocalLibraryPath + var spec internal.SubscriptionDestinationSpec + for i := range subscriptions { + spec.Subscriptions = append(spec.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) + } + url := c.Resource(path).WithID(library.ID).WithAction("publish") + return c.Do(ctx, url.Request(http.MethodPost, spec), nil) +} + +// DeleteLibrary deletes an existing library. +func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error { + path := internal.LocalLibraryPath + if library.Type == "SUBSCRIBED" { + path = internal.SubscribedLibraryPath + } + url := c.Resource(path).WithID(library.ID) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// ListLibraries returns a list of all content library IDs in the system. +func (c *Manager) ListLibraries(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryPath) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryByID returns information on a library for the given ID. +func (c *Manager) GetLibraryByID(ctx context.Context, id string) (*Library, error) { + url := c.Resource(internal.LibraryPath).WithID(id) + var res Library + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryByName returns information on a library for the given name. +func (c *Manager) GetLibraryByName(ctx context.Context, name string) (*Library, error) { + // Lookup by name + libraries, err := c.GetLibraries(ctx) + if err != nil { + return nil, err + } + for i := range libraries { + if libraries[i].Name == name { + return &libraries[i], nil + } + } + return nil, fmt.Errorf("library name (%s) not found", name) +} + +// GetLibraries returns a list of all content library details in the system. +func (c *Manager) GetLibraries(ctx context.Context) ([]Library, error) { + ids, err := c.ListLibraries(ctx) + if err != nil { + return nil, fmt.Errorf("get libraries failed for: %s", err) + } + + var libraries []Library + for _, id := range ids { + library, err := c.GetLibraryByID(ctx, id) + if err != nil { + return nil, fmt.Errorf("get library %s failed for %s", id, err) + } + + libraries = append(libraries, *library) + + } + return libraries, nil +} + +// ListSubscribers lists the subscriptions of the published library. +func (c *Manager) ListSubscribers(ctx context.Context, library *Library) ([]SubscriberSummary, error) { + url := c.Resource(internal.Subscriptions).WithParam("library", library.ID) + var res []SubscriberSummary + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CreateSubscriber creates a subscription of the published library. +func (c *Manager) CreateSubscriber(ctx context.Context, library *Library, s SubscriberLibrary) (string, error) { + var spec struct { + Sub struct { + SubscriberLibrary SubscriberLibrary `json:"subscribed_library"` + } `json:"spec"` + } + spec.Sub.SubscriberLibrary = s + url := c.Resource(internal.Subscriptions).WithID(library.ID) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, &spec), &res) +} + +// GetSubscriber returns information about the specified subscriber of the published library. +func (c *Manager) GetSubscriber(ctx context.Context, library *Library, subscriber string) (*Subscriber, error) { + id := internal.SubscriptionDestination{ID: subscriber} + url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("get") + var res Subscriber + return &res, c.Do(ctx, url.Request(http.MethodPost, &id), &res) +} + +// DeleteSubscriber deletes the specified subscription of the published library. +// The subscribed library associated with the subscription will not be deleted. +func (c *Manager) DeleteSubscriber(ctx context.Context, library *Library, subscriber string) error { + id := internal.SubscriptionDestination{ID: subscriber} + url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("delete") + return c.Do(ctx, url.Request(http.MethodPost, &id), nil) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_file.go new file mode 100644 index 000000000..ba71d72d2 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_file.go @@ -0,0 +1,56 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "context" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" +) + +// Checksum provides checksum information on library item files. +type Checksum struct { + Algorithm string `json:"algorithm,omitempty"` + Checksum string `json:"checksum"` +} + +// File provides methods to get information on library item files. +type File struct { + Cached *bool `json:"cached,omitempty"` + Checksum *Checksum `json:"checksum_info,omitempty"` + Name string `json:"name,omitempty"` + Size *int64 `json:"size,omitempty"` + Version string `json:"version,omitempty"` +} + +// ListLibraryItemFiles returns a list of all the files for a library item. +func (c *Manager) ListLibraryItemFiles(ctx context.Context, id string) ([]File, error) { + url := c.Resource(internal.LibraryItemFilePath).WithParam("library_item_id", id) + var res []File + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItemFile returns a file with the provided name for a library item. +func (c *Manager) GetLibraryItemFile(ctx context.Context, id, fileName string) (*File, error) { + url := c.Resource(internal.LibraryItemFilePath).WithID(id).WithAction("get") + spec := struct { + Name string `json:"name"` + }{fileName} + var res File + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go new file mode 100644 index 000000000..57914ad6c --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go @@ -0,0 +1,180 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/vmware/govmomi/vapi/internal" +) + +const ( + ItemTypeISO = "iso" + ItemTypeOVF = "ovf" + ItemTypeVMTX = "vm-template" +) + +// Item provides methods to create, read, update, delete, and enumerate library items. +type Item struct { + Cached bool `json:"cached,omitempty"` + ContentVersion string `json:"content_version,omitempty"` + CreationTime *time.Time `json:"creation_time,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` + LastSyncTime *time.Time `json:"last_sync_time,omitempty"` + LibraryID string `json:"library_id,omitempty"` + MetadataVersion string `json:"metadata_version,omitempty"` + Name string `json:"name,omitempty"` + Size int64 `json:"size,omitempty"` + SourceID string `json:"source_id,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` +} + +// Patch merges updates from the given src. +func (i *Item) Patch(src *Item) { + if src.Name != "" { + i.Name = src.Name + } + if src.Description != "" { + i.Description = src.Description + } + if src.Type != "" { + i.Type = src.Type + } + if src.Version != "" { + i.Version = src.Version + } +} + +// CreateLibraryItem creates a new library item +func (c *Manager) CreateLibraryItem(ctx context.Context, item Item) (string, error) { + type createItemSpec struct { + Name string `json:"name"` + Description string `json:"description"` + LibraryID string `json:"library_id,omitempty"` + Type string `json:"type"` + } + spec := struct { + Item createItemSpec `json:"create_spec"` + }{ + Item: createItemSpec{ + Name: item.Name, + Description: item.Description, + LibraryID: item.LibraryID, + Type: item.Type, + }, + } + url := c.Resource(internal.LibraryItemPath) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// CopyLibraryItem copies a library item +func (c *Manager) CopyLibraryItem(ctx context.Context, src *Item, dst Item) (string, error) { + body := struct { + Item `json:"destination_create_spec"` + }{dst} + url := c.Resource(internal.LibraryItemPath).WithID(src.ID).WithAction("copy") + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, body), &res) +} + +// SyncLibraryItem syncs a subscribed library item +func (c *Manager) SyncLibraryItem(ctx context.Context, item *Item, force bool) error { + body := struct { + Force bool `json:"force_sync_content"` + }{force} + url := c.Resource(internal.SubscribedLibraryItem).WithID(item.ID).WithAction("sync") + return c.Do(ctx, url.Request(http.MethodPost, body), nil) +} + +// PublishLibraryItem publishes a library item to specified subscriptions. +// If no subscriptions are specified, then publishes the library item to all subscriptions. +func (c *Manager) PublishLibraryItem(ctx context.Context, item *Item, force bool, subscriptions []string) error { + body := internal.SubscriptionItemDestinationSpec{ + Force: force, + } + for i := range subscriptions { + body.Subscriptions = append(body.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) + } + url := c.Resource(internal.LibraryItemPath).WithID(item.ID).WithAction("publish") + return c.Do(ctx, url.Request(http.MethodPost, body), nil) +} + +// DeleteLibraryItem deletes an existing library item. +func (c *Manager) DeleteLibraryItem(ctx context.Context, item *Item) error { + url := c.Resource(internal.LibraryItemPath).WithID(item.ID) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// ListLibraryItems returns a list of all items in a content library. +func (c *Manager) ListLibraryItems(ctx context.Context, id string) ([]string, error) { + url := c.Resource(internal.LibraryItemPath).WithParam("library_id", id) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItem returns information on a library item for the given ID. +func (c *Manager) GetLibraryItem(ctx context.Context, id string) (*Item, error) { + url := c.Resource(internal.LibraryItemPath).WithID(id) + var res Item + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItems returns a list of all the library items for the specified library. +func (c *Manager) GetLibraryItems(ctx context.Context, libraryID string) ([]Item, error) { + ids, err := c.ListLibraryItems(ctx, libraryID) + if err != nil { + return nil, fmt.Errorf("get library items failed for: %s", err) + } + var items []Item + for _, id := range ids { + item, err := c.GetLibraryItem(ctx, id) + if err != nil { + return nil, fmt.Errorf("get library item for %s failed for %s", id, err) + } + items = append(items, *item) + } + return items, nil +} + +// FindItem is the search criteria for finding library items. +type FindItem struct { + Cached *bool `json:"cached,omitempty"` + LibraryID string `json:"library_id,omitempty"` + Name string `json:"name,omitempty"` + SourceID string `json:"source_id,omitempty"` + Type string `json:"type,omitempty"` +} + +// FindLibraryItems returns the IDs of all the library items that match the +// search criteria. +func (c *Manager) FindLibraryItems( + ctx context.Context, search FindItem) ([]string, error) { + + url := c.Resource(internal.LibraryItemPath).WithAction("find") + spec := struct { + Spec FindItem `json:"spec"` + }{search} + var res []string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go new file mode 100644 index 000000000..6f432f727 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go @@ -0,0 +1,71 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "context" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// DownloadFile is the specification for the downloadsession +// operations file:add, file:get, and file:list. +type DownloadFile struct { + BytesTransferred int64 `json:"bytes_transferred"` + Checksum *Checksum `json:"checksum_info,omitempty"` + DownloadEndpoint *TransferEndpoint `json:"download_endpoint,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + Name string `json:"name"` + Size int64 `json:"size,omitempty"` + Status string `json:"status"` +} + +// GetLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) GetLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("get") + spec := struct { + Name string `json:"file_name"` + }{name} + var res DownloadFile + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + if res.Status == "ERROR" { + return nil, res.ErrorMessage + } + return &res, nil +} + +// ListLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) ListLibraryItemDownloadSessionFile(ctx context.Context, sessionID string) ([]DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithParam("download_session_id", sessionID) + var res []DownloadFile + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// PrepareLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) PrepareLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("prepare") + spec := struct { + Name string `json:"file_name"` + }{name} + var res DownloadFile + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go new file mode 100644 index 000000000..df66a87b3 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go @@ -0,0 +1,165 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "context" + "net/http" + "time" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// Session is used to create an initial update or download session +type Session struct { + ClientProgress int64 `json:"client_progress,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + ExpirationTime *time.Time `json:"expiration_time,omitempty"` + ID string `json:"id,omitempty"` + LibraryItemContentVersion string `json:"library_item_content_version,omitempty"` + LibraryItemID string `json:"library_item_id,omitempty"` + State string `json:"state,omitempty"` +} + +// CreateLibraryItemUpdateSession creates a new library item +func (c *Manager) CreateLibraryItemUpdateSession(ctx context.Context, session Session) (string, error) { + url := c.Resource(internal.LibraryItemUpdateSession) + spec := struct { + CreateSpec Session `json:"create_spec"` + }{session} + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetLibraryItemUpdateSession gets the update session information with status +func (c *Manager) GetLibraryItemUpdateSession(ctx context.Context, id string) (*Session, error) { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) + var res Session + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// ListLibraryItemUpdateSession gets the list of update sessions +func (c *Manager) ListLibraryItemUpdateSession(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryItemUpdateSession) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CancelLibraryItemUpdateSession cancels an update session +func (c *Manager) CancelLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("cancel") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// CompleteLibraryItemUpdateSession completes an update session +func (c *Manager) CompleteLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("complete") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// DeleteLibraryItemUpdateSession deletes an update session +func (c *Manager) DeleteLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// FailLibraryItemUpdateSession fails an update session +func (c *Manager) FailLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("fail") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// KeepAliveLibraryItemUpdateSession keeps an inactive update session alive. +func (c *Manager) KeepAliveLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("keep-alive") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// WaitOnLibraryItemUpdateSession blocks until the update session is no longer +// in the ACTIVE state. +func (c *Manager) WaitOnLibraryItemUpdateSession( + ctx context.Context, sessionID string, + interval time.Duration, intervalCallback func()) error { + + // Wait until the upload operation is complete to return. + for { + session, err := c.GetLibraryItemUpdateSession(ctx, sessionID) + if err != nil { + return err + } + + if session.State != "ACTIVE" { + if session.State == "ERROR" { + return session.ErrorMessage + } + return nil + } + time.Sleep(interval) + if intervalCallback != nil { + intervalCallback() + } + } +} + +// CreateLibraryItemDownloadSession creates a new library item +func (c *Manager) CreateLibraryItemDownloadSession(ctx context.Context, session Session) (string, error) { + url := c.Resource(internal.LibraryItemDownloadSession) + spec := struct { + CreateSpec Session `json:"create_spec"` + }{session} + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetLibraryItemDownloadSession gets the download session information with status +func (c *Manager) GetLibraryItemDownloadSession(ctx context.Context, id string) (*Session, error) { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) + var res Session + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// ListLibraryItemDownloadSession gets the list of download sessions +func (c *Manager) ListLibraryItemDownloadSession(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryItemDownloadSession) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CancelLibraryItemDownloadSession cancels an download session +func (c *Manager) CancelLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("cancel") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// DeleteLibraryItemDownloadSession deletes an download session +func (c *Manager) DeleteLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// FailLibraryItemDownloadSession fails an download session +func (c *Manager) FailLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("fail") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// KeepAliveLibraryItemDownloadSession keeps an inactive download session alive. +func (c *Manager) KeepAliveLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("keep-alive") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go new file mode 100644 index 000000000..e34331cfa --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go @@ -0,0 +1,149 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 library + +import ( + "bufio" + "context" + "io" + "net/http" + "strings" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25/soap" +) + +// TransferEndpoint provides information on the source of a library item file. +type TransferEndpoint struct { + URI string `json:"uri,omitempty"` + SSLCertificateThumbprint string `json:"ssl_certificate_thumbprint,omitempty"` +} + +// UpdateFile is the specification for the updatesession +// operations file:add, file:get, and file:list. +type UpdateFile struct { + BytesTransferred int64 `json:"bytes_transferred,omitempty"` + Checksum *Checksum `json:"checksum_info,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + Name string `json:"name"` + Size int64 `json:"size,omitempty"` + SourceEndpoint *TransferEndpoint `json:"source_endpoint,omitempty"` + SourceType string `json:"source_type"` + Status string `json:"status,omitempty"` + UploadEndpoint *TransferEndpoint `json:"upload_endpoint,omitempty"` +} + +// AddLibraryItemFile adds a file +func (c *Manager) AddLibraryItemFile(ctx context.Context, sessionID string, updateFile UpdateFile) (*UpdateFile, error) { + url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("add") + spec := struct { + FileSpec UpdateFile `json:"file_spec"` + }{updateFile} + var res UpdateFile + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + if res.Status == "ERROR" { + return nil, res.ErrorMessage + } + return &res, nil +} + +// AddLibraryItemFileFromURI adds a file from a remote URI. +func (c *Manager) AddLibraryItemFileFromURI( + ctx context.Context, + sessionID, fileName, uri string) (*UpdateFile, error) { + + n, fingerprint, err := c.getContentLengthAndFingerprint(ctx, uri) + if err != nil { + return nil, err + } + + info, err := c.AddLibraryItemFile(ctx, sessionID, UpdateFile{ + Name: fileName, + SourceType: "PULL", + Size: n, + SourceEndpoint: &TransferEndpoint{ + URI: uri, + SSLCertificateThumbprint: fingerprint, + }, + }) + if err != nil { + return nil, err + } + + return info, c.CompleteLibraryItemUpdateSession(ctx, sessionID) +} + +// GetLibraryItemUpdateSessionFile retrieves information about a specific file +// that is a part of an update session. +func (c *Manager) GetLibraryItemUpdateSessionFile(ctx context.Context, sessionID string, fileName string) (*UpdateFile, error) { + url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("get") + spec := struct { + Name string `json:"file_name"` + }{fileName} + var res UpdateFile + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// getContentLengthAndFingerprint gets the number of bytes returned +// by the URI as well as the SHA1 fingerprint of the peer certificate +// if the URI's scheme is https. +func (c *Manager) getContentLengthAndFingerprint( + ctx context.Context, uri string) (int64, string, error) { + resp, err := c.Head(uri) + if err != nil { + return 0, "", err + } + if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 { + return resp.ContentLength, "", nil + } + fingerprint := c.Thumbprint(resp.Request.URL.Host) + if fingerprint == "" { + if c.DefaultTransport().TLSClientConfig.InsecureSkipVerify { + fingerprint = soap.ThumbprintSHA1(resp.TLS.PeerCertificates[0]) + } + } + return resp.ContentLength, fingerprint, nil +} + +// ReadManifest converts an ovf manifest to a map of file name -> Checksum. +func ReadManifest(m io.Reader) (map[string]*Checksum, error) { + // expected format: openssl sha1 *.{ovf,vmdk} + c := make(map[string]*Checksum) + + scanner := bufio.NewScanner(m) + for scanner.Scan() { + line := strings.SplitN(scanner.Text(), ")=", 2) + if len(line) != 2 { + continue + } + name := strings.SplitN(line[0], "(", 2) + if len(name) != 2 { + continue + } + sum := &Checksum{ + Algorithm: strings.TrimSpace(name[0]), + Checksum: strings.TrimSpace(line[1]), + } + c[name[1]] = sum + } + + return c, scanner.Err() +} diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/client.go b/vendor/github.com/vmware/govmomi/vapi/rest/client.go index 0cad1fb13..6b69c0947 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/client.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/client.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "net/http" "net/url" + "strings" "sync" "time" @@ -106,10 +107,21 @@ func (c *Client) UnmarshalJSON(b []byte) error { return nil } +// isAPI returns true if path starts with "/api" +// This hack allows helpers to support both endpoints: +// "/rest" - value wrapped responses and structured error responses +// "/api" - raw responses and no structured error responses +func isAPI(path string) bool { + return strings.HasPrefix(path, "/api") +} + // Resource helper for the given path. func (c *Client) Resource(path string) *Resource { r := &Resource{u: c.URL()} - r.u.Path = Path + path + if !isAPI(path) { + path = Path + path + } + r.u.Path = path return r } @@ -153,6 +165,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) return c.Client.Do(ctx, req, func(res *http.Response) error { switch res.StatusCode { case http.StatusOK: + case http.StatusCreated: case http.StatusNoContent: case http.StatusBadRequest: // TODO: structured error types @@ -174,12 +187,18 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) _, err := io.Copy(b, res.Body) return err default: + d := json.NewDecoder(res.Body) + if isAPI(req.URL.Path) { + // Responses from the /api endpoint are not wrapped + return d.Decode(resBody) + } + // Responses from the /rest endpoint are wrapped in this structure val := struct { Value interface{} `json:"value,omitempty"` }{ resBody, } - return json.NewDecoder(res.Body).Decode(&val) + return d.Decode(&val) } }) } diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/resource.go b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go index 243789632..060a1c84f 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/resource.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go @@ -48,11 +48,12 @@ func (r *Resource) WithAction(action string) *Resource { return r.WithParam("~action", action) } -// WithParam sets adds a parameter to the URL.RawQuery +// WithParam adds one parameter on the URL.RawQuery func (r *Resource) WithParam(name string, value string) *Resource { - r.u.RawQuery = url.Values{ - name: []string{value}, - }.Encode() + // ParseQuery handles empty case, and we control access to query string so shouldn't encounter an error case + params, _ := url.ParseQuery(r.u.RawQuery) + params[name] = []string{value} + r.u.RawQuery = params.Encode() return r } diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go new file mode 100644 index 000000000..3eaaa6431 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go @@ -0,0 +1,304 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +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 vcenter + +import ( + "context" + "fmt" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25/types" +) + +// AdditionalParams are additional OVF parameters which can be specified for a deployment target. +// This structure is a union where based on Type, only one of each commented section will be set. +type AdditionalParams struct { + Class string `json:"@class"` + Type string `json:"type"` + + // DeploymentOptionParams + SelectedKey string `json:"selected_key,omitempty"` + DeploymentOptions []DeploymentOption `json:"deployment_options,omitempty"` + + // ExtraConfigs + ExtraConfig []ExtraConfig `json:"extra_configs,omitempty"` + + // PropertyParams + Properties []Property `json:"properties,omitempty"` + + // SizeParams + ApproximateSparseDeploymentSize int64 `json:"approximate_sparse_deployment_size,omitempty"` + VariableDiskSize bool `json:"variable_disk_size,omitempty"` + ApproximateDownloadSize int64 `json:"approximate_download_size,omitempty"` + ApproximateFlatDeploymentSize int64 `json:"approximate_flat_deployment_size,omitempty"` + + // IpAllocationParams + SupportedAllocationScheme []string `json:"supported_allocation_scheme,omitempty"` + SupportedIPProtocol []string `json:"supported_ip_protocol,omitempty"` + SupportedIPAllocationPolicy []string `json:"supported_ip_allocation_policy,omitempty"` + IPAllocationPolicy string `json:"ip_allocation_policy,omitempty"` + IPProtocol string `json:"ip_protocol,omitempty"` + + // UnknownSections + UnknownSections []UnknownSection `json:"unknown_sections,omitempty"` +} + +const ( + ClassDeploymentOptionParams = "com.vmware.vcenter.ovf.deployment_option_params" + ClassPropertyParams = "com.vmware.vcenter.ovf.property_params" + TypeDeploymentOptionParams = "DeploymentOptionParams" + TypeExtraConfigParams = "ExtraConfigParams" + TypeIPAllocationParams = "IpAllocationParams" + TypePropertyParams = "PropertyParams" + TypeSizeParams = "SizeParams" +) + +// DeploymentOption contains the information about a deployment option as defined in the OVF specification +type DeploymentOption struct { + Key string `json:"key,omitempty"` + Label string `json:"label,omitempty"` + Description string `json:"description,omitempty"` + DefaultChoice bool `json:"default_choice,omitempty"` +} + +// ExtraConfig contains information about a vmw:ExtraConfig OVF element +type ExtraConfig struct { + Key string `json:"key,omitempty"` + Value string `json:"value,omitempty"` + VirtualSystemID string `json:"virtual_system_id,omitempty"` +} + +// Property contains information about a property in an OVF package +type Property struct { + Category string `json:"category,omitempty"` + ClassID string `json:"class_id,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + InstanceID string `json:"instance_id,omitempty"` + Label string `json:"label,omitempty"` + Type string `json:"type,omitempty"` + UIOptional bool `json:"ui_optional,omitempty"` + Value string `json:"value,omitempty"` +} + +// UnknownSection contains information about an unknown section in an OVF package +type UnknownSection struct { + Tag string `json:"tag,omitempty"` + Info string `json:"info,omitempty"` +} + +// NetworkMapping specifies the target network to use for sections of type ovf:NetworkSection in the OVF descriptor +type NetworkMapping struct { + Key string `json:"key"` + Value string `json:"value"` +} + +// StorageGroupMapping defines the storage deployment target and storage provisioning type for a section of type vmw:StorageGroupSection in the OVF descriptor +type StorageGroupMapping struct { + Type string `json:"type"` + StorageProfileID string `json:"storage_profile_id,omitempty"` + DatastoreID string `json:"datastore_id,omitempty"` + Provisioning string `json:"provisioning,omitempty"` +} + +// StorageMapping specifies the target storage to use for sections of type vmw:StorageGroupSection in the OVF descriptor +type StorageMapping struct { + Key string `json:"key"` + Value StorageGroupMapping `json:"value"` +} + +// DeploymentSpec is the deployment specification for the deployment +type DeploymentSpec struct { + Name string `json:"name,omitempty"` + Annotation string `json:"annotation,omitempty"` + AcceptAllEULA bool `json:"accept_all_EULA,omitempty"` + NetworkMappings []NetworkMapping `json:"network_mappings,omitempty"` + StorageMappings []StorageMapping `json:"storage_mappings,omitempty"` + StorageProvisioning string `json:"storage_provisioning,omitempty"` + StorageProfileID string `json:"storage_profile_id,omitempty"` + Locale string `json:"locale,omitempty"` + Flags []string `json:"flags,omitempty"` + AdditionalParams []AdditionalParams `json:"additional_parameters,omitempty"` + DefaultDatastoreID string `json:"default_datastore_id,omitempty"` +} + +// Target is the target for the deployment +type Target struct { + ResourcePoolID string `json:"resource_pool_id,omitempty"` + HostID string `json:"host_id,omitempty"` + FolderID string `json:"folder_id,omitempty"` +} + +// Deploy contains the information to start the deployment of a library OVF +type Deploy struct { + DeploymentSpec `json:"deployment_spec,omitempty"` + Target `json:"target,omitempty"` +} + +// Error is a SERVER error +type Error struct { + Class string `json:"@class,omitempty"` + Messages []rest.LocalizableMessage `json:"messages,omitempty"` +} + +// ParseIssue is a parse issue struct +type ParseIssue struct { + Category string `json:"@classcategory,omitempty"` + File string `json:"file,omitempty"` + LineNumber int64 `json:"line_number,omitempty"` + ColumnNumber int64 `json:"column_number,omitempty"` + Message rest.LocalizableMessage `json:"message,omitempty"` +} + +// OVFError is a list of errors from create or deploy +type OVFError struct { + Category string `json:"category,omitempty"` + Error *Error `json:"error,omitempty"` + Issues []ParseIssue `json:"issues,omitempty"` + Message *rest.LocalizableMessage `json:"message,omitempty"` +} + +// ResourceID is a managed object reference for a deployed resource. +type ResourceID struct { + Type string `json:"type,omitempty"` + Value string `json:"id,omitempty"` +} + +// DeploymentError is an error that occurs when deploying and OVF from +// a library item. +type DeploymentError struct { + Errors []OVFError `json:"errors,omitempty"` +} + +// Error implements the error interface +func (e *DeploymentError) Error() string { + msg := "" + if len(e.Errors) != 0 { + err := e.Errors[0] + if err.Message != nil { + msg = err.Message.DefaultMessage + } else if err.Error != nil && len(err.Error.Messages) != 0 { + msg = err.Error.Messages[0].DefaultMessage + } + } + if msg == "" { + msg = fmt.Sprintf("%#v", e) + } + return "deploy error: " + msg +} + +// LibraryTarget specifies a Library or Library item +type LibraryTarget struct { + LibraryID string `json:"library_id,omitempty"` + LibraryItemID string `json:"library_item_id,omitempty"` +} + +// CreateSpec info used to create an OVF package from a VM +type CreateSpec struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Flags []string `json:"flags,omitempty"` +} + +// OVF data used by CreateOVF +type OVF struct { + Spec CreateSpec `json:"create_spec"` + Source ResourceID `json:"source"` + Target LibraryTarget `json:"target"` +} + +// CreateResult used for decoded a CreateOVF response +type CreateResult struct { + Succeeded bool `json:"succeeded,omitempty"` + ID string `json:"ovf_library_item_id,omitempty"` + Error *DeploymentError `json:"error,omitempty"` +} + +// Deployment is the results from issuing a library OVF deployment +type Deployment struct { + Succeeded bool `json:"succeeded,omitempty"` + ResourceID *ResourceID `json:"resource_id,omitempty"` + Error *DeploymentError `json:"error,omitempty"` +} + +// FilterRequest contains the information to start a vcenter filter call +type FilterRequest struct { + Target `json:"target,omitempty"` +} + +// FilterResponse returns information from the vcenter filter call +type FilterResponse struct { + EULAs []string `json:"EULAs,omitempty"` + AdditionalParams []AdditionalParams `json:"additional_params,omitempty"` + Annotation string `json:"Annotation,omitempty"` + Name string `json:"name,omitempty"` + Networks []string `json:"Networks,omitempty"` + StorageGroups []string `json:"storage_groups,omitempty"` +} + +// Manager extends rest.Client, adding content library related methods. +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, + } +} + +// CreateOVF creates a library OVF item in content library from an existing VM +func (c *Manager) CreateOVF(ctx context.Context, ovf OVF) (string, error) { + if ovf.Source.Type == "" { + ovf.Source.Type = "VirtualMachine" + } + url := c.Resource(internal.VCenterOVFLibraryItem) + var res CreateResult + err := c.Do(ctx, url.Request(http.MethodPost, ovf), &res) + if err != nil { + return "", err + } + if res.Succeeded { + return res.ID, nil + } + return "", res.Error +} + +// DeployLibraryItem deploys a library OVF +func (c *Manager) DeployLibraryItem(ctx context.Context, libraryItemID string, deploy Deploy) (*types.ManagedObjectReference, error) { + url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("deploy") + var res Deployment + err := c.Do(ctx, url.Request(http.MethodPost, deploy), &res) + if err != nil { + return nil, err + } + if res.Succeeded { + ref := types.ManagedObjectReference(*res.ResourceID) + return &ref, nil + } + return nil, res.Error +} + +// FilterLibraryItem deploys a library OVF +func (c *Manager) FilterLibraryItem(ctx context.Context, libraryItemID string, filter FilterRequest) (FilterResponse, error) { + url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("filter") + var res FilterResponse + return res, c.Do(ctx, url.Request(http.MethodPost, filter), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go new file mode 100644 index 000000000..a71d4a061 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go @@ -0,0 +1,285 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +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 vcenter + +import ( + "context" + "crypto/sha1" + "fmt" + "log" + "net/http" + "path" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/library" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// vcenter vm template +// The vcenter.vm_template API provides structures and services that will let its client manage VMTX template in Content Library. +// http://vmware.github.io/vsphere-automation-sdk-rest/6.7.1/index.html#SVC_com.vmware.vcenter.vm_template.library_items + +// Template create spec +type Template struct { + Description string `json:"description,omitempty"` + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` + Library string `json:"library,omitempty"` + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + SourceVM string `json:"source_vm,omitempty"` + VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` +} + +// TemplateInfo for a VM template contained in an existing library item +type TemplateInfo struct { + GuestOS string `json:"guest_OS,omitempty"` + // TODO... +} + +// Placement information used to place the virtual machine template +type Placement = library.Placement + +// StoragePolicy for DiskStorage +type StoragePolicy struct { + Policy string `json:"policy,omitempty"` + Type string `json:"type"` +} + +// DiskStorage defines the storage specification for VM files +type DiskStorage struct { + Datastore string `json:"datastore,omitempty"` + StoragePolicy *StoragePolicy `json:"storage_policy,omitempty"` +} + +// DiskStorageOverride storage specification for individual disks in the virtual machine template +type DiskStorageOverride struct { + Key string `json:"key"` + Value DiskStorage `json:"value"` +} + +// GuestCustomization spec to apply to the deployed VM +type GuestCustomization struct { + Name string `json:"name,omitempty"` +} + +// HardwareCustomization spec which specifies updates to the deployed VM +type HardwareCustomization struct { + // TODO +} + +// DeployTemplate specification of how a library VM template clone should be deployed. +type DeployTemplate struct { + Description string `json:"description,omitempty"` + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` + GuestCustomization *GuestCustomization `json:"guest_customization,omitempty"` + HardwareCustomization *HardwareCustomization `json:"hardware_customization,omitempty"` + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + PoweredOn bool `json:"powered_on"` + VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` +} + +// CheckOut specification +type CheckOut struct { + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + PoweredOn bool `json:"powered_on,omitempty"` +} + +// CheckIn specification +type CheckIn struct { + Message string `json:"message"` +} + +// CreateTemplate creates a library VMTX item in content library from an existing VM +func (c *Manager) CreateTemplate(ctx context.Context, vmtx Template) (string, error) { + url := c.Resource(internal.VCenterVMTXLibraryItem) + var res string + spec := struct { + Template `json:"spec"` + }{vmtx} + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// DeployTemplateLibraryItem deploys a VM as a copy of the source VM template contained in the given library item +func (c *Manager) DeployTemplateLibraryItem(ctx context.Context, libraryItemID string, deploy DeployTemplate) (*types.ManagedObjectReference, error) { + url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID)).WithParam("action", "deploy") + var res string + spec := struct { + DeployTemplate `json:"spec"` + }{deploy} + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil +} + +// CheckOut a library item containing a VM template. +func (c *Manager) CheckOut(ctx context.Context, libraryItemID string, checkout *CheckOut) (*types.ManagedObjectReference, error) { + url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs")).WithParam("action", "check-out") + var res string + spec := struct { + *CheckOut `json:"spec"` + }{checkout} + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil +} + +// CheckIn a VM into the library item. +func (c *Manager) CheckIn(ctx context.Context, libraryItemID string, vm mo.Reference, checkin *CheckIn) (string, error) { + p := path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs", vm.Reference().Value) + url := c.Resource(p).WithParam("action", "check-in") + var res string + spec := struct { + *CheckIn `json:"spec"` + }{checkin} + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// TemplateLibrary params for synchronizing subscription library OVF items to VM Template items +type TemplateLibrary struct { + Source library.Library + Destination library.Library + Placement Target + Include func(library.Item, *library.Item) bool + SyncItem func(context.Context, library.Item, *Deploy, *Template) error +} + +func (c *Manager) includeTemplateLibraryItem(src library.Item, dst *library.Item) bool { + return dst == nil +} + +// SyncTemplateLibraryItem deploys an Library OVF item from which a VM template (vmtx) Library item is created. +// The deployed VM is deleted after being converted to a Library vmtx item. +func (c *Manager) SyncTemplateLibraryItem(ctx context.Context, item library.Item, deploy *Deploy, spec *Template) error { + destroy := false + if spec.SourceVM == "" { + ref, err := c.DeployLibraryItem(ctx, item.ID, *deploy) + if err != nil { + return err + } + + destroy = true + spec.SourceVM = ref.Value + } + + _, err := c.CreateTemplate(ctx, *spec) + + if destroy { + // Delete source VM regardless of CreateTemplate result + url := c.Resource("/vcenter/vm/" + spec.SourceVM) + derr := c.Do(ctx, url.Request(http.MethodDelete), nil) + if derr != nil { + if err == nil { + // Return Delete error if CreateTemplate was successful + return derr + } + // Return CreateTemplate error and just log Delete error + log.Printf("destroy %s: %s", spec.SourceVM, derr) + } + } + + return err +} + +func vmtxSourceName(l library.Library, item library.Item) string { + sum := sha1.Sum([]byte(path.Join(l.Name, item.Name))) + return fmt.Sprintf("vmtx-src-%x", sum) +} + +// SyncTemplateLibrary converts TemplateLibrary.Source OVF items to VM Template items within TemplateLibrary.Destination +// The optional TemplateLibrary.Include func can be used to filter which items are synced. +// By default all items that don't exist in the Destination library are synced. +// The optional TemplateLibrary.SyncItem func can be used to change how the item is synced, by default SyncTemplateLibraryItem is used. +func (c *Manager) SyncTemplateLibrary(ctx context.Context, l TemplateLibrary, items ...library.Item) error { + m := library.NewManager(c.Client) + var err error + if len(items) == 0 { + items, err = m.GetLibraryItems(ctx, l.Source.ID) + if err != nil { + return err + } + } + + templates, err := m.GetLibraryItems(ctx, l.Destination.ID) + if err != nil { + return err + } + + existing := make(map[string]*library.Item) + for i := range templates { + existing[templates[i].Name] = &templates[i] + } + + include := l.Include + if include == nil { + include = c.includeTemplateLibraryItem + } + + sync := l.SyncItem + if sync == nil { + sync = c.SyncTemplateLibraryItem + } + + for _, item := range items { + if item.Type != library.ItemTypeOVF { + continue + } + + // Deploy source VM from library ovf item + deploy := Deploy{ + DeploymentSpec: DeploymentSpec{ + Name: vmtxSourceName(l.Destination, item), + DefaultDatastoreID: l.Destination.Storage[0].DatastoreID, + AcceptAllEULA: true, + }, + Target: l.Placement, + } + + // Create library vmtx item from source VM + storage := &DiskStorage{ + Datastore: deploy.DeploymentSpec.DefaultDatastoreID, + } + spec := Template{ + Name: item.Name, + Library: l.Destination.ID, + DiskStorage: storage, + VMHomeStorage: storage, + Placement: &Placement{ + Folder: deploy.Target.FolderID, + ResourcePool: deploy.Target.ResourcePoolID, + }, + } + + if !l.Include(item, existing[item.Name]) { + continue + } + + if err = sync(ctx, item, &deploy, &spec); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go index 8c209e604..eb2be0d00 100644 --- a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go +++ b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go @@ -4843,6 +4843,26 @@ func DownloadDescriptionTree(ctx context.Context, r soap.RoundTripper, req *type return resBody.Res, nil } +type DropConnectionsBody struct { + Req *types.DropConnections `xml:"urn:vim25 DropConnections,omitempty"` + Res *types.DropConnectionsResponse `xml:"DropConnectionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DropConnectionsBody) Fault() *soap.Fault { return b.Fault_ } + +func DropConnections(ctx context.Context, r soap.RoundTripper, req *types.DropConnections) (*types.DropConnectionsResponse, error) { + var reqBody, resBody DropConnectionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type DuplicateCustomizationSpecBody struct { Req *types.DuplicateCustomizationSpec `xml:"urn:vim25 DuplicateCustomizationSpec,omitempty"` Res *types.DuplicateCustomizationSpecResponse `xml:"DuplicateCustomizationSpecResponse,omitempty"` @@ -9523,6 +9543,26 @@ func QueryConnectionInfoViaSpec(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type QueryConnectionsBody struct { + Req *types.QueryConnections `xml:"urn:vim25 QueryConnections,omitempty"` + Res *types.QueryConnectionsResponse `xml:"QueryConnectionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConnectionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConnections(ctx context.Context, r soap.RoundTripper, req *types.QueryConnections) (*types.QueryConnectionsResponse, error) { + var reqBody, resBody QueryConnectionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryCryptoKeyStatusBody struct { Req *types.QueryCryptoKeyStatus `xml:"urn:vim25 QueryCryptoKeyStatus,omitempty"` Res *types.QueryCryptoKeyStatusResponse `xml:"QueryCryptoKeyStatusResponse,omitempty"` diff --git a/vendor/github.com/vmware/govmomi/vim25/retry.go b/vendor/github.com/vmware/govmomi/vim25/retry.go index f10e2cb6c..bf663a101 100644 --- a/vendor/github.com/vmware/govmomi/vim25/retry.go +++ b/vendor/github.com/vmware/govmomi/vim25/retry.go @@ -25,42 +25,50 @@ import ( type RetryFunc func(err error) (retry bool, delay time.Duration) -// TemporaryNetworkError returns a RetryFunc that retries up to a maximum of n -// times, only if the error returned by the RoundTrip function is a temporary -// network error (for example: a connect timeout). +// TemporaryNetworkError is deprecated. Use Retry() with RetryTemporaryNetworkError and retryAttempts instead. func TemporaryNetworkError(n int) RetryFunc { - return func(err error) (retry bool, delay time.Duration) { - var ok bool - - t, ok := err.(interface { - // Temporary is implemented by url.Error and net.Error - Temporary() bool - }) - if !ok { - // Never retry if this is not a Temporary error. - return false, 0 + return func(err error) (bool, time.Duration) { + if IsTemporaryNetworkError(err) { + // Don't retry if we're out of tries. + if n--; n <= 0 { + return false, 0 + } + return true, 0 } - - if !t.Temporary() { - return false, 0 - } - - // Don't retry if we're out of tries. - if n--; n <= 0 { - return false, 0 - } - - return true, 0 + return false, 0 } } +// RetryTemporaryNetworkError returns a RetryFunc that returns IsTemporaryNetworkError(err) +func RetryTemporaryNetworkError(err error) (bool, time.Duration) { + return IsTemporaryNetworkError(err), 0 +} + +// IsTemporaryNetworkError returns false unless the error implements +// a Temporary() bool method such as url.Error and net.Error. +// Otherwise, returns the value of the Temporary() method. +func IsTemporaryNetworkError(err error) bool { + t, ok := err.(interface { + // Temporary is implemented by url.Error and net.Error + Temporary() bool + }) + + if !ok { + // Not a Temporary error. + return false + } + + return t.Temporary() +} + type retry struct { roundTripper soap.RoundTripper // fn is a custom function that is called when an error occurs. // It returns whether or not to retry, and if so, how long to // delay before retrying. - fn RetryFunc + fn RetryFunc + maxRetryAttempts int } // Retry wraps the specified soap.RoundTripper and invokes the @@ -68,10 +76,16 @@ type retry struct { // retry the call, and if so, how long to wait before retrying. If // the result of this function is to not retry, the original error // is returned from the RoundTrip function. -func Retry(roundTripper soap.RoundTripper, fn RetryFunc) soap.RoundTripper { +// The soap.RoundTripper will return the original error if retryAttempts is specified and reached. +func Retry(roundTripper soap.RoundTripper, fn RetryFunc, retryAttempts ...int) soap.RoundTripper { r := &retry{ - roundTripper: roundTripper, - fn: fn, + roundTripper: roundTripper, + fn: fn, + maxRetryAttempts: 1, + } + + if len(retryAttempts) == 1 { + r.maxRetryAttempts = retryAttempts[0] } return r @@ -80,7 +94,7 @@ func Retry(roundTripper soap.RoundTripper, fn RetryFunc) soap.RoundTripper { func (r *retry) RoundTrip(ctx context.Context, req, res soap.HasFault) error { var err error - for { + for attempt := 0; attempt < r.maxRetryAttempts; attempt++ { err = r.roundTripper.RoundTrip(ctx, req, res) if err == nil { break diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/client.go b/vendor/github.com/vmware/govmomi/vim25/soap/client.go index 04e26f059..637330462 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/client.go @@ -74,7 +74,8 @@ type Client struct { Types types.Func UserAgent string - cookie string + cookie string + insecureCookies bool } var schemeMatch = regexp.MustCompile(`^\w+://`) @@ -156,6 +157,10 @@ func NewClient(u *url.URL, insecure bool) *Client { c.u = c.URL() c.u.User = nil + if c.u.Scheme == "http" { + c.insecureCookies = os.Getenv("GOVMOMI_INSECURE_COOKIES") == "true" + } + return &c } @@ -476,6 +481,16 @@ func (c *Client) UnmarshalJSON(b []byte) error { type kindContext struct{} +func (c *Client) setInsecureCookies(res *http.Response) { + cookies := res.Cookies() + if len(cookies) != 0 { + for _, cookie := range cookies { + cookie.Secure = false + } + c.Jar.SetCookies(c.u, cookies) + } +} + func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Response) error) error { if ctx == nil { ctx = context.Background() @@ -519,6 +534,10 @@ func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Respons d.debugResponse(res, ext) } + if c.insecureCookies { + c.setInsecureCookies(res) + } + return f(res) } @@ -541,7 +560,7 @@ type statusError struct { } // Temporary returns true for HTTP response codes that can be retried -// See vim25.TemporaryNetworkError +// See vim25.IsTemporaryNetworkError func (e *statusError) Temporary() bool { switch e.res.StatusCode { case http.StatusBadGateway: diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/error.go b/vendor/github.com/vmware/govmomi/vim25/soap/error.go index 46111556c..1e1508733 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/error.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/error.go @@ -17,6 +17,7 @@ limitations under the License. package soap import ( + "encoding/json" "fmt" "reflect" @@ -49,6 +50,15 @@ func (s soapFaultError) Error() string { return fmt.Sprintf("%s: %s", s.fault.Code, msg) } +func (s soapFaultError) MarshalJSON() ([]byte, error) { + out := struct { + Fault *Fault + }{ + Fault: s.fault, + } + return json.Marshal(out) +} + type vimFaultError struct { fault types.BaseMethodFault } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/enum.go b/vendor/github.com/vmware/govmomi/vim25/types/enum.go index a356fff4f..834cdcb79 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/enum.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/enum.go @@ -272,6 +272,18 @@ func init() { t["ClusterComputeResourceHCIWorkflowState"] = reflect.TypeOf((*ClusterComputeResourceHCIWorkflowState)(nil)).Elem() } +type ClusterComputeResourceVcsHealthStatus string + +const ( + ClusterComputeResourceVcsHealthStatusHealthy = ClusterComputeResourceVcsHealthStatus("healthy") + ClusterComputeResourceVcsHealthStatusDegraded = ClusterComputeResourceVcsHealthStatus("degraded") + ClusterComputeResourceVcsHealthStatusNonhealthy = ClusterComputeResourceVcsHealthStatus("nonhealthy") +) + +func init() { + t["ClusterComputeResourceVcsHealthStatus"] = reflect.TypeOf((*ClusterComputeResourceVcsHealthStatus)(nil)).Elem() +} + type ClusterCryptoConfigInfoCryptoMode string const ( @@ -537,6 +549,7 @@ type CustomizationFailedReasonCode string const ( CustomizationFailedReasonCodeUserDefinedScriptDisabled = CustomizationFailedReasonCode("userDefinedScriptDisabled") + CustomizationFailedReasonCodeCustomizationDisabled = CustomizationFailedReasonCode("customizationDisabled") ) func init() { @@ -801,6 +814,7 @@ const ( DistributedVirtualSwitchHostInfrastructureTrafficClassHbr = DistributedVirtualSwitchHostInfrastructureTrafficClass("hbr") DistributedVirtualSwitchHostInfrastructureTrafficClassVsan = DistributedVirtualSwitchHostInfrastructureTrafficClass("vsan") DistributedVirtualSwitchHostInfrastructureTrafficClassVdp = DistributedVirtualSwitchHostInfrastructureTrafficClass("vdp") + DistributedVirtualSwitchHostInfrastructureTrafficClassBackupNfc = DistributedVirtualSwitchHostInfrastructureTrafficClass("backupNfc") ) func init() { @@ -1440,6 +1454,7 @@ const ( HostFileSystemVolumeFileSystemTypeVFFS = HostFileSystemVolumeFileSystemType("VFFS") HostFileSystemVolumeFileSystemTypeVVOL = HostFileSystemVolumeFileSystemType("VVOL") HostFileSystemVolumeFileSystemTypePMEM = HostFileSystemVolumeFileSystemType("PMEM") + HostFileSystemVolumeFileSystemTypeVsanD = HostFileSystemVolumeFileSystemType("vsanD") HostFileSystemVolumeFileSystemTypeOTHER = HostFileSystemVolumeFileSystemType("OTHER") ) @@ -2098,6 +2113,18 @@ func init() { t["HostServicePolicy"] = reflect.TypeOf((*HostServicePolicy)(nil)).Elem() } +type HostSevInfoSevState string + +const ( + HostSevInfoSevStateUninitialized = HostSevInfoSevState("uninitialized") + HostSevInfoSevStateInitialized = HostSevInfoSevState("initialized") + HostSevInfoSevStateWorking = HostSevInfoSevState("working") +) + +func init() { + t["HostSevInfoSevState"] = reflect.TypeOf((*HostSevInfoSevState)(nil)).Elem() +} + type HostSgxInfoFlcModes string const ( @@ -2228,6 +2255,18 @@ func init() { t["HostTpmAttestationInfoAcceptanceStatus"] = reflect.TypeOf((*HostTpmAttestationInfoAcceptanceStatus)(nil)).Elem() } +type HostTrustAuthorityAttestationInfoAttestationStatus string + +const ( + HostTrustAuthorityAttestationInfoAttestationStatusAttested = HostTrustAuthorityAttestationInfoAttestationStatus("attested") + HostTrustAuthorityAttestationInfoAttestationStatusNotAttested = HostTrustAuthorityAttestationInfoAttestationStatus("notAttested") + HostTrustAuthorityAttestationInfoAttestationStatusUnknown = HostTrustAuthorityAttestationInfoAttestationStatus("unknown") +) + +func init() { + t["HostTrustAuthorityAttestationInfoAttestationStatus"] = reflect.TypeOf((*HostTrustAuthorityAttestationInfoAttestationStatus)(nil)).Elem() +} + type HostUnresolvedVmfsExtentUnresolvedReason string const ( @@ -4280,174 +4319,187 @@ func init() { type VirtualMachineGuestOsIdentifier string const ( - VirtualMachineGuestOsIdentifierDosGuest = VirtualMachineGuestOsIdentifier("dosGuest") - VirtualMachineGuestOsIdentifierWin31Guest = VirtualMachineGuestOsIdentifier("win31Guest") - VirtualMachineGuestOsIdentifierWin95Guest = VirtualMachineGuestOsIdentifier("win95Guest") - VirtualMachineGuestOsIdentifierWin98Guest = VirtualMachineGuestOsIdentifier("win98Guest") - VirtualMachineGuestOsIdentifierWinMeGuest = VirtualMachineGuestOsIdentifier("winMeGuest") - VirtualMachineGuestOsIdentifierWinNTGuest = VirtualMachineGuestOsIdentifier("winNTGuest") - VirtualMachineGuestOsIdentifierWin2000ProGuest = VirtualMachineGuestOsIdentifier("win2000ProGuest") - VirtualMachineGuestOsIdentifierWin2000ServGuest = VirtualMachineGuestOsIdentifier("win2000ServGuest") - VirtualMachineGuestOsIdentifierWin2000AdvServGuest = VirtualMachineGuestOsIdentifier("win2000AdvServGuest") - VirtualMachineGuestOsIdentifierWinXPHomeGuest = VirtualMachineGuestOsIdentifier("winXPHomeGuest") - VirtualMachineGuestOsIdentifierWinXPProGuest = VirtualMachineGuestOsIdentifier("winXPProGuest") - VirtualMachineGuestOsIdentifierWinXPPro64Guest = VirtualMachineGuestOsIdentifier("winXPPro64Guest") - VirtualMachineGuestOsIdentifierWinNetWebGuest = VirtualMachineGuestOsIdentifier("winNetWebGuest") - VirtualMachineGuestOsIdentifierWinNetStandardGuest = VirtualMachineGuestOsIdentifier("winNetStandardGuest") - VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest = VirtualMachineGuestOsIdentifier("winNetEnterpriseGuest") - VirtualMachineGuestOsIdentifierWinNetDatacenterGuest = VirtualMachineGuestOsIdentifier("winNetDatacenterGuest") - VirtualMachineGuestOsIdentifierWinNetBusinessGuest = VirtualMachineGuestOsIdentifier("winNetBusinessGuest") - VirtualMachineGuestOsIdentifierWinNetStandard64Guest = VirtualMachineGuestOsIdentifier("winNetStandard64Guest") - VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest = VirtualMachineGuestOsIdentifier("winNetEnterprise64Guest") - VirtualMachineGuestOsIdentifierWinLonghornGuest = VirtualMachineGuestOsIdentifier("winLonghornGuest") - VirtualMachineGuestOsIdentifierWinLonghorn64Guest = VirtualMachineGuestOsIdentifier("winLonghorn64Guest") - VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest = VirtualMachineGuestOsIdentifier("winNetDatacenter64Guest") - VirtualMachineGuestOsIdentifierWinVistaGuest = VirtualMachineGuestOsIdentifier("winVistaGuest") - VirtualMachineGuestOsIdentifierWinVista64Guest = VirtualMachineGuestOsIdentifier("winVista64Guest") - VirtualMachineGuestOsIdentifierWindows7Guest = VirtualMachineGuestOsIdentifier("windows7Guest") - VirtualMachineGuestOsIdentifierWindows7_64Guest = VirtualMachineGuestOsIdentifier("windows7_64Guest") - VirtualMachineGuestOsIdentifierWindows7Server64Guest = VirtualMachineGuestOsIdentifier("windows7Server64Guest") - VirtualMachineGuestOsIdentifierWindows8Guest = VirtualMachineGuestOsIdentifier("windows8Guest") - VirtualMachineGuestOsIdentifierWindows8_64Guest = VirtualMachineGuestOsIdentifier("windows8_64Guest") - VirtualMachineGuestOsIdentifierWindows8Server64Guest = VirtualMachineGuestOsIdentifier("windows8Server64Guest") - VirtualMachineGuestOsIdentifierWindows9Guest = VirtualMachineGuestOsIdentifier("windows9Guest") - VirtualMachineGuestOsIdentifierWindows9_64Guest = VirtualMachineGuestOsIdentifier("windows9_64Guest") - VirtualMachineGuestOsIdentifierWindows9Server64Guest = VirtualMachineGuestOsIdentifier("windows9Server64Guest") - VirtualMachineGuestOsIdentifierWindowsHyperVGuest = VirtualMachineGuestOsIdentifier("windowsHyperVGuest") - VirtualMachineGuestOsIdentifierWindows2019srv_64Guest = VirtualMachineGuestOsIdentifier("windows2019srv_64Guest") - VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") - VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") - VirtualMachineGuestOsIdentifierFreebsd11Guest = VirtualMachineGuestOsIdentifier("freebsd11Guest") - VirtualMachineGuestOsIdentifierFreebsd11_64Guest = VirtualMachineGuestOsIdentifier("freebsd11_64Guest") - VirtualMachineGuestOsIdentifierFreebsd12Guest = VirtualMachineGuestOsIdentifier("freebsd12Guest") - VirtualMachineGuestOsIdentifierFreebsd12_64Guest = VirtualMachineGuestOsIdentifier("freebsd12_64Guest") - VirtualMachineGuestOsIdentifierRedhatGuest = VirtualMachineGuestOsIdentifier("redhatGuest") - VirtualMachineGuestOsIdentifierRhel2Guest = VirtualMachineGuestOsIdentifier("rhel2Guest") - VirtualMachineGuestOsIdentifierRhel3Guest = VirtualMachineGuestOsIdentifier("rhel3Guest") - VirtualMachineGuestOsIdentifierRhel3_64Guest = VirtualMachineGuestOsIdentifier("rhel3_64Guest") - VirtualMachineGuestOsIdentifierRhel4Guest = VirtualMachineGuestOsIdentifier("rhel4Guest") - VirtualMachineGuestOsIdentifierRhel4_64Guest = VirtualMachineGuestOsIdentifier("rhel4_64Guest") - VirtualMachineGuestOsIdentifierRhel5Guest = VirtualMachineGuestOsIdentifier("rhel5Guest") - VirtualMachineGuestOsIdentifierRhel5_64Guest = VirtualMachineGuestOsIdentifier("rhel5_64Guest") - VirtualMachineGuestOsIdentifierRhel6Guest = VirtualMachineGuestOsIdentifier("rhel6Guest") - VirtualMachineGuestOsIdentifierRhel6_64Guest = VirtualMachineGuestOsIdentifier("rhel6_64Guest") - VirtualMachineGuestOsIdentifierRhel7Guest = VirtualMachineGuestOsIdentifier("rhel7Guest") - VirtualMachineGuestOsIdentifierRhel7_64Guest = VirtualMachineGuestOsIdentifier("rhel7_64Guest") - VirtualMachineGuestOsIdentifierRhel8_64Guest = VirtualMachineGuestOsIdentifier("rhel8_64Guest") - VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") - VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") - VirtualMachineGuestOsIdentifierCentos6Guest = VirtualMachineGuestOsIdentifier("centos6Guest") - VirtualMachineGuestOsIdentifierCentos6_64Guest = VirtualMachineGuestOsIdentifier("centos6_64Guest") - VirtualMachineGuestOsIdentifierCentos7Guest = VirtualMachineGuestOsIdentifier("centos7Guest") - VirtualMachineGuestOsIdentifierCentos7_64Guest = VirtualMachineGuestOsIdentifier("centos7_64Guest") - VirtualMachineGuestOsIdentifierCentos8_64Guest = VirtualMachineGuestOsIdentifier("centos8_64Guest") - VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") - VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") - VirtualMachineGuestOsIdentifierOracleLinux6Guest = VirtualMachineGuestOsIdentifier("oracleLinux6Guest") - VirtualMachineGuestOsIdentifierOracleLinux6_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux6_64Guest") - VirtualMachineGuestOsIdentifierOracleLinux7Guest = VirtualMachineGuestOsIdentifier("oracleLinux7Guest") - VirtualMachineGuestOsIdentifierOracleLinux7_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux7_64Guest") - VirtualMachineGuestOsIdentifierOracleLinux8_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux8_64Guest") - VirtualMachineGuestOsIdentifierSuseGuest = VirtualMachineGuestOsIdentifier("suseGuest") - VirtualMachineGuestOsIdentifierSuse64Guest = VirtualMachineGuestOsIdentifier("suse64Guest") - VirtualMachineGuestOsIdentifierSlesGuest = VirtualMachineGuestOsIdentifier("slesGuest") - VirtualMachineGuestOsIdentifierSles64Guest = VirtualMachineGuestOsIdentifier("sles64Guest") - VirtualMachineGuestOsIdentifierSles10Guest = VirtualMachineGuestOsIdentifier("sles10Guest") - VirtualMachineGuestOsIdentifierSles10_64Guest = VirtualMachineGuestOsIdentifier("sles10_64Guest") - VirtualMachineGuestOsIdentifierSles11Guest = VirtualMachineGuestOsIdentifier("sles11Guest") - VirtualMachineGuestOsIdentifierSles11_64Guest = VirtualMachineGuestOsIdentifier("sles11_64Guest") - VirtualMachineGuestOsIdentifierSles12Guest = VirtualMachineGuestOsIdentifier("sles12Guest") - VirtualMachineGuestOsIdentifierSles12_64Guest = VirtualMachineGuestOsIdentifier("sles12_64Guest") - VirtualMachineGuestOsIdentifierSles15_64Guest = VirtualMachineGuestOsIdentifier("sles15_64Guest") - VirtualMachineGuestOsIdentifierNld9Guest = VirtualMachineGuestOsIdentifier("nld9Guest") - VirtualMachineGuestOsIdentifierOesGuest = VirtualMachineGuestOsIdentifier("oesGuest") - VirtualMachineGuestOsIdentifierSjdsGuest = VirtualMachineGuestOsIdentifier("sjdsGuest") - VirtualMachineGuestOsIdentifierMandrakeGuest = VirtualMachineGuestOsIdentifier("mandrakeGuest") - VirtualMachineGuestOsIdentifierMandrivaGuest = VirtualMachineGuestOsIdentifier("mandrivaGuest") - VirtualMachineGuestOsIdentifierMandriva64Guest = VirtualMachineGuestOsIdentifier("mandriva64Guest") - VirtualMachineGuestOsIdentifierTurboLinuxGuest = VirtualMachineGuestOsIdentifier("turboLinuxGuest") - VirtualMachineGuestOsIdentifierTurboLinux64Guest = VirtualMachineGuestOsIdentifier("turboLinux64Guest") - VirtualMachineGuestOsIdentifierUbuntuGuest = VirtualMachineGuestOsIdentifier("ubuntuGuest") - VirtualMachineGuestOsIdentifierUbuntu64Guest = VirtualMachineGuestOsIdentifier("ubuntu64Guest") - VirtualMachineGuestOsIdentifierDebian4Guest = VirtualMachineGuestOsIdentifier("debian4Guest") - VirtualMachineGuestOsIdentifierDebian4_64Guest = VirtualMachineGuestOsIdentifier("debian4_64Guest") - VirtualMachineGuestOsIdentifierDebian5Guest = VirtualMachineGuestOsIdentifier("debian5Guest") - VirtualMachineGuestOsIdentifierDebian5_64Guest = VirtualMachineGuestOsIdentifier("debian5_64Guest") - VirtualMachineGuestOsIdentifierDebian6Guest = VirtualMachineGuestOsIdentifier("debian6Guest") - VirtualMachineGuestOsIdentifierDebian6_64Guest = VirtualMachineGuestOsIdentifier("debian6_64Guest") - VirtualMachineGuestOsIdentifierDebian7Guest = VirtualMachineGuestOsIdentifier("debian7Guest") - VirtualMachineGuestOsIdentifierDebian7_64Guest = VirtualMachineGuestOsIdentifier("debian7_64Guest") - VirtualMachineGuestOsIdentifierDebian8Guest = VirtualMachineGuestOsIdentifier("debian8Guest") - VirtualMachineGuestOsIdentifierDebian8_64Guest = VirtualMachineGuestOsIdentifier("debian8_64Guest") - VirtualMachineGuestOsIdentifierDebian9Guest = VirtualMachineGuestOsIdentifier("debian9Guest") - VirtualMachineGuestOsIdentifierDebian9_64Guest = VirtualMachineGuestOsIdentifier("debian9_64Guest") - VirtualMachineGuestOsIdentifierDebian10Guest = VirtualMachineGuestOsIdentifier("debian10Guest") - VirtualMachineGuestOsIdentifierDebian10_64Guest = VirtualMachineGuestOsIdentifier("debian10_64Guest") - VirtualMachineGuestOsIdentifierDebian11Guest = VirtualMachineGuestOsIdentifier("debian11Guest") - VirtualMachineGuestOsIdentifierDebian11_64Guest = VirtualMachineGuestOsIdentifier("debian11_64Guest") - VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") - VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") - VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") - VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") - VirtualMachineGuestOsIdentifierAsianux5_64Guest = VirtualMachineGuestOsIdentifier("asianux5_64Guest") - VirtualMachineGuestOsIdentifierAsianux7_64Guest = VirtualMachineGuestOsIdentifier("asianux7_64Guest") - VirtualMachineGuestOsIdentifierAsianux8_64Guest = VirtualMachineGuestOsIdentifier("asianux8_64Guest") - VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") - VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") - VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") - VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") - VirtualMachineGuestOsIdentifierCoreos64Guest = VirtualMachineGuestOsIdentifier("coreos64Guest") - VirtualMachineGuestOsIdentifierVmwarePhoton64Guest = VirtualMachineGuestOsIdentifier("vmwarePhoton64Guest") - VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") - VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") - VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") - VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") - VirtualMachineGuestOsIdentifierOther4xLinuxGuest = VirtualMachineGuestOsIdentifier("other4xLinuxGuest") - VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") - VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") - VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") - VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") - VirtualMachineGuestOsIdentifierOther4xLinux64Guest = VirtualMachineGuestOsIdentifier("other4xLinux64Guest") - VirtualMachineGuestOsIdentifierOtherLinux64Guest = VirtualMachineGuestOsIdentifier("otherLinux64Guest") - VirtualMachineGuestOsIdentifierSolaris6Guest = VirtualMachineGuestOsIdentifier("solaris6Guest") - VirtualMachineGuestOsIdentifierSolaris7Guest = VirtualMachineGuestOsIdentifier("solaris7Guest") - VirtualMachineGuestOsIdentifierSolaris8Guest = VirtualMachineGuestOsIdentifier("solaris8Guest") - VirtualMachineGuestOsIdentifierSolaris9Guest = VirtualMachineGuestOsIdentifier("solaris9Guest") - VirtualMachineGuestOsIdentifierSolaris10Guest = VirtualMachineGuestOsIdentifier("solaris10Guest") - VirtualMachineGuestOsIdentifierSolaris10_64Guest = VirtualMachineGuestOsIdentifier("solaris10_64Guest") - VirtualMachineGuestOsIdentifierSolaris11_64Guest = VirtualMachineGuestOsIdentifier("solaris11_64Guest") - VirtualMachineGuestOsIdentifierOs2Guest = VirtualMachineGuestOsIdentifier("os2Guest") - VirtualMachineGuestOsIdentifierEComStationGuest = VirtualMachineGuestOsIdentifier("eComStationGuest") - VirtualMachineGuestOsIdentifierEComStation2Guest = VirtualMachineGuestOsIdentifier("eComStation2Guest") - VirtualMachineGuestOsIdentifierNetware4Guest = VirtualMachineGuestOsIdentifier("netware4Guest") - VirtualMachineGuestOsIdentifierNetware5Guest = VirtualMachineGuestOsIdentifier("netware5Guest") - VirtualMachineGuestOsIdentifierNetware6Guest = VirtualMachineGuestOsIdentifier("netware6Guest") - VirtualMachineGuestOsIdentifierOpenServer5Guest = VirtualMachineGuestOsIdentifier("openServer5Guest") - VirtualMachineGuestOsIdentifierOpenServer6Guest = VirtualMachineGuestOsIdentifier("openServer6Guest") - VirtualMachineGuestOsIdentifierUnixWare7Guest = VirtualMachineGuestOsIdentifier("unixWare7Guest") - VirtualMachineGuestOsIdentifierDarwinGuest = VirtualMachineGuestOsIdentifier("darwinGuest") - VirtualMachineGuestOsIdentifierDarwin64Guest = VirtualMachineGuestOsIdentifier("darwin64Guest") - VirtualMachineGuestOsIdentifierDarwin10Guest = VirtualMachineGuestOsIdentifier("darwin10Guest") - VirtualMachineGuestOsIdentifierDarwin10_64Guest = VirtualMachineGuestOsIdentifier("darwin10_64Guest") - VirtualMachineGuestOsIdentifierDarwin11Guest = VirtualMachineGuestOsIdentifier("darwin11Guest") - VirtualMachineGuestOsIdentifierDarwin11_64Guest = VirtualMachineGuestOsIdentifier("darwin11_64Guest") - VirtualMachineGuestOsIdentifierDarwin12_64Guest = VirtualMachineGuestOsIdentifier("darwin12_64Guest") - VirtualMachineGuestOsIdentifierDarwin13_64Guest = VirtualMachineGuestOsIdentifier("darwin13_64Guest") - VirtualMachineGuestOsIdentifierDarwin14_64Guest = VirtualMachineGuestOsIdentifier("darwin14_64Guest") - VirtualMachineGuestOsIdentifierDarwin15_64Guest = VirtualMachineGuestOsIdentifier("darwin15_64Guest") - VirtualMachineGuestOsIdentifierDarwin16_64Guest = VirtualMachineGuestOsIdentifier("darwin16_64Guest") - VirtualMachineGuestOsIdentifierDarwin17_64Guest = VirtualMachineGuestOsIdentifier("darwin17_64Guest") - VirtualMachineGuestOsIdentifierDarwin18_64Guest = VirtualMachineGuestOsIdentifier("darwin18_64Guest") - VirtualMachineGuestOsIdentifierDarwin19_64Guest = VirtualMachineGuestOsIdentifier("darwin19_64Guest") - VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") - VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") - VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") - VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") - VirtualMachineGuestOsIdentifierVmkernel7Guest = VirtualMachineGuestOsIdentifier("vmkernel7Guest") - VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux2_64Guest") - VirtualMachineGuestOsIdentifierCrxPod1Guest = VirtualMachineGuestOsIdentifier("crxPod1Guest") - VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") - VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") + VirtualMachineGuestOsIdentifierDosGuest = VirtualMachineGuestOsIdentifier("dosGuest") + VirtualMachineGuestOsIdentifierWin31Guest = VirtualMachineGuestOsIdentifier("win31Guest") + VirtualMachineGuestOsIdentifierWin95Guest = VirtualMachineGuestOsIdentifier("win95Guest") + VirtualMachineGuestOsIdentifierWin98Guest = VirtualMachineGuestOsIdentifier("win98Guest") + VirtualMachineGuestOsIdentifierWinMeGuest = VirtualMachineGuestOsIdentifier("winMeGuest") + VirtualMachineGuestOsIdentifierWinNTGuest = VirtualMachineGuestOsIdentifier("winNTGuest") + VirtualMachineGuestOsIdentifierWin2000ProGuest = VirtualMachineGuestOsIdentifier("win2000ProGuest") + VirtualMachineGuestOsIdentifierWin2000ServGuest = VirtualMachineGuestOsIdentifier("win2000ServGuest") + VirtualMachineGuestOsIdentifierWin2000AdvServGuest = VirtualMachineGuestOsIdentifier("win2000AdvServGuest") + VirtualMachineGuestOsIdentifierWinXPHomeGuest = VirtualMachineGuestOsIdentifier("winXPHomeGuest") + VirtualMachineGuestOsIdentifierWinXPProGuest = VirtualMachineGuestOsIdentifier("winXPProGuest") + VirtualMachineGuestOsIdentifierWinXPPro64Guest = VirtualMachineGuestOsIdentifier("winXPPro64Guest") + VirtualMachineGuestOsIdentifierWinNetWebGuest = VirtualMachineGuestOsIdentifier("winNetWebGuest") + VirtualMachineGuestOsIdentifierWinNetStandardGuest = VirtualMachineGuestOsIdentifier("winNetStandardGuest") + VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest = VirtualMachineGuestOsIdentifier("winNetEnterpriseGuest") + VirtualMachineGuestOsIdentifierWinNetDatacenterGuest = VirtualMachineGuestOsIdentifier("winNetDatacenterGuest") + VirtualMachineGuestOsIdentifierWinNetBusinessGuest = VirtualMachineGuestOsIdentifier("winNetBusinessGuest") + VirtualMachineGuestOsIdentifierWinNetStandard64Guest = VirtualMachineGuestOsIdentifier("winNetStandard64Guest") + VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest = VirtualMachineGuestOsIdentifier("winNetEnterprise64Guest") + VirtualMachineGuestOsIdentifierWinLonghornGuest = VirtualMachineGuestOsIdentifier("winLonghornGuest") + VirtualMachineGuestOsIdentifierWinLonghorn64Guest = VirtualMachineGuestOsIdentifier("winLonghorn64Guest") + VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest = VirtualMachineGuestOsIdentifier("winNetDatacenter64Guest") + VirtualMachineGuestOsIdentifierWinVistaGuest = VirtualMachineGuestOsIdentifier("winVistaGuest") + VirtualMachineGuestOsIdentifierWinVista64Guest = VirtualMachineGuestOsIdentifier("winVista64Guest") + VirtualMachineGuestOsIdentifierWindows7Guest = VirtualMachineGuestOsIdentifier("windows7Guest") + VirtualMachineGuestOsIdentifierWindows7_64Guest = VirtualMachineGuestOsIdentifier("windows7_64Guest") + VirtualMachineGuestOsIdentifierWindows7Server64Guest = VirtualMachineGuestOsIdentifier("windows7Server64Guest") + VirtualMachineGuestOsIdentifierWindows8Guest = VirtualMachineGuestOsIdentifier("windows8Guest") + VirtualMachineGuestOsIdentifierWindows8_64Guest = VirtualMachineGuestOsIdentifier("windows8_64Guest") + VirtualMachineGuestOsIdentifierWindows8Server64Guest = VirtualMachineGuestOsIdentifier("windows8Server64Guest") + VirtualMachineGuestOsIdentifierWindows9Guest = VirtualMachineGuestOsIdentifier("windows9Guest") + VirtualMachineGuestOsIdentifierWindows9_64Guest = VirtualMachineGuestOsIdentifier("windows9_64Guest") + VirtualMachineGuestOsIdentifierWindows9Server64Guest = VirtualMachineGuestOsIdentifier("windows9Server64Guest") + VirtualMachineGuestOsIdentifierWindowsHyperVGuest = VirtualMachineGuestOsIdentifier("windowsHyperVGuest") + VirtualMachineGuestOsIdentifierWindows2019srv_64Guest = VirtualMachineGuestOsIdentifier("windows2019srv_64Guest") + VirtualMachineGuestOsIdentifierWindows2019srvNext_64Guest = VirtualMachineGuestOsIdentifier("windows2019srvNext_64Guest") + VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") + VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") + VirtualMachineGuestOsIdentifierFreebsd11Guest = VirtualMachineGuestOsIdentifier("freebsd11Guest") + VirtualMachineGuestOsIdentifierFreebsd11_64Guest = VirtualMachineGuestOsIdentifier("freebsd11_64Guest") + VirtualMachineGuestOsIdentifierFreebsd12Guest = VirtualMachineGuestOsIdentifier("freebsd12Guest") + VirtualMachineGuestOsIdentifierFreebsd12_64Guest = VirtualMachineGuestOsIdentifier("freebsd12_64Guest") + VirtualMachineGuestOsIdentifierFreebsd13Guest = VirtualMachineGuestOsIdentifier("freebsd13Guest") + VirtualMachineGuestOsIdentifierFreebsd13_64Guest = VirtualMachineGuestOsIdentifier("freebsd13_64Guest") + VirtualMachineGuestOsIdentifierRedhatGuest = VirtualMachineGuestOsIdentifier("redhatGuest") + VirtualMachineGuestOsIdentifierRhel2Guest = VirtualMachineGuestOsIdentifier("rhel2Guest") + VirtualMachineGuestOsIdentifierRhel3Guest = VirtualMachineGuestOsIdentifier("rhel3Guest") + VirtualMachineGuestOsIdentifierRhel3_64Guest = VirtualMachineGuestOsIdentifier("rhel3_64Guest") + VirtualMachineGuestOsIdentifierRhel4Guest = VirtualMachineGuestOsIdentifier("rhel4Guest") + VirtualMachineGuestOsIdentifierRhel4_64Guest = VirtualMachineGuestOsIdentifier("rhel4_64Guest") + VirtualMachineGuestOsIdentifierRhel5Guest = VirtualMachineGuestOsIdentifier("rhel5Guest") + VirtualMachineGuestOsIdentifierRhel5_64Guest = VirtualMachineGuestOsIdentifier("rhel5_64Guest") + VirtualMachineGuestOsIdentifierRhel6Guest = VirtualMachineGuestOsIdentifier("rhel6Guest") + VirtualMachineGuestOsIdentifierRhel6_64Guest = VirtualMachineGuestOsIdentifier("rhel6_64Guest") + VirtualMachineGuestOsIdentifierRhel7Guest = VirtualMachineGuestOsIdentifier("rhel7Guest") + VirtualMachineGuestOsIdentifierRhel7_64Guest = VirtualMachineGuestOsIdentifier("rhel7_64Guest") + VirtualMachineGuestOsIdentifierRhel8_64Guest = VirtualMachineGuestOsIdentifier("rhel8_64Guest") + VirtualMachineGuestOsIdentifierRhel9_64Guest = VirtualMachineGuestOsIdentifier("rhel9_64Guest") + VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") + VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") + VirtualMachineGuestOsIdentifierCentos6Guest = VirtualMachineGuestOsIdentifier("centos6Guest") + VirtualMachineGuestOsIdentifierCentos6_64Guest = VirtualMachineGuestOsIdentifier("centos6_64Guest") + VirtualMachineGuestOsIdentifierCentos7Guest = VirtualMachineGuestOsIdentifier("centos7Guest") + VirtualMachineGuestOsIdentifierCentos7_64Guest = VirtualMachineGuestOsIdentifier("centos7_64Guest") + VirtualMachineGuestOsIdentifierCentos8_64Guest = VirtualMachineGuestOsIdentifier("centos8_64Guest") + VirtualMachineGuestOsIdentifierCentos9_64Guest = VirtualMachineGuestOsIdentifier("centos9_64Guest") + VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") + VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") + VirtualMachineGuestOsIdentifierOracleLinux6Guest = VirtualMachineGuestOsIdentifier("oracleLinux6Guest") + VirtualMachineGuestOsIdentifierOracleLinux6_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux6_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux7Guest = VirtualMachineGuestOsIdentifier("oracleLinux7Guest") + VirtualMachineGuestOsIdentifierOracleLinux7_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux7_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux8_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux8_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux9_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux9_64Guest") + VirtualMachineGuestOsIdentifierSuseGuest = VirtualMachineGuestOsIdentifier("suseGuest") + VirtualMachineGuestOsIdentifierSuse64Guest = VirtualMachineGuestOsIdentifier("suse64Guest") + VirtualMachineGuestOsIdentifierSlesGuest = VirtualMachineGuestOsIdentifier("slesGuest") + VirtualMachineGuestOsIdentifierSles64Guest = VirtualMachineGuestOsIdentifier("sles64Guest") + VirtualMachineGuestOsIdentifierSles10Guest = VirtualMachineGuestOsIdentifier("sles10Guest") + VirtualMachineGuestOsIdentifierSles10_64Guest = VirtualMachineGuestOsIdentifier("sles10_64Guest") + VirtualMachineGuestOsIdentifierSles11Guest = VirtualMachineGuestOsIdentifier("sles11Guest") + VirtualMachineGuestOsIdentifierSles11_64Guest = VirtualMachineGuestOsIdentifier("sles11_64Guest") + VirtualMachineGuestOsIdentifierSles12Guest = VirtualMachineGuestOsIdentifier("sles12Guest") + VirtualMachineGuestOsIdentifierSles12_64Guest = VirtualMachineGuestOsIdentifier("sles12_64Guest") + VirtualMachineGuestOsIdentifierSles15_64Guest = VirtualMachineGuestOsIdentifier("sles15_64Guest") + VirtualMachineGuestOsIdentifierSles16_64Guest = VirtualMachineGuestOsIdentifier("sles16_64Guest") + VirtualMachineGuestOsIdentifierNld9Guest = VirtualMachineGuestOsIdentifier("nld9Guest") + VirtualMachineGuestOsIdentifierOesGuest = VirtualMachineGuestOsIdentifier("oesGuest") + VirtualMachineGuestOsIdentifierSjdsGuest = VirtualMachineGuestOsIdentifier("sjdsGuest") + VirtualMachineGuestOsIdentifierMandrakeGuest = VirtualMachineGuestOsIdentifier("mandrakeGuest") + VirtualMachineGuestOsIdentifierMandrivaGuest = VirtualMachineGuestOsIdentifier("mandrivaGuest") + VirtualMachineGuestOsIdentifierMandriva64Guest = VirtualMachineGuestOsIdentifier("mandriva64Guest") + VirtualMachineGuestOsIdentifierTurboLinuxGuest = VirtualMachineGuestOsIdentifier("turboLinuxGuest") + VirtualMachineGuestOsIdentifierTurboLinux64Guest = VirtualMachineGuestOsIdentifier("turboLinux64Guest") + VirtualMachineGuestOsIdentifierUbuntuGuest = VirtualMachineGuestOsIdentifier("ubuntuGuest") + VirtualMachineGuestOsIdentifierUbuntu64Guest = VirtualMachineGuestOsIdentifier("ubuntu64Guest") + VirtualMachineGuestOsIdentifierDebian4Guest = VirtualMachineGuestOsIdentifier("debian4Guest") + VirtualMachineGuestOsIdentifierDebian4_64Guest = VirtualMachineGuestOsIdentifier("debian4_64Guest") + VirtualMachineGuestOsIdentifierDebian5Guest = VirtualMachineGuestOsIdentifier("debian5Guest") + VirtualMachineGuestOsIdentifierDebian5_64Guest = VirtualMachineGuestOsIdentifier("debian5_64Guest") + VirtualMachineGuestOsIdentifierDebian6Guest = VirtualMachineGuestOsIdentifier("debian6Guest") + VirtualMachineGuestOsIdentifierDebian6_64Guest = VirtualMachineGuestOsIdentifier("debian6_64Guest") + VirtualMachineGuestOsIdentifierDebian7Guest = VirtualMachineGuestOsIdentifier("debian7Guest") + VirtualMachineGuestOsIdentifierDebian7_64Guest = VirtualMachineGuestOsIdentifier("debian7_64Guest") + VirtualMachineGuestOsIdentifierDebian8Guest = VirtualMachineGuestOsIdentifier("debian8Guest") + VirtualMachineGuestOsIdentifierDebian8_64Guest = VirtualMachineGuestOsIdentifier("debian8_64Guest") + VirtualMachineGuestOsIdentifierDebian9Guest = VirtualMachineGuestOsIdentifier("debian9Guest") + VirtualMachineGuestOsIdentifierDebian9_64Guest = VirtualMachineGuestOsIdentifier("debian9_64Guest") + VirtualMachineGuestOsIdentifierDebian10Guest = VirtualMachineGuestOsIdentifier("debian10Guest") + VirtualMachineGuestOsIdentifierDebian10_64Guest = VirtualMachineGuestOsIdentifier("debian10_64Guest") + VirtualMachineGuestOsIdentifierDebian11Guest = VirtualMachineGuestOsIdentifier("debian11Guest") + VirtualMachineGuestOsIdentifierDebian11_64Guest = VirtualMachineGuestOsIdentifier("debian11_64Guest") + VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") + VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") + VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") + VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") + VirtualMachineGuestOsIdentifierAsianux5_64Guest = VirtualMachineGuestOsIdentifier("asianux5_64Guest") + VirtualMachineGuestOsIdentifierAsianux7_64Guest = VirtualMachineGuestOsIdentifier("asianux7_64Guest") + VirtualMachineGuestOsIdentifierAsianux8_64Guest = VirtualMachineGuestOsIdentifier("asianux8_64Guest") + VirtualMachineGuestOsIdentifierAsianux9_64Guest = VirtualMachineGuestOsIdentifier("asianux9_64Guest") + VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") + VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") + VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") + VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") + VirtualMachineGuestOsIdentifierCoreos64Guest = VirtualMachineGuestOsIdentifier("coreos64Guest") + VirtualMachineGuestOsIdentifierVmwarePhoton64Guest = VirtualMachineGuestOsIdentifier("vmwarePhoton64Guest") + VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") + VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") + VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") + VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") + VirtualMachineGuestOsIdentifierOther4xLinuxGuest = VirtualMachineGuestOsIdentifier("other4xLinuxGuest") + VirtualMachineGuestOsIdentifierOther5xLinuxGuest = VirtualMachineGuestOsIdentifier("other5xLinuxGuest") + VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") + VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") + VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") + VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") + VirtualMachineGuestOsIdentifierOther4xLinux64Guest = VirtualMachineGuestOsIdentifier("other4xLinux64Guest") + VirtualMachineGuestOsIdentifierOther5xLinux64Guest = VirtualMachineGuestOsIdentifier("other5xLinux64Guest") + VirtualMachineGuestOsIdentifierOtherLinux64Guest = VirtualMachineGuestOsIdentifier("otherLinux64Guest") + VirtualMachineGuestOsIdentifierSolaris6Guest = VirtualMachineGuestOsIdentifier("solaris6Guest") + VirtualMachineGuestOsIdentifierSolaris7Guest = VirtualMachineGuestOsIdentifier("solaris7Guest") + VirtualMachineGuestOsIdentifierSolaris8Guest = VirtualMachineGuestOsIdentifier("solaris8Guest") + VirtualMachineGuestOsIdentifierSolaris9Guest = VirtualMachineGuestOsIdentifier("solaris9Guest") + VirtualMachineGuestOsIdentifierSolaris10Guest = VirtualMachineGuestOsIdentifier("solaris10Guest") + VirtualMachineGuestOsIdentifierSolaris10_64Guest = VirtualMachineGuestOsIdentifier("solaris10_64Guest") + VirtualMachineGuestOsIdentifierSolaris11_64Guest = VirtualMachineGuestOsIdentifier("solaris11_64Guest") + VirtualMachineGuestOsIdentifierOs2Guest = VirtualMachineGuestOsIdentifier("os2Guest") + VirtualMachineGuestOsIdentifierEComStationGuest = VirtualMachineGuestOsIdentifier("eComStationGuest") + VirtualMachineGuestOsIdentifierEComStation2Guest = VirtualMachineGuestOsIdentifier("eComStation2Guest") + VirtualMachineGuestOsIdentifierNetware4Guest = VirtualMachineGuestOsIdentifier("netware4Guest") + VirtualMachineGuestOsIdentifierNetware5Guest = VirtualMachineGuestOsIdentifier("netware5Guest") + VirtualMachineGuestOsIdentifierNetware6Guest = VirtualMachineGuestOsIdentifier("netware6Guest") + VirtualMachineGuestOsIdentifierOpenServer5Guest = VirtualMachineGuestOsIdentifier("openServer5Guest") + VirtualMachineGuestOsIdentifierOpenServer6Guest = VirtualMachineGuestOsIdentifier("openServer6Guest") + VirtualMachineGuestOsIdentifierUnixWare7Guest = VirtualMachineGuestOsIdentifier("unixWare7Guest") + VirtualMachineGuestOsIdentifierDarwinGuest = VirtualMachineGuestOsIdentifier("darwinGuest") + VirtualMachineGuestOsIdentifierDarwin64Guest = VirtualMachineGuestOsIdentifier("darwin64Guest") + VirtualMachineGuestOsIdentifierDarwin10Guest = VirtualMachineGuestOsIdentifier("darwin10Guest") + VirtualMachineGuestOsIdentifierDarwin10_64Guest = VirtualMachineGuestOsIdentifier("darwin10_64Guest") + VirtualMachineGuestOsIdentifierDarwin11Guest = VirtualMachineGuestOsIdentifier("darwin11Guest") + VirtualMachineGuestOsIdentifierDarwin11_64Guest = VirtualMachineGuestOsIdentifier("darwin11_64Guest") + VirtualMachineGuestOsIdentifierDarwin12_64Guest = VirtualMachineGuestOsIdentifier("darwin12_64Guest") + VirtualMachineGuestOsIdentifierDarwin13_64Guest = VirtualMachineGuestOsIdentifier("darwin13_64Guest") + VirtualMachineGuestOsIdentifierDarwin14_64Guest = VirtualMachineGuestOsIdentifier("darwin14_64Guest") + VirtualMachineGuestOsIdentifierDarwin15_64Guest = VirtualMachineGuestOsIdentifier("darwin15_64Guest") + VirtualMachineGuestOsIdentifierDarwin16_64Guest = VirtualMachineGuestOsIdentifier("darwin16_64Guest") + VirtualMachineGuestOsIdentifierDarwin17_64Guest = VirtualMachineGuestOsIdentifier("darwin17_64Guest") + VirtualMachineGuestOsIdentifierDarwin18_64Guest = VirtualMachineGuestOsIdentifier("darwin18_64Guest") + VirtualMachineGuestOsIdentifierDarwin19_64Guest = VirtualMachineGuestOsIdentifier("darwin19_64Guest") + VirtualMachineGuestOsIdentifierDarwin20_64Guest = VirtualMachineGuestOsIdentifier("darwin20_64Guest") + VirtualMachineGuestOsIdentifierDarwin21_64Guest = VirtualMachineGuestOsIdentifier("darwin21_64Guest") + VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") + VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") + VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") + VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") + VirtualMachineGuestOsIdentifierVmkernel7Guest = VirtualMachineGuestOsIdentifier("vmkernel7Guest") + VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux2_64Guest") + VirtualMachineGuestOsIdentifierAmazonlinux3_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux3_64Guest") + VirtualMachineGuestOsIdentifierCrxPod1Guest = VirtualMachineGuestOsIdentifier("crxPod1Guest") + VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") + VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") ) func init() { diff --git a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go index 95c49f333..d6efec47e 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go @@ -17,6 +17,7 @@ limitations under the License. package types import ( + "net/url" "reflect" "strings" "time" @@ -63,6 +64,11 @@ func (r *ManagedObjectReference) FromString(o string) bool { return true } +// Encode ManagedObjectReference for use with URL and File paths +func (r ManagedObjectReference) Encode() string { + return strings.Join([]string{r.Type, url.QueryEscape(r.Value)}, "-") +} + func (c *PerfCounterInfo) Name() string { return c.GroupInfo.GetElementDescription().Key + "." + c.NameInfo.GetElementDescription().Key + "." + string(c.RollupType) } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/if.go b/vendor/github.com/vmware/govmomi/vim25/types/if.go index 9b377c96d..d80255000 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/if.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/if.go @@ -798,7 +798,6 @@ func (b *DvsFilterConfig) GetDvsFilterConfig() *DvsFilterConfig { return b } type BaseDvsFilterConfig interface { GetDvsFilterConfig() *DvsFilterConfig - GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig } func init() { @@ -841,21 +840,12 @@ func (b *DvsNetworkRuleQualifier) GetDvsNetworkRuleQualifier() *DvsNetworkRuleQu type BaseDvsNetworkRuleQualifier interface { GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier - GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier } func init() { t["BaseDvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() } -func (b *DvsIpNetworkRuleQualifier) GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier { - return b -} - -type BaseDvsIpNetworkRuleQualifier interface { - GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier -} - func (b *DvsTrafficFilterConfig) GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig { return b } type BaseDvsTrafficFilterConfig interface { @@ -3022,6 +3012,16 @@ func init() { t["BaseVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() } +func (b *VirtualMachineConnection) GetVirtualMachineConnection() *VirtualMachineConnection { return b } + +type BaseVirtualMachineConnection interface { + GetVirtualMachineConnection() *VirtualMachineConnection +} + +func init() { + t["BaseVirtualMachineConnection"] = reflect.TypeOf((*VirtualMachineConnection)(nil)).Elem() +} + func (b *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState) GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState { return b } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/types.go b/vendor/github.com/vmware/govmomi/vim25/types/types.go index e10cf8219..ac5de63b4 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/types.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/types.go @@ -1803,6 +1803,14 @@ func init() { t["ArrayOfClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ArrayOfClusterComputeResourceValidationResultBase)(nil)).Elem() } +type ArrayOfClusterComputeResourceVcsSlots struct { + ClusterComputeResourceVcsSlots []ClusterComputeResourceVcsSlots `xml:"ClusterComputeResourceVcsSlots,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ArrayOfClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ArrayOfClusterDasAamNodeState struct { ClusterDasAamNodeState []ClusterDasAamNodeState `xml:"ClusterDasAamNodeState,omitempty"` } @@ -2683,6 +2691,14 @@ func init() { t["ArrayOfFcoeConfigVlanRange"] = reflect.TypeOf((*ArrayOfFcoeConfigVlanRange)(nil)).Elem() } +type ArrayOfFeatureEVCMode struct { + FeatureEVCMode []FeatureEVCMode `xml:"FeatureEVCMode,omitempty"` +} + +func init() { + t["ArrayOfFeatureEVCMode"] = reflect.TypeOf((*ArrayOfFeatureEVCMode)(nil)).Elem() +} + type ArrayOfFileInfo struct { FileInfo []BaseFileInfo `xml:"FileInfo,omitempty,typeattr"` } @@ -3843,6 +3859,14 @@ func init() { t["ArrayOfHostTpmEventLogEntry"] = reflect.TypeOf((*ArrayOfHostTpmEventLogEntry)(nil)).Elem() } +type ArrayOfHostTrustAuthorityAttestationInfo struct { + HostTrustAuthorityAttestationInfo []HostTrustAuthorityAttestationInfo `xml:"HostTrustAuthorityAttestationInfo,omitempty"` +} + +func init() { + t["ArrayOfHostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*ArrayOfHostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type ArrayOfHostUnresolvedVmfsExtent struct { HostUnresolvedVmfsExtent []HostUnresolvedVmfsExtent `xml:"HostUnresolvedVmfsExtent,omitempty"` } @@ -5491,6 +5515,14 @@ func init() { t["ArrayOfVirtualMachineConfigSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigSpec)(nil)).Elem() } +type ArrayOfVirtualMachineConnection struct { + VirtualMachineConnection []BaseVirtualMachineConnection `xml:"VirtualMachineConnection,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineConnection"] = reflect.TypeOf((*ArrayOfVirtualMachineConnection)(nil)).Elem() +} + type ArrayOfVirtualMachineCpuIdInfoSpec struct { VirtualMachineCpuIdInfoSpec []VirtualMachineCpuIdInfoSpec `xml:"VirtualMachineCpuIdInfoSpec,omitempty"` } @@ -7207,17 +7239,19 @@ func init() { type Capability struct { DynamicData - ProvisioningSupported bool `xml:"provisioningSupported"` - MultiHostSupported bool `xml:"multiHostSupported"` - UserShellAccessSupported bool `xml:"userShellAccessSupported"` - SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` - NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` - FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` - HciWorkflowSupported *bool `xml:"hciWorkflowSupported"` - ComputePolicyVersion int32 `xml:"computePolicyVersion,omitempty"` - ClusterPlacementSupported *bool `xml:"clusterPlacementSupported"` - LifecycleManagementSupported *bool `xml:"lifecycleManagementSupported"` - ScalableSharesSupported *bool `xml:"scalableSharesSupported"` + ProvisioningSupported bool `xml:"provisioningSupported"` + MultiHostSupported bool `xml:"multiHostSupported"` + UserShellAccessSupported bool `xml:"userShellAccessSupported"` + SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` + SupportedEVCGraphicsMode []FeatureEVCMode `xml:"supportedEVCGraphicsMode,omitempty"` + NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` + FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` + HciWorkflowSupported *bool `xml:"hciWorkflowSupported"` + ComputePolicyVersion int32 `xml:"computePolicyVersion,omitempty"` + ClusterPlacementSupported *bool `xml:"clusterPlacementSupported"` + LifecycleManagementSupported *bool `xml:"lifecycleManagementSupported"` + ScalableSharesSupported *bool `xml:"scalableSharesSupported"` + HadcsSupported *bool `xml:"hadcsSupported"` } func init() { @@ -7533,8 +7567,9 @@ type CheckCompliance_TaskResponse struct { } type CheckConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -8230,16 +8265,20 @@ func init() { type ClusterComputeResourceSummary struct { ComputeResourceSummary - CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` - AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` - NumVmotions int32 `xml:"numVmotions"` - TargetBalance int32 `xml:"targetBalance,omitempty"` - CurrentBalance int32 `xml:"currentBalance,omitempty"` - DrsScore int32 `xml:"drsScore,omitempty"` - NumVmsPerDrsScoreBucket []int32 `xml:"numVmsPerDrsScoreBucket,omitempty"` - UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` + AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` + NumVmotions int32 `xml:"numVmotions"` + TargetBalance int32 `xml:"targetBalance,omitempty"` + CurrentBalance int32 `xml:"currentBalance,omitempty"` + DrsScore int32 `xml:"drsScore,omitempty"` + NumVmsPerDrsScoreBucket []int32 `xml:"numVmsPerDrsScoreBucket,omitempty"` + UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + ClusterMaintenanceModeStatus string `xml:"clusterMaintenanceModeStatus,omitempty"` + VcsHealthStatus string `xml:"vcsHealthStatus,omitempty"` + VcsSlots []ClusterComputeResourceVcsSlots `xml:"vcsSlots,omitempty"` } func init() { @@ -8249,8 +8288,9 @@ func init() { type ClusterComputeResourceVCProfile struct { DynamicData - ClusterSpec *ClusterConfigSpecEx `xml:"clusterSpec,omitempty"` - EvcModeKey string `xml:"evcModeKey,omitempty"` + ClusterSpec *ClusterConfigSpecEx `xml:"clusterSpec,omitempty"` + EvcModeKey string `xml:"evcModeKey,omitempty"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -8267,6 +8307,17 @@ func init() { t["ClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ClusterComputeResourceValidationResultBase)(nil)).Elem() } +type ClusterComputeResourceVcsSlots struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + TotalSlots int32 `xml:"totalSlots"` +} + +func init() { + t["ClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ClusterConfigInfo struct { DynamicData @@ -9583,6 +9634,7 @@ type ConfigTarget struct { DynamicPassthrough []VirtualMachineDynamicPassthroughInfo `xml:"dynamicPassthrough,omitempty"` SgxTargetInfo *VirtualMachineSgxTargetInfo `xml:"sgxTargetInfo,omitempty"` PrecisionClockInfo []VirtualMachinePrecisionClockInfo `xml:"precisionClockInfo,omitempty"` + SevSupported *bool `xml:"sevSupported"` } func init() { @@ -9647,8 +9699,9 @@ type ConfigureDatastorePrincipalResponse struct { } type ConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -11128,9 +11181,10 @@ func init() { type CryptoKeyResult struct { DynamicData - KeyId CryptoKeyId `xml:"keyId"` - Success bool `xml:"success"` - Reason string `xml:"reason,omitempty"` + KeyId CryptoKeyId `xml:"keyId"` + Success bool `xml:"success"` + Reason string `xml:"reason,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` } func init() { @@ -15207,6 +15261,25 @@ type DownloadDescriptionTreeResponse struct { Returnval []byte `xml:"returnval"` } +type DropConnections DropConnectionsRequestType + +func init() { + t["DropConnections"] = reflect.TypeOf((*DropConnections)(nil)).Elem() +} + +type DropConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + ListOfConnections []BaseVirtualMachineConnection `xml:"listOfConnections,omitempty,typeattr"` +} + +func init() { + t["DropConnectionsRequestType"] = reflect.TypeOf((*DropConnectionsRequestType)(nil)).Elem() +} + +type DropConnectionsResponse struct { + Returnval bool `xml:"returnval"` +} + type DrsDisabledEvent struct { ClusterEvent } @@ -18345,6 +18418,18 @@ func init() { t["FcoeFaultPnicHasNoPortSetFault"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSetFault)(nil)).Elem() } +type FeatureEVCMode struct { + ElementDescription + + Mask []HostFeatureMask `xml:"mask,omitempty"` + Capability []HostFeatureCapability `xml:"capability,omitempty"` + Requirement []VirtualMachineFeatureRequirement `xml:"requirement,omitempty"` +} + +func init() { + t["FeatureEVCMode"] = reflect.TypeOf((*FeatureEVCMode)(nil)).Elem() +} + type FeatureRequirementsNotMet struct { VirtualHardwareCompatibilityIssue @@ -22607,6 +22692,7 @@ type HostHardwareInfo struct { ReliableMemoryInfo *HostReliableMemoryInfo `xml:"reliableMemoryInfo,omitempty"` PersistentMemoryInfo *HostPersistentMemoryInfo `xml:"persistentMemoryInfo,omitempty"` SgxInfo *HostSgxInfo `xml:"sgxInfo,omitempty"` + SevInfo *HostSevInfo `xml:"sevInfo,omitempty"` } func init() { @@ -23335,19 +23421,21 @@ func init() { type HostListSummary struct { DynamicData - Host *ManagedObjectReference `xml:"host,omitempty"` - Hardware *HostHardwareSummary `xml:"hardware,omitempty"` - Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` - Config HostConfigSummary `xml:"config"` - QuickStats HostListSummaryQuickStats `xml:"quickStats"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` - RebootRequired bool `xml:"rebootRequired"` - CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` - ManagementServerIp string `xml:"managementServerIp,omitempty"` - MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` - TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Hardware *HostHardwareSummary `xml:"hardware,omitempty"` + Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` + Config HostConfigSummary `xml:"config"` + QuickStats HostListSummaryQuickStats `xml:"quickStats"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + RebootRequired bool `xml:"rebootRequired"` + CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` + ManagementServerIp string `xml:"managementServerIp,omitempty"` + MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` + TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + TrustAuthorityAttestationInfos []HostTrustAuthorityAttestationInfo `xml:"trustAuthorityAttestationInfos,omitempty"` } func init() { @@ -23885,6 +23973,7 @@ type HostNetCapabilities struct { DnsConfigSupported bool `xml:"dnsConfigSupported"` DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported"` IpV6Supported *bool `xml:"ipV6Supported"` + BackupNfcNiocSupported *bool `xml:"backupNfcNiocSupported"` } func init() { @@ -25676,6 +25765,17 @@ func init() { type HostSetVStorageObjectControlFlagsResponse struct { } +type HostSevInfo struct { + DynamicData + + SevState string `xml:"sevState"` + MaxSevEsGuests int64 `xml:"maxSevEsGuests"` +} + +func init() { + t["HostSevInfo"] = reflect.TypeOf((*HostSevInfo)(nil)).Elem() +} + type HostSgxInfo struct { DynamicData @@ -26282,6 +26382,20 @@ func init() { t["HostTpmSoftwareComponentEventDetails"] = reflect.TypeOf((*HostTpmSoftwareComponentEventDetails)(nil)).Elem() } +type HostTrustAuthorityAttestationInfo struct { + DynamicData + + AttestationStatus string `xml:"attestationStatus"` + ServiceId string `xml:"serviceId,omitempty"` + AttestedAt *time.Time `xml:"attestedAt"` + AttestedUntil *time.Time `xml:"attestedUntil"` + Messages []LocalizableMessage `xml:"messages,omitempty"` +} + +func init() { + t["HostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*HostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type HostUnresolvedVmfsExtent struct { DynamicData @@ -32707,7 +32821,7 @@ type NetworkSummary struct { Name string `xml:"name"` Accessible bool `xml:"accessible"` IpPoolName string `xml:"ipPoolName"` - IpPoolId int32 `xml:"ipPoolId,omitempty"` + IpPoolId *int32 `xml:"ipPoolId"` } func init() { @@ -37789,6 +37903,24 @@ type QueryConnectionInfoViaSpecResponse struct { Returnval HostConnectInfo `xml:"returnval"` } +type QueryConnections QueryConnectionsRequestType + +func init() { + t["QueryConnections"] = reflect.TypeOf((*QueryConnections)(nil)).Elem() +} + +type QueryConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryConnectionsRequestType"] = reflect.TypeOf((*QueryConnectionsRequestType)(nil)).Elem() +} + +type QueryConnectionsResponse struct { + Returnval []BaseVirtualMachineConnection `xml:"returnval,omitempty,typeattr"` +} + type QueryCryptoKeyStatus QueryCryptoKeyStatusRequestType func init() { @@ -41144,6 +41276,7 @@ type RemoveInternetScsiSendTargetsRequestType struct { This ManagedObjectReference `xml:"_this"` IScsiHbaDevice string `xml:"iScsiHbaDevice"` Targets []HostInternetScsiHbaSendTarget `xml:"targets"` + Force *bool `xml:"force"` } func init() { @@ -46727,18 +46860,19 @@ func init() { type ToolsConfigInfo struct { DynamicData - ToolsVersion int32 `xml:"toolsVersion,omitempty"` - ToolsInstallType string `xml:"toolsInstallType,omitempty"` - AfterPowerOn *bool `xml:"afterPowerOn"` - AfterResume *bool `xml:"afterResume"` - BeforeGuestStandby *bool `xml:"beforeGuestStandby"` - BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` - BeforeGuestReboot *bool `xml:"beforeGuestReboot"` - ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` - PendingCustomization string `xml:"pendingCustomization,omitempty"` - CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` - SyncTimeWithHost *bool `xml:"syncTimeWithHost"` - LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` + ToolsVersion int32 `xml:"toolsVersion,omitempty"` + ToolsInstallType string `xml:"toolsInstallType,omitempty"` + AfterPowerOn *bool `xml:"afterPowerOn"` + AfterResume *bool `xml:"afterResume"` + BeforeGuestStandby *bool `xml:"beforeGuestStandby"` + BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` + BeforeGuestReboot *bool `xml:"beforeGuestReboot"` + ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` + PendingCustomization string `xml:"pendingCustomization,omitempty"` + CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` + SyncTimeWithHostAllowed *bool `xml:"syncTimeWithHostAllowed"` + SyncTimeWithHost *bool `xml:"syncTimeWithHost"` + LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` } func init() { @@ -52082,6 +52216,8 @@ type VirtualMachineCapability struct { VirtualMmuUsageIgnored *bool `xml:"virtualMmuUsageIgnored"` VirtualExecUsageIgnored *bool `xml:"virtualExecUsageIgnored"` DiskOnlySnapshotOnSuspendedVMSupported *bool `xml:"diskOnlySnapshotOnSuspendedVMSupported"` + ToolsSyncTimeAllowSupported *bool `xml:"toolsSyncTimeAllowSupported"` + SevSupported *bool `xml:"sevSupported"` } func init() { @@ -52186,6 +52322,7 @@ type VirtualMachineConfigInfo struct { SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` ContentLibItemInfo *VirtualMachineContentLibraryItemInfo `xml:"contentLibItemInfo,omitempty"` GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` } func init() { @@ -52317,6 +52454,7 @@ type VirtualMachineConfigSpec struct { MigrateEncryption string `xml:"migrateEncryption,omitempty"` SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` } func init() { @@ -52353,6 +52491,18 @@ func init() { t["VirtualMachineConfigSummary"] = reflect.TypeOf((*VirtualMachineConfigSummary)(nil)).Elem() } +type VirtualMachineConnection struct { + DynamicData + + Label string `xml:"label"` + Client string `xml:"client"` + UserName string `xml:"userName"` +} + +func init() { + t["VirtualMachineConnection"] = reflect.TypeOf((*VirtualMachineConnection)(nil)).Elem() +} + type VirtualMachineConsolePreferences struct { DynamicData @@ -52887,6 +53037,14 @@ func init() { t["VirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() } +type VirtualMachineMksConnection struct { + VirtualMachineConnection +} + +func init() { + t["VirtualMachineMksConnection"] = reflect.TypeOf((*VirtualMachineMksConnection)(nil)).Elem() +} + type VirtualMachineMksTicket struct { DynamicData @@ -56490,6 +56648,17 @@ func init() { t["VsanClusterUuidMismatchFault"] = reflect.TypeOf((*VsanClusterUuidMismatchFault)(nil)).Elem() } +type VsanDatastoreInfo struct { + DatastoreInfo + + MembershipUuid string `xml:"membershipUuid,omitempty"` + AccessGenNo int32 `xml:"accessGenNo,omitempty"` +} + +func init() { + t["VsanDatastoreInfo"] = reflect.TypeOf((*VsanDatastoreInfo)(nil)).Elem() +} + type VsanDiskFault struct { VsanFault diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go index 92c637177..c0c0a588b 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go @@ -479,8 +479,11 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat xmlname := tinfo.xmlname if xmlname.name != "" { start.Name.Space, start.Name.Local = xmlname.xmlns, xmlname.name - } else if v, ok := xmlname.value(val).Interface().(Name); ok && v.Local != "" { - start.Name = v + } else { + fv := xmlname.value(val, dontInitNilPointers) + if v, ok := fv.Interface().(Name); ok && v.Local != "" { + start.Name = v + } } } if start.Name.Local == "" && finfo != nil { @@ -505,7 +508,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat if finfo.flags&fAttr == 0 { continue } - fv := finfo.value(val) + fv := finfo.value(val, dontInitNilPointers) if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { continue @@ -814,7 +817,12 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { if finfo.flags&fAttr != 0 { continue } - vf := finfo.value(val) + vf := finfo.value(val, dontInitNilPointers) + if !vf.IsValid() { + // The field is behind an anonymous struct field that's + // nil. Skip it. + continue + } switch finfo.flags & fMode { case fCDATA, fCharData: @@ -925,7 +933,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { p.WriteString("-->") continue - case fInnerXml: + case fInnerXML: vf = indirect(vf) iface := vf.Interface() switch raw := iface.(type) { diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/read.go b/vendor/github.com/vmware/govmomi/vim25/xml/read.go index 60f71582d..ea61352f6 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/read.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/read.go @@ -491,7 +491,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { } return UnmarshalError(e) } - fv := finfo.value(sv) + fv := finfo.value(sv, initNilPointers) if _, ok := fv.Interface().(Name); ok { fv.Set(reflect.ValueOf(start.Name)) } @@ -505,7 +505,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { finfo := &tinfo.fields[i] switch finfo.flags & fMode { case fAttr: - strv := finfo.value(sv) + strv := finfo.value(sv, initNilPointers) if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { needTypeAttr := (finfo.flags & fTypeAttr) != 0 // HACK: avoid using xsi:type value for a "type" attribute, such as ManagedObjectReference.Type for example. @@ -525,7 +525,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { } if !handled && any >= 0 { finfo := &tinfo.fields[any] - strv := finfo.value(sv) + strv := finfo.value(sv, initNilPointers) if err := d.unmarshalAttr(strv, a); err != nil { return err } @@ -538,22 +538,22 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { switch finfo.flags & fMode { case fCDATA, fCharData: if !saveData.IsValid() { - saveData = finfo.value(sv) + saveData = finfo.value(sv, initNilPointers) } case fComment: if !saveComment.IsValid() { - saveComment = finfo.value(sv) + saveComment = finfo.value(sv, initNilPointers) } case fAny, fAny | fElement: if !saveAny.IsValid() { - saveAny = finfo.value(sv) + saveAny = finfo.value(sv, initNilPointers) } - case fInnerXml: + case fInnerXML: if !saveXML.IsValid() { - saveXML = finfo.value(sv) + saveXML = finfo.value(sv, initNilPointers) if d.saved == nil { saveXMLIndex = 0 d.saved = new(bytes.Buffer) @@ -769,7 +769,7 @@ Loop: } if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local { // It's a perfect match, unmarshal the field. - return true, d.unmarshal(finfo.value(sv), start) + return true, d.unmarshal(finfo.value(sv, initNilPointers), start) } if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local { // It's a prefix for the field. Break and recurse diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go index 0d240b1e3..5eb0b4e5f 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go @@ -33,14 +33,14 @@ const ( fAttr fCDATA fCharData - fInnerXml + fInnerXML fComment fAny fOmitEmpty fTypeAttr - fMode = fElement | fAttr | fCDATA | fCharData | fInnerXml | fComment | fAny + fMode = fElement | fAttr | fCDATA | fCharData | fInnerXML | fComment | fAny xmlName = "XMLName" ) @@ -135,7 +135,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro case "chardata": finfo.flags |= fCharData case "innerxml": - finfo.flags |= fInnerXml + finfo.flags |= fInnerXML case "comment": finfo.flags |= fComment case "any": @@ -152,7 +152,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro switch mode := finfo.flags & fMode; mode { case 0: finfo.flags |= fElement - case fAttr, fCDATA, fCharData, fInnerXml, fComment, fAny, fAny | fAttr: + case fAttr, fCDATA, fCharData, fInnerXML, fComment, fAny, fAny | fAttr: if f.Name == xmlName || tag != "" && mode != fAttr { valid = false } @@ -347,15 +347,25 @@ func (e *TagPathError) Error() string { return fmt.Sprintf("%s field %q with tag %q conflicts with field %q with tag %q", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2) } +const ( + initNilPointers = true + dontInitNilPointers = false +) + // value returns v's field value corresponding to finfo. -// It's equivalent to v.FieldByIndex(finfo.idx), but initializes -// and dereferences pointers as necessary. -func (finfo *fieldInfo) value(v reflect.Value) reflect.Value { +// It's equivalent to v.FieldByIndex(finfo.idx), but when passed +// initNilPointers, it initializes and dereferences pointers as necessary. +// When passed dontInitNilPointers and a nil pointer is reached, the function +// returns a zero reflect.Value. +func (finfo *fieldInfo) value(v reflect.Value, shouldInitNilPointers bool) reflect.Value { for i, x := range finfo.idx { if i > 0 { t := v.Type() if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct { if v.IsNil() { + if !shouldInitNilPointers { + return reflect.Value{} + } v.Set(reflect.New(v.Type().Elem())) } v = v.Elem() diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go index 50117a00e..28631bdfe 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go @@ -290,7 +290,10 @@ func (d *Decoder) Token() (Token, error) { t = d.nextToken d.nextToken = nil } else if t, err = d.rawToken(); err != nil { - if err == io.EOF && d.stk != nil && d.stk.kind != stkEOF { + switch { + case err == io.EOF && d.t != nil: + err = nil + case err == io.EOF && d.stk != nil && d.stk.kind != stkEOF: err = d.syntaxError("unexpected EOF") } return t, err @@ -961,7 +964,7 @@ func (d *Decoder) ungetc(b byte) { d.offset-- } -var entity = map[string]int{ +var entity = map[string]rune{ "lt": '<', "gt": '>', "amp": '&', @@ -1056,7 +1059,7 @@ Input: d.buf.WriteByte(';') n, err := strconv.ParseUint(s, base, 64) if err == nil && n <= unicode.MaxRune { - text = string(n) + text = string(rune(n)) haveText = true } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 37bc0452a..bf88192ee 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -564,6 +564,14 @@ github.com/hashicorp/packer-plugin-sdk/tmp github.com/hashicorp/packer-plugin-sdk/useragent github.com/hashicorp/packer-plugin-sdk/uuid github.com/hashicorp/packer-plugin-sdk/version +# github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe +## explicit +github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone +github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common +github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver +github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso +github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere +github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template # github.com/hashicorp/serf v0.9.2 github.com/hashicorp/serf/coordinate # github.com/hashicorp/vault/api v1.0.4 @@ -789,19 +797,23 @@ github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma -# github.com/vmware/govmomi v0.23.1 +# github.com/vmware/govmomi v0.24.1 ## explicit github.com/vmware/govmomi github.com/vmware/govmomi/find +github.com/vmware/govmomi/internal github.com/vmware/govmomi/list github.com/vmware/govmomi/nfc github.com/vmware/govmomi/object +github.com/vmware/govmomi/ovf github.com/vmware/govmomi/property github.com/vmware/govmomi/session github.com/vmware/govmomi/session/keepalive github.com/vmware/govmomi/task github.com/vmware/govmomi/vapi/internal +github.com/vmware/govmomi/vapi/library github.com/vmware/govmomi/vapi/rest +github.com/vmware/govmomi/vapi/vcenter github.com/vmware/govmomi/vim25 github.com/vmware/govmomi/vim25/debug github.com/vmware/govmomi/vim25/methods @@ -947,7 +959,7 @@ golang.org/x/crypto/ssh/terminal # golang.org/x/lint v0.0.0-20200302205851-738671d3881b golang.org/x/lint golang.org/x/lint/golint -# golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2 +# golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 golang.org/x/mobile/event/key # golang.org/x/mod v0.3.0 ## explicit From a00846102be02a481f827cdbe10979919424fbbd Mon Sep 17 00:00:00 2001 From: sylviamoss <moss@hashicorp.com> Date: Thu, 15 Apr 2021 13:52:26 +0200 Subject: [PATCH 4/7] add vsphere to docs-remote-plugins.json --- website/data/docs-remote-plugins.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/data/docs-remote-plugins.json b/website/data/docs-remote-plugins.json index 7c6ae6de3..16cfd8daa 100644 --- a/website/data/docs-remote-plugins.json +++ b/website/data/docs-remote-plugins.json @@ -10,5 +10,11 @@ "path": "amazon", "repo": "hashicorp/packer-plugin-amazon", "version": "latest" + }, + { + "title": "VMware vSphere", + "path": "vsphere", + "repo": "hashicorp/packer-plugin-vsphere", + "version": "latest" } ] From c7ee5f1efde31f2749cc118ca3fbd6ece80cfa02 Mon Sep 17 00:00:00 2001 From: sylviamoss <moss@hashicorp.com> Date: Thu, 15 Apr 2021 14:35:04 +0200 Subject: [PATCH 5/7] update packer-plugin-vsphere and sdk --- go.mod | 4 ++-- go.sum | 4 ++++ vendor/modules.txt | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index d59a5cfe8..59ce91a77 100644 --- a/go.mod +++ b/go.mod @@ -52,8 +52,8 @@ require ( github.com/hashicorp/hcl/v2 v2.9.1 github.com/hashicorp/packer-plugin-amazon v0.0.1 github.com/hashicorp/packer-plugin-docker v0.0.7 - github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf - github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe + github.com/hashicorp/packer-plugin-sdk v0.1.3 + github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6 github.com/hashicorp/vault/api v1.0.4 github.com/hetznercloud/hcloud-go v1.15.1 github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 diff --git a/go.sum b/go.sum index df88fba60..3444ef0b4 100644 --- a/go.sum +++ b/go.sum @@ -450,8 +450,12 @@ github.com/hashicorp/packer-plugin-sdk v0.1.1/go.mod h1:1d3nqB9LUsXMQaNUiL67Q+WY github.com/hashicorp/packer-plugin-sdk v0.1.2/go.mod h1:KRjczE1/c9NV5Re+PXt3myJsVTI/FxEHpZjRjOH0Fug= github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf h1:0DBlIExTDefzbfkOl213QtgJsVJXWdgW/aIQIvYUMzs= github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf/go.mod h1:xePpgQgQYv/bamiypx3hH9ukidxDdcN8q0R0wLi8IEQ= +github.com/hashicorp/packer-plugin-sdk v0.1.3 h1:oHTVlgoX2piUzL54+LBo9uIMfW+L/kY7or83dDStdIY= +github.com/hashicorp/packer-plugin-sdk v0.1.3/go.mod h1:xePpgQgQYv/bamiypx3hH9ukidxDdcN8q0R0wLi8IEQ= github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe h1:qUU0ctLV5Pjq+RqxaKlVmKhE1BQtWZvqV4a05cF93PY= github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe/go.mod h1:ZmA5O2CDiIOGW/hvHbhxNzq2hEXDYyUVj+knuoxyWu0= +github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6 h1:pOv7Apd4P3KEpNBHLV4E7tKlwHoInCU/bnPVadGSDxY= +github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6/go.mod h1:XMhsLDDT7sD2BWaruLvGPynnn4IqdbrfvuKhb1GK1RI= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.2 h1:yJoyfZXo4Pk2p/M/viW+YLibBFiIbKoP79gu7kDAFP0= github.com/hashicorp/serf v0.9.2/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= diff --git a/vendor/modules.txt b/vendor/modules.txt index bf88192ee..e27716ab4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -522,7 +522,7 @@ github.com/hashicorp/packer-plugin-docker/post-processor/docker-import github.com/hashicorp/packer-plugin-docker/post-processor/docker-push github.com/hashicorp/packer-plugin-docker/post-processor/docker-save github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag -# github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf +# github.com/hashicorp/packer-plugin-sdk v0.1.3 ## explicit github.com/hashicorp/packer-plugin-sdk/acctest github.com/hashicorp/packer-plugin-sdk/acctest/provisioneracc @@ -564,7 +564,7 @@ github.com/hashicorp/packer-plugin-sdk/tmp github.com/hashicorp/packer-plugin-sdk/useragent github.com/hashicorp/packer-plugin-sdk/uuid github.com/hashicorp/packer-plugin-sdk/version -# github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe +# github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6 ## explicit github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common From 3c6b7841bc75ac6f44540d46786cfbadd2f71c72 Mon Sep 17 00:00:00 2001 From: sylviamoss <moss@hashicorp.com> Date: Thu, 15 Apr 2021 16:29:52 +0200 Subject: [PATCH 6/7] fix vsphere link --- .../partials/builders/building_on_remote_vsphere_hypervisor.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/partials/builders/building_on_remote_vsphere_hypervisor.mdx b/website/content/partials/builders/building_on_remote_vsphere_hypervisor.mdx index 1159b3791..bba7d3d92 100644 --- a/website/content/partials/builders/building_on_remote_vsphere_hypervisor.mdx +++ b/website/content/partials/builders/building_on_remote_vsphere_hypervisor.mdx @@ -16,7 +16,7 @@ $ esxcli system settings advanced set -o /Net/GuestIPHack -i 1 When using a remote VMware Hypervisor, the builder still downloads the ISO and various files locally, and uploads these to the remote machine. Packer currently uses SSH to communicate to the ESXi machine rather than the vSphere API. -If you want to use vSphere API, see the [vsphere-iso](/docs/builders/vsphere-iso) builder. +If you want to use vSphere API, see the [vsphere-iso](/docs/builders/vsphere/vsphere-iso) builder. Packer also requires VNC to issue boot commands during a build, which may be disabled on some remote VMware Hypervisors. Please consult the appropriate From 84af0ba6da9cd5889bd11169755053399fd62506 Mon Sep 17 00:00:00 2001 From: Megan Marsh <megan@hashicorp.com> Date: Thu, 15 Apr 2021 16:25:58 -0700 Subject: [PATCH 7/7] go mod tidy --- go.mod | 1 - go.sum | 4 ---- 2 files changed, 5 deletions(-) diff --git a/go.mod b/go.mod index 59ce91a77..1eec3f4d6 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,6 @@ require ( github.com/ucloud/ucloud-sdk-go v0.16.3 github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6 github.com/ulikunitz/xz v0.5.6 - github.com/ulikunitz/xz v0.5.5 github.com/vmware/govmomi v0.24.1 github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd diff --git a/go.sum b/go.sum index 3444ef0b4..9ce19fb30 100644 --- a/go.sum +++ b/go.sum @@ -448,12 +448,8 @@ github.com/hashicorp/packer-plugin-sdk v0.0.14/go.mod h1:tNb3XzJPnjMl3QuUdKmF47B github.com/hashicorp/packer-plugin-sdk v0.1.0/go.mod h1:CFsC20uZjtER/EnTn/CSMKD0kEdkqOVev8mtOmfnZiI= github.com/hashicorp/packer-plugin-sdk v0.1.1/go.mod h1:1d3nqB9LUsXMQaNUiL67Q+WYEtjsVcLNTX8ikVlpBrc= github.com/hashicorp/packer-plugin-sdk v0.1.2/go.mod h1:KRjczE1/c9NV5Re+PXt3myJsVTI/FxEHpZjRjOH0Fug= -github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf h1:0DBlIExTDefzbfkOl213QtgJsVJXWdgW/aIQIvYUMzs= -github.com/hashicorp/packer-plugin-sdk v0.1.3-0.20210407132324-af39c7839daf/go.mod h1:xePpgQgQYv/bamiypx3hH9ukidxDdcN8q0R0wLi8IEQ= github.com/hashicorp/packer-plugin-sdk v0.1.3 h1:oHTVlgoX2piUzL54+LBo9uIMfW+L/kY7or83dDStdIY= github.com/hashicorp/packer-plugin-sdk v0.1.3/go.mod h1:xePpgQgQYv/bamiypx3hH9ukidxDdcN8q0R0wLi8IEQ= -github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe h1:qUU0ctLV5Pjq+RqxaKlVmKhE1BQtWZvqV4a05cF93PY= -github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210409154313-881202ca3ffe/go.mod h1:ZmA5O2CDiIOGW/hvHbhxNzq2hEXDYyUVj+knuoxyWu0= github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6 h1:pOv7Apd4P3KEpNBHLV4E7tKlwHoInCU/bnPVadGSDxY= github.com/hashicorp/packer-plugin-vsphere v0.0.0-20210415100050-d0269b5646e6/go.mod h1:XMhsLDDT7sD2BWaruLvGPynnn4IqdbrfvuKhb1GK1RI= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=