#NEWLINE# def CheckPrereq( self ) : #NEWLINE# #INDENT# 'Check prerequisites.\n\n    This checks that the instance is in the cluster.\n\n    ' #NEWLINE# self . instance = self . cfg . GetInstanceInfo ( self . op . instance_uuid ) #NEWLINE# assert ( self . instance is not None ) , ( 'Cannot retrieve locked instance %s' % self . op . instance_name ) #NEWLINE# cluster = self . cfg . GetClusterInfo ( ) #NEWLINE# if self . op . hvparams : #NEWLINE# #INDENT# utils . ForceDictType ( self . op . hvparams , constants . HVS_PARAMETER_TYPES ) #NEWLINE# filled_hvp = cluster . FillHV ( self . instance ) #NEWLINE# filled_hvp . update ( self . op . hvparams ) #NEWLINE# hv_type = hypervisor . GetHypervisorClass ( self . instance . hypervisor ) #NEWLINE# hv_type . CheckParameterSyntax ( filled_hvp ) #NEWLINE# CheckHVParams ( self , self . cfg . GetInstanceNodes ( self . instance . uuid ) , self . instance . hypervisor , filled_hvp ) #NEWLINE# #UNINDENT# CheckInstanceState ( self , self . instance , INSTANCE_ONLINE ) #NEWLINE# self . primary_offline = self . cfg . GetNodeInfo ( self . instance . primary_node ) . offline #NEWLINE# if ( self . primary_offline and self . op . ignore_offline_nodes ) : #NEWLINE# #INDENT# self . LogWarning ( 'Ignoring offline primary node' ) #NEWLINE# if ( self . op . hvparams or self . op . beparams ) : #NEWLINE# #INDENT# self . LogWarning ( 'Overridden parameters are ignored' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# CheckNodeOnline ( self , self . instance . primary_node ) #NEWLINE# bep = self . cfg . GetClusterInfo ( ) . FillBE ( self . instance ) #NEWLINE# bep . update ( self . op . beparams ) #NEWLINE# CheckInstanceBridgesExist ( self , hv_type . instance ) #NEWLINE# remote_info = self . rpc . call_instance_info ( self . instance . primary_node , self . instance . name , self . instance . hypervisor , cluster . hvparams [ self . instance . hypervisor ] ) #NEWLINE# remote_info . Raise ( ( 'Error checking node %s' % self . cfg . GetNodeName ( self . instance . primary_node ) ) , prereq = True , ecode = errors . ECODE_ENVIRON ) #NEWLINE# self . requires_cleanup = False #NEWLINE# if remote_info . payload : #NEWLINE# #INDENT# if _IsInstanceUserDown ( self . cfg . GetClusterInfo ( ) , self . instance , remote_info . payload ) : #NEWLINE# #INDENT# self . requires_cleanup = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# CheckNodeFreeMemory ( self , self . instance . primary_node , ( 'starting instance %s' % self . instance . name ) , bep [ constants . BE_MINMEM ] , self . instance . hypervisor , self . cfg . GetClusterInfo ( ) . hvparams [ self . instance . hypervisor ] )