none
IaaS Post-Config script: Using Clusrun in the post-config script RRS feed

  • Question

  • I'm currently playing with the Azure file storage feature and am trying to pull down files to set up the cluster.  I can pull the files down and install them on the head node without an issue, but I am having issues with the clusrun command.  When running clusrun manually on the head node in the HPC Powershell, it prompts me for a password; the code then runs without issue.  Is there a way to work around that in the post-config script?

        $HeadNode = (Get-ChildItem Env:\CCP_SCHEDULER).Value
        Add-Content $LogFile "Pushing files through the cluster, using head node $HeadNode"
        clusrun /scheduler:$HeadNode /nodegroup:computenodes mkdir C:\HPCServices
        clusrun /scheduler:$HeadNode /nodegroup:computenodes copy  "\\$headNode\C$\HPCServices" "C:\HPCServices"
    Monday, January 11, 2016 11:17 PM

Answers

  • Hello KWiliams1,

    Have you tried to specify user/password as arguments of clusrun as below?

        clusrun /scheduler:$HeadNode /nodegroup:computenodes /user:hpc\username /password:password mkdir C:\HPCServices
        clusrun /scheduler:$HeadNode /nodegroup:computenodes /user:hpc\username /password:password copy  "\\$headNode\C$\HPCServices" "C:\HPCServices"

    The root cause of this issue is that the post-config script is run in a remote PowerShell session, user credential delegation is forbidden.

    Another way to workaround is you create a scheduled task with the user/password and execute the script in the scheduled task.

    • Marked as answer by KWilliams1 Wednesday, January 13, 2016 9:03 PM
    Wednesday, January 13, 2016 3:50 AM

All replies

  • Hi KWilliams1,

    You may use cluscfg or hpccred to store the credential for the clusrun jobs. E.g. hpccred setcreds /user:domain\username /password:***

    If not storing the credential, it is also feasible to specify the /user and /passowrd parameters for each clusrun command each time.

    Check this article for more about hpccred setcreds.

    BR,

    Yutong Sun

    Tuesday, January 12, 2016 2:03 AM
    Moderator
  • Thanks.  That's working for a manual run, but for not in the post-config script.  Clusrun fails silently there.  As a workaround, I can use the old net use trick I learned earlier to push things to the compute nodes:

        net use "\\ComputeNode000\C$" Password /User:hpc\username
        mkdir \\ComputeNode000\C$\HPCServices
        Copy-Item "C:\HPCServices\*.dll" "\\ComputeNode000\C$\HPCServices" -Force

    However, this is only good for currently for the single-node test cluster I'm creating.  I'll have to generalize the script in a loop for multiple nodes, and frankly I would rather use the clusrun commands that are supposed to handle it.

    Tuesday, January 12, 2016 11:04 PM
  • Hello KWiliams1,

    Have you tried to specify user/password as arguments of clusrun as below?

        clusrun /scheduler:$HeadNode /nodegroup:computenodes /user:hpc\username /password:password mkdir C:\HPCServices
        clusrun /scheduler:$HeadNode /nodegroup:computenodes /user:hpc\username /password:password copy  "\\$headNode\C$\HPCServices" "C:\HPCServices"

    The root cause of this issue is that the post-config script is run in a remote PowerShell session, user credential delegation is forbidden.

    Another way to workaround is you create a scheduled task with the user/password and execute the script in the scheduled task.

    • Marked as answer by KWilliams1 Wednesday, January 13, 2016 9:03 PM
    Wednesday, January 13, 2016 3:50 AM
  • Yup, it appears to have needed to be added on a per function call basis.

    Thanks!

    Wednesday, January 13, 2016 9:04 PM
  • We will fix the credential delegation issue in the new HPC deployment script version 4.5.1 by using the task scheduler to run the custom Pre/Post configuration script.

    Monday, January 18, 2016 5:49 AM