Beispiel #1
0
    def test_get_instance_info(self):
        """Check retrieval of instance info from VM instance in the system"""
        host = fake.HostSystem()
        device = fake.VirtualDisk(unitNumber=0)
        network = fake.Network()
        vm_folder = fake.Folder(name='fake-folder')
        fake._create_object('Folder', vm_folder)
        fake_folders = fake.FakeRetrieveResult()
        respool = fake.ResourcePool()
        fake._create_object('ResourcePool', respool)
        cluster = fake.ClusterComputeResource()
        cluster._add_root_resource_pool(respool.obj)
        fake._create_object('ClusterComputeResource', cluster)

        virtualMachine = fake.VirtualMachine(name="VM-1",
                                             instanceUuid="fake-uuid",
                                             runtime_host=host.obj,
                                             virtual_device=[device, network],
                                             parent=vm_folder.obj,
                                             resourcePool=respool.obj)

        fake_vms = fake.FakeRetrieveResult()
        fake_vms.add_object(virtualMachine)
        fake_pools = fake.FakeRetrieveResult()
        fake_pools.add_object(respool)
        fake_clusters = fake.FakeRetrieveResult()
        fake_clusters.add_object(cluster)
        session = fake_session(fake_virtual_machines=fake_vms,
                               fake_vm_folder=fake_folders,
                               fake_resource_pools=fake_pools)
        driver = fake_driver(session, cluster_ref=cluster.obj)

        vm_util.add_vm_to_cache(driver, 'fake-uuid', {
            'vmref': virtualMachine.obj,
            "template": "false"
        })
        instance_info = vm_util.get_instance_info(driver, 'fake-uuid')

        virtual_interfaces = instance_info['virtual_interfaces'][0]
        block_device_mapping = instance_info['block_device_mapping_v2'][0]

        self.assertEquals("123.123.123.123", instance_info['access_ip_v4'])
        self.assertEquals("fake-uuid", instance_info['instance_uuid'])
        self.assertEquals(1, instance_info['memory_mb'])
        self.assertEquals("VM-1", instance_info['name'])
        self.assertEquals(1, instance_info['power_state'])
        self.assertEquals(1, instance_info['vcpus'])
        self.assertEquals("test-mac-address",
                          virtual_interfaces['mac_address'])
        self.assertEquals("Test-Network",
                          virtual_interfaces['port_group_label'])
        self.assertEquals(0, block_device_mapping['boot_index'])
        self.assertEquals(False, block_device_mapping['delete_on_termination'])
        self.assertEquals("Test-Virtual-Disk",
                          block_device_mapping['device_name'])
        self.assertEquals("volume", block_device_mapping['guest_format'])
        self.assertEquals("blank", block_device_mapping['source_type'])
        self.assertEquals(1048576, block_device_mapping['virtual_size'])
Beispiel #2
0
    def test_get_datastore_with_token(self):
        regex = re.compile("^ds.*\d$")
        fake0 = fake.FakeRetrieveResult()
        fake0.add_object(fake.Datastore("ds0", 10 * units.Gi, 5 * units.Gi))
        fake0.add_object(fake.Datastore("foo", 10 * units.Gi, 9 * units.Gi))
        setattr(fake0, 'token', 'token-0')
        fake1 = fake.FakeRetrieveResult()
        fake1.add_object(fake.Datastore("ds2", 10 * units.Gi, 8 * units.Gi))
        fake1.add_object(fake.Datastore("ds3", 10 * units.Gi, 1 * units.Gi))

        with self._mock_get_datastore_calls(fake0, fake1):
            result = ds_util.get_datastore(self.session, 'fake-cluster', regex)
        self.assertEqual("ds2", result.name)
Beispiel #3
0
    def test_get_all_networks(self):
        """Check retrieval of networks from a datacenter"""
        network = fake.Network()
        fake_networks = fake.FakeRetrieveResult()
        fake_networks.add_object(network)
        datacenter = fake.Pf9Datacenter(name="test-datacenter",
                                        network=[[network.obj]])
        fake_dc = fake.FakeRetrieveResult()
        fake_dc.add_object(datacenter)

        session = fake_session(fake_datacenter=fake_dc,
                               fake_network=fake_networks)
        driver = fake_driver(session)
        networks = vm_utils_pf9.get_all_networks(driver)

        self.assertEquals("vmnet0", networks[0]['bridge'])
Beispiel #4
0
    def test_get_dynamic_properties_with_token(self):
        ObjectContent = collections.namedtuple('ObjectContent', ['propSet'])
        DynamicProperty = collections.namedtuple('Property', ['name', 'val'])

        # Add a token to our results, indicating that more are available
        result = fake.FakeRetrieveResult(token='fake_token')

        # We expect these properties to be returned
        result.add_object(
            ObjectContent(propSet=[
                DynamicProperty(name='name1', val='value1'),
                DynamicProperty(name='name2', val='value2')
            ]))

        # These properties should be ignored
        result.add_object(
            ObjectContent(
                propSet=[DynamicProperty(name='name3', val='value3')]))

        retrievePropertiesEx = mock.MagicMock(name='RetrievePropertiesEx')
        retrievePropertiesEx.return_value = result

        calls = {'RetrievePropertiesEx': retrievePropertiesEx}
        with stubs.fake_suds_context(calls):
            session = driver.VMwareAPISession(host_ip='localhost')

            service_content = session.vim.service_content
            props = session._call_method(vim_util, "get_dynamic_properties",
                                         service_content.propertyCollector,
                                         'fake_type', None)

            self.assertEqual(props, {'name1': 'value1', 'name2': 'value2'})
Beispiel #5
0
    def test_list_instance_uuids_hide_vms(self):
        """
        Check list of VM instance UUIDs and make sure VMs under
        pf9_cinder_volumes are not listed
        """
        host = fake.HostSystem()
        vm_folder = fake.Folder(name='fake-folder')
        fake._create_object('Folder', vm_folder)
        ignore_folder = fake.Folder(name='pf9_cinder_volumes')
        fake._create_object('Folder', ignore_folder)
        respool = fake.ResourcePool()
        fake._create_object('ResourcePool', respool)
        cluster = fake.ClusterComputeResource()
        cluster._add_root_resource_pool(respool.obj)
        fake._create_object('ClusterComputeResource', cluster)

        virtualMachine1 = fake.VirtualMachine(name="VM-1",
                                              instanceUuid="test-uuid-1",
                                              runtime_host=host.obj,
                                              parent=vm_folder.obj,
                                              resourcePool=respool.obj)
        virtualMachine2 = fake.VirtualMachine(name="VM-2",
                                              instanceUuid="test-uuid-2",
                                              runtime_host=host.obj,
                                              parent=ignore_folder.obj,
                                              resourcePool=respool.obj)

        fake_vms = fake.FakeRetrieveResult()
        fake_vms.add_object(virtualMachine1)
        fake_vms.add_object(virtualMachine2)
        fake_folders = fake.FakeRetrieveResult()
        fake_folders.add_object(vm_folder)
        fake_folders.add_object(ignore_folder)
        fake_pools = fake.FakeRetrieveResult()
        fake_pools.add_object(respool)

        session = fake_session(fake_virtual_machines=fake_vms,
                               fake_vm_folder=fake_folders,
                               fake_resource_pools=fake_pools)
        driver = fake_driver(session, cluster_ref=cluster.obj)

        instance_uuids = vm_util.list_instance_uuids(driver)
        self.assertIn("test-uuid-1", instance_uuids)
        self.assertNotIn("test-uuid-2", instance_uuids)
        self.assertEquals(1, len(instance_uuids))
Beispiel #6
0
    def test_get_vm_ref(self):
        """Check retrieval of vm reference using uuid or name"""
        respool = fake.ResourcePool()
        fake._create_object('ResourcePool', respool)
        cluster = fake.ClusterComputeResource()
        cluster._add_root_resource_pool(respool.obj)
        fake._create_object('ClusterComputeResource', cluster)
        vm_folder = fake.Folder(name='fake-folder')
        fake_folders = fake.FakeRetrieveResult()
        fake_folders.add_object(vm_folder)
        fake_pools = fake.FakeRetrieveResult()
        fake_pools.add_object(respool)
        fake_clusters = fake.FakeRetrieveResult()
        fake_clusters.add_object(cluster)
        optionVal = fake.OptionValue(key="nvp.vm-uuid", value="test-uuid-1")
        virtualMachine1 = fake.VirtualMachine(name="VM-1",
                                              instanceUuid="test-uuid-1",
                                              resourcePool=respool.obj,
                                              extra_config=[optionVal])
        fake_vms = fake.FakeRetrieveResult()
        fake_vms.add_object(virtualMachine1)
        session = fake_session(fake_virtual_machines=fake_vms,
                               fake_resource_pools=fake_pools,
                               fake_cluster=fake_clusters,
                               fake_vm_folder=fake_folders)
        driver = fake_driver(session, cluster_ref=cluster.obj)

        instance = {}
        vm_util.add_vm_to_cache(driver, 'test-uuid-1', {
            'vmref': virtualMachine1.obj,
            "template": "false"
        })
        # Verify retrieval based on uuid
        instance['uuid'] = 'test-uuid-1'
        returned_vm_ref = vm_util.get_vm_ref(driver._session, instance)
        returned_vm_name = driver._session._call_method(
            None, "get_dynamic_property", returned_vm_ref, "VirtualMachine",
            "name")
        self.assertEquals(virtualMachine1.obj, returned_vm_ref)
        self.assertEquals("VM-1", returned_vm_name)

        # Verify exception for wrong uuid
        instance['uuid'] = 'non-existent-uuid'
        self.assertRaises(exception.InstanceNotFound, vm_util.get_vm_ref,
                          driver._session, instance)
Beispiel #7
0
 def _create_fake_vms(self):
     fake_vms = fake.FakeRetrieveResult()
     OptionValue = collections.namedtuple('OptionValue', ['key', 'value'])
     for i in range(10):
         vm = fake.ManagedObject()
         opt_val = OptionValue(key='', value=5900 + i)
         vm.set(vm_util.VNC_CONFIG_KEY, opt_val)
         fake_vms.add_object(vm)
     return fake_vms
Beispiel #8
0
    def test_get_instance_info_ipv6(self):
        """Check retrieval of instance info from VM instance in the system"""
        host = fake.HostSystem()
        device = fake.VirtualDisk(unitNumber=0)
        network = fake.Network()
        vm_folder = fake.Folder(name='fake-folder')
        fake._create_object('Folder', vm_folder)
        fake_folders = fake.FakeRetrieveResult()
        respool = fake.ResourcePool()
        fake._create_object('ResourcePool', respool)
        cluster = fake.ClusterComputeResource()
        cluster._add_root_resource_pool(respool.obj)
        fake._create_object('ClusterComputeResource', cluster)

        virtualMachine = fake.VirtualMachine(
            name="VM-1",
            instanceUuid="fake-uuid",
            runtime_host=host.obj,
            virtual_device=[device, network],
            ip_address="aaaa::123:aaaa:aaaa:aaaa",
            parent=vm_folder.obj,
            resourcePool=respool.obj)

        fake_vms = fake.FakeRetrieveResult()
        fake_vms.add_object(virtualMachine)
        fake_pools = fake.FakeRetrieveResult()
        fake_pools.add_object(respool)
        fake_clusters = fake.FakeRetrieveResult()
        fake_clusters.add_object(cluster)
        session = fake_session(fake_virtual_machines=fake_vms,
                               fake_vm_folder=fake_folders,
                               fake_resource_pools=fake_pools)
        driver = fake_driver(session, cluster_ref=cluster.obj)

        vm_util.add_vm_to_cache(driver, 'fake-uuid', {
            'vmref': virtualMachine.obj,
            "template": "false"
        })

        instance_info = vm_util.get_instance_info(driver, 'fake-uuid')

        self.assertIn('access_ip_v6', instance_info.keys())
        self.assertEquals("aaaa::123:aaaa:aaaa:aaaa",
                          instance_info['access_ip_v6'])
Beispiel #9
0
    def test_get_datastore_ds_in_maintenance(self):
        data_store = fake.Datastore()
        data_store.set("summary.maintenanceMode", "inMaintenance")

        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(data_store)

        with self._mock_get_datastore_calls(fake_objects):
            self.assertRaises(exception.DatastoreNotFound,
                              ds_util.get_datastore, self.session,
                              'fake-cluster')
Beispiel #10
0
    def test_get_hostname(self):
        """Check retrieval of host name from HostSystem"""
        fake_host_name = "test-host"
        fake_host_sys = fake.HostSystem(fake_host_name)
        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(fake_host_sys)
        new_session = fake_session(fake_host_system=fake_objects)
        driver = fake_driver(new_session)

        result = vm_utils_pf9.get_hostname(driver)
        self.assertEquals("test-host", result)
Beispiel #11
0
    def test_get_datastore_inaccessible_ds(self):
        data_store = fake.Datastore()
        data_store.set("summary.accessible", False)

        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(data_store)

        with self._mock_get_datastore_calls(fake_objects):
            self.assertRaises(exception.DatastoreNotFound,
                              ds_util.get_datastore, self.session,
                              'fake-cluster')
Beispiel #12
0
    def test_get_datastore_with_regex(self):
        # Test with a regex that matches with a datastore
        datastore_valid_regex = re.compile("^openstack.*\d$")
        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(fake.Datastore("openstack-ds0"))
        fake_objects.add_object(fake.Datastore("fake-ds0"))
        fake_objects.add_object(fake.Datastore("fake-ds1"))

        with self._mock_get_datastore_calls(fake_objects):
            result = ds_util.get_datastore(self.session, 'fake-cluster',
                                           datastore_valid_regex)
        self.assertEqual("openstack-ds0", result.name)
Beispiel #13
0
    def test_get_datastore_with_list(self):
        # Test with a regex containing whitelist of datastores
        datastore_valid_regex = re.compile("(openstack-ds0|openstack-ds2)")
        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(fake.Datastore("openstack-ds0"))
        fake_objects.add_object(fake.Datastore("openstack-ds1"))
        fake_objects.add_object(fake.Datastore("openstack-ds2"))

        with self._mock_get_datastore_calls(fake_objects):
            result = ds_util.get_datastore(self.session, 'fake-cluster',
                                           datastore_valid_regex)
        self.assertNotEqual("openstack-ds1", result.name)
Beispiel #14
0
    def test_get_datastore(self):
        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(fake.Datastore())
        fake_objects.add_object(
            fake.Datastore("fake-ds-2", 2048, 1000, False, "normal"))
        fake_objects.add_object(
            fake.Datastore("fake-ds-3", 4096, 2000, True, "inMaintenance"))

        with self._mock_get_datastore_calls(fake_objects):
            result = ds_util.get_datastore(self.session, 'fake-cluster')
        self.assertEqual("fake-ds", result.name)
        self.assertEqual(units.Ti, result.capacity)
        self.assertEqual(500 * units.Gi, result.freespace)
Beispiel #15
0
    def test_get_host_stats_vc(self):
        """Check retrieval of host stats from VC"""
        res_types = [
            resource_types.MEMORY, resource_types.CPU,
            resource_types.DISK_USED, resource_types.DISK_TOTAL
        ]

        respool = fake.ResourcePool()
        fake._create_object('ResourcePool', respool)
        datastore = fake.Datastore("ds-1", 1024, 500)
        fake._create_object('Datastore', datastore)
        host = fake.HostSystem()
        fake._create_object('HostSystem', host)
        cluster = fake.ClusterComputeResource()
        fake._create_object('ClusterComputeResource', cluster)
        cluster._add_host(host.obj)
        cluster._add_datastore(datastore.obj)

        fake_pools = fake.FakeRetrieveResult()
        fake_pools.add_object(respool)
        fake_hosts = fake.FakeRetrieveResult()
        fake_hosts.add_object(host)
        fake_ds = fake.FakeRetrieveResult()
        fake_ds.add_object(datastore)
        fake_cluster = fake.FakeRetrieveResult()
        fake_cluster.add_object(cluster)

        session = fake_session(fake_resource_pools=fake_pools,
                               fake_host_system=fake_hosts,
                               fake_datastore=fake_ds,
                               fake_cluster=fake_cluster)
        driver = fake_driver(session, cluster_ref=cluster.obj)
        pf9_stats = vm_utils_pf9.get_host_stats_vc(driver, res_types,
                                                   'test_cluster')
        self.assertEquals(10.0, pf9_stats['cpu_util_percent'])
        self.assertEquals(48.828125, pf9_stats['mem_util_percent'])
        self.assertEquals(1024.0, pf9_stats['disk_total_gb'])
        self.assertEquals(524.0, pf9_stats['disk_used_gb'])
Beispiel #16
0
    def test_get_all_ip_mappings(self):
        """Check retrieval of IP mappings from guest NIC on a VM"""

        fake_guest_nic = fake.GuestNic()
        virtualMachine = fake.VirtualMachine(name="Test-VM",
                                             instanceUuid="test-uuid",
                                             guest_nic=fake_guest_nic)
        fake_vms = fake.FakeRetrieveResult()
        fake_vms.add_object(virtualMachine)

        session = fake_session(fake_virtual_machines=fake_vms)
        driver = fake_driver(session)
        ip_mappings = vm_utils_pf9.get_all_ip_mappings(driver)

        nic_details = ip_mappings['test-uuid'][0]
        self.assertEquals("111.222.333.444", nic_details['ip_address'])
        self.assertEquals("de:ad:be:ef:be:ef", nic_details['mac_address'])
        self.assertEquals("Test-Network", nic_details['bridge'])
Beispiel #17
0
 def test_get_datastore_with_regex_error(self):
     # Test with a regex that has no match
     # Checks if code raises DatastoreNotFound with a specific message
     datastore_invalid_regex = re.compile("unknown-ds")
     exp_message = ("Datastore regex %s did not match any datastores" %
                    datastore_invalid_regex.pattern)
     fake_objects = fake.FakeRetrieveResult()
     fake_objects.add_object(fake.Datastore("fake-ds0"))
     fake_objects.add_object(fake.Datastore("fake-ds1"))
     # assertRaisesRegExp would have been a good choice instead of
     # try/catch block, but it's available only from Py 2.7.
     try:
         with self._mock_get_datastore_calls(fake_objects):
             ds_util.get_datastore(self.session, 'fake-cluster',
                                   datastore_invalid_regex)
     except exception.DatastoreNotFound as e:
         self.assertEqual(exp_message, e.args[0])
     else:
         self.fail("DatastoreNotFound Exception was not raised with "
                   "message: %s" % exp_message)
Beispiel #18
0
 def _create_fake_vm_objects(self):
     fake_objects = fake.FakeRetrieveResult()
     fake_objects.add_object(fake.VirtualMachine())
     return fake_objects
Beispiel #19
0
    def _test_get_stats_from_cluster(self, connection_state="connected",
                                     maintenance_mode=False):
        ManagedObjectRefs = [fake.ManagedObjectReference("host1",
                                                         "HostSystem"),
                             fake.ManagedObjectReference("host2",
                                                         "HostSystem")]
        hosts = fake._convert_to_array_of_mor(ManagedObjectRefs)
        respool = fake.ManagedObjectReference("resgroup-11", "ResourcePool")
        prop_dict = {'host': hosts, 'resourcePool': respool}

        hardware = fake.DataObject()
        hardware.numCpuCores = 8
        hardware.numCpuThreads = 16
        hardware.vendor = "Intel"
        hardware.cpuModel = "Intel(R) Xeon(R)"

        runtime_host_1 = fake.DataObject()
        runtime_host_1.connectionState = "connected"
        runtime_host_1.inMaintenanceMode = False

        runtime_host_2 = fake.DataObject()
        runtime_host_2.connectionState = connection_state
        runtime_host_2.inMaintenanceMode = maintenance_mode

        prop_list_host_1 = [fake.Prop(name="hardware_summary", val=hardware),
                            fake.Prop(name="runtime_summary",
                                      val=runtime_host_1)]
        prop_list_host_2 = [fake.Prop(name="hardware_summary", val=hardware),
                            fake.Prop(name="runtime_summary",
                                      val=runtime_host_2)]

        fake_objects = fake.FakeRetrieveResult()
        fake_objects.add_object(fake.ObjectContent("prop_list_host1",
                                                   prop_list_host_1))
        fake_objects.add_object(fake.ObjectContent("prop_list_host1",
                                                   prop_list_host_2))

        respool_resource_usage = fake.DataObject()
        respool_resource_usage.maxUsage = 5368709120
        respool_resource_usage.overallUsage = 2147483648

        def fake_call_method(*args):
            if "get_dynamic_properties" in args:
                return prop_dict
            elif "get_properties_for_a_collection_of_objects" in args:
                return fake_objects
            else:
                return respool_resource_usage

        session = fake.FakeSession()
        with mock.patch.object(session, '_call_method', fake_call_method):
            result = vm_util.get_stats_from_cluster(session, "cluster1")
            cpu_info = {}
            mem_info = {}
            if connection_state == "connected" and not maintenance_mode:
                cpu_info['vcpus'] = 32
                cpu_info['cores'] = 16
                cpu_info['vendor'] = ["Intel", "Intel"]
                cpu_info['model'] = ["Intel(R) Xeon(R)",
                                     "Intel(R) Xeon(R)"]
            else:
                cpu_info['vcpus'] = 16
                cpu_info['cores'] = 8
                cpu_info['vendor'] = ["Intel"]
                cpu_info['model'] = ["Intel(R) Xeon(R)"]
            mem_info['total'] = 5120
            mem_info['free'] = 3072
            expected_stats = {'cpu': cpu_info, 'mem': mem_info}
            self.assertEqual(expected_stats, result)
Beispiel #20
0
 def test_get_all_cluster_refs_by_name_missing(self):
     fake_objects = fake.FakeRetrieveResult()
     fake_objects.add_object(partialObject(path='cluster'))
     refs = vm_util.get_all_cluster_refs_by_name(
         fake.FakeObjectRetrievalSession(fake_objects), ['cluster'])
     self.assertEqual({}, refs)
Beispiel #21
0
 def test_get_all_cluster_refs_by_name_exists(self):
     fake_objects = fake.FakeRetrieveResult()
     fake_objects.add_object(fake.ClusterComputeResource(name='cluster'))
     refs = vm_util.get_all_cluster_refs_by_name(
         fake.FakeObjectRetrievalSession(fake_objects), ['cluster'])
     self.assertEqual(1, len(refs))
Beispiel #22
0
 def test_get_all_cluster_refs_by_name_none(self):
     fake_objects = fake.FakeRetrieveResult()
     refs = vm_util.get_all_cluster_refs_by_name(
         fake.FakeObjectRetrievalSession(fake_objects), ['fake_cluster'])
     self.assertEqual({}, refs)
def _fake_get_object_properties_missing(vim, collector, mobj, type,
                                        properties):
    fake_objects = fake.FakeRetrieveResult()
    ml = [fake.MissingProperty()]
    fake_objects.add_object(fake.ObjectContent(None, missing_list=ml))
    return fake_objects
def _fake_get_object_properties(vim, collector, mobj, type, properties):
    fake_objects = fake.FakeRetrieveResult()
    fake_objects.add_object(fake.ObjectContent(None))
    return fake_objects
Beispiel #25
0
    def _call_method(self, *args, **kwargs):
        if args[1] == "get_dynamic_property":
            fake_objects = self.return_objects_of_type(args[3])
            objectRef = args[2]
            objectProperty = args[4]
            for object in fake_objects.objects:
                if object.obj == objectRef:
                    for p in object.propSet:
                        if p.name == objectProperty:
                            return p.val
        elif args[1] == 'get_dynamic_properties':
            return_dict = dict()
            fake_objects = self.return_objects_of_type(args[3])
            objectRef = args[2]
            objectProperties = args[4]
            for object in fake_objects.objects:
                if object.obj == objectRef:
                    for p in object.propSet:
                        if p.name in objectProperties:
                            return_dict[p.name] = p.val
            return return_dict
        elif args[1] == "get_vc_properties_pf9":
            fake_vim = fake.FakeVim()
            fake_vim._login()
            return vim_util.get_vc_properties_pf9(fake_vim, args[2], args[3],
                                                  args[4], args[5], None)

        elif args[1] == "get_object_properties":
            obj_ref = args[3]
            obj_type = args[4]
            prop_list = args[5]
            lst_return_objects = fake.FakeRetrieveResult()
            prop_vals = fake.ManagedObject()
            for prop in prop_list:
                prop_val = self._call_method(None, "get_dynamic_property",
                                             obj_ref, obj_type, prop)
                elem = fake.Prop()
                elem.name = prop
                elem.val = prop_val
                prop_vals.propSet.append(elem)

            lst_return_objects.add_object(prop_vals)
            return lst_return_objects

        elif args[1] == "get_object_properties_dict":
            obj_ref = args[2]
            obj_type = args[2].type
            prop_list = args[3]
            prop_dict = {}
            for prop in prop_list:
                prop_val = self._call_method(None, "get_dynamic_property",
                                             obj_ref, obj_type, prop)
                prop_dict[prop] = prop_val

            return prop_dict

        elif args[1] == "get_object_property":
            obj_ref = args[2]
            obj_type = args[2].type
            property = args[3]
            return_object = fake.FakeRetrieveResult()
            prop_val = self._call_method(None, "get_dynamic_property", obj_ref,
                                         obj_type, property)
            return prop_val

        elif args[1] == "get_properties_for_objects_pf9":
            obj_refs = args[3]
            obj_type = args[4]
            prop_list = args[5]
            lst_return_objects = fake.FakeRetrieveResult()
            for obj_ref in obj_refs:
                prop_vals = fake.ManagedObject()
                for prop in prop_list:
                    prop_val = self._call_method(None, "get_dynamic_property",
                                                 obj_ref, obj_type, prop)
                    elem = fake.Prop()
                    elem.name = prop
                    elem.val = prop_val
                    prop_vals.propSet.append(elem)
                    lst_return_objects.add_object(prop_vals)
            return lst_return_objects

        elif args[1] == "FindAllByUuid":
            return self._get_vim()._find_all_by_uuid(self, args, kwargs)
        else:
            return self.return_objects_of_type(args[2])