locked
job submit ignores given user and password RRS feed

  • Question

  • i'm currently developing an application which needs to submit jobs using the windows console.

    when i submit a job using "job submit /jobfile:file /scheduler:test /user:username /password:pass" the job arrives at the cluster using my the username of my windows account and not the one specified in the command-line.

    how can i force the cluster to use the given credentials?

     

    regards,

        s.raubach

    Tuesday, May 31, 2011 2:14 PM

Answers

  • Hi,

    'user' and 'password' options are for 'Run As' property of the job. Your job, when started, will execute its commandline under 'Run As' user account, but you will still appear as the owner of the job.

    To find who is the owner of the job and what's the value of 'Run As' property you can use 'job view <job_ID>' command or in the GUI you can double click on the job to see its details, also you can select 'Owner' and 'Run As User' columns in job view.

    If you want to start job with a different owner, you need to run job.exe command as a different user. The simplest, manual way will be to use 'runas' command. There are also other options, like for example use of .NET System.Diagnostic.Process class or if possible, changing your application to use Windows HPC Scheduler API combined with user impersonation.

    Thanks,
    Łukasz

     

    • Marked as answer by WACMemphis Tuesday, May 31, 2011 5:55 PM
    • Unmarked as answer by WACMemphis Tuesday, May 31, 2011 8:22 PM
    • Marked as answer by WACMemphis Thursday, June 2, 2011 11:24 AM
    Tuesday, May 31, 2011 5:43 PM
  • Powershell 'Start' cmdlet provides '-RedirectStandardOutput' option, which can be used to save application's output to the file. Maybe this can be useful in your case. For more information about this cmdlet please take a look at:

    http://technet.microsoft.com/en-us/library/dd347667.aspx

    Regards,
    Łukasz

     

    • Marked as answer by WACMemphis Wednesday, June 1, 2011 6:38 PM
    Wednesday, June 1, 2011 5:43 PM

All replies

  • Hi,

    'user' and 'password' options are for 'Run As' property of the job. Your job, when started, will execute its commandline under 'Run As' user account, but you will still appear as the owner of the job.

    To find who is the owner of the job and what's the value of 'Run As' property you can use 'job view <job_ID>' command or in the GUI you can double click on the job to see its details, also you can select 'Owner' and 'Run As User' columns in job view.

    If you want to start job with a different owner, you need to run job.exe command as a different user. The simplest, manual way will be to use 'runas' command. There are also other options, like for example use of .NET System.Diagnostic.Process class or if possible, changing your application to use Windows HPC Scheduler API combined with user impersonation.

    Thanks,
    Łukasz

     

    • Marked as answer by WACMemphis Tuesday, May 31, 2011 5:55 PM
    • Unmarked as answer by WACMemphis Tuesday, May 31, 2011 8:22 PM
    • Marked as answer by WACMemphis Thursday, June 2, 2011 11:24 AM
    Tuesday, May 31, 2011 5:43 PM
  • hi,

     

    thanks for your quick answer. this will help a lot!

    i will try the 'runas' command.

    changing the application to use one of the other suggestions doesn't seem possible, since the application is written in java.

     

    thanks again,

        s.raubach

    Tuesday, May 31, 2011 5:59 PM
  • ok, i tried runas and several other applications trying to do the same.

    runas doesn't fulfill my requirements, since the password cannot be transmitted. the others have different problems.

    does any of you know how to start a process as a different user from java.

    or is there an api of the microsoft hpc server for java?

     

    regards,

        s.raubach

    Tuesday, May 31, 2011 8:22 PM
  • Unfortunatelly runas command is good only for manual usage.

    Currently, there is a HPC Basic Profile Web Service API, which can be used from java application, but it provides a limited functionality as it implements open standard, which is also used by other, non-windows resource control systems. In SP2 for Windows HPC Server 2008 R2 we are planning to add new, simplified web services interface with more functionality, which will be based on REST model.

    The other, quite hacky way to go will be to replace 'runas' command with something similar to the following powershell call:

    powershell.exe start job 'submit /user:domain\user /password:pass123 hostname' -Credential (New-Object System.Management.Automation.PSCredential -ArgumentList 'domain\user',('pass123' ^| ConvertTo-SecureString -AsPlainText -Force))

    where you should be able to provide clear text password and username.

    Regards,
    Łukasz

    Tuesday, May 31, 2011 9:03 PM
  • thanks for your qualified help!!

    i will try using the powershell this afternoon and mark you post as the answer if it works.

     

    regards,

        s.raubach

    Wednesday, June 1, 2011 6:19 AM
  • ok, it does work. so the job runs on the cluster as the specified user.

    the last thing that is missing, is the fact, that i don't get the job id. it is shown in a separate shell which dissappears in less than a second.

    is there any way to get the id of the just submitted job?

     

    regards,

        s.raubach

    • Marked as answer by WACMemphis Wednesday, June 1, 2011 6:38 PM
    • Unmarked as answer by WACMemphis Wednesday, June 1, 2011 6:38 PM
    Wednesday, June 1, 2011 10:44 AM
  • Powershell 'Start' cmdlet provides '-RedirectStandardOutput' option, which can be used to save application's output to the file. Maybe this can be useful in your case. For more information about this cmdlet please take a look at:

    http://technet.microsoft.com/en-us/library/dd347667.aspx

    Regards,
    Łukasz

     

    • Marked as answer by WACMemphis Wednesday, June 1, 2011 6:38 PM
    Wednesday, June 1, 2011 5:43 PM
  • thanks again for your fast and brilliant answer :)

    works like a charm.

     

    regards,

        s.raubach

    Wednesday, June 1, 2011 6:38 PM