#NEWLINE# def testInstNodesDrbdDisks( self ) : #NEWLINE# #INDENT# cfg = self . _get_object_mock ( ) #NEWLINE# node_group = cfg . LookupNodeGroup ( None ) #NEWLINE# master_uuid = cfg . GetMasterNode ( ) #NEWLINE# node2 = objects . Node ( name = 'node2.example.com' , group = node_group , ndparams = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , uuid = 'node2-uuid' ) #NEWLINE# cfg . AddNode ( node2 , 'my-job' ) #NEWLINE# inst = self . _create_instance ( cfg ) #NEWLINE# disks = [ objects . Disk ( dev_type = constants . DT_DRBD8 , size = 786432 , logical_id = ( master_uuid , node2 . uuid , 12300 , 0 , 0 , 'secret' ) , children = [ objects . Disk ( dev_type = constants . DT_PLAIN , size = 786432 , logical_id = ( 'myxenvg' , 'disk0' ) , uuid = 'data0' ) , objects . Disk ( dev_type = constants . DT_PLAIN , size = 128 , logical_id = ( 'myxenvg' , 'meta0' ) , uuid = 'meta0' ) ] , iv_name = 'disk/0' , uuid = 'disk0' ) ] #NEWLINE# cfg . AddInstance ( inst , 'my-job' ) #NEWLINE# for disk in disks : #NEWLINE# #INDENT# cfg . AddInstanceDisk ( inst . uuid , disk ) #NEWLINE# #UNINDENT# all_nodes = cfg . GetInstanceNodes ( inst . uuid ) #NEWLINE# secondary_nodes = cfg . GetInstanceSecondaryNodes ( inst . uuid ) #NEWLINE# self . _GenericNodesCheck ( inst , all_nodes , secondary_nodes ) #NEWLINE# self . assertEqual ( set ( secondary_nodes ) , set ( [ node2 . uuid ] ) ) #NEWLINE# self . assertEqual ( set ( all_nodes ) , set ( [ inst . primary_node , node2 . uuid ] ) ) #NEWLINE# self . assertEqual ( cfg . GetInstanceLVsByNode ( inst . uuid ) , { #NEWLINE# #INDENT# node2 : [ 'myxenvg/disk0' , 'myxenvg/meta0' ] , #NEWLINE# node2 . uuid : [ 'myxenvg/disk0' , 'myxenvg/meta0' ] , #NEWLINE# #UNINDENT# } )