Ask Your Question

John Zhao's profile - activity

2019-06-27 03:20:29 -0600 received badge  Famous Question (source)
2016-06-15 07:09:14 -0600 received badge  Famous Question (source)
2016-02-04 16:19:14 -0600 received badge  Notable Question (source)
2016-02-04 16:19:14 -0600 received badge  Popular Question (source)
2015-12-10 09:10:14 -0600 received badge  Popular Question (source)
2015-12-10 09:10:14 -0600 received badge  Notable Question (source)
2015-12-09 06:51:07 -0600 commented question state code for instance, volume and IP address

Thanks, RHK. I think I did not ask the question clearly enough. The question is to about how to check the state of resources, instance, volume, IP to deal with latency in the application.

2015-12-08 14:34:52 -0600 asked a question state code for instance, volume and IP address

I am developing an application in Python. In simplistic ways, the application has three steps, which will runs in batch

1. create an instance with volumes;

2. associate floating IP to the instance;

3. run ssh remote commands on the instance to get work done

I know there is latency in step 1 & 2, but could not find documents on state(status) map of instance, volume and IP address. Can experts point me to right place to check or provide advice on how to ensure successful remote connection to a newly created instance?

Thanks,

John

2015-12-07 07:45:23 -0600 asked a question cinderclient attach API is not working ?

I called cinderclient.volumes.attach(...) to attach a block volume to an instance, the volume is in 'In-Use' status and attached to the volume. However, when I got on Openstack dashboard and clicked on the instance, I could not find the volume in the 'Volumes Attached' section.

I use cinder 2.0 client.

Thanks for help!

John

2015-12-06 07:15:21 -0600 asked a question tagging instance and volume

I came from AWS EC2 world, it has API to tag sources. I checked API, and did not find similar calls. So my questions is: does Openstack have similar feature?

Thanks,

John

2015-12-04 10:56:40 -0600 received badge  Notable Question (source)
2015-12-03 13:29:19 -0600 commented answer How to list all volumes attached to a particular instance

thanks, I got it. John

2015-12-03 12:24:03 -0600 commented answer get image size

thanks, that works. John

2015-12-03 04:06:44 -0600 received badge  Popular Question (source)
2015-12-02 15:35:03 -0600 asked a question get image size

I want to use Python API to create a volume from an image. To do so, I need to know the size of image. I noticed that image class has OS-EXT-IMG-SIZE:size property, but I don't know how to get the size from there.

Thanks,

John

2015-12-01 08:49:22 -0600 received badge  Good Question (source)
2015-11-30 22:04:58 -0600 received badge  Notable Question (source)
2015-11-30 20:25:16 -0600 received badge  Nice Question (source)
2015-11-30 12:07:20 -0600 received badge  Student (source)
2015-11-30 08:16:41 -0600 answered a question How to list all volumes attached to a particular instance

Thanks, Jay. Do you know Python API call that will do the same? Thanks, John

2015-11-30 06:42:46 -0600 asked a question failed to create instance with block_device_mapping_v2 option

I was able to create an instance with CLI

$ nova boot --flavor gc1.small --image c85b0898-2bbd-46be-8950-3c031f07cb93 --key-name dev_key --block-device id=c85b0898-2bbd-46be-8950-3c031f07cb93,source=image,dest=volume,type=disk,device=vda,size=30,bootindex=1,shutdown=remove --availability-zone dev_zone --security-groups dev_tech --nic net-id=6fc22c46-b895-408f-b005-b2c4de916d8c ins_from_cl

However, when I submitted it via Python API: net = novaClient.networks.find(label='dev_net') image = novaClient.images.find(name='Base RHEL 6.7 Cloud') flavor = novaClient.flavors.find(name='gc1.small') dev_mapping = [{ 'source_type' : 'image', "image_id" : image.id, 'device_name' : 'vda', "volume_id" : "f7c90ef0-925d-4c19-b499-a951793d7572", "volume_size" : 30, "boot_index" : 0, 'destination_type' : 'volume'}] novaClient.servers.create('ins_from_python', image,flavor , key_name = 'dev_key' ,block_device_mapping_v2 =dev_mapping, availability_zone ='dev_zone', nics = [{'net-id': net.id}])

I got the following error: Traceback (most recent call last): File "<input>", line 1, in <module> File "/usr/share/lib/python2.7/site-packages/novaclient/v2/servers.py", line 995, in create *boot_kwargs) File "/usr/share/lib/python2.7/site-packages/novaclient/v2/servers.py", line 541, in _boot return_raw=return_raw, *kwargs) File "/usr/share/lib/python2.7/site-packages/novaclient/base.py", line 172, in _create _resp, body = self.api.client.post(url, body=body) File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 449, in post return self._cs_request(url, 'POST', *kwargs) File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 424, in _cs_request resp, body = self._time_request(url, method, *kwargs) File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 397, in _time_request resp, body = self.request(url, method, **kwargs) File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 391, in request raise exceptions.from_response(resp, body, url, method) BadRequest: Block Device Mapping is Invalid: Missing device UUID. (HTTP 400) (Request-ID: req-9b4b44fb-659f-4f25-90e2-465343431a21)

I searched, but am not able to find a solution. Can someone help? Thanks

John

2015-11-30 06:26:20 -0600 received badge  Enthusiast
2015-11-29 00:47:36 -0600 received badge  Popular Question (source)
2015-11-28 11:04:54 -0600 asked a question How to list all volumes attached to a particular instance

Given an instance name/id, is there a API call or filter option to list ALL volumes attached? Thanks, John

2015-11-26 00:54:49 -0600 received badge  Popular Question (source)
2015-11-26 00:54:49 -0600 received badge  Notable Question (source)
2015-11-20 13:11:01 -0600 asked a question cinderclient 2.0 python api

I could not find API document for cinderclient 2.0 api. can someone point me to the right URL? This is what I found so far: http://docs.openstack.org/developer/python-cinderclient/ (http://docs.openstack.org/developer/p...)

Thanks,

John

2015-11-19 08:17:38 -0600 received badge  Notable Question (source)
2015-11-19 02:27:29 -0600 received badge  Popular Question (source)
2015-11-18 08:53:38 -0600 answered a question how to associate floating_ip to a server

found the syntax. It is myInstance.add_floating_ip(myIP)

2015-11-18 08:27:28 -0600 commented question how to associate floating_ip to a server

I am writing a python application, and need python API call syntax. Thanks.

2015-11-17 21:37:36 -0600 asked a question how to associate floating_ip to a server

I am using novaclient 2.0. After creating a server and floating IP, what is the syntax to associate the ip to the server?

Thanks,

John

2015-11-17 21:33:53 -0600 answered a question method to get keypair names

I figured it out. Name is an attribute of keypair class, so you can get the name with myKey.name.

2015-11-17 00:55:29 -0600 asked a question method to get keypair names

novaclient.keypairs.list() return a list of keypairs object. However, I could not find a method to get the names of the keypairs.

Can someone help?

Thanks,

John