- add xen-password file with export pool-metadata
This commit is contained in:
		
							parent
							
								
									b95d07705f
								
							
						
					
					
						commit
						76f73416f0
					
				@ -31,9 +31,9 @@ from common import *
 | 
				
			|||||||
class backup_xcp_metadata(backup_generic):
 | 
					class backup_xcp_metadata(backup_generic):
 | 
				
			||||||
    """Backup metatdata of a xcp pool using xe pool-dump-database"""
 | 
					    """Backup metatdata of a xcp pool using xe pool-dump-database"""
 | 
				
			||||||
    type = 'xcp-dump-metadata'    
 | 
					    type = 'xcp-dump-metadata'    
 | 
				
			||||||
    required_params = ['type','server_name','xcp_user','xcp_passwd','backup_name']
 | 
					    required_params = ['type','server_name','password_file','backup_name']
 | 
				
			||||||
    xcp_user=''
 | 
					
 | 
				
			||||||
    xcp_passwd='' 
 | 
					    user_xen, password_xen, null = open(self.password_file).read().split('\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def do_backup(self,stats):
 | 
					    def do_backup(self,stats):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -52,8 +52,10 @@ class backup_xcp_metadata(backup_generic):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        stats['status']='Dumping'
 | 
					        stats['status']='Dumping'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not self.dry_run:
 | 
					        if not self.dry_run:
 | 
				
			||||||
            cmd = "/opt/xensource/bin/xe -s %s -u %s -pw %s pool-dump-database file-name=%s" %(self.server_name,self.xcp_user,self.xcp_passwd,temppath)
 | 
					            cmd = "/opt/xensource/bin/xe -s %s -u %s -pw %s pool-dump-database file-name=%s" %(self.server_name,self.user_xen,self.password_xen,temppath)
 | 
				
			||||||
            self.logger.debug('[%s] Dump XCP Metadata : %s',self.backup_name,cmd)
 | 
					            self.logger.debug('[%s] Dump XCP Metadata : %s',self.backup_name,cmd)
 | 
				
			||||||
            call_external_process(cmd)
 | 
					            call_external_process(cmd)
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user