Skip to main content

VsanVdsSystem

Struct VsanVdsSystem 

Source
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

Source

pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> VsanVdsSystem

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any_ref<'a>(&'a self) -> &'a (dyn Any + 'static)

Cast a reference to Any trait.

Source§

fn as_any_box(self: Box<T>) -> Box<dyn Any>

Cast to a boxed reference to Any trait.

Source§

fn type_id(&self) -> TypeId

Get the underlying type identifier.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<To, T> CastInto<To> for T
where To: CastFrom<T> + ?Sized, T: 'static + ?Sized,

Source§

fn into_ref<'a>(&'a self) -> Option<&'a To>

Casts a reference to a trait object. If the cast fails, std::option::Option::None is returned.
Source§

fn into_box(self: Box<T>) -> Result<Box<To>, Box<dyn Any>>

Casts a boxed trait object to another trait object. If the cast fails, the original boxed trait object is returned in std::result::Result::Err.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,