'Ensure we warn when create_vm() fails after we passed an
unrecognised guestId'

@mock.patch.object(vm_util.LOG, 'warning')
def test_create_vm_invalid_guestid(self, mock_log_warn):

    found = [False]
    def fake_log_warn(msg, values):
        if (not isinstance(values, dict)):
            return
        if (values.get('ostype') == 'invalid_os_type'):
            found[0] = True
    mock_log_warn.side_effect = fake_log_warn
    session = driver.VMwareAPISession()
    config_spec = vm_util.get_vm_create_spec(session.vim.client.factory, self._instance, 'fake-datastore', [], vm_util.ExtraSpecs(), os_type='invalid_os_type')
    self.assertRaises(vexc.VMwareDriverException, vm_util.create_vm, session, self._instance, 'folder', config_spec, 'res-pool')
    self.assertTrue(found[0])
