# Managed Object - DistributedVirtualPortgroup(vim.dvs.DistributedVirtualPortgroup)

Property of
  ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping, ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping, DistributedVirtualPortgroupInfo, DistributedVirtualPortgroupNsxPortgroupOperationResult, DistributedVirtualSwitch, DistributedVirtualSwitchManagerImportResult, DVSConfigInfo, DVSConfigSpec
Returned by
  CreateDVPortgroup_Task, DVSManagerLookupDvPortGroup, LookupDvPortGroup
Extends
  Network
See also
  DVPortgroupConfigInfo, DVPortgroupConfigSpec, EntityBackupConfig
Since
  vSphere API 4.0

## Managed Object Description

The DistributedVirtualPortgroup managed object defines how hosts and virtual machines connect to a network. A distributed virtual portgroup specifies DistributedVirtualPort configuration options for the ports on a DistributedVirtualSwitch. A portgroup also represents a Network entity in the datacenter.

- To configure host access by portgroup, set the portgroup in the host virtual NIC specification (HostVirtualNicSpec.portgroup).
- To configure virtual machine access by portgroup, set the portgroup in the virtual Ethernet card backing (VirtualEthernetCard.backing.port.portgroupKey).

When you use a portgroup for network access, the Server will create a port according to Config.type.

Properties

Name | Type | Description
--- | --- | ---
config | DVPortgroupConfigInfo | Configuration of the portgroup.
key | xsd:string | Generated UUID of the portgroup.
portKeys* | xsd:string[] | Port keys for the set of ports in the portgroup.
Properties inherited from Network
host, name, summary, vm
Properties inherited from ManagedEntity
alarmActionsEnabled, configIssue, configStatus, customValue, declaredAlarmState, disabledMethod, effectiveRole, name, overallStatus, parent, permission, recentTask, tag, triggeredAlarmState
Properties inherited from ExtensibleManagedObject
availableField, value

*May not be present

Methods

Methods defined in this Managed Object
DVPortgroupRollback_Task, ReconfigureDVPortgroup_Task
Methods inherited from Network
DestroyNetwork
Methods inherited from ManagedEntity
Destroy_Task, Reload, Rename_Task
Methods inherited from ExtensibleManagedObject
setCustomValue

# DVPortgroupRollback_Task(rollback)

This method determines if the portgroup configuration has changed. If it has changed, the method returns a DVPortgroupConfigSpec. Use the ReconfigureDVPortgroup_Task method to apply the rollback configuration to the portgroup. You can use the rollback method only on a portgroup that is associated with a VmwareDistributedVirtualSwitch.

- If you specify the `entityBackup` parameter, the returned configuration specification represents the exported portgroup configuration. If the `entityBackup` matches the current portgroup configuration, the method does not return a configuration specification.
- If `entityBackup` is not specified, the returned configuration specification represents a previous state of the portgroup, if available. When you use a VMware distributed virtual switch, each time you reconfigure the switch, the Server saves the switch configuration before applying the updates. If the vCenter Server is restarted, the saved configuration is not preserved and the method does not return a configuration specification.

To use the rollback method, you must have the DVPortgroup.Read privilege.

Required Privileges
  None
Since
  vSphere API 5.1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the DistributedVirtualPortgroup used to make the method call.
entityBackup* P | EntityBackupConfig | The backup of Distributed Virtual PortGroup entity. Since vSphere API 5.1

*Need not be set P Required privilege: entityBackup

Return Value

Type | Description
--- | ---
ManagedObjectReference to a VslmTask | Returns a Task object with which to monitor the operation. If the distributed virtual portgroup configuration has changed, the Task.Info.result property contains the DVPortgroupConfigSpec object.

Faults

Type | Description
--- | ---
DvsFault | Thrown if operation fails.
RollbackFailure | Thrown if there is no configuration specified in entityBackup and the previous configuration does not exist either
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

# ReconfigureDVPortgroup_Task(reconfigure)

Reconfigures one or more distributed virtual portgroups. You can use this method to set portgroup properties or to reset the portgroup to a previous state.

Reconfiguring a Standard Distributed Virtual Portgroup

To reconfigure a DistributedVirtualPortgroup, use a DVPortgroupConfigSpec to set the portgroup properties.

Reconfiguring a Portgroup Associated With a VMware Distributed Virtual Switch

If you use a VmwareDistributedVirtualSwitch, you can perform the following portgroup reconfiguration:

- Use a DVPortgroupConfigSpec to set the portgroup properties.
- Use the DVPortgroupConfigSpec returned by DVPortgroupRollback_Task to reset the portgroup to a previous state.

The following privileges are required to reconfigure a portgroup.

- DVPortgroup.PolicyOp if you are changing the policy of the portgroup.
- DVPortgroup.ScopeOp if you are changing the scope of the portgroup.
- DVPortgroup.Modify for anything else.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the DistributedVirtualPortgroup used to make the method call.
spec P | DVPortgroupConfigSpec | Configuration data for the portgroup. Since vSphere API 4.0

P Required privilege: spec

Return Value

Type | Description
--- | ---
ManagedObjectReference to a VslmTask |

Faults

Type | Description
--- | ---
ConcurrentAccess |
DuplicateName |
DvsFault | Thrown if spec is not valid.
DvsNotAuthorized | Thrown if login-session's extension key does not match the switch's configured extensionKey.
InvalidName |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None