Files
deb-python-pyvmomi/docs/vim/dvs/DistributedVirtualSwitchManager.rst
Shawn Hartsock 15f7be9a52 pyVmomi reStructured Text Documentation
This external documentation for pyVmomi was generated using Googly Docs
(aka Google Standard Documentation) which renders very cleanly in
GitHub. Internal documentation for a class should be done in Sphinx
format because tools like pyCharm and Eclipse can use that documentation
as a hint for code completion.

Note: External docs as Googly Docs, internal docs as Sphinx.

Closes bug#15
2014-06-17 14:07:42 -04:00

13 KiB

vim.dvs.DistributedVirtualSwitchManager

The DistributedVirtualSwitchManager provides methods that support the following operations:
since

vSphere API 4.0

Attributes

Methods

QueryAvailableDvsSpec():

This operation returns a list of switch product specifications that are supported by the vCenter Server.

Privilege:

System.View

Args:

Returns:

vim.dvs.ProductSpec:

QueryCompatibleHostForNewDvs(container, recursive, switchProductSpec):

This operation returns a list of hosts that are compatible with the given DistributedVirtualSwitch product specification.

Privilege:

System.View

Args:
container (vim.ManagedEntity):

Where to look for hosts. Supported types of objects for this parameter are Datacenter , ComputeResource and Folder .

recursive (bool):

Whether to search for hosts in the subfolders, if applicable. In the case when container is a Datacenter , the recursive flag is applied to its HostFolder.

switchProductSpec (vim.dvs.ProductSpec, optional):

The productSpec of a DistributedVirtualSwitch . If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

Returns:

vim.HostSystem:

Raises:

vmodl.fault.InvalidArgument:

If the productSpec value is not valid or recognized.

QueryCompatibleHostForExistingDvs(container, recursive, dvs):

This operation returns a list of hosts that are compatible with the given DistributedVirtualSwitch product specification.

Privilege:

System.View

Args:
container (vim.ManagedEntity):

Where to look for hosts. Supported types of objects for this parameter are Datacenter , ComputeResource and Folder .

recursive (bool):

Whether to search for hosts in the subfolders, if applicable. In the case when container is a Datacenter , the recursive flag is applied to its HostFolder.

dvs (vim.DistributedVirtualSwitch):

Search the host based on the specification published in the compatibleHostComponentProductInfo of a DistributedVirtualSwitch . If not set, it is assumed to be the specification that a DistributedVirtualSwitch would have if it is created with the default DistributedVirtualSwitchProductSpec .

Returns:

vim.HostSystem:

Raises:

vmodl.fault.InvalidArgument:

If the switch value is not valid or recognized.

QueryDvsCompatibleHostSpec(switchProductSpec):

This operation returns a list of host product specifications that are compatible with the given DistributedVirtualSwitch product specification.

Privilege:

System.View

Args:
switchProductSpec (vim.dvs.ProductSpec, optional):

The productSpec of a DistributedVirtualSwitch . If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

Returns:

vim.dvs.HostProductSpec:

Raises:

vmodl.fault.InvalidArgument:

If the switchProductSpec value is not valid or recognized.

QueryDvsFeatureCapability(switchProductSpec):

This operation indicates which version-specific DVS features are available for the given DistributedVirtualSwitch product specification. since: vSphere API 4.1

Privilege:

System.View

Args:
switchProductSpec (vim.dvs.ProductSpec, optional):

The productSpec of a DistributedVirtualSwitch . If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

Returns:

vim.DistributedVirtualSwitch.FeatureCapability:

Raises:

vmodl.fault.InvalidArgument:

If the switchProductSpec value is not valid or recognized.

QueryDvsByUuid(uuid):

This operation returns a DistributedVirtualSwitch given a UUID.

Privilege:

System.View

Args:

uuid (str):

Returns:

vim.DistributedVirtualSwitch:

Raises:

vim.fault.NotFound:

If a switch with the UUID doesn't exist.

QueryDvsConfigTarget(host, dvs):

This operation returns the DistributedVirtualSwitch or DistributedVirtualPortgroup configuration target on a host.

Privilege:

System.View

Args:
host (vim.HostSystem, optional):

The host on which the query is to be made. If called directly on the host this parameter need not be specified.

dvs (vim.DistributedVirtualSwitch, optional):

The distributed virtual switch on which the query is to be made. If unspecified the config target will encompass all the distributed virtual switches available on the host.

Returns:

vim.dvs.DistributedVirtualSwitchManager.DvsConfigTarget:

QueryDvsCheckCompatibility(hostContainer, dvsProductSpec, hostFilterSpec):
This operation returns a list of compatibility results. Each compatibility result is an object that has a host property and optionally a fault which would be populated only if that host is not compatible with a given dvsProductSpec. All filters in hostFilerSpecs are ANDed to derive the intersection of hosts against which compatibility is checked. If caller did not have view privileges on the host entity in an element of the CompatibilityResult array, then that entire element would be removed from the CompatibilityResult array. Typical uses:
  • For the createDVS situation, hostFilterSpec is of type HostDvsFilterSpec and DvsProductSpec will have newSwitchProductSpec set.
  • For the Add-Host-To-DVS situation, you can use either HostDvsFilterSpec or HostDvsMembershipFilter with inclusive being false, and pass the DVS in DvsProductSpec.
  • For the Upgrade-DVS situation, you can use either HostDvsFilterSpec or HostDvsMembershipFilter with inclusive being true, and pass the new desired ProductSpec for DVS in newSwitchProductSpec.

since: vSphere API 4.1

Privilege:

System.View

Args:
hostContainer (vim.dvs.DistributedVirtualSwitchManager.HostContainer):

The container of hosts on which we check the compatibility. This container can be a datacenter, folder, or computeResource. We can also include all the hosts in the hierarchy with container as root of the tree.

dvsProductSpec (vim.dvs.DistributedVirtualSwitchManager.DvsProductSpec, optional):

The productSpec of a DistributedVirtualSwitch. If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation for current version.

hostFilterSpec (vim.dvs.DistributedVirtualSwitchManager.HostDvsFilterSpec, optional):

The hosts against which to check compatibility. This is a filterSpec and users can use this to specify all hosts in a container (datacenter, folder, or computeResource), an array of hosts, or hosts that might or might not be a DVS member.

Returns:

vim.dvs.DistributedVirtualSwitchManager.CompatibilityResult:

Raises:

vmodl.fault.InvalidArgument:

If the dvsProductSpec value is not valid or recognized.

RectifyDvsOnHost(hosts):

Update the Distributed Switch configuration on the hosts to bring them in sync with the current configuration in vCenter Server. since: vSphere API 5.0

Privilege:

System.Read

Args:
hosts (vim.HostSystem):

The hosts to be rectified.

Returns:

vim.Task:

Raises:

vim.fault.DvsFault:

if operation fails on any host or if there are other update failures.

DVSManagerExportEntity(selectionSet):

Export the configuration for entities specified in theselectionSetparameter. You can use this method only for a VmwareDistributedVirtualSwitch and its associated DistributedVirtualPortgroup objects.Use the DVSManagerImportEntity_Task method to restore the entity to the state represented by the exported configuration. You can also use the exported configuration to create a new switch or portgroup. since: vSphere API 5.1

Privilege:

dynamic

Args:
selectionSet (vim.SelectionSet):

The selection criteria for a set of entities to export the configuration.

Returns:

vim.Task:

Raises:

vim.fault.NotFound:

If entity in selectionSet doesn't exist.

vim.fault.BackupBlobWriteFailure:

if failed to create backup config blob.

DVSManagerImportEntity(entityBackup, importType):

Import the configuration of entities specified in EntityBackupConfig . You can restore the existing configuration to the state represented by the backup configuration. You can also use the backup configuration to create a new switch or portgroup. See EntityImportType . since: vSphere API 5.1

Privilege:

dynamic

Args:
entityBackup (vim.dvs.EntityBackup.Config):

Configuration of one or more entities to be imported. The entity backup configuration is returned by the DVSManagerExportEntity_Task method.

importType (str):

Specifies whether to create a new configuration or restore a previous configuration. See EntityImportType for valid values.

Returns:

vim.Task:

Raises:

vim.fault.DvsFault:

if operation fails on any host.

vim.fault.NotFound:

If entity in key doesn't exist.

DVSManagerLookupDvPortGroup(switchUuid, portgroupKey):

Returns the portgroup identified by the key within the specified VDS identified by its UUID. since: vSphere API 5.1

Privilege:

System.View

Args:
switchUuid (str):

The UUID of the DistributedVirtualSwitch .

portgroupKey (str):

The key that identifies a DistributedVirtualPortgroup .

Returns:

vim.dvs.DistributedVirtualPortgroup:

Raises:

vim.fault.NotFound:

If the portgroup for the specified inputs was not found.

vmodl.fault.NotSupported:

If the operation is not supported.