def create_vio_scsi_pair(cs, managedsystem_id, virtualioserver_id, logicalpartition_id): # create the link to the LogicalPartition alp = "%s/LogicalPartition/%s" % (cs.client.getserviceurl("uom"), logicalpartition_id) # the server adapter vssa = VirtualSCSIServerAdapter() # vssa.adapter_type = 'Server' vssa.use_next_available_slot_id = "true" # the client adapter vsca = VirtualSCSIClientAdapter() # vsca.adapter_type = 'Client' vsca.use_next_available_slot_id = "true" # the map vsm = VirtualSCSIMapping() vsm.associated_logical_partition = alp vsm.server_adapter = vssa vsm.client_adapter = vsca # add the map to the virtualioserver vios = cs.virtualioserver.getasroot(virtualioserver_id) vios.virtual_scsi_mappings.virtual_scsi_mapping.append(vsm) ms = cs.managedsystem.get(managedsystem_id) cs.managedsystem.update(ms, vios)
def create_virtual_scsi_mapping(logicalunit, logicalpartition): """create vio scsi pair""" # create the link to the LogicalPartition alp = "%s/LogicalPartition/%s" % (cs.client.getserviceurl("uom"), logicalpartition.id) # the server adapter vssa = VirtualSCSIServerAdapter() # vssa.adapter_type = 'Server' vssa.use_next_available_slot_id = 'true' # the client adapter vsca = VirtualSCSIClientAdapter() # vsca.adapter_type = 'Client' vsca.use_next_available_slot_id = 'true' # the map vsm = VirtualSCSIMapping() vsm.associated_logical_partition = alp vsm.server_adapter = vssa vsm.client_adapter = vsca # storage vsm.storage_type = "LOGICAL_UNIT" vsm.storage = logicalunit return vsm