Open vmbro opened 1 year ago
I'm not 100% sure about this, but it looks like there are some advanced settings you can't set directly. The vSphere API seems to ignore them. I've seen this already in #1330.
Does the module report a change that doesn't happen, or doesn't it even do that and report that everything's OK? And what do you see in your vCenter? Is there a task that succeeds, but there's no change?
Yes, module does report this as change and I can see reconfigure virtual machine logs on vCenter. All reconfigure logs are success at vCenter tasks. I agree with you, this is similar as #1330
I just tested this enabling VM logging with PowerCLI and everything works fine. I can easily change this parameter with following function. $newSpec has EnableLogging flag as $true. It seems vSphere API works fine with PowerCLI.
$vm.ExtensionData.ReconfigVM($newSpec)
@vmbro $newSpec - what type is this object?
I just tested this enabling VM logging with PowerCLI and everything works fine. I can easily change this parameter with following function. $newSpec has EnableLogging flag as $true. It seems vSphere API works fine with PowerCLI.
$vm.ExtensionData.ReconfigVM($newSpec)
I'm not sure if this is the same thing. I mean, you do it by using a flag in the spec and not by setting an advanced setting directly. Even if it is, at the end of the day, an advanced setting there might be differences how the API handles this.
$newSpec - what type is this object?
@ihumster Possibly VirtualMachineConfigSpec, where flags
is a VirtualMachineFlagInfo which has enableLogging
.
We're already using flags for Virtualization-based security and Intel Virtualization Technology for Directed I/O:
If it isn't possible to set this advanced setting directly, maybe we need to implement a new parameter for this. Or, alternatively, a new optionflags
with a sub-option enable_logging
or similar. And, in the long run, possibly move iommu
and virt_based_security
from hardware
there. This might make the module easier to maintain in the long run, especially when the need arises to implement even more flags.
@mariolenz Just I mean VM Advanced Options and VirtualMachineFlag not the same.
SUMMARY
Can not edit logging = "FALSE" key value as "TRUE" or delete this logging key value in .vmx configuration file with advanced_settings parameter. I would like to edit this parameter as "TRUE" if virtual machine logging disabled. I am able to create/change/delete other keys with same playbook, but I can not change the logging key. There is no error during this change.
COMPONENT NAME
community.vmware.vmware_guest
ADDITIONAL INFORMATION