安装配置 HYPER V Core SERVER 的基本命令 - Hyper V 2012 R2
admin
2023-03-10 10:42:15
0

安装配置 HYPER V Core SERVER 的基本命令 - Hyper V 2012 R2

1. 基本命令

安装集群故障转移角色

Install-WindowsFeature -name Failover-Clustering -IncludeManagementTools

关闭防火墙

netsh advfirewall set allprofiles state off

关闭IPv6

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents -PropertyType DWord -Value 0xffffffff

安装 SNMP

Add-WindowsFeature -Name SNMP-Service -IncludeAllSubFeature -IncludeManagementTools

加入域之前检查区域和时间的准确性 ,例如:

Set-Date -date "6/17/2018 5:10 AM

确保安装了最新的 Update Rollups, hotfixes, 包括关键性补丁。

https://social.technet.microsoft.com/wiki/contents/articles/20885.hyper-v-update-list-for-windows-server-2012-r2.aspx

确保安装最新的网卡驱动。例如:

Tip: to check Fibre HBA driver versions, use "Get-WmiObject -class MSFC_FCAdapterHBAAttributes -computername MyTestServer -namespace "root\WMI" | Select-Object DriverVersion, FirmwareVersion, Manufacturer, Model, SerialNumber | Format-Table -AutoSize"

扫描可用磁盘

"rescan" | diskpart

2. 网络

重命名网卡,例如

Rename-NetAdapter -Name "Ethernet 5" -NewName iSCSI1

配置网卡IP

$netadapter = Get-NetAdapter -Name iSCSI1
$netadapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress 192.168.10.2 -PrefixLength 24 -Type Unicast

给网卡配置DNS

Set-DnsClientServerAddress -InterfaceAlias -ServerAddresses ,

启用 Jumbo frames

Set-NetAdapterAdvancedProperty -Name iSCSI1 -RegistryKeyword "*JumboPacket" -RegistryValue 9014

对iSCSI网卡禁用文件和打印共享
- 下载 NVSPbind : http://archive.msdn.microsoft.com/nvspbind/ , 拷贝到本地服务器
- 运行 nvspbind.exe . 列出所有网卡信息,启用/禁用的协议。找出NIC ID(或者查看注册表)
- 禁用文件和打印共享: 例如: nvspbind - d {913D8F46-BFC7-4359-A024-90485C276984} ms_server
更新网卡绑定顺序,规则:iSCSI - 底部, cluster - 中部, “用于外部链接的网卡” - 顶部
- 查看当前顺序: nvspbind /o ms_tcpip
- 移动到顶部: nvspbind /++ "Local Area Connection" ms_tcpip
- 向上移动一次: nvspbind /+ "Local Area Connection" ms_tcpip
- 移动到底部: "nvspbind /-- "iSCSI1" ms_tcpip"hvr.inf
创建 NIC Teaming:

New-NetLbfoTeam -name AdminTeam -TeamMembers VM1,VM2 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm HyperVPort

创建 converged fabric switch:

''' New-VMSwitch "ConvergedSwitch" –NetAdapterName "ConvergedTeam" –MinimumBandwidthMode Weight –AllowManagementOS $false'''

''' Set-VMSwitch -Name "ConvergedSwitch" -DefaultFlowMinimumBandwidthWeight 0 '''

加入虚拟网卡:
Add-VMNetworkAdapter -ManagementOS -Name "LiveMigration" -SwitchName "ConvergedSwitch"
Add-VMNetworkAdapter -ManagementOS -Name "ClusterCSV" -SwitchName "ConvergedSwitch"
Set-VMNetworkAdapter -ManagementOS -Name "LiveMigration" -MinimumBandwidthWeight 50
Set-VMNetworkAdapter -ManagementOS -Name "ClusterCSV" -MinimumBandwidthWeight 50
New-NetIPAddress -InterfaceAlias "vEthernet (LiveMigration)" -IPAddress 10.40.1.123 -PrefixLength "16"
New-NetIPAddress -InterfaceAlias "vEthernet (ClusterCSV)" -IPAddress 10.30.1.133 -PrefixLength "16"
查看虚拟网卡配置的权重:
"Get-vmnetworkadapter -ManagementOS | fl"

3. iSCSI 配置

Set-Service -Name MSiSCSI -StartupType Automatic
Start-Service MSiSCSI
Install-WindowsFeature Multipath-IO
Enable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
Enable-MSDSMAutomaticClaim -BusType iSCSI
Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
Set-MPIOSetting -NewDiskTimeout 60
Connecting to an iSCSI SAN:
    - New-IscsiTargetPortal -TargetPortalAddress 192.168.30.10
    - Get-IscsiTarget | fl
    - Use 'iscsicpl' to configure iSCSI targets or, as an example, connect using something like: "Connect-IscsiTarget -NodeAddress iqn.2001-05.com.equallogic:8-cb2b76-66f2c8e4a-67859b190555933f-vm2012 -AuthenticationType ONEWAYCHAP -ChapUsername liquid_chap2012 -ChapSecret chappassword–IsMultipathEnabled $True -IsPersistent $True"
    - Initialize a disk, if it's new: "Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "VMs2012-2" -Confirm:$false"

4. 光纤配置

    - Install-WindowsFeature Multipath-IO
    - Enable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
    - Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
    - Set-MPIOSetting -NewDiskTimeout 60
    - Update-MPIOClaimedHW (and restart the server)
    - Launch mpiocpl. If the expected device (COMPELNT, for example) isn't in the devices list, click on the "Discover Multi-Paths" tab and add the FC SAN from the Others list (COMPELNT, for example). Restart the server.
    - To rescan available disks, use " "rescan" | diskpart "
    - Initialize a disk, if it's new: "Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "VMs2012-2" -Confirm:$false"

相关内容

热门资讯

今日重大消息“快乐打筒子.到底... 您好:快乐打筒子这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这款游...
女子打车遇“最炫出租车”,网友... 极目新闻记者 王柳钦近日,有网友发视频称,她和朋友在吉林长春乘坐出租车时,意外坐上了一辆改装有绚丽星...
【第一资讯】“衡阳十胡卡.辅助... 有 亲,根据资深记者爆料衡阳十胡卡是可以开挂的,确实有挂(咨询软件无需打...
“将首都从莫斯科迁往西伯利亚”... 【环球网报道 记者 张江平】据俄新社23日报道,俄罗斯总统办公厅副主任马克西姆·奥列什金在出席一场科...
终于懂了“情怀娱乐.开挂神器?... 家人们!今天小编来为大家解答情怀娱乐透视挂怎么安装这个问题咨询软件客服徽4282891的挂在哪里买很...
终于明白“天府红桃3.辅助器?... 您好:天府红桃3这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款游...
重磅消息“情怀娱乐.到底有挂吗... 您好:情怀娱乐这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9752949】很多玩家在这款游戏...
【第一资讯】“新皇豪炸金花.到... 有 亲,根据资深记者爆料新皇豪炸金花是可以开挂的,确实有挂(咨询软件无需...
【第一资讯】“西兵互娱牛牛.到... 您好:西兵互娱牛牛这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款...
重磅消息“情怀娱乐.可以开挂吗... 重磅消息“情怀娱乐.可以开挂吗?”太坑了原来有挂您好,情怀娱乐这个游戏其实有挂的,确实是有挂的,需要...