Solved

Unable to backup a filesystem (subclient content issue) - cvpysdk - Python

  • 4 February 2021
  • 10 replies
  • 1160 views

Badge +2

Hello,

I'm trying to backup a filesystem from a storage array, I noticed that the update of the subclient content using this syntax :

subclient.content = ["My_storage_array:/My_Filesystem"]

This syntax is not executed correctly, we can write anything in the content even if it is not present in the storage array, no validation is done by commvault.

The output of the backup job fails and returns the following error:

"File system scan failed - there is nothing to back up. A possible cause is that none of the subclient contents exist.".

the code that i'm using to do my backup is bellow :

commcell = Commcell('My_commcell', commcell_login ,commcell_password)
client = commcell.clients.get('My_storage_array')
agent = client.agents.get('My_Agent')
backupset = agent.backupsets.get('My_Backupset')
backupset.subclients.add("backup_tmp", storage_policy="My_storage_policy")
subclient = backupset.subclients.get("backup_tmp")
subclient.content = ["My_storage_array:/My_Filesystem"]
subclient.enable_backup()
job_backup = subclient.backup(backup_level='Full')

Thank you in advance for your answers.

icon

Best answer by loki 8 February 2021, 22:05

View original

10 replies

Userlevel 6
Badge +14

Hi,

 

What Agent type are you specifying under “agent = client.agents.get('My_Agent')” ?

What errors are you seeing in the FileScan log for the Job on the Data Access Node?

Also, Do you see the correct content path specified in FileScan.log?

 

Regards,

Michael

 

Userlevel 7
Badge +23

Looks like NFS based on the content structure?

 

I wonder if you can manually set the subclient with content in the UI, and then retrieve via API to look for the expected output (via qscript, REST, powershell, python etc).

Badge +2

Hi Michael,

 

Thank you for your answer.

 

The agent type is : Linux File system.

 

job_backup.delay_reason or FIlescan log returns always:


'File system scan failed - there is nothing to back up. A possible cause is that none of the subclient contents exist.

 

I can see the content path in the subclient properties not in the Filescan log:thinking:

 

Amine HAMEL

 

Badge +2

Hi Damian,

 

Thank you for your answer.

 

I did a backup via the Commcell Console (GUI) then i downloaded the XML script and i wrote my script via these properties.

 

the backup via the Commcell Console succeeded, the backup via python script with the same properities as the Commcell Console failed which is confusing me.

 

Regards,

 

Amine HAMEL

 

 

Userlevel 3
Badge +4

Code looks fine. Are you able to trigger backup for the subclient created through the python script from Commcell Console?

Badge +2

Hi Yash,

Yes, the backup triggered from the Commcell Console works perfectly, the same backup triggered from a python script fails. :thinking:

Userlevel 3
Badge +4

Then I wonder if the subclient object you’re fetching might not be the correct one. You could check by trying to resubmit the failed job from Command center or printing the subclient properties with this: print (subclient.properties)

Also, just curious, what’s the output of this? print (client.agents)

Badge +2

the content : ["My_storage_array:/My_Filesystem"]  exists in the output of the subclient.properties

'content': [{'path': 'My_storage_array:/My_Filesystem'}],

the output of “client.agents” is :

print(client_fs.agents)
Agents class instance for Client: 'My_storage_array'

 

Badge

For automount backup, below additional property also needs to be set.

Please set this also and try.

 

subclient.network_share_auto_mount = True

Badge +2

Hi loki,

It worked, thanks a lot for your help :D

 

Reply