<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Simplivity Total Backup Report in HPE SimpliVity</title>
    <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7098266#M1689</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I create a case to HPE send to us a script, now we are try,&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 11:41:05 GMT</pubDate>
    <dc:creator>sampiyonts</dc:creator>
    <dc:date>2020-08-14T11:41:05Z</dc:date>
    <item>
      <title>Simplivity Total Backup Report</title>
      <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096005#M1650</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is it possible In 4.0.0 version, is there a script how much data used for total backup and&amp;nbsp; for backup report per virtual server&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 19:15:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096005#M1650</guid>
      <dc:creator>sampiyonts</dc:creator>
      <dc:date>2020-07-22T19:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simplivity Total Backup Report</title>
      <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096068#M1652</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This feature is availaible in 4.0.1 as SimpliVity backup reporting for a centrally managed federation (MVA) and not 4.0.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HPE Employee&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 13:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096068#M1652</guid>
      <dc:creator>Shivam1</dc:creator>
      <dc:date>2020-07-23T13:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Simplivity Total Backup Report</title>
      <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096250#M1658</link>
      <description>&lt;P&gt;I recently wrote a powershell script that uses the Simplivity REST API and calculates the unique size (physical storage consumption) of all backups. It returns the 50 most disk consuming ones, or all of them if you want. I'm a powershell newbie, so it's kind of ugly, but it works. I think it's pretty self explanatory and I also commented it.&lt;/P&gt;&lt;P&gt;The first time you run it, it will calculate a lot of backups, because you haven't calculated any of them before, so you might want to monitor that the first time. I don't know how CPU intensive it is, but I didn't notice anything and we have 2000 backups on a 2 node cluster.&lt;/P&gt;&lt;P&gt;I run this script every night and e-mail myself the results.&lt;/P&gt;&lt;P&gt;Oh, and it uses Windows Subsystem for Linux because I couldn't be bothered with working out how curl works in powershell... &lt;LI-EMOJI id="lia_winking-face" title=":winking_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;/Gustav&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;#fetches all Simplivity backups, calculates their unique backup size and returns the 50 biggest backups. //Gustav 2020-07-22

$auth = $null
$result = $null
$backupArr = $null
$reportString = ""
$ovcIP = "x" # change me
$ovcUsername = "y" # change me
$ovcPassword = "z" # change me

#fetch token.
$auth = (wsl curl -k https://simplivity@$ovcIP/api/oauth/token -d grant_type=password -d username=$ovcUsername -d password=$ovcPassword) | convertfrom-json
$token = $auth.access_token

#fetch all backups. maximum number for the "limit" query parameter is 3000, so don't edit that to be any higher.
$result = (wsl curl -k https://simplivity@$ovcIP/api/backups?limit=3000 -H "Authorization: Bearer $($token)") | convertfrom-json

#calculate unique backup size for backups not yet calculated.
$counter = 0

foreach ($backup in $result.backups) {
  if ($backup.unique_size_timestamp -eq "NA") {
    $counter++
    write-host "`n`n$($backup.virtual_machine_name) $($backup.name) unique backup size has not been calculated yet. Calculating...`n"
    wsl curl -XPOST -k "https://simplivity@$ovcIP/api/backups/$($backup.id)/calculate_unique_size" -H "Authorization: Bearer $($token)" -H "Content-Type: application/vnd.simplivity.v1.1+json" -H "Content-Length: 0"
  }
}

$reportString += "$($counter) backups calculated for its unique backup size.`n`n"

#get unique backup size in MB for all backups that have been calculated and consume more than 0 bytes of space.
foreach ($backup in $result.backups) {
  if ($backup.unique_size_timestamp -ne "NA" -And $backup.unique_size_bytes -ne 0) {
    $sizeInMB = [math]::Round($backup.unique_size_bytes / 1024 / 1024)
    $backupArr += @(@{name=$backup.virtual_machine_name; cluster=$backup.omnistack_cluster_name; backupName=$backup.name; size=$sizeInMB})
  }
}

#sort the array of backups by unique backup size and include only the 50 biggest objects. modify this value if you want to return more or less results.
$backupArr = $backupArr | Sort-Object {$_.size} -descending | select-object -first 50

foreach ($obj in $backupArr) {
  $reportString += "VM: $($obj.name). Backup: $($obj.backupName). Cluster: $($obj.cluster). Size: $($obj.size) MB`n"
}

$to = ""
$from = ""
$smtpServer = ""
$subject = "SVT backup size"

Send-MailMessage -from $from -to $to -subject $subject -body $reportString -smtpServer $smtpServer -encoding "utf8"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 19:42:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7096250#M1658</guid>
      <dc:creator>guan8</dc:creator>
      <dc:date>2020-07-24T19:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Simplivity Total Backup Report</title>
      <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7098266#M1689</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I create a case to HPE send to us a script, now we are try,&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7098266#M1689</guid>
      <dc:creator>sampiyonts</dc:creator>
      <dc:date>2020-08-14T11:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simplivity Total Backup Report</title>
      <link>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7144340#M2699</link>
      <description>&lt;P&gt;It looks like the script is not working in Windows 11.&lt;/P&gt;&lt;P&gt;In order to use the script I needed to get Linux Subsystem for Windows, which requires Windows insider programme. Script worked great until the programme decided to enroll the computer to Windows 11.&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;convertfrom-json Invalid JSON primitive W.&lt;BR /&gt;At CalculateUniqueBackup.ps112 char158&lt;BR /&gt;+ ... ovcUsername -d password=$ovcPassword) Out-String convertfrom-json&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;Tried both -RAW and Out-String parameters, they dont work.&lt;/P&gt;&lt;P&gt;It has issues with the ConvertFrom-JSON, tried different PS versions, no luck.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 09:05:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-simplivity/simplivity-total-backup-report/m-p/7144340#M2699</guid>
      <dc:creator>steez</dc:creator>
      <dc:date>2021-08-02T09:05:55Z</dc:date>
    </item>
  </channel>
</rss>

