Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Support for ExtraConfigParams and ExtraConfig classes #66

Open
mdechiaro opened this issue Dec 6, 2019 · 5 comments
Open

Support for ExtraConfigParams and ExtraConfig classes #66

mdechiaro opened this issue Dec 6, 2019 · 5 comments
Labels

Comments

@mdechiaro
Copy link

I am trying to set ExtraConfigParams and ExtraConfig parameters under additional_parameters inside VSphereAutomation::VCenter::VcenterOvfLibraryItemResourcePoolDeploymentSpec on a deployed VM, however I do not see these classes inside the project. How can these parameters be set?

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/4f867b1e-c524-4e4b-b79e-4321822b5c70/a3cd39a7-4eaf-4e10-9ad2-589f9dfe1f9a/doc/Com/Vmware/Vcenter/Ovf/ExtraConfig.html

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/4f867b1e-c524-4e4b-b79e-4321822b5c70/a3cd39a7-4eaf-4e10-9ad2-589f9dfe1f9a/doc/Com/Vmware/Vcenter/Ovf/ExtraConfigParams.html

Ruby: 2.5.1
SDK: 0.4.6

@jrgarcia
Copy link
Contributor

jrgarcia commented Dec 6, 2019

That documentation is for an older version. Unfortunately, the documentation for that section of the Ruby SDK isn't very helpful as it just takes an Array<Object>. The documentation here can help point you in the right direction. The additional_parameters section shows the various types you can use there (e.g. extra_config_params). There aren't types in the Ruby SDK that map to this, however. You'll need to create a Hash that is structured that way.

As an aside, the Ruby SDK is generated from an OpenAPI definition of the API which has additional_params taking an array of object which makes Ruby assume it's just going to pass an Array of any type. The runtime does take care of serializing a Hash to JSON properly though which means that if you pass a correctly structured Hash it will work as intended.

I'll see what I can do to ensure that in the future types like this get created appropriately.

@mdechiaro
Copy link
Author

mdechiaro commented Dec 7, 2019

Thanks for the quick and detailed response. Here is the data structure I came up with:

additional_parameters: [
      { 
        '@class' => 'com.vmware.vcenter.ovf.extra_config_params',
        'extra_configs' => [
          { 
            'key' => 'guestinfo.metadata.encoding',
            'value' => 'gzip+base64',
          },
          { 
            'key' => 'guestinfo.metadata',
            'value' => Base64.encode64(Zlib::Deflate.deflate({'local-hostname' => 'hostname'}.to_json)),
          },
        ],
        'type' => 'ExtraConfigParams',
      },
    ]

While the VM deployed, the extra config parameters are missing

@mdechiaro
Copy link
Author

@jrgarcia

I believe I am sending the correct data structure, however the extra parameters are not being configured inside the virtual machine. I made attempts to create a Hash with symbols and strings as key values without success. Any samples you can share or assistance you can provide would be greatly appreciated. These additional parameters are not configured after the VM is deployed inside vsphere 6.5.

Here is the output for the deployment request:

:additional_parameters=>[{"@class"=>"com.vmware.vcenter.ovf.extra_config_params", "extra_configs"=>[{"key"=>"guestinfo.metadata.encoding", "value"=>"gzip+base64"}, {"key"=>"guestinfo.metadata", "value"=>"eJyrVsrJT07M0c3ILy7JS8xNVbJSgjNrAaCvCrE=\n"}], "type"=>"ExtraConfigParams"}]

Here are the results of this deployment:
{:value=>{:succeeded=>true, :resource_id=>{:type=>"VirtualMachine", :id=>"vm-1012"}, :error=>{:errors=>[], :warnings=>[], :information=>[]}}}

@jrgarcia
Copy link
Contributor

I'm so sorry it's taken me so long to get back to you! I totally missed your first reply (though I didn't seem to get a notification about it 🤔) and I was out and away from the computer for the holidays on your last reply. I'm back today and this is near the top of my list. I'll let you know what I find as soon as I can. Sorry again for the late reply!

@mdechiaro
Copy link
Author

No problem with the delayed response, as the holidays are a busy time. Let me know if there is any further info I can share to assist. Thanks again.

@jrgarcia jrgarcia removed their assignment Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants