Ask Your Question

tking's profile - activity

2017-09-18 05:51:41 -0600 received badge  Famous Question (source)
2017-09-18 05:51:41 -0600 received badge  Notable Question (source)
2017-09-18 05:51:41 -0600 received badge  Popular Question (source)
2017-09-12 10:03:46 -0600 asked a question Set default property for all new images

Is there a method to set a default property for any new image? Specifically, I want to set hw_vif_model='VirtualVmxnet3' for all new images, even for images users import.

I didn't see such a method to set a default in the image properties schema file.

2017-03-31 19:15:38 -0600 received badge  Supporter (source)
2016-12-01 03:51:43 -0600 received badge  Famous Question (source)
2016-09-25 01:25:32 -0600 received badge  Popular Question (source)
2016-09-25 01:25:32 -0600 received badge  Notable Question (source)
2016-07-27 20:13:15 -0600 received badge  Notable Question (source)
2016-07-27 20:13:15 -0600 received badge  Notable Question (source)
2016-07-26 08:46:05 -0600 received badge  Teacher (source)
2016-07-24 22:32:03 -0600 answered a question How to use a switch instead of NAT

I'd first see if your VM instance's MAC address shows up on the switch. Also, see if the switch port is set to tagged or untagged and add the network under the corresponding ml2 type (flat vs. VLAN). In that installation guide, it is Interface 2 that should be mapped.

If the instance's MAC shows up on the switch, can the VM ping the gateway? Do the subnet settings for that provider network match the router's subnet config?

If the instance's MAC does not show up on the switch after you try to ping, I'd double check your switch port config, network mapping, and ml2-vlan config.

2016-07-21 06:34:28 -0600 received badge  Popular Question (source)
2016-07-20 17:41:41 -0600 answered a question Mitaka glance api with multi-region


from keystoneauth1 import adapter

After establishing the auth:

    sess = session.Session(auth=auth)
    adapt = adapter.Adapter(session=sess,service_type='image',region_name=self.region_name)
    endp = adapt.get_endpoint()
    glance = Client('2', endpoint=endp, session=sess)
2016-07-18 20:06:15 -0600 asked a question Mitaka glance api with multi-region

If answered elsewhere, please punt me over to it.

I'm not seeing a method in the Mitaka API to specify a region when getting a session for the glance client.

We are guessing that we need to make an extra call after the session is established to get_endpoint, pass the session, the 'image' service type, and the region_name. Once get_endpoint returns the endpoint, that would be passed to the glance Client() call.

Is this correct, or is there a better way?

2016-06-08 03:22:24 -0600 answered a question Where to find list of deprecated settings for nova?

Have you already checked the config guide? It lists all of the config options and which ones are deprecated. (

2016-06-08 03:22:23 -0600 answered a question python glance client attribute error


The issue was my code. Taking out the 'keystone =', removing 'endpoint=', and pointing session to 'sess' cleared up the attribute problem. I also had to pass user_domain_name and project_domain_name into loader.load_from_options for auth.

Passing in the domain name will make the code even better.

Working code:

    226     def auth_glance(self):
    227         loader = loading.get_plugin_loader('password')
    228         auth = loader.load_from_options(
    229             auth_url=self.auth_url,
    230             username=self.username,
    231             password=self.password,
    232             project_name=self.tenant_name,
    233             user_domain_name='default',
    234             project_domain_name='default')
    240         sess = session.Session(auth=auth)
    243         glance = Client('2', session=sess)
    244         return glance
2016-06-08 03:22:23 -0600 asked a question python glance client attribute error

Part of our service will be grabbing builds and uploading them into glance. I've written a test for the glance image list using (

From the code (pardon the line numbers):

232     def testme(self):
233         print self.auth_url
234         print self.tenant_name
235         print "testage!"
236         loader = loading.get_plugin_loader('password')
237         auth = loader.load_from_options(
238             auth_url=self.auth_url,
239             username=self.username,
240             password=self.password,
241             project_name=self.tenant_name)
242         sess = session.Session(auth=auth)
243         keystone = ksclient.Client(session=sess)
244         glance = Client('2', endpoint=self.glance_url, session=keystone)
246         for image in glance.images.list():
247             print image

The image list fails:

Traceback (most recent call last):
  File "", line 11, in <module>
  File "/usr/local/bin/tools/", line 246, in testme
    for image in glance.images.list():
  File "/usr/lib/python2.7/dist-packages/glanceclient/v2/", line 176, in list
    for image in paginate(url, page_size, limit):
  File "/usr/lib/python2.7/dist-packages/glanceclient/v2/", line 108, in paginate
    resp, body = self.http_client.get(next_url)
  File "/usr/lib/python2.7/dist-packages/keystoneclient/", line 176, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/dist-packages/glanceclient/common/", line 332, in request
    return self._handle_response(resp)
  File "/usr/lib/python2.7/dist-packages/glanceclient/common/", line 81, in _handle_response
    if not resp.ok:
AttributeError: 'tuple' object has no attribute 'ok'

I've found no other mention of this issue via Google or Bing - is this a glance client bug or my bad coding?