pub struct VsanVdsSystem { /* private fields */ }Expand description
vSAN optimized methods for performing VDS related operations, especially migrations from VSS to VDS.
In every vCenter server there is a singleton instance of this class with the Managed Object ID of ‘vsan-vds-system’.
Implementations§
Source§impl VsanVdsSystem
impl VsanVdsSystem
pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self
Sourcepub async fn vsan_rollback_vds_to_vss(
&self,
task: &ManagedObjectReference,
) -> Result<bool>
pub async fn vsan_rollback_vds_to_vss( &self, task: &ManagedObjectReference, ) -> Result<bool>
Rollback the change committed by the VsanVdsSystem.VsanVdsMigrateVss
Required privileges: Host.Config.Storage
§Parameters:
§task
The task associated with the change committed by the VsanVdsMigrateVss
Refers instance of Task.
§Returns:
Always return True
§Errors:
NotFound: Task not found
VsanFault: Any unexpected runtime error.
Sourcepub async fn vsan_vds_get_migration_plan(
&self,
cluster: &ManagedObjectReference,
vswitch_name: Option<&str>,
vds_name: Option<&str>,
vmnic_devices: Option<&[String]>,
infra_vm: Option<&[ManagedObjectReference]>,
vds: Option<&ManagedObjectReference>,
hosts: Option<&[ManagedObjectReference]>,
) -> Result<VsanVdsMigrationPlan>
pub async fn vsan_vds_get_migration_plan( &self, cluster: &ManagedObjectReference, vswitch_name: Option<&str>, vds_name: Option<&str>, vmnic_devices: Option<&[String]>, infra_vm: Option<&[ManagedObjectReference]>, vds: Option<&ManagedObjectReference>, hosts: Option<&[ManagedObjectReference]>, ) -> Result<VsanVdsMigrationPlan>
Computes a migration plan to convert the VSS instances per host in the cluster to a newly created VDS.
The VDS preserves all settings
of the VSS, and all consumers (vmknics, VM vNICs, pNICs) are
considered as part of the migration. The VSS vSwitch and portgroup
instances across the hosts are matched to each other by common name.
It is expected that hosts have a uniform configuration, and issues
will be raised in the migration plan if deviations are found. Any
deviations will still be carried over, but may require renaming of
portgroups and additional VDS portgroups to resolve the conflicts.
The migration plan is defined to be safe, i.e., the effective data
path for all impacted VMs, vmknics and so on are going to be
using the same settings as before the migration. The only change
will be in any additional pNICs added as part of the migration.
Note: This API can also be used to create a new VDS without any
portgroups, but with the physical NICs attached, and with good
settings for vSAN, by simply passing the vswitchName as NULL.
§Parameters:
§cluster
Hosts of this cluster will be migrated to the new VDS
Required privileges: System.Read
Refers instance of ComputeResource.
§vswitch_name
Name of the original VSS vSwitch
§vds_name
Name of the new VDS. Only required for the creation of a new VDS
§vmnic_devices
Physical NICs that are currently unused to be attached to the new vDS.
§infra_vm
Infrastructure VMs that will be handled specially during migration.
Refers instances of VirtualMachine.
§vds
The VDS which the hosts are connected to. Set this parameter when existing VDS can be leveraged.
Refers instance of VmwareDistributedVirtualSwitch.
§hosts
hosts in the cluster to be migrated to the VDS. Leave this field empty if all the hosts in the cluster needs to be migrated.
Refers instances of HostSystem.
§Returns:
Detailed migration plan.
§Errors:
NotFound: when specified cluster doesn’t exist.
VsanFault: Any unexpected runtime error.
InvalidArgument: When hosts with invalid or inconsistent configuration are found.
Sourcepub async fn vsan_vds_migrate_vss(
&self,
cluster: &ManagedObjectReference,
migration_plan: Option<&VsanVdsMigrationPlan>,
vswitch_name: Option<&str>,
vds_name: Option<&str>,
vmnic_devices: Option<&[String]>,
infra_vm: Option<&[ManagedObjectReference]>,
vds: Option<&ManagedObjectReference>,
hosts: Option<&[ManagedObjectReference]>,
) -> Result<ManagedObjectReference>
pub async fn vsan_vds_migrate_vss( &self, cluster: &ManagedObjectReference, migration_plan: Option<&VsanVdsMigrationPlan>, vswitch_name: Option<&str>, vds_name: Option<&str>, vmnic_devices: Option<&[String]>, infra_vm: Option<&[ManagedObjectReference]>, vds: Option<&ManagedObjectReference>, hosts: Option<&[ManagedObjectReference]>, ) -> Result<ManagedObjectReference>
Perform a migration to convert the VSS instances per host in the cluster to a newly created VDS.
The VDS preserves all settings
of the VSS, and all consumers (vmknics, VM vNICs, pNICs) are
considered as part of the migration. The VSS vSwitch and portgroup
instances across the hosts are matched to each other by common name.
It is expected that hosts have a uniform configuration, and issues
will be raised in the migration plan if deviations are found. Any
deviations will still be carried over, but may require renaming of
portgroups and additional VDS portgroups to resolve the conflicts.
The migration plan is defined to be safe, i.e., the effective data
path for all impacted VMs, vmknics and so on are going to be
using the same settings as before the migration. The only change
will be in any additional pNICs added as part of the migration.
Note: This API can also be used to create a new VDS without any
portgroups, but with the physical NICs attached, and with good
settings for vSAN, by simply passing the vswitchName as NULL.
If a migration plan is passed in, the API makes sure that no
changes have happened and that the migration plan is still
current. This can be used to make sure that the migration plan
that the user reviewed doesn’t deviate from the actual migration
performed.
If there are any inaccessible or orphaned VMs found the migration
will not be performed. This is a safety measure as such VMs may
loose their networking.
If there are any inaccessible hosts in the cluster the migration
will fail.
The migration will fail if there is any infraVm on ESX with
version prior to 6.5.0d, due to the missing of API support on the
hosts.
A minimal version of 6.0 is required for all hosts to be migrated
for the NetIOC setup task. Also the VDS version will be 6.0.0 if
there is any 6.0 host to be migrated, otherwise 6.5.0.
This API by default requires DVSwitch.Create and DVSwitch.Modify on RootFolder, and System.Read on cluster. Host.Inventory.EditCluster on hosts is required if hosts parameter is provided.
§Parameters:
§cluster
Hosts of this cluster will be migrated to the new VDS
Refers instance of ComputeResource.
§migration_plan
Detailed migration plan
§vswitch_name
Name of the original VSS vswitch
§vds_name
Name of the new VDS. Only required for the creation of a new VDS
§vmnic_devices
Physical NICs that are currently unused to be attached to the new VDS.
§infra_vm
Infrastructure VMs that will be handled specially during migration.
Refers instances of VirtualMachine.
§vds
The VDS which the hosts are connected to. Set this parameter when existing VDS can be leveraged.
Refers instance of VmwareDistributedVirtualSwitch.
§hosts
hosts in the cluster to be migrated to the VDS. Leave this field empty if all the hosts in the cluster needs to be migrated.
Refers instances of HostSystem.
§Returns:
The task associated with the migration
Refers instance of Task.
§Errors:
NotFound: when specified cluster doesn’t exist.
VsanFault: Any unexpected runtime error.
InvalidArgument: When hosts with invalid or inconsistent configuration are found.
Sourcepub async fn vsan_vss_migrate_vds(
&self,
cluster: Option<&ManagedObjectReference>,
hosts: Option<&[ManagedObjectReference]>,
vds: &ManagedObjectReference,
vswitch_name: Option<&str>,
vmnic_devices: Option<&[String]>,
infra_vm: Option<&[ManagedObjectReference]>,
) -> Result<ManagedObjectReference>
pub async fn vsan_vss_migrate_vds( &self, cluster: Option<&ManagedObjectReference>, hosts: Option<&[ManagedObjectReference]>, vds: &ManagedObjectReference, vswitch_name: Option<&str>, vmnic_devices: Option<&[String]>, infra_vm: Option<&[ManagedObjectReference]>, ) -> Result<ManagedObjectReference>
Perform a migration to convert the VDS instance in the cluster to a newly created VSS on each host.
The VSS preserves all settings of the VDS, and all consumers (vmknics, VM vNICs, pNICs) are considered as part of the migration. The VSS vSwitch and portgroup instances on the VDS are matched to each other by common name. It is expected that hosts have a uniform configuration. The VDS will be deleted if no hosts and virtual machines are connected to this VDS after the migration completes. If there are any inaccessible or orphaned VMs found, the migration will not be performed. This is a safety measure as such VMs may lose their networking. If there are any inaccessible hosts in the cluster the migration will fail as well.
This API requires DVSwitch.Delete and DVSwitch.Modify on vds, extra privilege check might be needed depends on what is being migrated.
- Host.Inventory.EditCluster on cluster if hosts of the specified cluster to be migrated to the VDS
- Host.Inventory.EditCluster on all the hosts specified in hosts parameter
§Parameters:
§cluster
Hosts of this cluster will be migrated from the specified VDS to the new VSS.
Refers instance of ComputeResource.
§hosts
Individual hosts to be migrated from the VDS to the VSS.
Refers instances of HostSystem.
§vds
The VDS which the hosts in the cluster are connected to.
Refers instance of VmwareDistributedVirtualSwitch.
§vswitch_name
Name of the new VSS to be migrated to.
§vmnic_devices
Physical NICs that are currently unused to be attached to the new VSS.
§infra_vm
Infrastructure VMs that will be handled specially during migration.
Refers instances of VirtualMachine.
§Returns:
The task associated with the migration
Refers instance of Task.
§Errors:
NotFound: when specified cluster doesn’t exist.
VsanFault: Any unexpected runtime error.
Trait Implementations§
Source§impl Clone for VsanVdsSystem
impl Clone for VsanVdsSystem
Source§fn clone(&self) -> VsanVdsSystem
fn clone(&self) -> VsanVdsSystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more