[openstack-dev] [Heat] Use block_device_mapping_v2 for swap?

marios marios at redhat.com
Mon Aug 31 10:07:27 UTC 2015


On 31/08/15 11:19, TIANTIAN wrote:
> 
> 
> At 2015-08-28 21:48:11, "marios" <marios at redhat.com> wrote:
>> I am working with the OS::Nova::Server resource and looking at the tests
>> [1], it should be possible to just define 'swap_size' and get a swap
>> space created on the instance:
>>
>>  NovaCompute:
>>    type: OS::Nova::Server
>>    properties:
>>      image:
>>        {get_param: Image}
>>      ...
>>      block_device_mapping_v2:
>>        - swap_size: 1
>>
>> When trying this the first thing I hit is a validation code nit that is
>> already fixed @ [2] (I have slightly older heat) and I applied that fix.
>> However, when I try and deploy with a Flavor that has a 2MB swap for
>> example, and with the above template, I still end up with a 2MB swap.
>>
>> Am I right in my assumption that the above template is the equivalent of
>> specifying --swap on the nova boot cli (i.e. should this work?)? I am
>> working with the Ironic nova driver btw and when deploying using the
>> nova cli using --swap works; has anyone used/tested this property
>> recently? I'm not yet sure if this is worth filing a bug for yet.
> 
>>
> ------According to the codes of heat and novaclient, the above template is the equivalent of
>        specifying --swap on the nova boot cli:
> https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/shell.py#L142-L146
> https://github.com/openstack/heat/blob/master/heat/engine/resources/openstack/nova/server.py#L822-L831
> 
> 
> But don't know much about nova, and not sure how does nova behave if specified different swap size on Flavor
> 
> 
> and Bdm.

Hey TianTian, thanks very much for the pointers and sanity check. Yeah I
think it is intended to work that way (e.g. the tests on the heatclient
also cover this as per my original), I was mostly looking for 'yeah did
this recently worked ok for me'.

WRT the different swap size on flavor, in this case what is on the
flavor becomes the effective maximum you can specify (and can override
with --swap on the nova cli).

thanks! marios

> 
> 
>> thanks very much for reading! marios > >[1] >https://github.com/openstack/heat/blob/a1819ff0696635c516d0eb1c59fa4f70cae27d65/heat/tests/nova/test_server.py#L2446 >[2] >https://review.openstack.org/#/q/I2c538161d88a51022b91b584f16c1439848e7ada,n,z > >__________________________________________________________________________ >OpenStack Development Mailing List (not for usage questions) >Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe >http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>>
>> __________________________________________________________________________
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




More information about the OpenStack-dev mailing list