locked
Create a job task to take a node offline RRS feed

  • Question

  • Hi

    How can I create a job task that takes a node offline and sends me a mail?
    I want to add the job to the jobqueue, so users can see in jobmanager what will happen, when their job is done.

    I got this powershell:

    add-pssnapin microsoft.hpc
    Set-HpcNodeState -Name HPCTEST -State Offline

    It works: Sets the node offline, but how can I make it send me a mail?

    I tried this, it does set the node offline, but it fails in creating the job, and sending me a mail.

    New-HpcJob -name "Put HPCTEST Offline" -Exclusive 1 -requestednodes "hpctest" -EmailAddress "JALI@MAIL.COM" -NotifyOnStart 1 -NotifyOnCompletion 1 | Add-HpcTask -name "basic task" -command "powershell.exe -command "add-pssnapin microsoft.hpc ; Set-HpcNodeState -Name HPCTEST -State Offline"" | Submit-HpcJob

    Error:

    ubmit-HpcJob : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any
    of the parameters that take pipeline input.
    At C:\tools\SetOffline_Test.ps1:8 char:319
    + New-HpcJob -name "Put HPCTEST Offline" -Exclusive 1 -requestednodes "hpctest" -EmailAddress "JALI@MAIL.COM" -NotifyOnStart 1 -NotifyOnCompletion 1 | Add-HpcTask -name "basic task"
     -command "powershell.exe -command "add-pssnapin microsoft.hpc ; Set-HpcNodeState -Name HPCTEST -State Offline"" | Submit-HpcJob <<<<
        + CategoryInfo          : InvalidArgument: (Microsoft.ComputeCluster.CCPPSH.HpcNode:PSObject) [Submit-HpcJob], ParameterBindingException
        + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.ComputeCluster.CCPPSH.SubmitJob

    Tuesday, April 15, 2014 1:14 PM

All replies

  • Hi

    Have you already configured the Email Notifications in the Job Scheduler Configurations for the SMTP server etc. before submitting the job? If not, you may configure it in the Options -> Job Scheduler Configuration -> E-mail Notifications.

    Regards,

    Yutong

    Friday, April 18, 2014 7:51 AM