VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

health of vcenter appliance using connect-cisserver

Hi Luc,

can you please suggest if i can use rest apis to anayse health of vcenter appliance using connect-cisserver.

i used following  and health of vcenter appliance comes as orange .right now i dont have vcenter root password to check gui.are there further apis to analyse further .

pastedImage_0.png

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid there is currently no fool-proof way available to make the link between a guest OS partition and the VMDK on which it lives.

But luckily, the VCSA partition-VMDK mapping is well documented.

See for example the table in William's post Updates to VMDK partitions & disk resizing in VCSA 6.5

What you are seeing for /storage/archive is intentional and by design (see KB57829).

The issue with the warning message is fixed VCSA 6.7U1b

Note that you increase the VCSA file sizes via a REST API (/appliance/system/storage/resize)

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
12 Replies
LucD
Leadership
Leadership
Jump to solution

Yes, there are quite a few.

Use the API EXplorer (https://<vcsa-FQDN>/apiexplorer)  to see what is available in your vSphere version.

It depends what you want to see.
There is for example the option to check the status of the services.

Connect-CisServer -Server $vcName | Out-Null

$vmon = Get-CisService -Server $vcName -Name 'com.vmware.appliance.vmon.service'

$services = $vmon.list_details()

$services.GetEnumerator() |

Select @{N='Service';E={$_.Key}},

   @{N='State';E={$_.Value.state}},

   @{N='Health';E={$_.Value.health}},

   @{N='Startup';E={$_.Value.startup_type}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks Luc .since the health of storage comes out orange as mentioned in the screen shot .i am trying to see the partitions space for vcsa.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Afaik, that is not available through the REST API.

Can't you see that with

(Get-VM -Name <vcsa>).Guest.Disks


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks .i found  /storage/archive is nearly full .there are 12 partitions and 13 hard drives .now we need to find disk corresponding to /storage/archive.

pastedImage_0.png

i thought of finding in percentage format as this thing is missing in all powercli commands . can we add some logic in below to find corresponding vmdk to be increased ??

Connect-CisServer -Server "servervc" -Credential $credential

$health_appliancestorage=(Get-CisService -Name 'com.vmware.appliance.health.storage').get()

$health_appliancestorage

if($health_appliancestorage -ne 'green')

{

Disconnect-CisServer -Server "servervc"

Connect-VIServer -Server "servervc" -Credential $credential

$vm=get-vm servervc

$paths=$vm.Guest.Disks

$paths

  foreach($p in $paths)

  {

  $partition_freespace_percent=$p.freespacegb/$p.capacityGB*100

  $partition_freespace_percent_round=[math]::Round($partition_freespace_percent)

 

  $p|select @{N='vmname';E={$vm.name}},@{N='partition';E={$p.Path}},@{N='freespacepercent';E={$partition_freespace_percent_round}}

  }}

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid there is currently no fool-proof way available to make the link between a guest OS partition and the VMDK on which it lives.

But luckily, the VCSA partition-VMDK mapping is well documented.

See for example the table in William's post Updates to VMDK partitions & disk resizing in VCSA 6.5

What you are seeing for /storage/archive is intentional and by design (see KB57829).

The issue with the warning message is fixed VCSA 6.7U1b

Note that you increase the VCSA file sizes via a REST API (/appliance/system/storage/resize)

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

thnaks luc.as per the vmware kB it should be autoclearedby archiver service .

i also run your code to check all the services started .is there any specific service realted to archiver .

pastedImage_0.png

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That should be the vmware-postgres-archiver service.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

tx .since it is started I think as mentioned in kb 6.71b update will get rid of this.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The update will get rid of the message mentioned in the KB.
The partition will always be close to 100% used, that is how it set up.
The archiver will remove old entries when there is a need to have more space.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

though it is by design to utilise nearly 100 percent of partition  space but update will make health  green from orange .

and this will avoid confusion of unhealthy  vcenter appliance. Is that correct?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is indeed how I understood the explanation in the KB.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

thanks .let me paint it green:smileylaugh:

0 Kudos