{"id":264930,"date":"2015-09-04T11:04:02","date_gmt":"2015-09-04T07:04:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264930"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264930","title":{"rendered":"\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043c\u0435\u0441\u0442\u0430, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 Hyper-V"},"content":{"rendered":"<p>     \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u043c\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 System Center Virtual Machine Manager \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <i>Get-SCVirtualMachine<\/i> \u0438 \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u043c \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442\u0430 <i>Get-SCVirtualMachine<\/i>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u043b \u0432\u0441\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<pre><code>$totalhdd = 0 $vms =  Get-SCVirtualMachine  #| where {$_.Name -eq &quot;VM Name&quot;} # \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438  foreach ($vm in $vms) {               $totalhdd += ($vm.VirtualHardDisks.Size -as [double]) \/ 1TB}   } <\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0442\u0438\u0440\u0430\u0436\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u043e\u0440\u0443\u043c\u0430\u0445 technet \u0438 \u0432\u043e <a href=\"http:\/\/vniklas.djungeln.se\/2012\/02\/13\/vm-inventory-function-with-powershell-on-scvmm-2012\/\">\u0432\u0441\u044f\u043a\u0438\u0445 \u0431\u043b\u043e\u0433\u0430\u0445<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u0432 \u0438\u0445 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e. <a name=\"habracut\"><\/a> \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0446\u0438\u043a\u043b \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438: <i>$vm.VirtualHardDisks.Size<\/i> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0412\u041c \u0438 \u0435\u0451 \u0438\u043c\u044f. \u0412\u044b\u0432\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0412\u041c \u043e\u0431\u044a\u0451\u043c \u0431\u044b\u043b \u0440\u0430\u0432\u0435\u043d 0. \u042f \u0431\u044b\u043b \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e <i>$vm.VirtualHardDisks.Size<\/i> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u043c\u043c\u0443, \u043d\u043e \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 (\u0434\u043b\u044f \u0434\u0432\u0443\u0445 vhd). \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, powershell \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 1TB, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u043b 0:<\/p>\n<pre><code>PS D:\\Scripts\\IT_git&gt; $vm.VirtualHardDisks.Size 3547332608 4194304  PS D:\\Scripts\\IT_git&gt; ($vm.VirtualHardDisks.Size -as [double]) \/ 1TB 0 <\/code><\/pre>\n<p>  \u0414\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u0435\u0440\u0448\u0435\u043b\u043b\u0430 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 <i>ERROR<\/i>, \u0438\u043b\u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u043c\u0443 \u0430\u043d\u0442\u0438\u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043c\u0435\u0434\u0432\u0435\u0436\u044c\u044e \u0443\u0441\u043b\u0443\u0433\u0443. \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u043e\u0449\u0430\u0435\u0442.<\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0438 \u0446\u0438\u043a\u043b\u043e\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043d\u0430 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0443\u044e:<\/p>\n<pre><code>foreach ($vm in $vms) {        $vhds = $vm.VirtualHardDisks         foreach ($vhd in $vhds) { $totalhdd += ($vhd.Size -as [double]) \/ 1TB}   } <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0422\u0435\u043f\u0435\u0440\u044c \u0412\u041c \u0441 \u0434\u0432\u0443\u043c\u044f \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0438\u0441\u043a\u0430\u043c\u0438 \u0441\u0447\u0438\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u041d\u041e! \u0421\u0443\u043c\u043c\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0430\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0430, \u0445\u043e\u0442\u044c \u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u043b\u0430\u0441\u044c \u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<br \/>  \u041f\u043e\u0433\u043e\u043d\u044f\u043b \u0441\u0432\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0442\u0430\u043a, \u0438 \u044d\u0434\u0430\u043a. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u043f\u043e\u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u0438 \u0443\u0432\u0438\u0434\u0435\u043b, \u0447\u0442\u043e \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0412\u041c \u0441\u0443\u043c\u043c\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0434\u043e \u043a\u043e\u043f\u0435\u0439\u043a\u0438, \u0430 \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435. \u041f\u043e\u043b\u0435\u0437 \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u0442\u0430\u043c\u2026 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b! \u0418\u0445-\u0442\u043e \u043c\u044b \u0438 \u043d\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0438.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043e\u043f\u044f\u0442\u044c \u0433\u0443\u0433\u043b, \u043e\u043f\u044f\u0442\u044c \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043e\u0447\u0435\u043d\u044c \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 <a href=\"http:\/\/www.ivobeerens.nl\/2013\/09\/17\/list-hyper-v-snapshot-file-sizes-on-cluster-shared-volumes-with-powershell\/\">\u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a> \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e \u043c\u0430\u0441\u043a\u0435.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\u041c\u0435\u0442\u043e\u0434 \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c <i>*avhdx<\/i>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 avhd \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0441\u043d\u0430\u043f\u0448\u043e\u0442 \u043b\u0435\u0436\u0438\u0442 \u0441\u0435\u0431\u0435 \u0432 vhdx. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0433\u043e \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0438 \u0443 <a href=\"http:\/\/blog.fedenko.info\/2015\/07\/scvmm-powershel-checkpoints-size.html\">\u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432<\/a>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <i>Get-SCVirtualHardDisk<\/i> \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044f \u043a \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043b\u0438\u0448\u044c \u0442\u0435 \u0434\u0438\u0441\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <i>$vm.VirtualHardDisks<\/i>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435. \u0423 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <i>VMCheckpoints<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0431\u044a\u0435\u043a\u0442 <i>VMSnapshot <\/i>(\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b \u0447\u0435\u043c Snapshot \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 Checkpoint \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 SCVMM). \u0423 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <i>VirtualDiskDrives<\/i>, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <i>Size<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u044c: \u0438\u0437 <i>VirtualDiskDrives <\/i>\u043c\u044b \u0431\u0435\u0440\u0451\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <i>VirtualHardDiskID <\/i>\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e ID \u0434\u0435\u043b\u0430\u0435\u043c <i>Get-SCVirtualHardDisk<\/i>:<\/p>\n<pre><code>... # Snapshots search     foreach ($vmc in $vm.VMCheckpoints) {         foreach ($vdd in $vmc.VirtualDiskDrives) {             $vhd = Get-SCVirtualHardDisk -ID $vdd.VirtualHardDiskID             $snapshotshdd += ($vhd.Size -as [double]) \/ 1TB                       }     } ... <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c, \u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b \u043c\u043d\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <i>.bin<\/i> \u0438 <i>.vsv<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u0432\u0440\u043e\u0434\u0435 \u0434\u0430\u043c\u043f\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430\u2026 <b><i>$vm.TotalSize<\/i><\/b>. \u041a\u0442\u043e \u0431\u044b \u043c\u043e\u0433 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0437\u0430 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d!<br \/>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0440\u043d\u0438\u0438, \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u0438 \u0433\u0440\u0430\u0431\u043b\u0438 \u044f \u043d\u0430\u0448\u0451\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>$totalhdd = 0 $vms =  Get-SCVirtualMachine  #| where {$_.Name -eq &quot;VM Name&quot;} # \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438  foreach ($vm in $vms) {               $totalsize += ($vm.TotalSize  -as [double]) \/ 1TB   } <\/code><\/pre>\n<p>  \u0411\u044b\u043b\u043e \u0442\u0430\u043a \u0441\u043c\u0435\u0448\u043d\u043e, \u0447\u0442\u043e \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u0442\u0440\u0443\u0434\u043e\u043c. <br \/>  \u0417\u0430\u043b\u0438\u043b \u0432\u043e\u0442 \u0441\u044e\u0434\u0430 <a href=\"https:\/\/gallery.technet.microsoft.com\/scriptcenter\/Script-to-calculate-the-36a9314f\">gallery.technet.microsoft.com\/scriptcenter\/Script-to-calculate-the-36a9314f<\/a>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/266097\/\"> http:\/\/habrahabr.ru\/post\/266097\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u043c\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 System Center Virtual Machine Manager \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <i>Get-SCVirtualMachine<\/i> \u0438 \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u043c \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442\u0430 <i>Get-SCVirtualMachine<\/i>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u043b \u0432\u0441\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<pre><code>$totalhdd = 0 $vms =  Get-SCVirtualMachine  #| where {$_.Name -eq &quot;VM Name&quot;} # \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438  foreach ($vm in $vms) {               $totalhdd += ($vm.VirtualHardDisks.Size -as [double]) \/ 1TB}   } <\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0442\u0438\u0440\u0430\u0436\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u043e\u0440\u0443\u043c\u0430\u0445 technet \u0438 \u0432\u043e <a href=\"http:\/\/vniklas.djungeln.se\/2012\/02\/13\/vm-inventory-function-with-powershell-on-scvmm-2012\/\">\u0432\u0441\u044f\u043a\u0438\u0445 \u0431\u043b\u043e\u0433\u0430\u0445<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u0432 \u0438\u0445 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264930","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264930"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264930\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}