设为首页 收藏本站
查看: 1255|回复: 0

[经验分享] [转]使用Hyper-V BPA(Best Practices Analyzer-最佳化分析工具)

[复制链接]

尚未签到

发表于 2015-4-3 10:01:40 | 显示全部楼层 |阅读模式
本帖最后由 wuyvzhang 于 2016-8-2 17:25 编辑

  使用Hyper-V BPA(Best Practices Analyzer-最佳化分析工具)   這篇介紹的是Windows 2008 R2的Hyper-V Best Practices Analyzer   這個工具可以快速的檢查出目前Hyper-V非最佳化的設定,並給予建議跟修正的方向   首先需要先將KB977238安裝在Hyper-V Server上   KB977238:Windows Server 2008 R2 x64 Edition 之 HYPER-V 的 Best Practices Analyzer 更新   安裝完並不需要重新開機,請放心使用      安裝完後,就可以到【伺服器管理員】→【Hyper-V】→【Best Practices Analyzer】去掃描是否有未最佳化的設定 DSC0000.png   接著就可以看他的原因、跟解決方法 DSC0001.png      以上是安裝有GUI版本的Hyper-V,如果是使用Server Core版本的話,則是使用Powershell   需要先Import ServerManager的Module(因為BPA是ServerManager的組件)   語法:   Import-Module ServerManager   Import-Module BestPractices   接著就是執行BPA   Invoke-Bpamodel Microsoft/Windows/Hyper-V DSC0002.png   然後,去取得BPA的Report   Get-BpaResult Microsoft/Windows/Hyper-V   或者是匯出成csv格式   Get-BpaResult Microsoft/Windows/Hyper-V | Export-Csv C:\Hyper-V_BPA.csv DSC0003.png   您也可以使用微軟原廠所提供的PowerShell Script去將資訊匯出成csv格式(預設存放csv的路徑是User的Desktop)   路徑的部份,您可以修改$OutputPath的參數例如:$OutputPath = “C:\Hyper-V_BPA” view source print?
01# the following command will run Hyper-V Best Practices Analyzer (KB977238) and exports the result in CSV format c:\temp\Hyperv_BPA_Report.csv
02# Powershell Help: Get-Help about_BestPractices
03# Hyper-V BPA ID: Microsoft/Windows/Hyper-V
04# This Sample script was last updated by mghazai on 06/08/2010
05
06# Disclaimer:
07# This sample script is not supported under any Microsoft standard support program or service. The software is provided AS IS without warranty of any kind.
08# Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The
09# entire risk arising out of the use or performance of the software and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved
10# in the creation, production, or delivery of the software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits,
11# business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the software or documentation, even if
12# Microsoft has been advised of the possibility of such damages.?
13
14# Please make sure PowerShell Execution policy is configured properly as this script isn't signed. Get-ExecutionPolicy
15
16
17$OutputPath = $env:USERPROFILE + "\Desktop\Hyperv_BPA_Report.csv"
18import-module ServerManager
19import-module BestPractices
20
21if ((Get-windowsfeature hyper-v).BestPracticesModelId -eq $null)
22 {
23 write-host
24 write-host -ForegroundColor red "Hyper-V Best Practices Analyzer is not installed on the server."
25 write-host -ForegroundColor red "Please see Microsoft KB977238"
27 write-host
28 }
29
30else{
31
32 $BPAResults = Invoke-BpaModel Microsoft/Windows/Hyper-V
33
34 Get-BPAResult Microsoft/Windows/Hyper-v | select ResultNumber,@{Name="Server Name"; Expression={hostname}},ModelId,RuleId,ResultId,Severity,NeutralSeverity,Category,Title,Problem,Impact,Resolution,Compliance,Help,Excluded | Export-Csv $OutputPath
35
36 If ($BPAResults[0].Success -eq $True) {
37
38 Write-Host
39 Write-Host -ForegroundColor green "The BPA Output has been saved in $OutputPath"
40 Write-Host
41
42 }
43 else{
44
45 Write-Host -ForegroundColor red "Error!!!!"
46 Write-Host -ForegroundColor red $BPAResults[0].Detail
47
48 }
49}
SO娱乐城:真_人.足球.彩票齐全| 开户送10元.首存送58元.手机可投ゥ注任何游戏顶级信用ゥ提现即时到账SO.CC

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-53446-1-1.html 上篇帖子: Microsoft Support 下篇帖子: [转]Hyper-V Cluster Shared Volume 原理初探
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表