cancel
Showing results for 
Search instead for 
Did you mean: 

Start/stop NetBackup with Ansible

X2
Moderator
Moderator
   VIP   

Calling on Ansible experts:

I created an Ansible playbook to "standardize" our Linux client NetBackup configuration after initial install. The configuration steps work fine except that I'm having difficulties to shutdown/startup of NetBackup. Below the is part of playbook which I use:

- name: Stop NetBackup
      service:
        name: netbackup
        state: stopped
...
- name: Start NetBackup service: name: netbackup state: started

I have also tried by adding a 30 second pause after this task but it didn't help.

Below is the Anisible's warning for shutdown of NetBackup

TASK [Stop NetBackup] **********************************************************
 [WARNING]: The service (netbackup) is actually an init script but the system
is managed by systemd

and for startup:

TASK [Start NetBackup] *********************************************************
fatal: [orford.it.mcgill.ca]: FAILED! => {"changed": false, "msg": "Unable to start service netbackup: Failed to start netbackup.service: Unit not found.\n"}

Any suggestions?

 

1 ACCEPTED SOLUTION

Accepted Solutions

X2
Moderator
Moderator
   VIP   

@vtas_chas apologies for the late reply. No infoscale on the client. These are standard VMs on vSphere without Infoscale. I haven't tried this on our Solaris servers but they are provisioned so rarely!

As a workaround, I ended up using sysvinit module rather than service or systemd.

    - name: Stop NetBackup (initd)
      sysvinit:
        name: netbackup
        state: stopped

 

View solution in original post

6 REPLIES 6

vtas_chas
Level 6
Employee

Not 100% sure, but the error makes me think the init script isn't enabled for systemd. Have you enabled the NetBackup service being managed by systemd?  

The other thing could be the way you're dealing with the service.  IIRC, you can do this:

- name:  Stop NetBackup

systemd:

name: netbackup

state: stopped

As long as the service has been enabled (systemctl enable netbackup) and the symlinks are there, that may fix your problem.

 

Charles
VCS, NBU & Appliances

X2
Moderator
Moderator
   VIP   

@vtas_chas Thanks for the reply.

I will try that out on my test system.

NB: Starting and stopping NetBackup using command "service netbackup start" via ssh works fine. However, when the system is rebooted, NetBackup does not start. I had a case opened earlier and InfoScale engineering team gave me a fix. But when Infoscale was upgraded to a newer version, the fix was not in it.

X2
Moderator
Moderator
   VIP   

@vtas_chas tried your suggestion yesterday and the behaviour was the same. Ansible came back with the same response. NetBackup did not go down. Maybe I will try with a pause of a few seconds after the task and see if it changes anything.

 

vtas_chas
Level 6
Employee

The pause is a good idea.  Depending on what's going on in the system, services can take some time.

I'm curious about the InfoScale team comment -- is this on a cluster or you're running Infoscale on the client?

Charles
VCS, NBU & Appliances

X2
Moderator
Moderator
   VIP   

@vtas_chas apologies for the late reply. No infoscale on the client. These are standard VMs on vSphere without Infoscale. I haven't tried this on our Solaris servers but they are provisioned so rarely!

As a workaround, I ended up using sysvinit module rather than service or systemd.

    - name: Stop NetBackup (initd)
      sysvinit:
        name: netbackup
        state: stopped

 

vtas_chas
Level 6
Employee

Yeah, I was wondering what happened.  Thanks for updating, X2.  My next suggestion would be to test with sysvinit, glad it worked. 

The issue we run into, and everyone has to remember, is that once we get out of the actual API, the number of variables skyrockets from environment to environment and so using the 3rd party tools one way in one environment doesn't necessarily translate precisely the same way in another.  That's part of why we are trying to bring more attention to the API set and get more collaboration from customers / partners here and on GitHub.  What you guys all do in your environments is impossible for us truly replicate in any of ours, so that interaction becomes really important.

Keep the conversation and questions coming!

Charles
VCS, NBU & Appliances