Ask Your Question
2

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

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

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
2

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

instances_pathconfig parameter. See http://docs.openstack.org/newton/conf....

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )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 -0600 )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 -0600 )edit
1

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 -0600 )edit
0

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

Damian Dąbrowski gravatar image

Hi,

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

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

Seen: 1,498 times

Last updated: Feb 08 '17