dsccommunity / iSCSIDsc

DSC resources for configuring Windows iSCSI targets and initiators.
https://dsccommunity.org
MIT License
7 stars 10 forks source link

ResourceName: iscsiinitiator #42

Open ewhitesides opened 5 years ago

ewhitesides commented 5 years ago

applied configuration extremely similar to the example given for the iSCSIInitiator resource. however, tests show the following even though it is connected and working fine:

Service iSCSIService { Name = 'MSiSCSI' StartupType = 'Automatic' State = 'Running' }

iSCSIInitiator iSCSIInitiator { Ensure = 'Present' NodeAddress = 'iqn.2000-01.com.longiscsiname' TargetPortalAddress = 'x.x.x.x' InitiatorPortalAddress = 'x.x.x.x' IsPersistent = $true DependsOn = "[Service]iSCSIService" }

VERBOSE: [mycomputer]: LCM: [ Start Resource ] [[iSCSIInitiator]iSCSIInitiator] VERBOSE: [mycomputer]: LCM: [ Start Test ] [[iSCSIInitiator]iSCSIInitiator] VERBOSE: [mycomputer]: [[iSCSIInitiator]iSCSIInitiator] Test-TargetResource: Testing iSCSI Initiator 'iqn.2000-01.com.longiscsiname', 'x.x.x.x' from ''. VERBOSE: [mycomputer]: [[iSCSIInitiator]iSCSIInitiator] Test-TargetResource: iSCSI Connection 'iqn.2000-01.com.longiscsiname' does not exist but should. Change required. VERBOSE: [mycomputer]: LCM: [ End Test ] [[iSCSIInitiator]iSCSIInitiator] False in 0.2500 seconds. VERBOSE: [mycomputer]: LCM: [ End Resource ] [[iSCSIInitiator]iSCSIInitiator]

because it works correctly in applying, my temporary solution is to apply it, then comment it out, and apply my configuration again, so the testing doesn't keep alerting me on a false configuration.

PlagueHO commented 5 years ago

Hi @ewhitesides - thanks for raising this. It does look like a bit of a bug here. If you run the following commands on the machine with the initiator what do you see:

Get-iSCSIConnection -IscsiTarget (Get-iSCSITarget -NodeAddress 'iqn.2000-01.com.longiscsiname')

Also, what do you see if you just run:

Get-iSCSIConnection

What appears to be happening is that all the target is all set up the connection record isn't appearing.

ewhitesides commented 5 years ago

get-iscsiconnection returns an object with info on the connection get-iscsiconnection | get-iscsitarget also returns the correct node address.

however, get-isciconnection -iscsitarget (get-iscsitarget -nodeaddress ) returns 'no matching MSFT_iSCSIConnection objects found'