def add_vnic_passthrough_profile(api): engine = api.system_service() vnic_service = _get_vnic_service(engine, MANAGEMENT_NETWORK) vnic_profile = vnic_service.add( profile=VnicProfile(name=PASSTHROUGH_VNIC_PROFILE, pass_through=VnicPassThrough(mode=VnicPassThroughMode.ENABLED))) nt.assert_equals(vnic_profile.pass_through.mode, VnicPassThroughMode.ENABLED)
def _add_nics(vm_service, profiles): nics_service = vm_service.nics_service() for profile in profiles: nics_service.add( Nic(name=profile.name, vnic_profile=VnicProfile(id=profile.id)))
def _create_mapping_target_id(self, from_name, to_id): return RegistrationVnicProfileMapping( from_=VnicProfile(name=from_name, network=Network(name=from_name)), to=VnicProfile(id=to_id), )
def _create_mapping_no_target(self, from_name): return RegistrationVnicProfileMapping( from_=VnicProfile(name=from_name, network=Network(name=from_name)), to=None, )
def _create_mapping_no_source(self, to_name): return RegistrationVnicProfileMapping( from_=None, to=VnicProfile(name=to_name, network=Network(name=to_name)), )
def _create_mapping(self, from_name, to_name): return RegistrationVnicProfileMapping( from_=VnicProfile(name=from_name, network=Network(name=from_name)), to=VnicProfile(name=to_name, network=Network(name=to_name)))