var spec = new VcVMwareDVSConfigSpec();
spec.configVersion = dvs.config.configVersion;
...
dvs.reconfigureDvs_Task(spec);
...
dvs.reconfigureDvs_Task(spec);
it failed as the spec version has not changed.
error:can not complete operation due to concurrent modification by another operation.
if I get the new spec version before execute dvs.reconfigureDvs_Task(spec) it can work.
namely it can work with the following scripts:
var spec = new VcVMwareDVSConfigSpec();
spec.configVersion = dvs.config.configVersion;
...
dvs.reconfigureDvs_Task(spec);
...
spec.configVersion = dvs.config.configVersion;
dvs.reconfigureDvs_Task(spec);
But the issue it that I must do some operation in the old spec. So must recofigueDvs in the same spec version twice.
Is anyone familiar with it? Waiting for your help.
Unfortunately I don't have a solution on this, but I am working on some ESX automation to move a host to a distributed switch, which of course involves adding it via config spec. However, when I try to do so, I get the same error you saw with "cannot complete operation due to concurrent modification by another operation". So I can at least confirm it is a bug.
I will try putting the version in my configuration tomorrow to see if that helps, so thanks for posting this.
Can confirm, adding this piece of code got rid of the error for me.
spec is of type VcDVSConfigSpec, targetSwitch is a VMware DVS.
spec.configVersion = targetSwitch.config.configVersion;
I do have a case open on it, so we'll see what they say.