Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
Merge branch '0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
ywang19 committed Jan 3, 2015
2 parents 11b4ba0 + 68eba35 commit 1c44b39
Show file tree
Hide file tree
Showing 29 changed files with 173 additions and 82 deletions.
2 changes: 1 addition & 1 deletion source/python-vsmclient/python-vsmclient.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: python-vsmclient
Version: 2014.12
Release: 0.9.0%{?dist}
Release: 0.9.1%{?dist}
Summary: Python API and CLI for vsm

Group: Development/Languages
Expand Down
2 changes: 1 addition & 1 deletion source/vsm-dashboard/vsm-dashboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Name: vsm-dashboard
Version: 2014.12
Release: 0.9.0%{?dist}
Release: 0.9.1%{?dist}
Url: http://intel.com/itflex
License: Apache 2.0
Group: Development/Languages/Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class AddCacheTier(forms.SelfHandlingForm):
cache_tier_pool = forms.ChoiceField(label=_('Cache Tier Pool'))
storage_tier_pool = forms.ChoiceField(label=_('Storage Tier Pool'))
cache_mode = forms.ChoiceField(label=_('Cache Mode'))
force_nonempty = forms.BooleanField(label="FORCE NONEMPTY",required=False,initial=False)
hit_set_type = forms.ChoiceField(label=_('Hit Set Type'))
hit_set_count = forms.CharField(label=_("Hit set count"))
hit_set_period_s = forms.CharField(label=_("Hit set period(s)"))
Expand Down Expand Up @@ -261,6 +262,7 @@ def handle(self, request, data):
'storage_pool_id': data['storage_tier_pool'],
'cache_pool_id': data['cache_tier_pool'],
'cache_mode': data['cache_mode'],
'force_nonempty': data['force_nonempty'],
'options': {
'hit_set_type': data['hit_set_type'],
'hit_set_count': data['hit_set_count'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<div class="right">
<h3>{% trans "Description" %}:</h3>
<p>{% trans "From here you can create a user " %}</p>
<p>{% trans "Your user name must be combination of letter,number ,'@', '.' and '_' " %}</p>
<p>{% trans "Your password must be at least 8 characters long, and contain at least one number, one upper case letter, one lower case letter, and one of the special characters !@#$%^&*(){}[]<>?" %}</p>
</div>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def handle(self, request, data):

LOG.error(api.keystone.user_get(request, ret.id))
messages.success(request,
_('Successfully created storage pool: %s')
_('Successfully created user: %s')
% data['name'])
return ret
except:
Expand Down
10 changes: 6 additions & 4 deletions source/vsm-deploy/server_manifest
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class ManifestChecker(object):
if line.startswith('#'):
continue

if find_it and line.find('[') != -1 and line.find(']') != -1:
print line
break

if len(line) < 2:
print 'Small line, skiped'
continue
Expand All @@ -187,9 +191,6 @@ class ManifestChecker(object):
find_it = True
continue

if find_it and line.find('[') != -1 and line.find(']') != -1:
print line
break

if find_it:
lines.append(line)
Expand Down Expand Up @@ -285,6 +286,7 @@ class ManifestChecker(object):
print ip_list
print self._lan_list
if self.__in_lan(ip):
self.__is_address_ok(ip)
ip_in_lan_cnt = ip_in_lan_cnt + 1

if ip_in_lan_cnt != len(self._lan_list):
Expand All @@ -302,7 +304,7 @@ class ManifestChecker(object):
if cnt == 'n':
error(info_list)

self.__is_address_ok(ip)
#self.elf.__is_address_ok(ip)

def format_to_json(self):
return json.dumps(self._info, sort_keys=True, indent=2)
Expand Down
4 changes: 2 additions & 2 deletions source/vsm-deploy/tools/etc/vsm/prepools/server/ceph
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

function _create_pool() {
local pool_name=$1
local temp_pool=${pool_name:4}
local cnt=`ceph osd lspools| grep $temp_pool | wc -l`
#local temp_pool=${pool_name:4}
local cnt=`ceph osd lspools| grep $pool_name | wc -l`
if [[ $cnt -eq 0 ]]; then
rados mkpool $pool_name
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function create_multiple_cinder() {

mkdir -p $TOPDIR/files/cinder/
cp -rf /etc/ceph/ceph.conf $TOPDIR/files/cinder/
sed -i "s,keyring = /etc/ceph/keyring.admin,,g" $TOPDIR/files/cinder/ceph.conf
mv $file $TOPDIR/files/cinder/

cat <<"EOF">>$TOPDIR/files/cinder/ceph.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function create_cinder() {

mkdir -p $TOPDIR/files/cinder/
cp -rf /etc/ceph/ceph.conf $TOPDIR/files/cinder/
sed -i "s,keyring = /etc/ceph/keyring.admin,,g" $TOPDIR/files/cinder/ceph.conf
mv $file $TOPDIR/files/cinder/

cat <<"EOF">>$TOPDIR/files/cinder/ceph.conf
Expand Down
1 change: 1 addition & 0 deletions source/vsm-deploy/tools/etc/vsm/prepools/server/glance
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function create_glance() {

mkdir -p $TOPDIR/files/glance/
cp -rf /etc/ceph/ceph.conf $TOPDIR/files/glance/
sed -i "s,keyring = /etc/ceph/keyring.admin,,g" $TOPDIR/files/glance/ceph.conf
mv $file $TOPDIR/files/glance/

cat <<"EOF">>$TOPDIR/files/glance/ceph.conf
Expand Down
1 change: 1 addition & 0 deletions source/vsm-deploy/tools/etc/vsm/prepools/server/nova
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function create_nova() {
mkdir -p $TOPDIR/files/nova/
cp -rf $TOPDIR/files/cinder/cinder.keyring $TOPDIR/files/nova/nova.keyring
cp -rf /etc/ceph/ceph.conf $TOPDIR/files/nova/
sed -i "s,keyring = /etc/ceph/keyring.admin,,g" $TOPDIR/files/nova/ceph.conf

cat <<"EOF">>$TOPDIR/files/nova/ceph.conf
[%AUTH_CINDER_USER%]
Expand Down
1 change: 1 addition & 0 deletions source/vsm-deploy/tools/etc/vsm/prepools/server/tarfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function gen_tar_file() {
TEMP=`mktemp`; rm -rf $TEMP; mkdir -p $TEMP/prepools
cp -rf /etc/vsm/prepools/* $TEMP/prepools/
cp -rf /etc/ceph/ceph.conf $TEMP/prepools/lib/
sed -i "s,keyring = /etc/ceph/keyring.admin,,g" $TEMP/prepools/lib/ceph.conf
cd $TEMP/prepools

cat <<"EOF" > localrc
Expand Down
2 changes: 1 addition & 1 deletion source/vsm-deploy/vsm-deploy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Name: vsm-deploy
Version: 2014.12
Release: 0.9.0%{?dist}
Release: 0.9.1%{?dist}
Summary: VSM-Deploy

Group: Deploy/VSM
Expand Down
25 changes: 25 additions & 0 deletions source/vsm/bin/refresh-cluster-status
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from vsmclient.v1 import client as vsm_client

# load vsm config
CONF_FILE = "/etc/vsmdeploy/deployrc"
conf_str = open(CONF_FILE, "r").read()
CONF_DICT = dict([x.strip().split("=",1) for x in conf_str.split("\n") if "=" in x])

vsmclient = None

def get_vsmclient():
global vsmclient
if not vsmclient:
vsmclient = vsm_client.Client('vsm',
CONF_DICT['KEYSTONE_VSM_SERVICE_PASSWORD'],
'service',
"http://%s:5000/v2.0" % CONF_DICT['VSM_HOST'],
)
return vsmclient

def cluster_refresh():
return get_vsmclient().clusters.refresh()

cluster_refresh()
25 changes: 25 additions & 0 deletions source/vsm/bin/refresh-osd-status
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from vsmclient.v1 import client as vsm_client

# load vsm config
CONF_FILE = "/etc/vsmdeploy/deployrc"
conf_str = open(CONF_FILE, "r").read()
CONF_DICT = dict([x.strip().split("=",1) for x in conf_str.split("\n") if "=" in x])

vsmclient = None

def get_vsmclient():
global vsmclient
if not vsmclient:
vsmclient = vsm_client.Client('vsm',
CONF_DICT['KEYSTONE_VSM_SERVICE_PASSWORD'],
'service',
"http://%s:5000/v2.0" % CONF_DICT['VSM_HOST'],
)
return vsmclient

def osd_refresh():
return get_vsmclient().osds.refresh()

osd_refresh()
10 changes: 6 additions & 4 deletions source/vsm/bin/server_manifest
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class ManifestChecker(object):
if line.startswith('#'):
continue

if find_it and line.find('[') != -1 and line.find(']') != -1:
print line
break

if len(line) < 2:
print 'Small line, skiped'
continue
Expand All @@ -187,9 +191,6 @@ class ManifestChecker(object):
find_it = True
continue

if find_it and line.find('[') != -1 and line.find(']') != -1:
print line
break

if find_it:
lines.append(line)
Expand Down Expand Up @@ -285,6 +286,7 @@ class ManifestChecker(object):
print ip_list
print self._lan_list
if self.__in_lan(ip):
self.__is_address_ok(ip)
ip_in_lan_cnt = ip_in_lan_cnt + 1

if ip_in_lan_cnt != len(self._lan_list):
Expand All @@ -302,7 +304,7 @@ class ManifestChecker(object):
if cnt == 'n':
error(info_list)

self.__is_address_ok(ip)
#self.elf.__is_address_ok(ip)

def format_to_json(self):
return json.dumps(self._info, sort_keys=True, indent=2)
Expand Down
1 change: 0 additions & 1 deletion source/vsm/etc/vsm/prepools/files/cinder/ceph.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[global]
auth supported = cephx
keyring = /etc/ceph/keyring.admin
max open files = 131072

[mds]
Expand Down
1 change: 0 additions & 1 deletion source/vsm/etc/vsm/prepools/files/glance/ceph.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[global]
auth supported = cephx
keyring = /etc/ceph/keyring.admin
max open files = 131072

[mds]
Expand Down
1 change: 0 additions & 1 deletion source/vsm/etc/vsm/prepools/files/nova/ceph.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[global]
auth supported = cephx
keyring = /etc/ceph/keyring.admin
max open files = 131072

[mds]
Expand Down
1 change: 0 additions & 1 deletion source/vsm/etc/vsm/prepools/lib/ceph.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[global]
auth supported = cephx
keyring = /etc/ceph/keyring.admin
max open files = 131072

[mds]
Expand Down
4 changes: 3 additions & 1 deletion source/vsm/etc/vsm/prepools/lib/cinder-multiple
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ function _del_other_multiple_section() {
if [[ $cnt -gt 0 ]]; then
sec_name=${n//[/ }
sec_name=${sec_name//]/ }
openstack-config --del /etc/cinder/cinder.conf $sec_name
if [[ `echo $sec_name | grep vsm | wc -l` -gt 0 ]]; then
openstack-config --del /etc/cinder/cinder.conf $sec_name
fi
fi
done
openstack-config --del /etc/cinder/cinder.conf DEFAULT enabled_backends
Expand Down
4 changes: 3 additions & 1 deletion source/vsm/etc/vsm/prepools/lib/cinder-single
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function _del_other_section() {
if [[ $cnt -gt 0 ]]; then
sec_name=${n//[/ }
sec_name=${sec_name//]/ }
openstack-config --del /etc/cinder/cinder.conf $sec_name
if [[ `echo $sec_name | grep vsm | wc -l` -gt 0 ]]; then
openstack-config --del /etc/cinder/cinder.conf $sec_name
fi
fi
done
openstack-config --del /etc/cinder/cinder.conf DEFAULT enabled_backends
Expand Down
4 changes: 2 additions & 2 deletions source/vsm/etc/vsm/prepools/server/ceph
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

function _create_pool() {
local pool_name=$1
local temp_pool=${pool_name:4}
local cnt=`ceph osd lspools| grep $temp_pool | wc -l`
#local temp_pool=${pool_name:4}
local cnt=`ceph osd lspools| grep $pool_name | wc -l`
if [[ $cnt -eq 0 ]]; then
rados mkpool $pool_name
fi
Expand Down
6 changes: 5 additions & 1 deletion source/vsm/vsm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Name: vsm
Version: 2014.12
Release: 0.9.0%{?dist}
Release: 0.9.1%{?dist}
Summary: VSM

Group: Storage/System
Expand Down Expand Up @@ -184,6 +184,8 @@ install -p -D -m 755 bin/vsm-backup %{buildroot}%{_bindir}/vsm-backup
install -p -D -m 755 bin/vsm-restore %{buildroot}%{_bindir}/vsm-restore
install -p -D -m 755 bin/cluster_manifest %{buildroot}%{_usr}/local/bin/cluster_manifest
install -p -D -m 755 bin/server_manifest %{buildroot}%{_usr}/local/bin/server_manifest
install -p -D -m 755 bin/refresh-osd-status %{buildroot}%{_usr}/local/bin/refresh-osd-status
install -p -D -m 755 bin/refresh-cluster-status %{buildroot}%{_usr}/local/bin/refresh-cluster-status
install -p -D -m 755 bin/getip %{buildroot}%{_usr}/local/bin/getip


Expand Down Expand Up @@ -262,6 +264,8 @@ exit 0
%config(noreplace) %attr(-, root, vsm) %{_usr}/local/bin/getip
%config(noreplace) %attr(-, root, vsm) %{_usr}/local/bin/cluster_manifest
%config(noreplace) %attr(-, root, vsm) %{_usr}/local/bin/server_manifest
%config(noreplace) %attr(-, root, vsm) %{_usr}/local/bin/refresh-osd-status
%config(noreplace) %attr(-, root, vsm) %{_usr}/local/bin/refresh-cluster-status
#-----------------------------
# Prepools
#-----------------------------
Expand Down
6 changes: 3 additions & 3 deletions source/vsm/vsm/agent/cephconfigparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def add_global(self,
# In order to support lower version of vsm.
# We set keyring path here.
# keyring = /etc/ceph/keyring.admin
#self._parser.set('global', 'keyring', '/etc/ceph/keyring.admin')
self._parser.set('global', 'keyring', '/etc/ceph/keyring.admin')
# Have to setup fsid.
self._parser.set('global', 'fsid', str(uuid.uuid1()))

Expand All @@ -335,7 +335,7 @@ def add_mds_header(self, keyring='false'):
#mds data = /var/lib/ceph/mds/ceph-$id
#keyring = /var/lib/ceph/mds/ceph-$id/keyring
self._parser.set('mds', 'mds data', '/var/lib/ceph/mds/ceph-$id')
#self._parser.set('mds', 'keyring', '/var/lib/ceph/mds/ceph-$id/keyring')
self._parser.set('mds', 'keyring', '/var/lib/ceph/mds/ceph-$id/keyring')
self._parser.set('mds', 'mds standby replay', keyring)

def add_mon_header(self, clock_drift=200):
Expand Down Expand Up @@ -407,7 +407,7 @@ def add_osd_header(self,
self._parser.set('osd', 'osd data', osd_data)
# NOTE add keyring to support lower version of OSD.
# keyring = /etc/ceph/keyring.$name
#self._parser.set('osd', 'keyring', '/etc/ceph/keyring.$name')
self._parser.set('osd', 'keyring', '/etc/ceph/keyring.$name')
self._parser.set('osd', 'osd mkfs type', osd_type)
mount_option = utils.get_fs_options(osd_type)[1]
self._parser.set('osd', 'osd mount options %s' % osd_type, mount_option)
Expand Down
Loading

0 comments on commit 1c44b39

Please sign in to comment.