Bright:Openstack-config

From Define Wiki
Revision as of 12:31, 6 January 2016 by K mouza (talk | contribs) (Created page with "== Changing default Storage directory == By Default, Openstack uses the <tt>/var</tt> directory, as the storage for everything Openstack-related. To change this follow the ne...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Changing default Storage directory

By Default, Openstack uses the /var directory, as the storage for everything Openstack-related. To change this follow the next steps.

1. Nova Path

You can change the nova state path, in which the instances are saved as follows:

[root@ma-b71-c7-os ~]# cmsh
[ma-b71-c7-os]% category roles openstack-compute-hosts
[ma-b71-c7-os->category[openstack-compute-hosts]->roles]% use openstack::compute
[ma-b71-c7-os->category[openstack-compute-hosts]->roles[OpenStack::Compute]]% set novastatepath /opt/nova
[ma-b71-c7-os->category[openstack-compute-hosts]->roles[OpenStack::Compute]]% commit

After setting the path, please make sure to move all the contents from under /var/lib/nova to /opt/nova (or the new state path of nova) on all openstack compute hosts. Please note that you can't have multiple state_path per compute host.

It's preferred not to change the nova state directory frequently as it may affect running instances.

2. Glance Path

You can change the data directory for glance images as follows:

[root@ma-b71-c7-os ~]# cmsh
[ma-b71-c7-os]% device roles master
[ma-b71-c7-os->device[ma-b71-c7-os]->roles]% use openstack::imageapi
[ma-b71-c7-os->device[ma-b71-c7-os]->roles[OpenStack::ImageApi]]% imagebackends
[ma-b71-c7-os->device[ma-b71-c7-os]->roles[OpenStack::ImageApi]->imagebackends]% use filesystem
[ma-b71-c7-os->device[ma-b71-c7-os]->roles[OpenStack::ImageApi]->imagebackends[filesystem]]% set filesystembackendstoragepath /cm/shared/apps/openstack/glance-images
[ma-b71-c7-os->device[ma-b71-c7-os]->roles[OpenStack::ImageApi]->imagebackends[filesystem]]% commit

Specifying multiple data directories for glance is not possible at the moment. A workaround for this is to freeze /etc/glance/glance-api.conf and add multiple "filesystem_store_datadir" directives specifying a data directory at each line:

[root@ma-b71-c7-os ~]# grep "filesystem_store_datadir" /etc/glance/glance-api.conf

filesystem_store_datadir=/cm/shared/apps/openstack/glance-images
filesystem_store_datadir=/opt/glance/images

3. Cinder Block Storage

For the cinder block storage, you can modify the NFS shares as follows:

[ma-b71-c7-os->device[ma-b71-c7-os]->roles[OpenStack::Volume]->volumebackends[nfs]]% show
Parameter                        Value                                           
-------------------------------- ------------------------------------------------
Name                             nfs                                              
Revision                                                                          
Type                             OpenStackVolumeBackendNFS                        
Volume driver                    cinder.volume.drivers.nfs.NfsDriver              
NFS disk util                    df                                               
NFS mount point base             /var/lib/cinder/volumes                          
NFS sparsed volumes              yes                                              
NFS shares                       master:/cm/shared/apps/openstack/cinder-volumes  
NFS shares config                /var/lib/cinder/nfsshare