powershell iSCSI门户和目标配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell iSCSI门户和目标配置相关的知识,希望对你有一定的参考价值。

#set iSCSI Initiator Service to Automatic start
Set-Service -Name msiscsi -StartupType Automatic
#start service
Start-Service msiscsi

# to check if working: Get-WindowsOptionalFeature –Online –FeatureName MultiPathIO
# enable MPIO
Enable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
# to remove: Disable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
 
# enable and set the policy
# reboot will likely be required at some point with the next two commands
Enable-MSDSMAutomaticClaim -BusType iSCSI
#--------------------------------------------------
Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
#--------------------------------------------------

# Configure the iSCSI target portal
New-IscsiTargetPortal –TargetPortalAddress 10.0.1.2
 
# quorum drive
$target = Get-IscsiTarget -NodeAddress iqn.address
$target| Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $true -InitiatorPortalAddress 10.0.1.20 -TargetPortalAddress 10.0.1.2
 
#HyperVStorage
$target2 = Get-IscsiTarget -NodeAddress iqn.address
$target2| Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $true -InitiatorPortalAddress 10.0.1.20 -TargetPortalAddress 10.0.1.2
 
#HyperVVMs
$target3 = Get-IscsiTarget -NodeAddress iqn.address
$target3| Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $true -InitiatorPortalAddress 10.0.1.20 -TargetPortalAddress 10.0.1.2
 
# to remove: Disconnect-IscsiTarget

以上是关于powershell iSCSI门户和目标配置的主要内容,如果未能解决你的问题,请参考以下文章

Linux从入门到精通——iscsi

ISCSI共享磁盘

IP-SAN在Windows端配置

ESXI使用记录---esxi主机通过iscsi连接存储

如何以编程方式在 linux 上创建 iscsi 目标?

Linux下配置iSCSI服务器,实现资源共享