vmware / vmware/pyvmomi

Configure lag on existing DVS

Open
#1,059 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

While configuring lag in passive mode on a existing DVS switch, method not found exception was caught, even though the method has been defined in the class.
Exception details:
(vmodl.fault.MethodNotFound) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = ,
faultCause = ,
faultMessage = (vmodl.LocalizableMessage) [],
receiver = 'vim.dvs.VmwareDistributedVirtualSwitch:dvs-73',
method = 'UpdateLacpGroupConfig'
}

Reproduction steps

def create_lag(si, dvsName, lagName, numberOfUplinks):
try:
dvs_vim_type = [vim.DistributedVirtualSwitch]
vds = get_obj(si,dvs_vim_type,dvsName)
except Exception as e:
print(e)
return None

#create lacp in passive mode
try:     

    lacpGroupSpec_0 = vim.dvs.VmwareDistributedVirtualSwitch.LacpGroupSpec()
    lacpGroupSpec_0.lacpGroupConfig = vim.dvs.VmwareDistributedVirtualSwitch.LacpGroupConfig()
    lacpGroupSpec_0.lacpGroupConfig.mode = 'passive'
    lacpGroupSpec_0.lacpGroupConfig.ipfix = vim.dvs.VmwareDistributedVirtualSwitch.LagIpfixConfig()
    lacpGroupSpec_0.lacpGroupConfig.loadbalanceAlgorithm = 'srcDestIpTcpUdpPortVlan'
    lacpGroupSpec_0.lacpGroupConfig.vlan = vim.dvs.VmwareDistributedVirtualSwitch.LagVlanConfig()
    lacpGroupSpec_0.lacpGroupConfig.name = 'vsan_lag'
    #lacpGroupSpec_0.lacpGroupConfig.timeoutMode = 'slow'
    lacpGroupSpec_0.lacpGroupConfig.uplinkNum = 2
    lacpGroupSpec_0.operation = 'add'
    lacpGroupSpec = [lacpGroupSpec_0]
    task = vds.UpdateDVSLacpGroupConfig_Task(lacpGroupSpec)
    # The attributes of lacpGroupConfig includes: 'dynamicProperty', 'dynamicType', 'ipfix', 'key', 'loadbalanceAlgorithm', 'mode', 'name', 'uplinkName', 'uplinkNum', 'uplinkPortKey', 'vlan'
    # this list does not contain timeoutMode. As default value for timeout mode is slow, ignoring this for now
    # TO DO : how to set the timeoutMode should be explored

    state, result = wait_for_task(task)
    if not state:
        print(result)
        exit()       
    return result
except Exception as e:
    print(e)
    return None

Obtained similar result when task = vds.UpdateLacpGroupConfig(lacpGroupSpec) was used.

Expected behavior
  1. Exception should have fault cause and fault message set to an appropriate value that describes the nature of the fault.
  2. Clear instructions of what pre-requisites needs to be set should be documented.
Additional context

Please note that the main logic of the code was generated using the developer center's code capture feature

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the create_lag reproduction and compare vds.UpdateDVSLacpGroupConfig_Task with vds.UpdateLacpGroupConfig for an existing DVS in passive mode. Investigate the reported MethodNotFound response and the prerequisites for these operations. Done means the failure is appropriately described and the required prerequisites are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.