Missing vspansession object
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 763
- PR merge metrics
- No merged PRs in 30d
Description
When iterating through a vim.dvs.VmwareDistributedVirtualSwitch object captured through viewManager.CreateContainerView() class, the vSpanSession list is always empty, even for DVSs which have multiple Mirroring Sessions.
Additionally, performing a ReconfigureDvs_Task() method on the DVS with a vspanConfigSpec "add" does not effectively get performed in vCenter. This has been tested on VC6.5 and 6.7 using the latest 6.7.1 pyvmomi codebase.
---GIST---
content = vmSI.RetrieveContent()
switch = get_obj(content, [vim.dvs.VmwareDistributedVirtualSwitch], "vds1")
vspan_spec = vim.dvs.VmwareDistributedVirtualSwitch.VspanConfigSpec()
vspan_sess_spec = vim.dvs.VmwareDistributedVirtualSwitch.VspanSession()
vspan_sess_spec.name = "Test Session"
vspan_sess_spec.description = "This is a test session"
vspan_sess_spec.enabled = True
vspan_sess_spec.sessionType = \ vim.dvs.VmwareDistributedVirtualSwitch.VspanSessionType.remoteMirrorDest
vspan_sess_spec.stripOriginalVlan = False
vspan_sess_spec.normalTrafficAllowed = True
# Set the source VLAN
source_rx = vim.dvs.VmwareDistributedVirtualSwitch.VspanPorts()
source_rx.vlans = [1234]
source_tx = vim.dvs.VmwareDistributedVirtualSwitch.VspanPorts()
source_tx.vlans = [1234]
vspan_sess_spec.sourcePortReceived = source_rx
#vspan_sess_spec.sourcePortTransmitted = source_tx
#Set the dest port
dest = vim.dvs.VmwareDistributedVirtualSwitch.VspanPorts()
dest.portKey = ['7']
vspan_sess_spec.destinationPort = dest
# Add the new spec
vspan_spec.operation = vim.ConfigSpecOperation.add
vspan_spec.vspanSession = vspan_sess_spec
#Get the current switch spec
switch_spec = switch.ConfigSpec()
switch_spec.configVersion = switch.config.configVersion
switch_spec.vspanConfigSpec = [vspan_spec]
switch_spec.name = "vds1"
switch_spec.description ="Help!!"
running_task = switch.ReconfigureDvs_Task(switch_spec)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with vim.dvs.VmwareDistributedVirtualSwitch, RetrieveContent(), CreateContainerView(), and the vspanSession and ReconfigureDvs_Task entry points shown in the reproduction. Compare the captured session list and the add vspanConfigSpec behavior on the stated vCenter versions; done means existing sessions are exposed and the added session is applied by vCenter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100