Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iSCSIInitiator: iSCSI initiator doesn't refresh when new target is added #43

Open
kungfoome opened this issue Mar 3, 2019 · 0 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@kungfoome
Copy link

kungfoome commented Mar 3, 2019

Details of the scenario you tried and the problem that is occurring

I connect to get the target portal to get the target nodes. When running the DSC script the first time, it connects to the target and get's the current targets. No issues here. I now go back and add a new target and I want to initiate that new target. iSCSIInitiator resource can't find the new target because the connection hasn't been updated to reflect that.

Verbose logs showing the problem

VERBOSE: [DEV-TEST-DELETE]:                            [[iSCSIInitiator]iSCSIInitiator-tgt1] Set-TargetResource: Ensuring iSCSI Target 'iqn.2010-06.com.nutanix:dev-test-vg-delete-63dc3822-a5a1-4ad8-b8b2-db6bd27addff-
tgt1' is connected.
VERBOSE: [DEV-TEST-DELETE]: LCM:  [ End    Set      ]  [[iSCSIInitiator]iSCSIInitiator-tgt1]  in 0.0620 seconds.
PowerShell DSC resource DSR_iSCSIInitiator  failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common 
parameter is set to Stop: The target name is not found or is marked as hidden from login.  
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : DEV-TEST-DELETE

Running Update-IscsiTarget to refresh the targets and then running the config again works fine.

Suggested solution to the issue

A few possible solutions.

Add a new parameter to force refresh of target.

[Parameter()]
[System.Boolean]
$RefreshTargets = $false

if($RefreshTargets) { Update-IscsiTargetPortal $TargetPortalAddress }

Another option would be to check if target exists and if doesn't then run Update-IscsiTargetPortal . If after this it fails, then it really should be an error.

You can run Update-IscsiTarget, but it does take much longer than Update-IscsiTargetPortal and it appears to list the target as it should.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

iSCSIInitiator iSCSIInitiator-tgt0 {
    Ensure                 = 'Present'
    NodeAddress            = 'iqn.2010-06.com.nutanix:dev-test-vg-delete-63dc3822-a5a1-4ad8-b8b2-db6bd27addff-tgt0'
    TargetPortalAddress    = '192.168.100.1'
    IsPersistent           = $true
}
@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants