Ask Your Question

How can I change where ephemeral and swap disk are stored?

asked 2016-06-03 17:38:13 -0500

Jorge Florencio gravatar image

Hi folks, when I create a new instance using ephemeral and swap disk, the root disk is created using my default cinder backend but the ephemeral and swap disks are created on two files (disk.eph0 and disk.swap) on the directory /var/lib/nova/instances/instance-id

Using this configuration I can't live-migrate instances because /var/lib/nova/instances directory is not shared between nova hosts.

The cinder backend is a shared storage, how can I configure nova for creating the ephemeral and swap volumes on the shared storage instead the default dir?

Thank you! Jorge.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2017-02-08 04:29:12 -0500

instances_pathconfig parameter. See

edit flag offensive delete link more


Thanks for help Bernd,

But it specifies where instances are stored on the hypervisor’s disk.

Is there any way to create seperate cinder LV for each swap space?

Damian Dąbrowski gravatar imageDamian Dąbrowski ( 2017-02-08 09:39:28 -0500 )edit

I misunderstood the question. Perhaps I still don't understand what you want.

You can, e.g., boot from a volume, but this is not called ephemeral storage. You can also attach additional Cinder volumes to the instance and use them for swapping.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-08 15:59:43 -0500 )edit

Hi Bernd, I'll try to explain it better. I'd like to cinder volume will be created and attached to instance as swap when i build instance with non-zero swap size in flavor. I know how to attach this volume manually, but I don't have any idea how can i make this has happened automatically.

Damian Dąbrowski gravatar imageDamian Dąbrowski ( 2017-02-09 02:59:44 -0500 )edit

You can attach a volume at boot time, but of course this is manual as well. You need to have a volume, then issue a command like

nova boot --block-device source=volume,id=VOLUME'sUUID,dest=volume,format=swap ....
Bernd Bausch gravatar imageBernd Bausch ( 2017-02-09 03:23:28 -0500 )edit

but you can't ask Nova to create a volume. You have to create it.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-09 03:24:29 -0500 )edit

answered 2017-02-08 03:30:41 -0500

Damian Dąbrowski gravatar image


I wonder about the same thing. Does anyone have any idea? I would be very grateful.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2016-06-03 17:38:13 -0500

Seen: 2,841 times

Last updated: Feb 08 '17