VMware Cloud Community
Sany_1973
Enthusiast
Enthusiast
Jump to solution

How to TAG Drive as Capacityflash for a vendor in command line

I have a VSAN setup contains all flash.I need to make drives from a particular vendor to CapacityFlash through command line.

Thanks.

Reply
0 Kudos
1 Solution

Accepted Solutions
TheBobkin
Champion
Champion
Jump to solution

Hello,

Yes, if you have the model name of the drives you can use this in RVC to mark them all:

(run at vcenter_server/data_center/computers/cluster/hosts)

#vsan.host_claim_disks_differently --claim-type capacity_flash --model <model_name> *

There is also a PowerCLI method:

http://www.punchingclouds.com/2016/03/24/vmware-virtual-san-automated-deployments-powercli/

The section that covers marking as capacityflash with PowerCLI:

#Foreach ($vmh in $vmhosts) {

#   Write-Host "Finding disks for $($vmh)"

#   $esxcli = Get-ESXCLI -VMhost $vmh

#   0..1 | Foreach {

#       $DiskgroupNum = $_ +1

#       $Caching = ($esxcli.storage.core.device.list() | Where {$_.model -eq $cachingSSD})[$_]

#       $Capacity = ($esxcli.storage.core.device.list() | Where {$_.model -eq $capacitySSD})[$_]

#       Write-Host "Using $($caching.Vendor) - $($caching.Model) for Caching in Disk Group $Diskgroupnum" -foregroundColor Green

#       Write-Host "Using $($Capacity.Vendor) - $($Capacity.Model) for Capacity in Disk Group $Diskgroupnum" -foregroundColor Green

#       Write-Host "Tagging $($Capacity.Model) as Capacity"

#       $capacitytag = $esxcli.vsan.storage.tag.add(($capacity.Device), "capacityFlash")

#       Write-Host "Adding Storage devices to $($vmhost)"

#       $adddisks = $esxcli.vsan.storage.add(($capacity.device), ($Caching.device))

#       if ($adddisks -eq "true") {

#            Write-Host "Disks added" -ForegroundColor Green

#       } Else {

#        Write-Host "Error adding disks: $adddisks" -ForegroundColor Red

#      }

#}

Bob

-o- If you found this comment useful or answer please select as 'Answer' and/or click the 'Helpful' button, please ask follow-up questions if you have any -o-

View solution in original post

3 Replies
Sany_1973
Enthusiast
Enthusiast
Jump to solution

Can we filter By Vendor in RVC ?

This is actually for a VSAN cluster with all flash disks.

I need to make some disks as capacity Flash for automatic disk claim work nicely.

Reply
0 Kudos
TheBobkin
Champion
Champion
Jump to solution

Hello,

Yes, if you have the model name of the drives you can use this in RVC to mark them all:

(run at vcenter_server/data_center/computers/cluster/hosts)

#vsan.host_claim_disks_differently --claim-type capacity_flash --model <model_name> *

There is also a PowerCLI method:

http://www.punchingclouds.com/2016/03/24/vmware-virtual-san-automated-deployments-powercli/

The section that covers marking as capacityflash with PowerCLI:

#Foreach ($vmh in $vmhosts) {

#   Write-Host "Finding disks for $($vmh)"

#   $esxcli = Get-ESXCLI -VMhost $vmh

#   0..1 | Foreach {

#       $DiskgroupNum = $_ +1

#       $Caching = ($esxcli.storage.core.device.list() | Where {$_.model -eq $cachingSSD})[$_]

#       $Capacity = ($esxcli.storage.core.device.list() | Where {$_.model -eq $capacitySSD})[$_]

#       Write-Host "Using $($caching.Vendor) - $($caching.Model) for Caching in Disk Group $Diskgroupnum" -foregroundColor Green

#       Write-Host "Using $($Capacity.Vendor) - $($Capacity.Model) for Capacity in Disk Group $Diskgroupnum" -foregroundColor Green

#       Write-Host "Tagging $($Capacity.Model) as Capacity"

#       $capacitytag = $esxcli.vsan.storage.tag.add(($capacity.Device), "capacityFlash")

#       Write-Host "Adding Storage devices to $($vmhost)"

#       $adddisks = $esxcli.vsan.storage.add(($capacity.device), ($Caching.device))

#       if ($adddisks -eq "true") {

#            Write-Host "Disks added" -ForegroundColor Green

#       } Else {

#        Write-Host "Error adding disks: $adddisks" -ForegroundColor Red

#      }

#}

Bob

-o- If you found this comment useful or answer please select as 'Answer' and/or click the 'Helpful' button, please ask follow-up questions if you have any -o-