Ask Your Question

pv2b's profile - activity

2019-06-30 21:09:16 -0500 received badge  Teacher (source)
2019-02-15 09:29:43 -0500 received badge  Famous Question (source)
2019-02-12 13:46:25 -0500 received badge  Notable Question (source)
2019-02-12 13:46:25 -0500 received badge  Notable Question (source)
2019-02-11 23:44:06 -0500 received badge  Popular Question (source)
2019-02-11 15:44:21 -0500 commented question Extending an in-use cinder volume?

Progress! I was missing a version header with the API call. Adding -H "OpenStack-API-Version: volume 3.42 to the curl command gave me a positive response. cinder now shows the volume as 2GB. I can't get Cirros to see the extra space but that might be a cirros thing. I'll try another OS.

2019-02-11 15:44:21 -0500 answered a question Network setup

Hi, dough.

I just spent a lot of frustration getting this exact thing to work as well, so I hope I can share what worked for me. (Also taking this opportunity for my own sake to write down what actually worked.)

I am also using packstack on CentOS 7 (I didn't end up getting it to work correctly with devstack that I tried initially.)

Some of my terminology might be wrong since I'm still learning myself. Also, I might be missing a step or two, since this is from my (rather fresh) memory.

VirtualBox Networking Setup

First of all, I configured two network interfaces in VirtualBox, both of them bridged to my home LAN, the plan being to use the first NIC (enp0s3 in my setup) as the NIC for management and API traffic, and using the second nic (enp0s8 in my example) as an uplink to the OpenSwitch OVS into the physical network. In my lab (and probably in yours also) these should be the same, although they can be different.

I configured the second network interface to allow promiscious mode in VirtualBox. This is neccessary to allow VM traffic to work. This is done through the VM settings inside of the VirtualBox GUI.

Management / API network setup

You will need to setup a static IP address from one of your 5 addresses for use as your packstack box's IP address. This is accomplished using the standard methods on CentOS. On my machine, this is how my /etc/sysconfig/network-scripts/ifcfg-enp0s3 file looks:

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp0s3"
UUID="635501cf-47d5-47ab-96f1-8e2c5eac7eb1"
DEVICE="enp0s3"
ONBOOT="yes"
IPADDR="192.168.1.240"
PREFIX="24"
GATEWAY="192.168.1.1"
DNS1="192.168.1.1"
IPV6_PRIVACY="no"
[pvz@localhost ~]$

Neutron router / subnet setup

By default on Packstack, there is already a router1 router that is present, but uses the wrong subnet.

What you need to do is to create a new subnet, specifying the default gateway and netmask, as well as giving it the range of 5 IP addresses provided to you by your school. You'll need to use the openstack CLI for this. Before running the openstack cli, you'll need to source /root/keystonerc_admin.

To actually achieve this state in the CLI refer to the docs, instead I'll show you how my working setup works:

[root@localhost pvz(keystone_admin)]# openstack router list
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+
| ID                                   | Name    | Status | State | Distributed | HA    | Project                          |
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+
| 4b194196-b644-46b1-af1f-40825886c0a9 | router1 | ACTIVE | UP    | False       | False | a17f01bc783445f5b352209283f4cc02 |
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+
[root@localhost pvz(keystone_admin)]# openstack router show 4b194196-b644-46b1-af1f-40825886c0a9
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                                                                                                                     |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up          | UP                                                                                                                                                                                        |
| availability_zone_hints |                                                                                                                                                                                           |
| availability_zones      | nova                                                                                                                                                                                      |
| created_at              | 2019-02-10T17:15:48Z                                                                                                                                                                      |
| description             |                                                                                                                                                                                           |
| distributed             | False                                                                                                                                                                                     |
| external_gateway_info   | {"network_id": "40083a3e-15c6-451d-9185-076c8cc4b055", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "295c727c-83a9-4fce-985d-0476f95fc387", "ip_address": "192.168.1.244"}]} |
| flavor_id               | None                                                                                                                                                                                      |
| ha                      | False                                                                                                                                                                                     |
| id                      | 4b194196-b644-46b1-af1f-40825886c0a9                                                                                                                                                      |
| interfaces_info         | [{"subnet_id": "467f2fa8-b1cb-40d5-b86b-3f029712faf4", "ip_address": "10.0.0.1", "port_id": "5aa4107a-711e-4c08-b0ec-e0a30de06718"}]                                                      |
| name                    | router1                                                                                                                                                                                   |
| project_id              | a17f01bc783445f5b352209283f4cc02                                                                                                                                                          |
| revision_number         | 9                                                                                                                                                                                         |
| routes                  |                                                                                                                                                                                           |
| status                  | ACTIVE                                                                                                                                                                                    |
| tags                    |                                                                                                                                                                                           |
| updated_at              | 2019-02-10T18:12:16Z                                                                                                                                                                      |
+-------------------------+----------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------+
[root@localhost pvz(keystone_admin)]# openstack network ...
(more)
2019-02-11 15:44:09 -0500 answered a question Extending an in-use cinder volume?

After some investigation this is what I have learned:

  1. I had the curl call almost right. I realized that I had omitted the OpenStack-API-Version header. The following curl call would work:

    curl -s -H "Content-Type: application/json" -H "X-Auth-Token: <redacted>" -H "OpenStack-API-Version: volume 3.42" http://<redacted>:8776/v3/a17f01bc783445f5b352209283f4cc02/volumes/006e4fcc-aa4d-414b-981c-5b2360d30202/action -d '{"os-extend":{"new_size":2}}'
    
  2. There is in fact an openstack cli tool. It is called like this:

    OS_VOLUME_API_VERSION=3.42 cinder extend 006e4fcc-aa4d-414b-981c-5b2360d30202 2
    

    Again, specifying the API version is neccessary here in order to enable extending of in-use volumes. I still haven't found anything to expose this functionality in Horizon.

  3. This almost works on my packstack setup, but I get the following in my /var/log/cinder/volume.log:

    2019-02-11 19:38:10.807 10278 ERROR cinder.compute.nova [req-7c27e5dc-d7eb-4290-a48f-290fe1964e08 2b2c9c98ce6948e28ba007722a2f9588 a17f01bc783445f5b352209283f4cc02 - default default] Failed to notify nova on events: [{'tag': u'006e4fcc-aa4d-414b-981c-5b2360d30202', 'name': 'volume-extended', 'server_uuid': u'1dcd32a3-41d0-443d-abd4-9e054cb1844d'}].: Forbidden: Policy doesn't allow os_compute_api:os-server-external-events:create to be performed. (HTTP 403) (Request-ID: req-dec890fe-9c2a-45a3-885c-3f0d3acd369e)
    

    Searching for this, I found a Red Hat bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1640443 (https://bugzilla.redhat.com/show_bug....)

    It seems on my system, I'm missing an admin connection between nova and cinder. This has been fixed in TripleO, but likely not in packstack deployments. However, fixing that's a question for a different question. :-)

2019-02-11 14:42:24 -0500 received badge  Editor (source)
2019-02-11 08:50:13 -0500 commented question Extending an in-use cinder volume?

@eblock nova-manage --version shows 18.1.0. I installed Packstack using the centos-release-openstack-rocky yum package. So, as I wrote in the question, I expect I'm running rocky.

2019-02-11 06:53:19 -0500 received badge  Supporter (source)
2019-02-11 05:45:01 -0500 commented question instance resizing on a running vm

What a co-incidence, I just posted the same question (although related just to disk space). By the time I finished writing my question your question popped up. https://ask.openstack.org/en/question/119853/extending-an-in-use-cinder-volume/ (https://ask.openstack.org/en/question...)

2019-02-11 04:33:36 -0500 asked a question Extending an in-use cinder volume?

Hello!

I have a recently deployed CentOS 7 VM with OpenStack rocky deployed using the PackStack all-in-one deployment, in order to evaluate and learn about OpenStack.

In the PackStack setup, the LVM Volume Driver is used by Cinder. The Libvirt driver is used by Nova. (The volume_type is shown as iscsi, I'm not sure why, I think this might be misleading.)

Right now I'm investigating the use case of being able to extend a volume that is currently attached to a running instance, in order to provision extra storage space on the fly. As far as I can tell, work was done in 2017 to add this functionality to Pike, as per the following specs:

  • https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html (Cinder Specs: Extend a volume while volume is attached to an instance)
  • https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html (Nova Specs: Allow an attached volume to be extended)

What I'm trying to do is to extend an online volume - i.e. grow the available disk space available to an instance without rebooting it, and without adding an additional volume.

Consulting the https://docs.openstack.org/cinder/rocky/reference/support-matrix.html#operation_online_extend_support (Cinder Driver Support Matrix (Rocky)), I have also been able to confirm that this is supported by the LVM driver.

According to the Nova spec:

The initial implementation aims to support virt drivers using os-brick such as libvirt and hyper-v.

So, as far as I can tell, the configuration I'm running (PackStack all-in-one) should support this functionality.

However, I have not been able to find this functionality exposed anywhere in the OpenStack CLI or Horizon. So, I tried an API call as per the https://developer.openstack.org/api-ref/block-storage/v3/index.html?expanded=extend-a-volume-size-detail#volume-actions-volumes-action (API Documentation (Block Storage volume actions)).

The API call below aims to try to extend the volume that's currently attached to the VM from 1 GB to 2 GB.

$ curl -s -H "Content-Type: application/json" -H "X-Auth-Token: <redacted>" http://<redacted>:8776/v3/a17f01bc783445f5b352209283f4cc02/volumes/006e4fcc-aa4d-414b-981c-5b2360d30202/action -d '{"os-extend":{"new_size":2}}'
{"badRequest": {"message": "Invalid volume: Volume 006e4fcc-aa4d-414b-981c-5b2360d30202 status must be '{'status': 'available'}' to extend, currently in-use.", "code": 400}}

As we can see, an error is thrown by Cinder, indicating that an in-use volume cannot be extended.

What am I missing? Is there something about OpenStack as deployed by Packstack that is incompatible with this functionality - i.e. being able to resize volumes on the fly? Or is the functionality simply not there, despite the documentation to the contrary?

For reference, here's a view of the cinder volume and the nova instance to which it is connected:

[root@localhost ~(keystone_demo)]# cinder show 006e4fcc-aa4d-414b-981c-5b2360d30202
+------------------------------+-------------------------------------------------+
| Property                     | Value                                           |
+------------------------------+-------------------------------------------------+
| attached_servers             | ['1dcd32a3-41d0-443d-abd4-9e054cb1844d']        |
| attachment_ids               | ['e67c034c-b800-42e8-9478-71e712f60ed2']        |
| availability_zone            | nova                                            |
| bootable                     | true                                            |
| consistencygroup_id          | None                                            |
| created_at                   | 2019-02-10T18:16:37.000000                      |
| description                  |                                                 |
| encrypted                    | False                                           |
| id                           | 006e4fcc-aa4d-414b-981c-5b2360d30202            |
| metadata                     | attached_mode : rw                              |
|                              | readonly : False                                |
| multiattach                  | False                                           |
| name                         |                                                 |
| os-vol-tenant-attr:tenant_id | a17f01bc783445f5b352209283f4cc02                |
| readonly                     | False                                           |
| replication_status           | None                                            |
| size                         | 1                                               |
| snapshot_id                  | None                                            |
| source_volid                 | None                                            |
| status                       | in-use                                          |
| updated_at                   | 2019-02-10T18 ...
(more)