<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VMware PowerCLI Blog</title>
	<atom:link href="https://blogs.vmware.com/PowerCLI/feed" rel="self" type="application/rss+xml" />
	<link>https://blogs.vmware.com/PowerCLI</link>
	<description>PowerCLI is the best tool for automating management and configuration of VMware vSphere</description>
	<lastBuildDate>Thu, 26 Oct 2023 11:50:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>PowerCLI and vSAN: A Comprehensive Guide to vSAN Disk Management</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/08/powercli-and-vsan-a-comprehensive-guide-to-vsan-disk-management.html</link>
		
		<dc:creator><![CDATA[Nichole Yang]]></dc:creator>
		<pubDate>Fri, 04 Aug 2023 09:37:16 +0000</pubDate>
				<category><![CDATA[Storage]]></category>
		<category><![CDATA[disk management]]></category>
		<category><![CDATA[vSAN]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4565</guid>

					<description><![CDATA[<div><img width="300" height="136" src="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1024x464.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-768x348.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1536x696.jpg 1536w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-600x272.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1.jpg 1850w" sizes="(max-width: 300px) 100vw, 300px" /></div>In this blog post, we&#8217;ll explore the powerful capabilities of PowerCLI in managing disks within a vSAN cluster and vSAN ESA enabled cluster. Disk management is a critical aspect of maintaining an efficient and optimized virtual storage infrastructure. With the help of specific PowerCLI cmdlets for vSAN cluster, we can manage vSAN disk groups, such as &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/08/powercli-and-vsan-a-comprehensive-guide-to-vsan-disk-management.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="136" src="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1024x464.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-768x348.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1536x696.jpg 1536w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-600x272.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1.jpg 1850w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>In this blog post, we&#8217;ll explore the powerful capabilities of PowerCLI in managing disks within a vSAN cluster and vSAN ESA enabled cluster. Disk management is a critical aspect of maintaining an efficient and optimized virtual storage infrastructure. <span class="inline-comment-marker" data-ref="2eeaa478-63e5-46ab-88a0-328e5488afb6">With the help of specific PowerCLI cmdlets for vSAN cluster, we can manage vSAN disk groups, such as New-VsanDiskGroup, New-VsanDisk, Get-VsanDisk, Remove-VsanDisk, Get-VsanDiskGroup, and Remove-VsanDiskGroup. With Get-VsanEsaEligibleDisk, Add-VsanStoragePoolDisk, Remove-VsanStoragePoolDisk, we can streamline our vSAN ESA storage pool disk management tasks and ensure smooth operations within vSAN or vSAN ESA environment</span>. Let&#8217;s dive in!</p>
<h2 id="UnleashingthePowerofPowerCLI:AComprehensiveGuidetovSANDiskManagement-ManagingvSANDisksGroupsandvSANDisks">Managing vSAN Disks Groups and vSAN Disks</h2>
<p>In vSAN clusters, vSAN architecture consists of two tiers: a cache tier for the purpose of read caching and write buffering, and a capacity tier for persistent storage. This <span class="inline-comment-marker" data-ref="d386394c-2e00-498b-8b4f-7d3c4f55eae1">two-tier</span> design offers supreme performance to VMs while ensuring that data is written to devices in the most efficient way. vSAN uses a logical construct called disk groups to manage the relationship between capacity devices and their cache tier.</p>
<h3 id="UnleashingthePowerofPowerCLI:AComprehensiveGuidetovSANDiskManagement-ManagingvSANDiskGroups">Managing vSAN Disk Groups</h3>
<p>1. Creating a New Disk Group</p>
<p>To create a new disk group with specific solid-state and hard disk devices, we can <span class="inline-comment-marker" data-ref="b2bcfddc-ef94-4c53-8676-c5292fcd0ba9">use</span> the New-VsanDiskGroup cmdlet. For example, let&#8217;s create a new disk group with an SSD and two data disks:</p>
<p class="p1"><code></code></p>
<p></p><pre class="crayon-plain-tag">New-VsanDiskGroup -VMHost $vmHost -SsdCanonicalName $MySsdCanonicalName -DataDiskCanonicalName $DataDisk1,$DataDisk2</pre><p></p>
<p class="p1"><code></code></p>
<p class="p1"><code></code></p>
<p>2. Fetching vSAN Disk Groups</p>
<p>To retrieve information about vSAN disk groups, we can use the Get-VsanDiskGroup cmdlet. For instance, to fetch the disk group &#8220;<span class="inline-comment-marker" data-ref="6e32e2d0-41a6-49e6-a0c2-6864f77114c0">DiskGroup02</span>&#8221; we can execute the following command. T<span class="inline-comment-marker" data-ref="dcc0d445-d012-4342-a0f3-899324a7720d">he output will the type of VsanDiskGroup.</span></p>
<p class="p1"><code></code></p>
<p></p><pre class="crayon-plain-tag">Get-VsanDiskGroup -Name "DiskGroup02"</pre><p></p>
<p class="p1"><code></code></p>
<p class="p1"><code></code></p>
<p class="p1">3. Removing vSAN Disk Groups</p>
<p>If we need to remove a vSAN disk group, we can use the Remove-VsanDiskGroup cmdlet. We can reuse the result from the Get-VsanDiskGroup command.</p><pre class="crayon-plain-tag">$diskGroup = Get-VsanDiskGroup -DiskCanonicalName $DiskCanonicalName -VMHost $vmHost
Remove-VsanDiskGroup&amp;nbsp;-VsanDiskGroup $diskGroup -Confirm:$false</pre><p>vSAN disk groups consist of vSAN disks. We can, therefore,  manage vSAN disks within vSAN disk groups.</p>
<p>4. Adding vSAN Disks to an existing Disk Group</p>
<p>To add a vSAN disk to an existing disk group, we can <span class="inline-comment-marker" data-ref="4794c006-6a11-49bd-b56a-9650722400c8">use</span> the New-VsanDisk cmdlet. For example, we can use the New-VsanDisk cmdlet to add a new disk, <span class="inline-comment-marker" data-ref="0dd37dce-6866-474d-97d4-0d6c341272e2">&#8220;DiskCanonicalName&#8221;</span> to this disk group:</p>
<p><code></code></p><pre class="crayon-plain-tag">New-VsanDisk -CanonicalName "mpx.vmhba0:C0:T11:L0" -VsanDiskGroup $vsanDiskGroup</pre><p><code></code></p>
<p><code></code></p>
<p>5. Fetching vSAN Disks</p>
<p>To fetch vSAN disks based on their ID or disk group information, we can use the Get-VsanDisk cmdlet. For instance, to retrieve information about all disks in a specified vSAN disk group we can execute the following command:</p><pre class="crayon-plain-tag">Get-VsanDisk -VsanDiskGroup $vsanDiskGroup</pre><p>6. Removing vSAN Disks from a Disk Group</p>
<p>If we need to remove a vSAN disk from a disk group, the Remove-VsanDisk cmdlet comes to our rescue. Let&#8217;s remove &#8220;mpx.vmhba0:C0:T11:L0&#8221; disk by <span class="inline-comment-marker" data-ref="ea3ec97c-b31e-4157-8a25-70e8724d2aa2">using</span> the following command:</p><pre class="crayon-plain-tag">$vsanDisk = Get-VsanDisk -CanonicalName "mpx.vmhba0:C0:T11:L0"
Remove-VsanDisk -VsanDisk $vsanDisk -Confirm:$false</pre><p></p>
<h2 id="UnleashingthePowerofPowerCLI:AComprehensiveGuidetovSANDiskManagement-IntroducingStoragePoolDisksinvSANESA">Introducing Storage Pool Disks in vSAN ESA</h2>
<p>In the vSAN 8.0, we introduced a new storage architecture. In <a href="https://core.vmware.com/blog/introduction-vsan-express-storage-architecture">vSAN ESA</a> (Express Storage Architecture), we <span class="inline-comment-marker" data-ref="83589bcd-2901-4119-ac3c-e5c8c62030a2">introduced</span> a new storage format called storage pool disks. These disks provide a more efficient and simplified approach to adding, removing, and managing storage within the ESA environment.</p>
<p class="p">We can claim disks to define a storage pool on a <span class="ph productname">vSAN</span> host. Each host that contributes storage contains a single storage pool of flash devices. Each flash device provides caching and capacity to the cluster. We can create a storage pool with any devices that are compatible for ESA. <span class="ph productname">vSAN</span> creates only one storage pool per host.</p>
<p class="p">In a storage pool, each device provides both caching and capacity in a single tier. This is different from a Disk Group, which has dedicated devices in different tiers of cache and capacity.</p>
<p class="p">Before we add storage pool disks, we can see which one is available to add by using the Get-VsanEsaEligibleDisk cmdlet. The output will be the ScsiLun type.</p>
<p></p><pre class="crayon-plain-tag">Get-VsanEsaEligibleDisk -Cluster $cluster</pre><p><span class="token-powershell variable"><span class="token-powershell function">When we know the disk canonical name from ScsiLun, we can claim disks to define the storage pool on a specified host.<br />
</span></span></p><pre class="crayon-plain-tag">Add-VsanStoragePoolDisk -VMHost (Get-VMHost "MyVMHost") -VsanStoragePoolDiskType "singleTier" -DiskCanonicalName ("mpx.vmhba0:C0:T11:L0","mpx.vmhba0:C0:T12:L0")</pre><p><span class="token-powershell variable">Also, we can query the storage pool disk with the specified VMHost or Cluster, and remove the disk from the defined storage pool disk.</span></p><pre class="crayon-plain-tag">$disks =get-vsanstoragepooldisk -VMHost (Get-VMHost 10.192.201.50)

Remove-VsanStoragePoolDisk -VsanStoragePoolDisk $disks -VsanDataMigrationMode nodatamigration -Purpose "test" -Confirm:$false</pre><p>&nbsp;</p>
<p>By harnessing the power of PowerCLI and leveraging its rich features, you can simplify and optimize your storage infrastructure, ensuring smooth operations within your vSAN cluster.</p>
<p><span class="inline-comment-marker" data-ref="dba1c815-b7de-4f49-8b7f-7a0fcbcf1ea8">Happy disk management with PowerCLI in your vSAN environment!</span></p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerCLI and vSAN: Exploring Remote Datastore Mounting</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/07/powercli-and-vsan-exploring-remote-datastore-mounting.html</link>
		
		<dc:creator><![CDATA[Nichole Yang]]></dc:creator>
		<pubDate>Tue, 25 Jul 2023 13:46:23 +0000</pubDate>
				<category><![CDATA[Storage]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4528</guid>

					<description><![CDATA[<div><img width="300" height="136" src="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1024x464.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-768x348.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1536x696.jpg 1536w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-600x272.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1.jpg 1850w" sizes="(max-width: 300px) 100vw, 300px" /></div>In the ever-evolving world of PowerCLI, each release brings exciting updates and enhancements to vSAN. With new cmdlets and vSAN APIs, managing your virtual storage infrastructure becomes even more efficient and powerful. One of the recent additions to PowerCLI is the support for remote datastore related features, opening up new possibilities for vSAN clusters. Now, &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/07/powercli-and-vsan-exploring-remote-datastore-mounting.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="136" src="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-300x136.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1024x464.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-768x348.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-1536x696.jpg 1536w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1-600x272.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/07/vsan-product-ico-rgb_400px_1.jpg 1850w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>In the ever-evolving world of PowerCLI, each release brings exciting updates and enhancements to vSAN. With new cmdlets and vSAN APIs, managing your virtual storage infrastructure becomes even more efficient and powerful. One of the recent additions to PowerCLI is the support for remote datastore related features, opening up new possibilities for vSAN clusters.</p>
<p>Now, vSAN clusters have the ability to share their datastores with other vSAN clusters, or even beyond a single vCenter Server. The beauty of this functionality lies in the flexibility it offers. Any compatible vSAN cluster can act as a server, allowing other vSAN clusters to mount its local datastores. This opens up a world of potential use cases and enables efficient data sharing across clusters.</p>
<p>But how do you go about mounting a remote datastore using PowerCLI? Fear not, as I&#8217;ll guide you through the process using PowerCLI cmdlets in various scenarios.</p>
<h2 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-ManagingvSANRemoteDatastores">Managing vSAN Remote Datastores</h2>
<p class="p1">Starting from PowerCL 12.7, we have introduced support for querying, mounting, and unmounting remote datastores for a specific cluster using the Get-VsanClusterConfiguration and Set-VsanClusterConfiguration cmdlets. Let&#8217;s delve into the details and discover how these cmdlets can empower you in managing remote datastores.</p>
<h3 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-Querythemountedremotedatastores">Query the mounted remote datastores</h3>
<p>By utilizing the Get-VsanClusterConfiguration cmdlet, we gain access to view all the properties of the vSAN configuration within the specific cluster. This includes crucial information about the mounted remote datastores.</p>
<p>In addition to accessing the overall vSAN configuration, we can specifically retrieve the value of the RemoteDatastore property by using a simple dot notation. This allows us to obtain accurate details about the remote datastores and their current status.</p><pre class="crayon-plain-tag">Get-VsanClusterConfiguration -Cluster "MyCluster" | select *
$vsanConfiguration = Get-VsanClusterConfiguration -Cluster "MyCluster"
$vsanConfiguration.RemoteDatastore</pre><p></p>
<h3 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-Mount/Unmounttheremotedatastore">Mount / Unmount the remote datastore</h3>
<p>As we intend to modify the vSAN configuration setting, we will utilize the Set-VsanClusterConfiguration cmdlet. To do so, it is necessary to retrieve the original vSAN cluster configuration beforehand <span class="inline-comment-marker" data-ref="39818c1c-86ee-49cd-95e7-d8dbaaa52aae">with the Get-VsanClusterConfiguration cmdlet</span>.</p>
<p class="p1"><sup><code></code></sup></p>
<p></p><pre class="crayon-plain-tag">$config = Get-VsanClusterConfiguration -Cluster "MyCluster"
Set-VsanClusterConfiguration -Configuration $config -MountRemoteDatastore (Get-Datastore -Name "MyDatastore")

#If we want to unmount the existing remote datastore, we can go fetch the current vSAN configuration again
$newVsanConfiguration = Get-VsanClusterConfiguration -Cluster "MyCluster"
Set-VsanClusterConfiguration -Configuration $newVsanConfiguration -UnMountRemoteDatastore $newVsanConfiguration.RemoteDatastore</pre><p></p>
<p class="p1"><sup><code></code></sup></p>
<p class="p1"><sup><code></code></sup></p>
<h3 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-Mount/Unmounttheremotedatastorefromthestretchedcluster">Mount / Unmount the remote datastore from the stretched cluster</h3>
<p>In the latest PowerCLI <span class="inline-comment-marker" data-ref="29043fad-fd03-4cd8-ab23-cad507d4ac2c">13.1 release</span>, which supports vSAN 8.0 Update 1, we&#8217;re thrilled to introduce the ability to mount remote datastores from both stretched clusters and vSAN ESA (Express Storage Architecture) enabled clusters. If you want to mount or unmount the remote datastore from a vSAN ESA enabled cluster, the operation would be the same as the first scenario, the normal vSAN cluster, and no additional settings are required. Let&#8217;s take a look at the configuration steps involved when mounting from stretched clusters</p>
<p><strong><span class="inline-comment-marker" data-ref="810e7a28-894d-4fc9-92fa-6de24c75769d">Mounting the Remote Datastore from Stretched Clusters</span></strong></p>
<p>When dealing with stretched clusters, an additional configuration step is necessary to ensure seamless remote datastore mounting. Specifically, you&#8217;ll need to configure the RemoteVsanServerClusterConfig as outlined below.</p>
<p><strong><span class="inline-comment-marker" data-ref="0db1f5f6-4bd4-4812-888d-b32ec48a1c7d">Understanding the NetworkTopology Parameter</span></strong></p>
<p>The NetworkTopology parameter plays a crucial role in defining the network topology between the client and server clusters in an HCI Mesh configuration. It offers two values: Asymmetric and Symmetric. In a Symmetric configuration, no ServerSiteName or ClientSiteName is required. However, in an Asymmetric configuration, the ServerSiteName becomes necessary and represents the fault domain of the stretched cluster, <span class="inline-comment-marker" data-ref="69565ecc-3dee-41af-a1d6-648ef6ad927e">which is</span> referred to as &#8220;Preferred&#8221; or &#8220;Secondary&#8221;. Additionally, if both the host cluster and server cluster are stretched clusters, the ClientSiteName is also required.</p>
<p>Below are some sample configurations for different RemoteVsanServerClusterConfig scenarios.</p><pre class="crayon-plain-tag">$serverconfig = New-RemoteVsanServerClusterConfig -cluster $clusterServer -networktopology "Symmetric" 
$serverconfig = New-RemoteVsanServerClusterConfig -cluster $clusterServer -networktopology "Asymmetric" -ServerSiteName "Secondary"
$serverconfig = New-RemoteVsanServerClusterConfig -cluster $clusterServer -networktopology "Asymmetric" -ServerSiteName "Secondary" -ClientSiteName "Preferred"

Set-VsanClusterConfiguration -configuration $clusterClient -MountRemoteDatastore $datastore -RemoteVsanServerClusterConfig $serverconfig</pre><p></p>
<p class="p1">When unmounting a remote datastore from the stretched cluster, it is <span class="inline-comment-marker" data-ref="bca108d4-fea3-4a82-9f9d-f336bbc8318c">enough</span> to pass the UnmountRemoteDatastore parameter. The RemoteVsanServerClusterConfig will be automatically adjusted and cleared accordingly.</p>
<p></p><pre class="crayon-plain-tag">Set-VsanClusterConfiguration -configuration $config -UnmountRemoteDatastore $datastore</pre><p></p>
<h3 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-Mount/UnmounttheremotedatastorefromanothervCenterServersystem" class="p1">Mount / Unmount the remote datastore from another vCenter Server system</h3>
<p>In PowerCLI13.1, we also have the capability to mount and unmount remote datastores from another <span class="inline-comment-marker" data-ref="e64dbf0c-e0c2-4b50-91cd-95719ed86621">vCenter Server System</span>, allowing for cross-vCenter remote datastore operations.</p>
<h3>Adding Datastore Source to the current vCenter Server system</h3>
<p>Before we can proceed with mounting the Cross-vCenter (XVC) remote datastore, we need to add the datastore source to the <span class="inline-comment-marker" data-ref="1b3d1fe6-b6e2-4cc6-8668-8cf9e0aef8f6">current vCenter</span> Server system by <span class="inline-comment-marker" data-ref="cd0f05b8-ccdc-4ada-b51e-eeb148b23dee">using</span> the appropriate credentials. This step ensures that the target <span class="inline-comment-marker" data-ref="82db671b-c2a4-47a6-8589-c1e0a02e071f">vCenter</span> Server can be accessed as another datastore source. To achieve this, we can utilize the New-VsanHCIMeshDatastoreSource cmdlet, where the VCHost parameter specifies the target vCenter that we want to add as a datastore source.</p><pre class="crayon-plain-tag">New-VsanHCIMeshDatastoreSource -VCHost 'MyAnotherVCIP' -User 'administrator@vsphere.local'  -Password 'MyVCPassword'</pre><p></p>
<h3>Retrieving HCI Mesh Datastore</h3>
<p>Once we&#8217;ve successfully added the datastore source, we can retrieve the datastore and fetch the HCI mesh datastore from the specified source. This retrieval process allows us to access the necessary data and information required for further operations.</p><pre class="crayon-plain-tag">$dsSource = Get-VsanHCIMeshDatastoreSource -VCHost 'MyVCIP'
$ds = Get-VsanHCIMeshDatastore -VsanHCIMeshDatastoresource $dsSource</pre><p></p>
<h3>Mounting and Unmounting Remote Datastores</h3>
<p>With the retrieved HCI mesh datastore at our disposal, we can now proceed to mount or unmount the remote datastore by <span class="inline-comment-marker" data-ref="6fa23cb2-9d6e-40b5-ad49-0a92bbc38292">using</span> the MountXVCDatastore or UnmountXVCDatastore parameters. With these parameters, you can execute the desired operations efficiently.</p><pre class="crayon-plain-tag">Set-VsanClusterConfiguration -Configuration $clusterClient -MountXVCDatastore $ds

Set-VsanClusterConfiguration -Configuration $clusterClient -UnmountXVCDatastore $ds</pre><p></p>
<h3 id="PowerCLIandvSAN:ExploringRemoteDatastoreMounting-QuerythemounteddatastorefromanothervCenterServerSystem">Query the mounted datastore from another <span class="inline-comment-marker" data-ref="6bfa2627-4de2-4be1-91fc-52470c7741d6">vCenter Server System</span></h3>
<p>The mounted datastore from another vCenter Server system can be fetched with the <span class="inline-comment-marker" data-ref="f74f4664-e85a-450e-b767-987d34bcb6a3">VsanXVCDatastore parameter</span>.</p>
<p><code></code></p><pre class="crayon-plain-tag">$vsanConfiguration = Get-VsanClusterConfiguration -Cluster "MyCluster"

$vsanConfiguration.VsanXVCDatastore

#output
DatastoreMoID            OwnerVcAddress
----------------------   --------------
Datastore-datastore-17   MyVCIP</pre><p><code></code></p>
<h2>Summary</h2>
<p>In this blog post, we&#8217;ve touched upon the latest advancements in PowerCLI and vSAN, focusing on the ability to mount remote datastores. As we move forward, we&#8217;ll delve deeper into each scenario and provide step-by-step guides on configuring remote datastores for stretched clusters, understanding network topology, implementing the <span class="inline-comment-marker" data-ref="cbbcced4-8c07-4d36-8059-e5af7e415272">RemoteVsanServerClusterConfig cmdlet</span>, and exploring the <span class="inline-comment-marker" data-ref="23d14315-70e8-4eeb-904f-0ceaec1194b8">cross-vCenter</span> remote datastores.</p>
<p>Join us on this thrilling journey as we unlock the full potential of PowerCLI and vSAN, empowering you to optimize your virtual storage infrastructure and harness the benefits of remote datastore mounting. Exciting times lie ahead for vSAN enthusiasts and PowerCLI users alike!</p>
<p>Make sure to stay tuned for our upcoming blog posts as we&#8217;ll unveil more insights, tips, and tricks to enhance your vSAN management experience. Until then, happy exploring!</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Array Based Replication with PowerCLI 13.1</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/06/array-based-replication-with-powercli-13-1.html</link>
		
		<dc:creator><![CDATA[Pavel Dimitrov]]></dc:creator>
		<pubDate>Tue, 06 Jun 2023 08:23:30 +0000</pubDate>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Array Based Replication]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware Site Recovery Manager]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4474</guid>

					<description><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div>This blog post explains how to configure Array Based Replication (ABR) with the PowerCLI VMware.Sdk.Srm module. Before diving in, consider reading the blog post, explaining the basic concepts of the VMware.Sdk.Srm module: &#8220;Managing SRM and VR with PowerCLI 13.1&#8220;. There you can find out more about the module&#8217;s connection management, which will not be covered &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/06/array-based-replication-with-powercli-13-1.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>This blog post explains how to configure Array Based Replication (ABR) with the PowerCLI VMware.Sdk.Srm module. Before diving in, consider reading the blog post, explaining the basic concepts of the VMware.Sdk.Srm module: &#8220;<a href="https://blogs.vmware.com/PowerCLI/2023/06/managing-srm-and-vr-with-powercli-13-1.html">Managing SRM and VR with PowerCLI 13.1</a>&#8220;. There you can find out more about the module&#8217;s connection management, which will not be covered in details here.</p>
<h2>Connect Site Recovery Manager with Connect-SrmSdkServer</h2>
<p>To connect Site Recover Manager server use the Connect-SrmSdkServer cmdlet:</p><pre class="crayon-plain-tag">$srmConnection = Connect-SrmSdkServer -Server &quot;MySrmAddress.com&quot; `
&nbsp;&nbsp; -User &quot;administrator@vsphere.local&quot; `
&nbsp;&nbsp; -Password &quot;MyLocalVcPassword&quot; `
&nbsp;&nbsp; -RemoteUser &quot;administrator@vsphere.local&quot; `
&nbsp;&nbsp; -RemotePassword &quot;MyRemoteVcPassword&quot;</pre><p></p>
<h2>Create Array Managers for the Array Pair</h2>
<p>Before creating the array pair you must create array managers for the local and the remote sites.</p>
<h3>Retrieve Storage Replication Adapter for the local Array Manager</h3>
<p>For this example we will use NetApp Storage Replication Adapter for ONTAP:</p><pre class="crayon-plain-tag">$localAdapter = (Invoke-SrmGetStorageAdapters -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
   -FilterProperty 'Name' `
   -Filter 'NetApp').List[0]</pre><p>Invoke-SrmGetStorageAdapters returns a list of adapters, matching the specified filters. In our case we filter the available storage adapters by their Name property and expect only one adapter with name matching &#8216;NetApp&#8217; to be found. Accordingly we will use the first element of the List property of the StorageAdapterDetailsDrResponseList object, returned from Invoke-SrmGetStorageAdapters.</p>
<h3>Prepare Connection Parameters for the Storage Replication Adapter</h3>
<p>To allow the array manager to communicate with the storage adapter we must prepare connection parameters, which will be used for the connection. Retrieve ConnectionParamGroup object for the local storage adapter:</p><pre class="crayon-plain-tag">$localConnectionParamGroup = (Invoke-SrmGetStorageAdapterConnectionParams `
   -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
   -StorageAdapterId $localAdapter.Id).List[0]</pre><p>The output of Invoke-SrmGetStorageAdapterConnectionParams is a ConnectionParamGroupDrResponseList object, which in our case contains a list of one ConnectionParamGroup element. You have to provide values to the connection parameter, available in the $localConnectionParamGroup.ConnectionParams list. The set of parameters, available in the ConnectionParams list is specific for the used storage replication adapter. Here we will provide values for connection parameters, specific for the NetApp storage replication adapter:</p><pre class="crayon-plain-tag">($localConnectionParamGroup.ConnectionParams | where {$_.key -eq &quot;username&quot;}).Value = &quot;myUser&quot;
($localConnectionParamGroup.ConnectionParams | where {$_.key -eq &quot;password&quot;}).Value = &quot;myPass&quot;
($localConnectionParamGroup.ConnectionParams | where {$_.key -eq &quot;VolumeInclusion&quot;}).Value = &quot;myVolume&quot;
($localConnectionParamGroup.ConnectionParams | where {$_.key -eq &quot;SVM Name&quot;}).Value = &quot;myLocalSvmName&quot;
($localConnectionParamGroup.ConnectionParams | where {$_.key -eq &quot;mgmtIP&quot;}).Value = &quot;192.168.10.10&quot;</pre><p></p>
<h3>Create the local Array Manager</h3>
<p>Now when we have all the prerequisites for the array manager, use the ConnectionParamGroup and the storage adapter Id to initialize ArrayManagerSpec object:</p><pre class="crayon-plain-tag">$localArrayManagerSpec = Initialize-SrmArrayManagerSpec -Name &quot;primary-array-manager&quot; `
&nbsp;&nbsp; -StorageAdapter $localAdapters.Id `
&nbsp;&nbsp; -ConnectionParams $localConnectionParamGroup</pre><p>Then create the array manger, using the Invoke-SrmCreateArrayManage cmdlet:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreateArrayManager -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ArrayManagerSpec $localArrayManagerSpec</pre><p>Wait for the task to complete and retrieve the array manager. The Result property of the task will contain the Id of the array manager, once the task completes:</p><pre class="crayon-plain-tag">$localManagerTask = Invoke-SrmGetTaskInfo -TaskId $task.Id

$localArrayManager = Invoke-SrmGetArrayManager -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ArrayManagerId $localManagerTask.Result</pre><p>Create the remote array manager, using the same approach:</p><pre class="crayon-plain-tag">$remoteAdapter = (Invoke-SrmGetStorageAdapters -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.RemoteSrmServer.Id.Guid `
   -FilterProperty 'Name' `
   -Filter 'NetApp').List[0]

$remoteConnectionParamGroup = (Invoke-SrmGetStorageAdapterConnectionParams `
   -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.RemoteSrmServer.Id.Guid `
   -StorageAdapterId $remoteAdapters.List[0].Id).List[0]

($remoteConnectionParamGroup.ConnectionParams | Where-Object {$_.key -eq &quot;username&quot;}).Value = &quot;myUser&quot;
($remoteConnectionParamGroup.ConnectionParams | Where-Object {$_.key -eq &quot;password&quot;}).Value = &quot;myPass&quot;
($remoteConnectionParamGroup.ConnectionParams | Where-Object {$_.key -eq &quot;VolumeInclusion&quot;}).Value = &quot;myVolume&quot;
($remoteConnectionParamGroup.ConnectionParams | Where-Object {$_.key -eq &quot;SVM Name&quot;}).Value = &quot;myRemoteSvmName&quot;
($remoteConnectionParamGroup.ConnectionParams | Where-Object {$_.key -eq &quot;mgmtIP&quot;}).Value = &quot;192.168.10.11&quot;

$remoteArrayManagerSpec = Initialize-SrmArrayManagerSpec -Name &quot;secondary-array-manager&quot; `
   -StorageAdapter $remoteAdapter.Id `
   -ConnectionParams $remoteConnectionParamGroup

$task = Invoke-SrmCreateArrayManager -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.RemoteSrmServer.Id.Guid `
   -ArrayManagerSpec $remoteArrayManagerSpec

#Wait for the create array manager task to complete
$remoteManagerTask = Invoke-SrmGetTaskInfo -TaskId $task.Id

$remoteArrayManager = Invoke-SrmGetArrayManager -PairingId $srmConnection.ConnectedPairing.PairingId `
   -SrmId $srmConnection.ConnectedPairing.RemoteSrmServer.Id.Guid `
   -ArrayManagerId $remoteManagerTask.Result</pre><p></p>
<h2>Create Replicated Array Pair</h2>
<p>To create the replicated array pair, you have to initialize a ReplicatedArrayPairSpec object:</p><pre class="crayon-plain-tag">$replicatedArrayPairSpec = Initialize-SrmReplicatedArrayPairSpec -ArrayManagerId $localArrayManager.Id `
&nbsp;&nbsp; -StorageArrayKey $localArrayManager.StorageArrays[0].StorageArrayKey `
&nbsp;&nbsp; -PeerStorageArrayKey $remoteArrayManager.StorageArrays[0].StorageArrayKey</pre><p>Besides the ArrayManagerId you have to specify the StorageArrayKey and the PeerStorageArrayKey parameter. The available storage array keys can be found in the StorageArrays property of the local and the remote array managers.</p>
<p>Use the Invoke-SrmCreateReplicatedArrayPair cmdlet to create the replicated array pair:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreateReplicatedArrayPair -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ReplicatedArrayPairSpec $replicatedArrayPairSpec</pre><p>Wait for the task to complete and retrieve the replicated array pair. The Result property of the task will contain the Id of the replicated array pair, once the task completes:</p><pre class="crayon-plain-tag">$replicatedArrayPairTask = Invoke-SrmGetTaskInfo -TaskId $task.Id

$replicatedArrayPair = Invoke-SrmGetReplicatedArrayPair -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ArrayPairId $replicatedArrayPairTask.Result</pre><p></p>
<h2>Create Protected Group and Recovery Plan for the Replicated Array Pair</h2>
<p>Use the Invoke-SrmDiscoverStorageDevices cmdlet to discover the storage devices of the replicated array pair. Wait for the task to complete before proceeding to the next step:</p><pre class="crayon-plain-tag">$task = Invoke-SrmDiscoverStorageDevices -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ArrayPairId $replicatedArrayPair.Id

Invoke-SrmGetTaskInfo -TaskId $task.Id</pre><p>Retrieve the storage devices from the replicated array pair:</p><pre class="crayon-plain-tag">$storageDevices = Invoke-SrmGetStorageDevices -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id.Guid `
&nbsp;&nbsp; -ArrayPairId $replicatedArrayPair.Id</pre><p>Initialize an AbrProtectionGroupSpec object. In our setup we created replicated array pair with single storage device, containing one datastore. We will create protection group for this datastore:</p><pre class="crayon-plain-tag">$abrProtectionGroupSpec = Initialize-SrmAbrProtectionGroupSpec `
   -ReplicatedArrayPair $replicatedArrayPair.Id `
   -Datastores $storageDevices.StorageDevicesData[0].Datastores[0].Id</pre><p>Then initialize ProtectionGroupCreateSpec object. For the ReplicationType parameter specify ABR:</p><pre class="crayon-plain-tag">$protectionGroupSpec = Initialize-SrmProtectionGroupCreateSpec -Name &quot;MyAbrProtectionGroup&quot; `
&nbsp;&nbsp; -ReplicationType ABR `
&nbsp;&nbsp; -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id.Guid `
&nbsp;&nbsp; -AbrSpec $abrProtectionGroupSpec</pre><p>Use Invoke-SrmCreateGroup to create the ABR protection group. Wait for the task to complete and retrieve the protection group:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreateGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp;&nbsp; -ProtectionGroupCreateSpec $protectionGroupSpec

$task = Invoke-SrmGetTaskInfo -TaskId $task.Id

$protectionGroup = Invoke-SrmGetGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
   -GroupId $task.Result</pre><p>Finally, you can create recovery plan for the protection group, we have just crated. To do this, Initialize RecoveryPlanCreateSpec object:</p><pre class="crayon-plain-tag">$recPlanSpec = Initialize-SrmRecoveryPlanCreateSpec `
&nbsp;&nbsp; -Name &quot;AbrRecoveryPlan&quot; `
&nbsp;&nbsp; -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id.Guid `
&nbsp;&nbsp; -ProtectionGroups @($protectionGroup.Id)</pre><p>Create recovery plan with the Invoke-SrmCreatePlan cmdlet and wait for the task to complete:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreatePlan -PairingId $srmConnection.ConnectedPairing.PairingId ` &nbsp;
   -RecoveryPlanCreateSpec $recPlanSpec

Invoke-SrmGetTaskInfo -TaskId $task.Id</pre><p></p>
<h2>Disconnect the SRM server connection</h2>
<p>After you have finished interacting with the SRM server, close the connection, using the Disconnect-SrmSdkServer cmdlet.</p><pre class="crayon-plain-tag">Disconnect-SrmSdkServer &quot;MySrmAddress.com&quot;</pre><p></p>
<h2>Conclusion</h2>
<p>VMware.Sdk.Srm PowerCLI module enables the access to the Site Recovery Manager Rest API through PowerShell cmdlets. In this article we covered the end to end scenario of configuring array based replication and creation of protection group and recovery plan, based on this replication flavor. If you&#8217;re interested in using host based replication, refer to the &#8220;<a href="https://blogs.vmware.com/PowerCLI/2023/06/managing-srm-and-vr-with-powercli-13-1.html">Managing SRM and VR with PowerCLI 13.1</a>&#8221; blog post.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Managing SRM and VR with PowerCLI 13.1</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/06/managing-srm-and-vr-with-powercli-13-1.html</link>
		
		<dc:creator><![CDATA[Pavel Dimitrov]]></dc:creator>
		<pubDate>Tue, 06 Jun 2023 08:22:55 +0000</pubDate>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[Host Based Replication]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware Site Recovery Manager]]></category>
		<category><![CDATA[vSphere Replication]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4408</guid>

					<description><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div>PowerCLI 13.1 introduces two new auto generated modules that provide PowerShelI bindings for the vSphere Replication REST API and the Site Recovery Manager REST API. We will cover connection management for both modules &#8211; host based replication with vSphere Replication and creation of protection groups and recovery plans with Site Recovery Manager. Note: VMware.Sdk.Vr and VMware.Sdk.Srm &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/06/managing-srm-and-vr-with-powercli-13-1.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/06/srmlogo2.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>PowerCLI 13.1 introduces two new auto generated modules that provide PowerShelI bindings for the vSphere Replication REST API and the Site Recovery Manager REST API. We will cover connection management for both modules &#8211; host based replication with vSphere Replication and creation of protection groups and recovery plans with Site Recovery Manager.</p>
<p>Note: VMware.Sdk.Vr and VMware.Sdk.Srm modules are compatible with vSphere Replication and Site Recovery Manager 8.7 and above.</p>
<h2>Connecting vSphere Replication server with Connect-VrServer</h2>
<p>To connect to a vSphere Replication management server you must use the Connect-VrServer cmdlet. Replications can be configured within a single vCenter Server, or between local and remote vCenter Server instances.</p>
<p>When configuring replication within the same VC you can connect only to the local vSphere Replication site. For Server parameter specify the vSphere Replication server address. For User and Password parameters specify the user name and the password for the vCenter Server instance where the vSphere Replication appliance is deployed:</p><pre class="crayon-plain-tag">$vrConnection = Connect-VrServer -Server &quot;MyVrAddress.com&quot; 
   -User &quot;administrator@vsphere.local&quot; `
   -Password &quot;MyLocalVCenterServerPassword&quot;</pre><p>Let&#8217;s take a moment and look at the VrServerConnection object, returned from the Connect-VrServer cmdlet. It contains ConnectedPairings property:</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4483" src="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1-300x38.jpg" alt="" width="624" height="79" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1-300x38.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1-768x97.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1-600x76.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsSingle-1.jpg 894w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>This property is a Dictionary, where all connected Pairings are stored. The Pairing is the VR API representation of the paired local and the remote sites. As we just authenticated only against the local VR site, the Dictionary contains only one entry. This is the local vCenter self-pair.</p>
<p>You can index this dictionary, by the vCenter name, and obtain certain Pairing object. You will need this Pairing object to invoke various operations from the VR API:</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4488" src="https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1-300x65.jpg" alt="" width="623" height="135" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1-300x65.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1-768x168.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1-600x131.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/Pairing-1.jpg 917w" sizes="(max-width: 623px) 100vw, 623px" /></a></p>
<p>To authenticate against a remote vCenter Server, you will use another parameter set of the Connect-VrServer cmdlet. (Note that you must have a site pairing configured between the local and the remote vSphere Replication sites.). This time, for LocalServer parameter specify the already available VrServerConnection object. For RemoteServer parameter specify the name of the remote VC. For RemoteUser and RemotePassword parameters specify the user name and the password of the remote VC. Note that with VR we can have multiple remote sites configured:</p><pre class="crayon-plain-tag">$remoteVc = &quot;myRemoteVcName&quot;
$vrConnection = Connect-VrServer -LocalServer $vrConnection `
&nbsp;&nbsp;&nbsp; -RemoteServer $remoteVc `
&nbsp;&nbsp;&nbsp; -RemoteUser &quot;administrator@vsphere.local&quot; `
&nbsp;&nbsp;&nbsp; -RemotePassword &quot;MyRemoteVCenterServerPassword&quot;</pre><p>Now, if you check the ConnectedPairings property of the VrServerConnection object, you will see that the dictionary contains second pairing, allowing you to invoke API operations on the remote site:</p>
<h2><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4487" src="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1-300x48.jpg" alt="" width="624" height="100" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1-300x48.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1-768x123.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1-600x96.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/ConnectedPairingsRemote-1.jpg 909w" sizes="(max-width: 624px) 100vw, 624px" /></a></h2>
<p>Alternatively you can authenticate against the local and the remote sites with a single Connect-VrServer call:</p><pre class="crayon-plain-tag">$remoteVc = &quot;myRemoteVcName&quot;
$vrConnection = Connect-VrServer -Server $localVr `
   -User &quot;administrator@vsphere.local&quot; `
   -Password &quot;MyLocalVCenterServerPassword&quot; `
   -RemoteServer $remoteVc `
   -RemoteUser &quot;administrator@vsphere.local&quot; `
   -RemotePassword &quot;MyRemoteVCenterServerPassword&quot;</pre><p></p>
<h2>Configuring host based replication</h2>
<p>For convenience, let&#8217;s store the remote site pairing that we will use for the replication in a variable:</p><pre class="crayon-plain-tag">$remotePairing = $vrConnection.ConnectedPairings[$remoteVc].Pairing</pre><p></p>
<h3>Retrieve the replicated VM</h3>
<p>To start, you must retrieve the VM, which you want to replicate. Use the Invoke-VrGetLocalVms cmdlet, which requires PairingId and VcenterId parameters to be specified. We have these IDs with the Pairing object we stored in the $remotePairing variable:</p><pre class="crayon-plain-tag">$replicatedVm = Invoke-VrGetLocalVms -PairingId $remotePairing.PairingId `
&nbsp;&nbsp; -VcenterId $remotePairing.LocalVcServer.Id.Guid `
&nbsp;&nbsp; -FilterProperty 'Name' `
 &nbsp; -Filter &quot;VrSrmDemo&quot;</pre><p>You can also apply filter to this call. FilterProperty parameter specifies the VM property that will be used for the search. In this case this is the Name property. The Filter parameter specifies the property value, you are looking for. The result of this call is a VirtualMachineDrResponseList object, which contains list of VMs that match the specified filter. In our case this will be a list with one VM:</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/localVM.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4455" src="https://blogs.vmware.com/PowerCLI/files/2023/05/localVM-300x77.jpg" alt="" width="623" height="160" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/localVM-300x77.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/localVM-768x196.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/localVM-600x153.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/localVM.jpg 951w" sizes="(max-width: 623px) 100vw, 623px" /></a></p>
<h3>Configure VM&#8217;s HDDs for the replication</h3>
<p>When configuring host based replication, you have to specify the VM&#8217;s hard disks that will be replicated. For each replicated disk you have to specify a datastore on the target VC. In this example we will replicate all the hard disks of our VM on one target datastore on the remote VC:<br />
Retrieve the target datastore on the remote VC, using the Invoke-VrGetVrCapableTargetDatastores cmdlet:</p><pre class="crayon-plain-tag">$targetDatastore = Invoke-VrGetVrCapableTargetDatastores -PairingId $remotePairing.PairingId `
   -VcenterId $remotePairing.RemoteVcServer.Id.Guid `
   -FilterProperty &quot;Name&quot; `
   -Filter &quot;MyRemoteDS&quot;</pre><p>Here for VcenterId, specify the remote VC Id. Specify FilterProperty and Filter parameters to choose the target datastore by name.</p>
<p>Hard disks are available in the Disks property of our VirtualMachine object, stored in the $replicatedVm variable. Iterate over the Disks list and initialize ConfigureReplicationVmDisk objects for each hard disk. Store these configurations in $replicationVmDisks array variable:</p><pre class="crayon-plain-tag">$replicationVmDisks = @()
$replicatedVm.List[0].Disks | ForEach-Object {
&nbsp;&nbsp; $replicationVmDisks += Initialize-VrConfigureReplicationVmDisk -VmDisk $_ `
&nbsp;&nbsp;&nbsp; &nbsp; -EnabledForReplication:$true `
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DestinationDatastoreId $targetDatastore.List[0].Id `
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DestinationDiskFormat 'SAMEASSOURCE'
}</pre><p></p>
<h3>Configure Host Based Replication</h3>
<p>First you have to initialize ConfigureReplicationSpec object. Besides various replication settings, we have to specify the disk replication configuration, stored in the $replicationVmDisks variable to the Disk parameter. You also have to specify the target VC Id and the Id of the replicated VM.</p><pre class="crayon-plain-tag">$replicationSpec = Initialize-VrConfigureReplicationSpec `
   -Rpo 60 `
   -NetworkCompressionEnabled:$true `
   -MpitEnabled:$true `
   -AutoReplicateNewDisks:$true `
   -LwdEncryptionEnabled:$false `
   -MpitInstances 1 `
   -MpitDays 1 `
   -Disks $replicationVmDisks `
   -TargetVcId $remotePairing.RemoteVcServer.Id.Guid `
   -VmId $replicatedVm.List[0].Id</pre><p>Then use the Invoke-VrConfigureReplication cmdlet to configure the replication. For parameters, specify the PairingId and the ConfigureReplicationSpec object:</p><pre class="crayon-plain-tag">$task = Invoke-VrConfigureReplication -PairingId $remotePairing.PairingId `
   -ConfigureReplicationSpec $replicationSpec</pre><p>The result of the operation is a TaskDrResponseList object, which in our example contains list of one task. If you want, you can specify array of ConfigureReplicationSpec objects, and replicate multiple VMs with single call.</p>
<p>To wait until the replication configuration task completes, retrieve the task until its Status property equals to something different from &#8216;RUNNING&#8217;:</p><pre class="crayon-plain-tag">Invoke-VrGetTaskInfo -TaskId $task.List[0].Id</pre><p><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4462" src="https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask-300x116.jpg" alt="" width="605" height="234" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask-300x116.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask-768x296.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask-600x231.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/configureReplicationTask.jpg 903w" sizes="(max-width: 605px) 100vw, 605px" /></a></p>
<p>In the next chapter we will use cmdlets from the VMware.Sdk.Srm module to create protection group and recovery plan for the replication that we just created.</p>
<h2>Connecting Site Recovery Manager with Connect-SrmSdkServer</h2>
<p>To connect Site Recover Manager server use the Connect-SrmSdkServer cmdlet. Do not use the old Connect-SrmServer cmdlet, already available in the VMware.VimAutomation.Srm module, as it&#8217;s not compatible with the VMware.Sdk.Srm module cmdlets.</p>
<p>Site Recover Manager supports only one pairing between local and remote SRM sites. You can connect either only to the local site, or you can authenticate with the remote site vCenter server site in the same call. Since we will further create protection group and recovery plan we will choose the second option. Note that you must have a site pairing configured between the local and the remote SRM sites.</p><pre class="crayon-plain-tag">$srmConnection = Connect-SrmSdkServer -Server &quot;MySrmAddress.com&quot; `
&nbsp;&nbsp; -User &quot;administrator@vsphere.local&quot; `
&nbsp;&nbsp; -Password &quot;MyLocalVcPassword&quot; `
&nbsp;&nbsp; -RemoteUser &quot;administrator@vsphere.local&quot; `
&nbsp;&nbsp; -RemotePassword &quot;MyRemoteVcPassword&quot;</pre><p>If we look at the SrmServerConnection object, returned from the Connect-SrmSdkServer cmdlet, we will see that it contains property named ConnectedPairing. In this case this is a single Pairing object that represents the pair between the local and the remote SRM sites. You will need this Pairing object for invoking various operations from the SRM API:</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm.jpg"><img decoding="async" loading="lazy" class="alignnone wp-image-4469" src="https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm-300x68.jpg" alt="" width="622" height="141" srcset="https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm-300x68.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm-768x174.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm-600x136.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2023/05/PairingSrm.jpg 785w" sizes="(max-width: 622px) 100vw, 622px" /></a></p>
<h2>Creating protection group and recovery plan for host based replication</h2>
<p>In this chapter we will use the host based replication that we configured earlier. First we will initialize HbrProtectionGroupSpec with the VM that we already replicated:</p>
<p>$hbrSpec = Initialize-SrmHbrProtectionGroupSpec -Vms $replicatedVm.List[0].Id</p>
<p>In this example we reuse the VM Id, we have stored in the $replicatedVm variable, as it&#8217;s consistent between the VR and SRM APIs. If you need to retrive the replicated VM with the VMware.Sdk.Srm module, use the Invoke-SrmGetReplicatedVms cmdlet:</p><pre class="crayon-plain-tag">$replicatedVm = Invoke-SrmGetReplicatedVms `
   -PairingId $srmConnection.ConnectedPairing.PairingId `
   -VcenterId $srmConnection.ConnectedPairing.LocalVcServer.Id.Guid `
   -FilterProperty &quot;Name&quot; `
   -Filter &quot;VrSrmDemo&quot;</pre><p>Use the HbrProtectionGroupSpec object to initialize SrmProtectionGroupCreateSpec. For the ReplicationType parameter specify HBR:</p><pre class="crayon-plain-tag">$protectionGroupSpec = Initialize-SrmProtectionGroupCreateSpec -Name &quot;SrmDemoGroup&quot; `
&nbsp;&nbsp; -ReplicationType HBR `
&nbsp;&nbsp; -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id.Guid `
&nbsp;&nbsp; -HbrSpec $hbrSpec</pre><p>Create protection group with the Invoke-SrmCreateGroup cmdlet:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreateGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
   -ProtectionGroupCreateSpec $protectionGroupSpec</pre><p>Wait for the SRM task to complete:</p><pre class="crayon-plain-tag">$task = Invoke-SrmGetTaskInfo -TaskId $task.Id</pre><p>When $task.Status is equal to &#8216;SUCCESS&#8217;, retrieve the protection group, using the $task.Result property, which contains the ID of the created group:</p><pre class="crayon-plain-tag">$protectionGroup = Invoke-SrmGetGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
   -GroupId $task.Result</pre><p>To conclude this example we will create a recovery plan for the protection group. For that purpose first Initialize RecoveryPlanCreateSpec, required by the Invoke-SrmCreatePlan cmdlet:</p><pre class="crayon-plain-tag">$recPlanSpec = Initialize-SrmRecoveryPlanCreateSpec `
&nbsp;&nbsp; -Name &quot;SrmDemoRecoveryPlan&quot; `
&nbsp;&nbsp; -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id.Guid `
&nbsp;&nbsp; -ProtectionGroups $protectionGroup.Id</pre><p>Then create the recovery plan with the RecoveryPlanCreateSpec object and wait for the task to complere, using the Invoke-SrmCreatePlan:</p><pre class="crayon-plain-tag">$task = Invoke-SrmCreatePlan -PairingId $srmConnection.ConnectedPairing.PairingId `
&nbsp; -RecoveryPlanCreateSpec $recPlanSpec
Invoke-SrmGetTaskInfo -TaskId $task.Id</pre><p></p>
<h2>Disconnect SRM and VR server connections</h2>
<p>After you have finished interacting with the SRM server, close the connection, using the Disconnect-SrmSdkServer cmdlet:</p><pre class="crayon-plain-tag">Disconnect-SrmSdkServer &quot;MySrmAddress.com&quot;</pre><p>To close the VR server connection use the Disconnect-VrServer cmdlet:</p><pre class="crayon-plain-tag">Disconnect-VrServer &quot;MyVrAddress.com&quot;</pre><p></p>
<h2>Conclusion</h2>
<p>You can combine the VMware.Sdk.Vr and the VMware.Sdk.Srm PowerCLI modules to automate the end to end scenario of creating host based replication, and utilizing it with protection group and recovery plan. If you want to automate array based replication, available with the VMware.Sdk.Srm module, refer to the &#8220;<a href="https://blogs.vmware.com/PowerCLI/2023/06/array-based-replication-with-powercli-13-1.html">Array Based Replication with PowerCLI 13.1</a>&#8221; blog post. Also, you can check out &#8220;<a href="https://blogs.vmware.com/code/2023/05/25/vsphere-replication-rest-api-with-powershell-configure-vm-replication/">vSphere Replication REST API with PowerShell: Configure VM replication</a>&#8220;.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerCLI 13.1 is now released</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/04/powercli-13-1-is-now-released.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Wed, 19 Apr 2023 12:33:39 +0000</pubDate>
				<category><![CDATA[Release]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4394</guid>

					<description><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div>After the exciting first release of Power Actions last week, this week brings another new release &#8211; PowerCLI 13.1. With this release, we&#8217;re delivering one of the most requested PowerCLI features &#8211; a PowerCLI module for vSphere Replication. It is built on the same technology that we used to deliver the auto-generated modules for the &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/04/powercli-13-1-is-now-released.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>After the exciting <a href="https://blogs.vmware.com/PowerCLI/2023/04/new-release-power-actions-1-0.html">first release of Power Actions</a> last week, this week brings another new release &#8211; PowerCLI 13.1.</p>
<p>With this release, we&#8217;re delivering one of the most requested PowerCLI features &#8211; a PowerCLI module for vSphere Replication. It is built on the same technology that we used to deliver the auto-generated modules for the NSX and vSphere REST APIs and provides full coverage of the new vSphere Replication REST API.</p>
<p>Here are some of the other exciting features of this PowerCLI release:</p>
<ul>
<li>New auto-generated module for the new SRM REST API</li>
<li>Added support for vLCM host configuration and offline depots</li>
<li>New vSAN cmdlets for vSAN direct disk and remote datastore management</li>
<li>New cmdlets for vSAN cluster shutdown</li>
<li>Updated NSX and Horizon modules</li>
<li>Extended Python version support for the ImageBuilder module</li>
</ul>
<p>Let&#8217;s take a closer look at some of these new features.</p>
<h3>New SDK modules for SRM and vSphere Replication</h3>
<p>With the 8.6 release of SRM and vSphere Replication, these two products received new REST APIs. In fact, it was the first public API released for vSphere Replication. This gave us the opportunity to automatically generate PowerCLI modules for these products as we had already done for NSX and vSphere. As with vSphere you will be able to find the PowerCLI examples directly in the vSphere Replication and SRM REST API documentation. We&#8217;re also working on a dedicated blog post to demonstrate how to use those modules to perform some common use cases.</p>
<p><strong>vLCM improvements</strong></p>
<p>In PowerCLI 13.1 we&#8217;re adding new parameters to the <code>Set-VMHost</code> cmdlet to allow you to set the ESXi host LCM configuraiton in the same way that you set the cluster LCM configuration. This is a new feature, supported only in vSphere 8.0 Update 1. We&#8217;re also introducing cmdlets for the creation of new LCM offline depots with PowerCLI.</p>
<p><strong>New vSAN cmdlets</strong></p>
<p>PowerCLI 13.1 comes with a lot of new vSAN functionality. New cmdlets are introduced for vSAN remote datastore management, direct disk management, and vSAN cluster shutdown.</p>
<h3>VMware Cloud Director changes</h3>
<p>For VMware Cloud Director, we changed the authentication mechanism of Connect-CIServer and it now authenticates against the new vCD API authentication endpoint. This will allow the cmdlet to continue working without issues with the future vCD versions. We also updated the Import-CIVappTemplate cmdlet to work with the latest APIs. Because of this we made some cmdlet interface changes, which might lead to the need of reworking some of your Cloud Director scripts.</p>
<h3>ImageBuilder module Python version support</h3>
<p>With PowerCLI 13.0 we ported the ImageBuilder and AutoDeploy modules to work on Linux and MacOS. That required users to have Python installed as a pre-requisite for those modules. In 13.0, these modules only supported Python version 3.7.x, which was quite limiting. With PowerCLI 13.1, we have fixed that and the ImageBuilder module now works with Python 3.7.1 and all later versions.</p>
<p><strong>Conclusion</strong></p>
<p>PowerCLI 13.1 is another release that brings a rich set of new features to our customers. It delivers one of the most requested PowerCLI functionalities, vSphere replication module, as well as new SRM module, new vSAN cmdlets, extended support for vLCM, and much more. For a full list of all improvements and fixes, check the <a href="https://developer.vmware.com/docs/18508/">PowerCLI 13.1 Release Notes</a>. For more information on specific cmdlets, see the <a href="https://developer.vmware.com/docs/powercli/latest/products/" target="_blank" rel="noopener">PowerCLI Cmdlet Reference</a>.</p>
<p>&nbsp;</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New Release &#8211; Power Actions 1.0</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/04/new-release-power-actions-1-0.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Sat, 15 Apr 2023 13:35:00 +0000</pubDate>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[Power Actions]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[vSphere client]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4384</guid>

					<description><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div>We are extremely excited to announce that the first standalone tech preview release of the new Power Actions went live today. Power Actions is a vSphere Client plug-in that provides an easy way to share PowerCLI scripts with users who have no PowerShell experience. Power Actions provides a script library where you can upload PowerCLI &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/04/new-release-power-actions-1-0.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="166" src="https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-300x166.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-300x166.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-1024x566.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-768x424.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-1536x848.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo-600x331.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/04/Power-Actions-logo.png 1805w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>We are extremely excited to announce that the first standalone tech preview release of the new Power Actions went live today.</p>
<p>Power Actions is a vSphere Client plug-in that provides an easy way to share PowerCLI scripts with users who have no PowerShell experience. Power Actions provides a script library where you can upload PowerCLI scripts that you want to make available to everyone in your organization. Users can then easily execute those scripts using a user-friendly interface to specify the script parameters. This provides an extremely powerful mechanism to extend the vSphere Client with custom PowerCLI scripts.</p>
<p>How about the security and permissions? All the scripts are executed by using the permissions of the user that&#8217;s logged in to the vSphere Client. So, if a user does not have permission to perform certain operations they won&#8217;t be able to perform these operations with Power Actions as well.</p>
<p>Let&#8217;s take a closer look at how to get started with Power Actions:</p>
<h3>Installation</h3>
<p>Power Actions is distributed as a virtual appliance. You can download the OVA file from the <a href="https://via.vmw.com/power-actions">Power Actions page</a>. Also from there, you can download the complete user&#8217;s guide that contains detailed installation instructions. After you install Power Actions you can use it through the Developer Center in the vSphere Client.</p>
<h3>Script library</h3>
<p>The main function of Power Actions is to run scripts from your script library. So the first thing to do is to create a script library and upload your scripts there.</p>
<p>Script libraries are actually content libraries, so any content library can be used as a script library. If you don&#8217;t have a content library at your disposal, you can create a new one by using either PowerCLI or the vSphere Client. The next step is to import your scripts to the script library. You can upload scripts one by one through the vSphere Client, or entire collections of scripts through PowerCLI.</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/04/script-library.png"><img decoding="async" loading="lazy" class="wp-image-4385 aligncenter" src="https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-300x146.png" alt="Screenshot of the script library" width="822" height="400" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-300x146.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-1024x499.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-768x374.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-1536x749.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-2048x998.png 2048w, https://blogs.vmware.com/PowerCLI/files/2023/04/script-library-600x292.png 600w" sizes="(max-width: 822px) 100vw, 822px" /></a></p>
<h3>Running scripts</h3>
<p>Once you have uploaded your scripts to the script library, you can start running them. You have two options to run a script &#8211; from the script library directly or through the context menu. In both cases, when you execute a script with parameters, you&#8217;ll be prompted to enter them. However, when you run a script from the context menu, some parameters will be pre-populated.</p>
<p>Let&#8217;s take a closer look at how this works. In our Power Actions script library we have imported a simple PowerCLI script that creates snapshots of a collection of virtual machines. This is what the script looks like:</p><pre class="crayon-plain-tag">param (
    [Parameter(Mandatory=$true)]
    [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $vms, 
    [Parameter(Mandatory=$true)]
    [string] $snapshotName)

foreach ($vm in $vms) {
    New-SnapShot -VM $vm -Name $snapshotName
}</pre><p>When we run this script from the script library, we&#8217;ll get a dialog in which we&#8217;ll have to specify the script parameters.</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/04/parameters.png"><img decoding="async" loading="lazy" class="wp-image-4387 aligncenter" src="https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-300x147.png" alt="" width="823" height="403" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-300x147.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-1024x501.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-768x375.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-1536x751.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-2048x1001.png 2048w, https://blogs.vmware.com/PowerCLI/files/2023/04/parameters-600x293.png 600w" sizes="(max-width: 823px) 100vw, 823px" /></a></p>
<p>However, if we want to run the script from the context menu, we can right-click on a VM and select &#8220;Power Actions&#8221; -&gt; &#8220;Run script&#8221;.</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu.png"><img decoding="async" loading="lazy" class="wp-image-4388 aligncenter" src="https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-248x300.png" alt="" width="385" height="466" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-248x300.png 248w, https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-847x1024.png 847w, https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-768x928.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-1271x1536.png 1271w, https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu-600x725.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/04/context-menu.png 1552w" sizes="(max-width: 385px) 100vw, 385px" /></a></p>
<p>We&#8217;ll get a dialog to first select the script that we want to run, and then we&#8217;ll have to enter the parameters. In this case, the vms parameter will be pre-populated from the VM we right-clicked on.</p>
<h3><a href="https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams.png"><img decoding="async" loading="lazy" class="wp-image-4389 aligncenter" src="https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-300x154.png" alt="" width="524" height="269" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-300x154.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-1024x526.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-768x394.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-1536x788.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-2048x1051.png 2048w, https://blogs.vmware.com/PowerCLI/files/2023/04/prepopulatedparams-600x308.png 600w" sizes="(max-width: 524px) 100vw, 524px" /></a></h3>
<h3>Monitoring script runs and checking the results</h3>
<p>The next screen in Power Actions is &#8216;Script runs&#8217;. There you can monitor your script runs and check their result. From this page you can also stop a running script.</p>
<h3>Console</h3>
<p>Another feature Power Actions provides is a built-in PowerShell console with the latest PowerCLI version pre-installed. When you open the console, it automatically connects to the vCenter Server by using the vSphere Client user. You can use the Power Actions console to run single commands or entire scripts. Keep in mind that the console will not be retained when you log out of the vSphere Client, so any files that you save on it will be lost after you log out. Beware that if you switch to another view in the vSphere Client or to another Power Actions screeen, and then return to the console, a new PowerShell session will be created and all in-memory variables from your previous session will be lost.</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2023/04/console.png"><img decoding="async" loading="lazy" class="wp-image-4390 aligncenter" src="https://blogs.vmware.com/PowerCLI/files/2023/04/console-300x146.png" alt="" width="842" height="410" srcset="https://blogs.vmware.com/PowerCLI/files/2023/04/console-300x146.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/04/console-1024x498.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/04/console-768x373.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/04/console-1536x746.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/04/console-2048x995.png 2048w, https://blogs.vmware.com/PowerCLI/files/2023/04/console-600x292.png 600w" sizes="(max-width: 842px) 100vw, 842px" /></a></p>
<h3>Summary</h3>
<p>Throughout the years, Power Actions underwent multiple transformations and was part of different fling releases of the vSphere Client. Now we&#8217;re starting to develop it again as an independent product and this first tech preview release of the new Power Actions is the first step of the process. We are very excited about the plethora of possibilities that Power Actions brings and we can&#8217;t wait to receive your feedback, use cases, feature requests and ideas. So don&#8217;t hesitate to submit your comments on the <a href="https://via.vmw.com/power-actions">Power Actions site</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Managing VICredentials on PowerShell 7 using VMware.VISecret Module!</title>
		<link>https://blogs.vmware.com/PowerCLI/2023/02/managing-vicredentials-on-powershell-7-using-vmware-visecret-module.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Wed, 15 Feb 2023 13:28:22 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Credentials]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VIServer]]></category>
		<category><![CDATA[vSphere]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4344</guid>

					<description><![CDATA[<div><img width="300" height="169" src="https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-300x169.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-300x169.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-1024x578.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-768x433.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-1536x867.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-752x423.png 752w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-576x324.png 576w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-600x339.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1.png 1753w" sizes="(max-width: 300px) 100vw, 300px" /></div>Many customers use the PowerCLI credential store to avoid hard coding credentials in scripts or saving them unencrypted in files. The credential store uses the Windows data protection API to encrypt the credentials and then saves them in a file. However, this API is only available in Windows and that&#8217;s why the PowerCLI credential store &#8230; <a href="https://blogs.vmware.com/PowerCLI/2023/02/managing-vicredentials-on-powershell-7-using-vmware-visecret-module.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="169" src="https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-300x169.png" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-300x169.png 300w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-1024x578.png 1024w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-768x433.png 768w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-1536x867.png 1536w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-752x423.png 752w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-576x324.png 576w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1-600x339.png 600w, https://blogs.vmware.com/PowerCLI/files/2023/02/Screenshot-2023-02-15-at-6.55.26-PM-1.png 1753w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>Many customers use the PowerCLI credential store to avoid hard coding credentials in scripts or saving them unencrypted in files. The credential store uses the Windows data protection API to encrypt the credentials and then saves them in a file. However, this API is only available in Windows and that&#8217;s why the PowerCLI credential store is not available on the cross-platform PowerShell 7. So what is the alternative for Linux and MacOS users?</p>
<p>Some time ago, Microsoft released two very useful cross-platform modules for managing secrets &#8211; SecretManagement and SecretStore. You can read more details about them in <a href="https://devblogs.microsoft.com/powershell/secretmanagement-and-secretstore-are-generally-available/">this blog post</a>. SecretManagement provides cmdlets that help users manage secrets across different vaults and SecretStore is one vault implementation. These two modules can be used instead of the VICredential store. To illustrate how this can be done, we&#8217;ve built a <a href="https://github.com/vmware/PowerCLI-Example-Scripts/tree/master/Modules/VISecret">sample module</a> with alternative versions of the VICredential store cmdlets using the two Microsoft modules. You can use this module as it is or just as a reference to build your own solution. Let&#8217;s go over the main use cases.</p>
<h2>Secret store configuration and vault registration</h2>
<p>The first step is to register and configure the secret vault. In our sample module, we have added an Initialize-VISecret cmdlet that does this. It registers SecretStore as a default vault and configures it to not prompt for a password when accessing the vault.</p>
<div>
<pre class="crayon-plain-tag">function Initialize-VISecret {
    [CmdletBinding()]
    param(
        [string]$Vault = "VMwareSecretStore"
    )

    process {
         Set-SecretStoreConfiguration -Scope CurrentUser -Authentication None -Interaction None -Confirm:$false 
         Register-SecretVault -Name $Vault -ModuleName Microsoft.PowerShell.SecretStore -DefaultVault
    }
}</pre><br />
<span style="font-size: 1rem;">This is the mode that is closest to the VICredentialStore as user experience, since it will not prompt for password and will still keep the password encrypted. However, it&#8217;s less secure than protecting the vault with a password. In addition, in our sample module we&#8217;re using SecretStore as a vault, but if you prefer a different vault you can modify the Initialize-VISecret to use a vault of your choice.</span></p>
<p>Here are some community vault extensions that are available:</p>
<ul>
<li><a href="https://www.powershellgallery.com/packages/Az.KeyVault" data-linktype="external">Azure KeyVault</a> (Microsoft Owned)</li>
<li><a href="https://www.powershellgallery.com/packages/SecretManagement.KeePass" data-linktype="external">KeePass</a></li>
<li><a href="https://www.powershellgallery.com/packages/SecretManagement.LastPass" data-linktype="external">LastPass</a></li>
<li><a href="https://www.powershellgallery.com/packages/SecretManagement.Hashicorp.Vault.KV" data-linktype="external">Hashicorp Vault</a></li>
<li><a href="https://www.powershellgallery.com/packages/SecretManagement.KeyChain" data-linktype="external">KeyChain</a></li>
<li><a href="https://www.powershellgallery.com/packages/SecretManagement.JustinGrote.CredMan" data-linktype="external">CredMan</a></li>
</ul>
</div>
<h2>Saving, reading and deleting credentials from the vault</h2>
<p>To save credentials to the vault, you should use the <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.secretmanagement/set-secret?view=ps-modules">Set-Secret</a> cmdlet in the SecretManagement module. The secret in this cmdlet is identified by its name only, but in our case a credential is described by two identifiers &#8211; the user name and the server it&#8217;s intended for. Therefore, in the New-VISecret cmdlet we&#8217;re concatenating &#8220;VISecret&#8221;, the server and user name by using the pipe symbol as a delimiter, and then we&#8217;re using the resulting string as an identifier of the secret. If you want to save credentials for more than one product you could extend the function to replace &#8220;VISecret&#8221; with another product specific string to build the identifier, for example &#8220;VMCSecret&#8221; for VMC. <span style="font-size: 1rem;">You can pass the password as a plain text string or as a secure string. </span></p>
<p><span style="font-size: 1rem;">Similarly, when we read a credential from the vault by using Get-VISecret, it concatenates &#8220;VISecret&#8221;, the server and username to form the identifier. Then it uses the </span><a style="background-color: #ffffff; font-size: 1rem;" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.secretmanagement/get-secret?view=ps-modules">Get-Secret</a><span style="font-size: 1rem;"> to retrieve the password for the corresponding server and username. </span></p>
<p><span style="font-size: 1rem;">You can also delete a credential from the store by using Remove-VISecret, which again builds the identifier, and calls </span><a style="background-color: #ffffff; font-size: 1rem;" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.secretmanagement/remove-secret?view=ps-modules">Remove-Secret</a><span style="font-size: 1rem;"> to delete the secret from the vault. If you&#8217;re using SecretStore as a vault, you can remove all the credentials it stores by calling </span><a style="background-color: #ffffff; font-size: 1rem;" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.secretstore/reset-secretstore?view=ps-modules">Reset-SecretStore</a></p><pre class="crayon-plain-tag">function New-VISecret {
    [CmdletBinding()]
    [Alias("Set-VISecret")]
    param (
        [Parameter(Mandatory=$true)]
        [string]$Server,
        [Parameter(Mandatory=$true)]
        [string]$User,
        [string]$Password,
        [securestring]$SecureStringPassword,
        [string]$Vault
    )
    begin {
        if ([string]::IsNullOrWhiteSpace($password) -and (-not $secureStringPassword)) {
            Throw "Either Password or SecureStringPassword parameter needs to be specified"
        }
        if (-not [string]::IsNullOrWhiteSpace($password) -and $secureStringPassword) {
            Throw "Password and SecureStringPassword parameters cannot be both specified at the same time"
        }
    }
    process {
        $params = @{
            "Name" = "VISecret|"+$server+"|"+$User
        }
         if ($password) {
            $params += @{"Secret" = $password}
        } elseif ($secureStringPassword) {
            $params += @{"SecureStringSecret" = $secureStringPassword}
        } elseif ($Vault) {
            $params += @{"Vault" = $Vault}
        }
        Set-Secret @params
    }
}</pre><p></p><pre class="crayon-plain-tag">function Get-VISecret {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [string]$Server,
        [Parameter(Mandatory=$true)]
        [string]$User,
        [switch]$AsPlainText,
        [string]$Vault
    )
    process {
        $params = @{
            "Name" = "VISecret|"+$server+"|"+$User
        }
        if ($AsPlainText.IsPresent) {
            $params += @{"AsPlainText" = $AsPlainText.ToBool()}
        } elseif ($Vault) {
            $params += @{"Vault" = $Vault}
        }
        Get-Secret @params
    }
}</pre><p>&nbsp;</p>
<h2>Integrated connection experience</h2>
<p>The last cmdlet in the sample module is Connect-VIServerWithSecret. It combines the cmdlets above to give you integrated experience, similar to the one that Connect-VIServer provides with VICredentialStore. You can call Connect-VIServerWithSecret with username and password and use the -SaveCredentials parameter to save the credentials in the vault. Then you can call it by passing just the username: Connect-VIServerWithSecret will automatically retrieve the password from the vault and connect you to the vCenter. When you&#8217;re using the VICredentialStore, if you only have a single credential saved for a specified server, you could connect with Connect-VIServer without specifying a username. In Get-Secret, however, the -Username parameter is mandatory as we cannot list all saved credentials and check if you only have a single credential saved for the specified server. To enable this experience, we have defined a global variable $global:defaultUser<span style="font-size: 1rem;"> that lets you set a default user name for the Connect-VIServerWithSecret.</span></p>
<h2>Conclusion</h2>
<p>By using Microsoft&#8217;s SecretManagement and SecretStore modules, you can achieve similar user experience as when you&#8217;re using the VICredentialStore. SecretManagement also gives you a rich set of integration options with other third-party vaults, both locally and in the cloud. You can use the sample VISecret module to configure and use vaults in a similar way as with the VICredentialStore.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerCLI 13 is now GA!</title>
		<link>https://blogs.vmware.com/PowerCLI/2022/11/powercli-13-is-now-ga.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Tue, 22 Nov 2022 08:05:19 +0000</pubDate>
				<category><![CDATA[Release]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4347</guid>

					<description><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div>We are excited to announce that PowerCLI 13.0 was officially released today. It is a major release full of new and exciting features. Here is what you can find in the new PowerCLI 13: PowerCLI is now fully multi-platform! The vCD module has been updated to support vCD 10.4 and some new features have been &#8230; <a href="https://blogs.vmware.com/PowerCLI/2022/11/powercli-13-is-now-ga.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>We are excited to announce that PowerCLI 13.0 was officially released today. It is a major release full of new and exciting features. Here is what you can find in the new PowerCLI 13:</p>
<ul>
<li>PowerCLI is now fully multi-platform!</li>
<li>The vCD module has been updated to support vCD 10.4 and some new features have been added to it.</li>
<li>Support for vSAN ESA has been added to the vSAN module.</li>
<li>OS customization spec support has been updated to support IPv6 and customization scripts.</li>
<li>Seed checkpoint and custom attributes support have been added to the HCX module.</li>
<li>vSphere and Horizon modules have been updated to support the latest API features of vSphere 8 and Horizon 8 2209.</li>
</ul>
<p>Let&#8217;s take a closer look at some of these features.</p>
<h3>Fully Multi-platform PowerCLI</h3>
<p>We have started the PowerCLI multi-platform journey back in 2018, just months after Microsoft released the first multi-platform version of PowerShell. Since then, we have gradually improved the multi-platform support by porting more and more modules.</p>
<p>Now we&#8217;re happy to announce that PowerCLI 13 is the first fully multi-platform version of PowerCLI. We have ported the last two Windows-only modules &#8211; ImageBuilder and AutoDeploy &#8211; and now they can run on all supported platforms.</p>
<p>To do that we have made some changes. Since Python is mandatory for the ImageBuilder module to run, we have decided not to bring Python with PowerCLI anymore, but to add it as a prerequisite for using the ImageBuilder module. So in PowerCLI 13, if you are using this module, you will need to have Python 3.7 installed on your machine. You will also need to install some additional packages in Python that the module uses (six, psutil, lxml, pyopenssl). We have added instructions in the <a href="https://developer.vmware.com/docs/15315/powercli-user-s-guide/GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html">PowerCLI User&#8217;s Guide</a> on how to install these on all supported platforms. We have also introduced a PowerCLI setting that allows you to set the path to the Python 3.7 installation. For this setting you can use</p><pre class="crayon-plain-tag">Set-PowerCLIConfiguration -PythonPath "&lt;path to the Python installation&gt;"</pre><p></p>
<h3>VMware Cloud Director module updates</h3>
<p>We have made several improvements in the vCD module in PowerCLI 13. First of all we updated the module to work with vCD 10.4 as well as to support the API features of vCD 10.4 (API version 37.0). But that&#8217;s not all. We have also extended some cmdlets with new parameters and parameter sets. For example, we have extended the <code>New-CIVM</code> cmdlet with a new parameter set that allows the creation of a blank VM, as well as the <code>New-OrgVdc</code> cmdlet with a new <code>-StorageProfile</code> parameter. We have also extended the <code>Get-NetworkPool</code> cmdlet to return the NSX-T-backed network pools.</p>
<p>Following some removals on the API side, we have removed the <code>Get/New/Set/Remove-OrgNetwork</code> cmdlets, which were replaced by the <code>Get/New/Set/Remove-OrgVdcNetwork</code> a long time ago.</p>
<h3>VMware vSAN Express Storage Architecture<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> support</h3>
<p>In PowerCLI 13 we&#8217;re also adding support for the new vSAN ESA. You can read more about this new vSAN architecture <a href="https://core.vmware.com/blog/introduction-vsan-express-storage-architecture">here</a>. We have introduced several new cmdlets (<code>Get-VsanEsaEligibleDisk</code> and <code>Add/Get/Remove-VsanStoragePoolDisk</code>) and extended some existing ones (<code>New/Set-Cluster</code> and <code>Get-VsanClusterConfiguration</code>) to enable support for vSAN ESA.</p>
<h3>NSX module updates</h3>
<p>To encourage the usage of the new NSX SDK module, we have added a dedicated chapter for it in the <a href="https://developer.vmware.com/docs/15315//GUID-52E0CF24-F338-4CF5-84BF-B5BAA0F2D07F.html">PowerCLI user&#8217;s guide</a>. In PowerCLI 13 we are also deprecating the old way of accessing the NSX APIs through the <code>Get-NsxtPolicyService, Get-NsxtGlobalManagerService</code> and <code>Get-VmcSddcNetworkService</code> cmdlets.</p>
<h3>HCX improvements</h3>
<p>In PowerCLI 13 we&#8217;re also adding some new HCX features. The HCX module now allows enabling seed checkpoint and migration of custom attributes.</p>
<h2>Certificate issue while upgrading</h2>
<p>As a quick reminder &#8211; you may encounter a certificate error while updating the existing PowerCLI module via Update-Module, as discussed <a href="https://twitter.com/KamenNikolov/status/1438503544206749703?s=20">here</a>. This is because we replaced the certificate that we used to sign the modules with a new one from a new publisher. To resolve this issue, delete the existing module and re-install the module with the Install-Module cmdlet.</p>
<h2>Summary</h2>
<p>PowerCLI 13 is the first fully multi-platform PowerCLI version, which also comes with updated vCD support, cmdlets for vSAN ESA and much more. For a full list of all improvements and fixes, check the PowerCLI 13.0 release notes. For more information on specific cmdlets, see the <a href="https://developer.vmware.com/docs/powercli/latest/products/" target="_blank" rel="noopener">PowerCLI Cmdlet Reference</a>.</p>
<p>Let us know in the comments what you think of this release!</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerCLI at VMware Explore US 2022</title>
		<link>https://blogs.vmware.com/PowerCLI/2022/08/powercli-at-vmware-explore-us-2022.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Tue, 16 Aug 2022 16:07:56 +0000</pubDate>
				<category><![CDATA[VMware Explore]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4327</guid>

					<description><![CDATA[<div><img width="300" height="191" src="https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-300x191.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-300x191.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-1024x653.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-768x490.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-600x383.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2.jpg 1342w" sizes="(max-width: 300px) 100vw, 300px" /></div>The countdown to VMware Explore in San Francisco is on and for the first time in three years we&#8217;re gathering together in person to show you the latest VMware technology innovations. And as usual there is a lot of great PowerCLI sessions and labs that you shouldn&#8217;t miss. The schedule builder is now live, so &#8230; <a href="https://blogs.vmware.com/PowerCLI/2022/08/powercli-at-vmware-explore-us-2022.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="191" src="https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-300x191.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-300x191.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-1024x653.jpg 1024w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-768x490.jpg 768w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2-600x383.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/08/vmware-explore-us-ad-2.jpg 1342w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>The countdown to <a href="https://www.vmware.com/explore/us.html">VMware Explore</a> in San Francisco is on and for the first time in three years we&#8217;re gathering together in person to show you the latest VMware technology innovations. And as usual there is a lot of great PowerCLI sessions and labs that you shouldn&#8217;t miss. The <a href="https://event.vmware.com/flow/vmware/explore2022us/content/page/catalog?src=so_6261c4a372891&amp;cid=7012H000001KawBQAS&amp;tab.contentcatalogtabs=1627421929827001vRXW">schedule builder</a> is now live, so make sure that you add these great sessions to you schedule and stay up-to-date with the latest innovation in PowerCLI.</p>
<h2>VMware {code} Sessions</h2>
<p><b>Session</b>: <strong>What’s New in VMware PowerCLI? [CODE2691US]</strong><br />
<b>Date</b>: <span class="semibold session-date">Thursday, Sep 1, </span><span class="semibold session-time">1:00 PM &#8211; 1:45 PM PDT</span><br />
<b>Speaker</b>: Kamen Nikolov<br />
Join us for this session to learn about the latest PowerCLI features, such as VMware vCenter Server Appliance services and VMware vSphere certificate management, the new approach for invoking vSphere REST APIs, PowerShell runspace support, extended VMware Cloud on AWS management, and much more. We have prepared interesting demos of the new features, useful scripting tips and tricks, as well as answers to all your questions related to PowerCLI.</p>
<p><b>Session</b>: <strong>Extending the UI with Script Actions – Meet PowerActions [CODE2690US]</strong><br />
<b>Date</b>: <span class="semibold session-date">Thursday, Sep 1, </span><span class="semibold session-time">12:00 PM &#8211; 12:45 PM PDT</span><br />
<b>Speaker</b>: Kamen Nikolov<br />
Many organizations have a ton of useful VMware PowerCLI scripts developed in-house for VMware vSphere automation. The problem is that these useful and time-saving scripts are only available to those admins that possess enough PowerShell and PowerCLI knowledge to know how to use commands, parameters, variables and so on. What if these scripts were available as easy-to-run actions directly from the vSphere UI? Meet PowerActions, the vSphere UI plug-in that allows extending the UI with custom PowerCLI scripts. PowerActions provides a script library and a user-friendly interface that allows you to build custom scripts through a wizard. PowerActions can be used by anyone in the organization, even if they have never touched PowerShell before. Join our session to learn more about PowerActions and see it in action.</p>
<p><b>Session</b>: <strong>Explore the New PowerCLI for NSX [CODE1881US]</strong><br />
<b>Date</b>: <span class="semibold session-date">Wednesday, Aug 31, </span><span class="semibold session-time">11:00 AM &#8211; 11:45 AM PDT</span><br />
<b>Speaker</b>: Madhukar Krishnarao<br />
VMware PowerCLI v12.6 introduces new high-level cmdlets to automation with VMware NSX. Learn about these new cmdlets and how to navigate the modules and build code whether NSX is on-premises or on VMware Cloud.</p>
<p><b>Session</b>: <strong>PowerCLI and REST APIs – A New Beginning [CODE2689US]</strong><br />
<b>Date</b>: <span class="semibold session-date">Thursday, Sep 1, 1</span><span class="semibold session-time">1:00 AM &#8211; 11:45 AM PDT</span><br />
<b>Speaker</b>: Kamen Nikolov<br />
In the latest PowerCLI versions, we developed a new, more intuitive approach to calling VMware REST APIs. We also built integration with the VMware REST API documentation database, so you can fetch PowerCLI samples directly from the API documentation portal. Join our session and see a demo of how you can easily automate workflows by using VMware vSphere and VMware NSX REST APIs with PowerShell.</p>
<p><b>Session</b>: <strong>Try This, Catch That, Finally – An Explanation on PowerCLI Error Handling [CODE1865US]</strong><br />
<b>Date</b>: <span class="semibold session-date">Wednesday, Aug 31, </span><span class="semibold session-time">3:00 PM &#8211; 3:45 PM PDT</span><br />
<b>Speaker</b>: Justin Sider<br />
Automation is impossible if your VMware PowerCLI scripts cannot run through to completion. Handling errors properly can greatly improve your code writing skills. Whether the script is a few lines or a few hundred lines, there are great efficiencies to be gained from using try/catch/finally blocks. During this session, Justin will cover the main differences between terminating and non-terminating errors. Examples of each type of error will be shown so you can see the code in action. This session will also cover the ErrorAction parameter. This presentation will have plenty of live code examples interacting with APIs and custom functions to ensure you can see the real-world application of these PowerShell tools.</p>
<h2>Hands on Labs</h2>
<p><b>Lab</b>: <strong>VMware vSphere Automation &#8211; PowerCLI [SPL-HOL-2211-04-SDC]</strong><br />
<b>Date</b>: Anytime the HOL area is open and available<br />
Get hands-on with VMware PowerCLI. Gain familiarity with the tool, and then dive deeper into the functionality available with real-world examples. Both new and experienced users are sure to learn something new about automating their environments.</p>
<p><b>Lab</b>: <strong>Automate your VMware Cloud on AWS [SPL-HOL-2287-04-ISM]</strong><br />
<b>Date</b>: Anytime the HOL area is open and available<br />
Learn about a number of tools that will help you automate your VMware Cloud on AWS environment. See how with PowerCLI and DatacenterCLI can query the status of your SDDC, perform log analysis, security event audits and expand capacity with few commands. Be amazed by the simplicity, value and benefits of using infrastructure as code with Terraform to manage, change or decommission your infrastructure. Take a look at a recent Fling that was published to automatically save the network configuration of your SDDC and restore it to another VMC SDDC.</p>
<p>Also don&#8217;t miss the VMware Odyssey by Hands-on Labs, which also includes some PowerCLI tasks</p>
<p><b>Lab</b>: <strong>VMware Odyssey by Hands-on Labs [ODY-HOL-2200-81-ODY]</strong><br />
<b>Date</b>: Anytime the HOL area is open and available<br />
<span style="font-size: 1rem;">VMware Odyssey by Hands-on Labs is an exciting way to challenge yourself and compete against your peers for the chance to earn prizes and bragging rights. Our Tournament is back in 2022 and more exciting than ever! Each of the first three days of VMware Explore you can complete tasks in a live lab environment, while racing against the clock. Be sure to visit each day as the cumulative leaderboard will show the results in ranked order. The top scores will qualify for the live tournament on the last day, and the winners will be awarded prizes. Be sure to take an Odyssey challenge each day and we’ll see you on the leaderboard!</span></p>
<p>&nbsp;</p>
<p><a href="https://www.vmware.com/explore/us.html">VMware Explore</a> is the new premier event to learn about the latest PowerCLI news. So if you haven&#8217;t registered yet make sure that you do it today and add all those great sessions to your schedule.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New Release &#8211; PowerCLI 12.7</title>
		<link>https://blogs.vmware.com/PowerCLI/2022/07/new-release-powercli-12-7.html</link>
		
		<dc:creator><![CDATA[Kamen Nikolov]]></dc:creator>
		<pubDate>Thu, 14 Jul 2022 12:24:18 +0000</pubDate>
				<category><![CDATA[Release]]></category>
		<category><![CDATA[NSX]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[VUM]]></category>
		<guid isPermaLink="false">https://blogs.vmware.com/PowerCLI/?p=4312</guid>

					<description><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div>The PowerCLI team has some exciting news this week! PowerCLI version 12.7 is out and it&#8217;s packed with lots of new and exciting features. We have made a long requested module available on PowerShell Core, extended many cmdlets and added some new ones, and also improved the performance of others. PowerCLI 12.7 comes with the &#8230; <a href="https://blogs.vmware.com/PowerCLI/2022/07/new-release-powercli-12-7.html">Continued</a>]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="168" src="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg" class="attachment-medium size-medium wp-post-image" alt="" decoding="async" loading="lazy" style="margin-bottom: 10px;" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-300x168.jpg 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-576x324.jpg 576w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1-600x335.jpg 600w, https://blogs.vmware.com/PowerCLI/files/2022/07/vmw-ico-powercli-vmc-rgb_400px-1.jpg 743w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>The PowerCLI team has some exciting news this week! PowerCLI version 12.7 is out and it&#8217;s packed with lots of new and exciting features. We have made a long requested module available on PowerShell Core, extended many cmdlets and added some new ones, and also improved the performance of others.</p>
<p>PowerCLI 12.7 comes with the following updates:</p>
<ul>
<li>The VUM module has been ported to PowerShell 7 and now supports Linux and macOS.</li>
<li>Remote authentication support has been added to Connect-NsxServer cmdlet.</li>
<li>The usability of Get-NsxOperation cmdlet has been improved.</li>
<li>The NSX module has been updated with the latest API features.</li>
<li>The Horizon module has also been updated with the latest API features of Horizon 8.4.</li>
<li>Support for vSAN health check threshold, historical health check and remote datastores has been added to the vSAN cluster configuration.</li>
<li>Performance improvements in Connect-SrmServer and Get-HCXVM cmdlets.</li>
</ul>
<p>Let&#8217;s take a closer look at some of these updates.</p>
<h2>Multi-platform VUM module</h2>
<p>One of the last non-multiplatform PowerCLI modules is now available for Linux and macOS after a lot of customer requests that we received in the last months and years. We started our multiplatform journey shortly after the first PowerShell core version was launched. Since then we&#8217;ve ported almost all of the PowerCLI modules with now only two modules left. We&#8217;re very happy to see that our hard work in this direction already pays off &#8211; PowerCLI is now the multi-platform VMware CLI with more than half of our users today using PowerShell 7 and more than 40% using PowerCLI on Linux and macOS.</p>
<h2>NSX module improvements</h2>
<p>We have introduced the new NSX SDK module in PowerCLI 12.6. If you haven&#8217;t already you can check this great <a href="https://blogs.vmware.com/networkvirtualization/2022/05/navigating-nsx-module-in-powercli-12-6.html/">blog post</a> from <a class="author url fn" title="Posts by Madhukar Krishnarao" href="https://blogs.vmware.com/networkvirtualization/author/madhukar_krishnarao/" rel="author">Madhukar Krishnarao</a> on how to use it to perform the most common NSX operations. In this release we&#8217;re updating it with the latest NSX API features, adding remote authentication to the Connect-NsxServer cmdlet with the -UseRemoteAuthentication parameter, and improving the usability of Get-NsxOperation cmdlet.</p>
<p>Let&#8217;s dig a bit deeper in the Get-NsxOperation improvements. We have changed the way the -Path parameter works in Get-NsxOperation. In 12.6 it required the path to be in the format that is used in the NSX API specification, which was different from the one that was used in the NSX API documentation. This is now changed and you can just copy/paste the operation URL from the API documentation to get the corresponding PowerCLI cmdlet with Get-NSXOperation as in the example below:</p>
<p><a href="https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot.png"><img decoding="async" loading="lazy" class="alignnone wp-image-4313" src="https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-300x161.png" alt="" width="933" height="501" srcset="https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-300x161.png 300w, https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-1024x550.png 1024w, https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-768x413.png 768w, https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-1536x826.png 1536w, https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-2048x1101.png 2048w, https://blogs.vmware.com/PowerCLI/files/2022/07/nsx-api-screenshot-600x323.png 600w" sizes="(max-width: 933px) 100vw, 933px" /></a></p>
<p>Another change in the -Path parameter behavior is that it no longer returns all the operations that contain the specified path, but only the exact matches. Of course, you can still use wildcards to find multiple operations by part of the path.</p>
<p><strong>New vSAN cluster configuration options</strong></p>
<p>We have added several new vSAN cluster configuration options. You can now set vSAN health check thresholds using the -CapacityThreshold parameter of Set-VsanClusterConfiguration and New-VsanHealthCheckThreshold. You can also enable or disable vSAN historical health check as well as mount or unmount datastore from another cluster as remote datastore using Set-VsanClusterConfiguration. Here are some samples:</p><pre class="crayon-plain-tag">$newThreshold = New-VsanHealthCheckThreshold -Enabled $true -YellowValue 95 -RedValue 99 -Target VsanDatastore
Set-VsanClusterConfiguration -Configuration $cluster -CapacityThreshold $newThreshold -HistoricalHealthEnabled $false</pre><p></p><pre class="crayon-plain-tag">$remoteDatastore = Get-Datastore 'MyDatastore'
Set-VsanClusterConfiguration -Configuration $cluster -MountRemoteDatastore $remoteDatastore</pre><p></p>
<h2>Certificate issue while upgrading</h2>
<p>You may encounter a certificate error while updating the existing PowerCLI module via Update-Module, as discussed <a href="https://twitter.com/KamenNikolov/status/1438503544206749703?s=20">here</a>. This is due to the fact that we replaced the certificate we used to sign the modules with a new one from a new publisher. To resolve this issue delete the existing module and re-install the module with the Install-Module cmdlet.</p>
<h2>Summary</h2>
<p>PowerCLI 12.7 comes with improved multiplatform support, NSX and vSAN improvements, and SRM and HCX performance optimizations. For a full list of all improvements and fixes check the <a href="https://code.vmware.com/doc/preview?id=15763">PowerCLI 12.7 release notes</a>. For more information on specific cmdlets, see the <a href="https://developer.vmware.com/docs/powercli/latest/products/" target="_blank" rel="noopener">PowerCLI Cmdlet Reference</a>.</p>
<p>Let us know in the comments what you’re looking forward to most!</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
